poise

Contents

poise.c

Subroutines that control the energy balance model for climate.

Author

Russell Deitrick (deitrr)

Date

Sep 10 2015

Functions

void BodyCopyPoise(BODY *dest, BODY *src, int iTideModel, int iNumBodies, int iBody)
void InitializeUpdateTmpBodyPoise(BODY *body, CONTROL *control, UPDATE *update, int iBody)
void ReadLatCellNum(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadPlanckA(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadPlanckB(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadSurfAlbedo(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadOrbitOblData(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadFileOrbitOblData(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadIceAlbedo(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadTGlobalInit(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadPCO2(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadDiffusion(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadFixIceLat(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadHeatCapAnn(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadIceDepRate(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadHadley(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadCalcAB(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadColdStart(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadAlbedoZA(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadSeaIceModel(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadMEPDiff(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadIceSheets(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadSkipSeasEnabled(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadAccuracyMode(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadElevFB(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadForceObliq(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadForceEcc(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadDiffRot(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadClimateModel(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadOLRModel(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadGeography(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadInitIceLat(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadInitIceHeight(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadHeatCapLand(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadSeaIceConduct(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadHeatCapWater(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadAlbedoLand(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadSeasOutputTime(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadAlbedoWater(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadObliqAmp(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadObliqPer(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadEccAmp(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadEccPer(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadMixingDepth(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadFrzTSeaIce(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadLandFrac(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadNuLandWater(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadLapseR(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadRefHeight(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadSpinUpTol(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadAblateFF(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadNStepInYear(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadNumYears(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadIceDt(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadReRunSeas(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadMinIceSheetHeight(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void InitializeOptionsPoise(OPTIONS *options, fnReadOption fnRead[])
void ReadOptionsPoise(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, fnReadOption fnRead[], int iBody)
void VerifyAlbedo(BODY *body, OPTIONS *options, char cFile[], int iBody, int iVerbose)
void VerifyIceSheets(BODY *body, OPTIONS *options, char cFile[], int iBody, int iVerbose)
void VerifyOLR(BODY *body, OPTIONS *options, char cFile[], int iBody, int iVerbose)
void VerifyOrbitOblData(BODY *body, CONTROL *control, OPTIONS *options, int iBody)
void VerifyNStepSeasonal(BODY *body, int iBody)
void InitializeLatGrid(BODY *body, int iBody)
void InitializeLandWater(BODY *body, int iBody)
void DampTemp(BODY *body, double dTGlobalTmp, int iBody)
void InitializeClimateParams(BODY *body, int iBody, int iVerbose)
void VerifyAstro(BODY *body, OPTIONS *options, char cFile[], int iBody, int iVerbose)
void VerifyDiffusion(BODY *body, OPTIONS *options, char cFile[], int iBody, int iVerbose)
void VerifySeasOutputTime(BODY *body, CONTROL *control, OPTIONS *options, char cFile[], int iBody, int iVerbose)
void AssignPoiseDerivatives(BODY *body, EVOLVE *evolve, UPDATE *update, fnUpdateVariable ***fnUpdate, int iBody)
void NullPoiseDerivatives(BODY *body, EVOLVE *evolve, UPDATE *update, fnUpdateVariable ***fnUpdate, int iBody)
void VerifyPoise(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, OUTPUT *output, SYSTEM *system, UPDATE *update, int iBody, int iModule)
void InitializeUpdatePoise(BODY *body, UPDATE *update, int iBody)
void FinalizeUpdateIceMassPoise(BODY *body, UPDATE *update, int *iEqn, int iVar, int iBody, int iLat)
void CountHaltsPoise(HALT *halt, int *iNumHalts)
void VerifyHaltPoise(BODY *body, CONTROL *control, OPTIONS *options, int iBody, int *iHalt)
void WriteTGlobal(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char cUnit[])
void WriteAlbedoGlobal(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char cUnit[])
void WriteSnowball(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char cUnit[])
void WriteIceCapNorthLand(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char cUnit[])
void WriteIceCapNorthLatLand(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char cUnit[])
void WriteIceCapNorthSea(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char cUnit[])
void WriteIceCapNorthLatSea(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char cUnit[])
void WriteIceCapSouthLand(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char cUnit[])
void WriteIceCapSouthLatLand(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char cUnit[])
void WriteIceCapSouthSea(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char cUnit[])
void WriteIceCapSouthLatSea(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char cUnit[])
void WriteIceBeltLand(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char cUnit[])
void WriteIceBeltNorthLatLand(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char cUnit[])
void WriteIceBeltSouthLatLand(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char cUnit[])
void WriteIceBeltSea(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char cUnit[])
void WriteIceBeltNorthLatSea(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char cUnit[])
void WriteIceBeltSouthLatSea(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char cUnit[])
void WriteSnowballLand(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char cUnit[])
void WriteSnowballSea(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char cUnit[])
void WriteIceFree(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char cUnit[])
void WriteSkipSeas(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char cUnit[])
void WriteTempLat(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char cUnit[])
void WriteTempMinLat(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char cUnit[])
void WriteTempMaxLat(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char cUnit[])
void WriteTempMaxLand(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char cUnit[])
void WriteTempMaxWater(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char cUnit[])
void WriteTempLandLat(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char cUnit[])
void WriteTempWaterLat(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char cUnit[])
void WriteLatitude(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char cUnit[])
void WriteAlbedoLat(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char cUnit[])
void WriteAlbedoLandLat(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char cUnit[])
void WriteAlbedoWaterLat(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char cUnit[])
void WriteFluxInGlobal(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char cUnit[])
void WriteFluxOutGlobal(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char cUnit[])
void WriteTotIceMass(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char cUnit[])
void WriteIceFlowTot(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char cUnit[])
void WriteAreaIceCov(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char cUnit[])
void WriteIceBalanceTot(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char cUnit[])
void WriteAnnualInsol(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char cUnit[])
void WritePeakInsol(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char cUnit[])
void WriteDailyInsol(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char cUnit[])
void WritePlanckB(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char cUnit[])
void WriteSeasonalTemp(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char cUnit[])
void WriteSeasonalFluxes(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char cUnit[])
void WriteSeasonalIceBalance(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char cUnit[])
void WriteFluxMerid(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char cUnit[])
void WriteFluxIn(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char cUnit[])
void WriteFluxOut(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char cUnit[])
void WriteDivFlux(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char cUnit[])
void WriteIceMass(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char cUnit[])
void WriteIceHeight(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char cUnit[])
void WriteBedrockH(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char cUnit[])
void WritePlanckBAvg(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char cUnit[])
void WriteDIceMassDt(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char cUnit[])
void WriteIceAccum(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char cUnit[])
void WriteIceAblate(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char cUnit[])
void WriteDIceMassDtFlow(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char cUnit[])
void WriteEnergyResL(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char cUnit[])
void WriteEnergyResW(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char cUnit[])
void InitializeOutputPoise(OUTPUT *output, fnWriteOutput fnWrite[])
void LogOptionsPoise(CONTROL *control, FILE *fp)
void LogPoise(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UPDATE *update, fnWriteOutput fnWrite[], FILE *fp)
void LogBodyPoise(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UPDATE *update, fnWriteOutput fnWrite[], FILE *fp, int iBody)
void AddModulePoise(CONTROL *control, MODULE *module, int iBody, int iModule)
void UpdateOrbitOblData(BODY *body, EVOLVE *evolve, int iBody)
double fdBasalFlow(BODY *body, int iBody, int iLat)

Calculates flow at base of ice sheet

Parameters:
  • body – Struct containing all body information and variables

  • iBody – Body in question

  • iLat – Index of current latitude cell

Returns:

Flow rate at base of ice sheet (velocity*height -> m^2/s)

void fvNoIceBelt(double *dLatIceEdgeNorth, double *dLatIceEdgeSouth, int *iLatIceEdgeNorth, int *iLatIceEdgeSouth, int *bBelt)

If a test for a belt is false, assign these values to the referenced parameters.

Parameters:
  • dLatIceEdgeNorth – Northern latitude of ice edge

  • dLatIceEdgeSouth – Southern latitude of ice edge

  • iLatIceEdgeNorth – Index of northern ice edge latitude

  • iLatIceEdgeNorth – Index of southern ice edge latitude

  • bBelt – Boolean for ice belt presence

void fvNoIceCap(double *dLatIceEdge, int *iLatIceEdge, int *bCap)

If a test for a cap is false, assign these values to the referenced parameters.

Parameters:
  • dLatIceEdge – Latitude of ice edge

  • iLatIceEdge – Index of ice edge latitude

  • bBoolean – Boolean for ice cap presence

double fbIceLatSea(BODY *body, int iBody, int iLat)

Is a specific latitude’s sea component covered in ice?

Parameters:
  • body – Struct containing all body information and variables

  • iBody – Body in question

double fbIceLatLand(BODY *body, int iBody, int iLat)

Is a specific latitude’s land component covered in ice?

Parameters:
  • body – Struct containing all body information and variables

  • iBody – Body in question

int fbIceFree(BODY *body, int iBody)

Determines if planet has no surface ice

Parameters:
  • body – Struct containing all body information and variables

  • iBody – Body in question

Returns:

1 for no sea or land ice free, 0 for ice

int fbIceFreeLand(BODY *body, int iBody)

Determines if planet has no sland ice

Parameters:
  • body – Struct containing all body information and variables

  • iBody – Body in question

Returns:

1 for no sea or land ice free, 0 for ice

int fbIceFreeSea(BODY *body, int iBody)

Determines if planet has no sea ice

Parameters:
  • body – Struct containing all body information and variables

  • iBody – Body in question

Returns:

1 for no sea or land ice free, 0 for ice

void fvSnowball(BODY *body, int iBody)

Determines if planet has entered snowball state

XXX This should really be removed or modified in order to be consistent with other ice coverage functions!!!! XXX

Parameters:
  • body – Struct containing all body information and variables

  • iBody – Body in question

int fbSnowballLand(BODY *body, int iBody)

Is all the land on the planet covered in ice?

Parameters:
  • body – Struct containing all body information and variables

  • iBody – Body in question

int fbSnowballSea(BODY *body, int iBody)

Are the planet’s seas all ice-covered?

Parameters:
  • body – Struct containing all body information and variables

  • iBody – Body in question

void fvNorthIceCapLand(BODY *body, int iBody, double *dLatIceEdge, int *iLatIceEdge, int *bCap)

Determine if planet has a northern polar ice cap on land and the extent of the cap.

Parameters:
  • body – Struct containing all body information and variables

  • iBody – Body in question

  • iLatIceEdge – Index of ice edge latitude

  • dLatIceEdge – Latitude of ice edge

  • bCap – 1 for northern polar ice cap, 0 for ice free north pole

void fvNorthIceCapSea(BODY *body, int iBody, double *dLatIceEdge, int *iLatIceEdge, int *bCap)

Determines if planet has a northern polar sea ice cap and the extent of the cap.

Parameters:
  • body – Struct containing all body information and variables

  • iBody – Body in question

  • iLatIceEdge – Index of ice edge latitude

  • dLatIceEdge – Latitude of ice edge

  • bCap – 1 for northern polar ice cap, 0 for ice free north pole

void fvSouthIceCapLand(BODY *body, int iBody, double *dLatIceEdge, int *iLatIceEdge, int *bCap)

Determines if planet has a southern polar ice cap on land and the extent of the cap.

Parameters:
  • body – Struct containing all body information and variables

  • iBody – Body in question

  • iLatIceEdge – Index of ice edge latitude

  • dLatIceEdge – Latitude of ice edge

  • bCap – 1 for northern polar ice cap, 0 for ice free north pole

void fvSouthIceCapSea(BODY *body, int iBody, double *dLatIceEdge, int *iLatIceEdge, int *bCap)

Determines if planet has a southern polar sea ice cap

Parameters:
  • body – Struct containing all body information and variables

  • iBody – Body in question

  • iLatIceEdge – Index of ice edge latitude

  • dLatIceEdge – Latitude of ice edge

  • bCap – 1 for northern polar ice cap, 0 for ice free north pole

void fvIceBeltLand(BODY *body, int iBody, double *dLatIceEdgeNorth, double *dLatIceEdgeSouth, int *iLatIceEdgeNorth, int *iLatIceEdgeSouth, int *bBelt)

Determines if planet has an equatorial ice belt on land

Parameters:
  • body – Struct containing all body information and variables

  • iBody – Body in question

  • iLatIceEdgeNorth – Index of northern ice edge latitude

  • iLatIceEdgeSouth – Index of southern ice edge latitude

  • dLatIceEdgeNorth – Latitude of northern ice edge

  • dLatIceEdgeSouth – Latitude of southern ice edge

  • bBelt – 1 for northern polar ice cap, 0 for ice free north pole

void fvIceBeltSea(BODY *body, int iBody, double *dLatIceEdgeNorth, double *dLatIceEdgeSouth, int *iLatIceEdgeNorth, int *iLatIceEdgeSouth, int *bBelt)

Determines if planet has an equatorial ice belt on sea

Parameters:
  • body – Struct containing all body information and variables

  • iBody – Body in question

  • iLatIceEdgeNorth – Index of northern ice edge latitude

  • iLatIceEdgeSouth – Index of southern ice edge latitude

  • dLatIceEdgeNorth – Latitude of northern ice edge

  • dLatIceEdgeSouth – Latitude of southern ice edge

  • bBelt – 1 for northern polar ice cap, 0 for ice free north pole

void fvPropsAuxPoise(BODY *body, EVOLVE *evolve, IO *io, UPDATE *update, int iBody)

Standard properties function for POISE. Updates auxiliary quantities (currently just the dynamical ellipticity when DistRot is not enabled).

XXX References to other modules are forbidden in this file!

Parameters:
  • body – Struct containing all body information and variables

  • evolve – Struct containing evolve information and variables

  • update – Struct containing update information and variables

  • iBody – Body in question

void fvPrecessionExplicit(BODY *body, EVOLVE *evolve, int iBody)

Calculates precession of the spin axis when DistRot is disabled

Parameters:
  • body – Struct containing all body information and variables

  • evolve – Struct containing evolve information and variables

  • iBody – Body in question

void fvForceObliq(BODY *body, EVOLVE *evolve, int iBody)

Forces obliquity oscillation (bForceObliq = 1).

Parameters:
  • body – Struct containing all body information and variables

  • evolve – Struct containing evolve information and variables

  • iBody – Body in question

void fvForceEcc(BODY *body, EVOLVE *evolve, int iBody)

Forces eccentricity oscillation (bForceEcc = 1).

Parameters:
  • body – Struct containing all body information and variables

  • evolve – Struct containing evolve information and variables

  • iBody – Body in question

void fvAreaIceCovered(BODY *body, int iBody)

Calculates the fractional ice covered area of the planet

XXX This looks wrong and inconsistent with other ice outputs. This returns the fraction of latitudes that are ice-covered, not the fractional area.

Parameters:
  • body – Struct containing all body information and variables

  • iBody – Body in question

void ForceBehaviorPoise(BODY *body, MODULE *module, EVOLVE *evolve, IO *io, SYSTEM *system, UPDATE *update, fnUpdateVariable ***fnUpdate, int iBody, int iModule)

Force behavior function for POISE. This is where the magic happens— POISE works entirely in force behavior because it needs to solve several PDEs (not well modeled with RK4). First, the EBM (climate) is run for several orbits, then the ice sheet flow. The EBM can be periodically rerun needed.

Parameters:
  • body – Struct containing all body information and variables

  • module – Struct containing module/intermodule quantities

  • evolve – Struct containing evolve information and variables

  • io – Struct containing read/write information

  • system – Struct containing system-wide information

  • update – Struct containing update information and variables

  • fnUpdate – Array of function pointers to derivatives

  • iBody – Body in question

  • iModule – Module in question

double fdEccTrueAnomaly(double dTrueA, double dEcc)

Calculates eccentric anomaly from true anomaly

Parameters:
  • dTrueA – Planet’s true anomaly

  • dEcc – Planet’s orbital eccentricity

Returns:

Eccentric anomaly

void fvDailyInsolation(BODY *body, int iBody, int iDay)

Calculates insolation at each latitude for a single “iNday” of the year/orbit

Parameters:
  • body – Struct containing all body information and variables

  • iBody – Body in question

  • iDay – Day of the year

void fvAnnualInsolation(BODY *body, int iBody)

Calculates insolation at each latitude over the entire year/orbit

Parameters:
  • body – Struct containing all body information and variables

  • iBody – Body in question

void fvAlbedoAnnual(BODY *body, int iBody)

Calculates/updates the albedo at each latitude for the annual EBM

Parameters:
  • body – Struct containing all body information and variables

  • iBody – Body in question

void fvMatrixInvertAnnual(BODY *body, int iBody)

Inverts the matrix for the annual EBM

Parameters:
  • body – Struct containing all body information and variables

  • iBody – Body in question

void fvMatrixInvertSeasonal(BODY *body, int iBody)

Inverts the matrix for the seasonal EBM

Parameters:
  • body – Struct containing all body information and variables

  • iBody – Body in question

void fvTempGradientAnn(BODY *body, double dDelta_x, int iBody)

Calculates the approximate temperature gradient in latitude for the annual EBM

Parameters:
  • body – Struct containing all body information and variables

  • dDelta_x – Spacing of grid (x = sin(latitude))

  • iBody – Body in question

void fvTempGradientSea(BODY *body, double dDelta_x, int iBody)

Calculates the approximate temperature gradient in latitude for the seasonal EBM

Parameters:
  • body – Struct containing all body information and variables

  • dDelta_x – Spacing of grid (x = sin(latitude))

  • iBody – Body in question

void fvMatrixAnnual(BODY *body, int iBody)

Calculates the backwards-Euler matrix that integrates the annual EBM. Each operation of the inverse matrix is a “time-step”.

Parameters:
  • body – Struct containing all body information and variables

  • iBody – Body in question

void PoiseAnnual(BODY *body, int iBody)

Runs the annual EBM, called from ForceBehavior. The annual EBM runs to steady-state (global temperature change becomes very small), rather than for a set number of orbits.

Parameters:
  • body – Struct containing all body information and variables

  • iBody – Body in question

double fdOLRhm16(BODY *body, int iBody, int iLat, int bModel)

Calculates the OLR from the Haqq-Misra+ 2016 formulae

Parameters:
  • body – Struct containing all body information

  • iBody – Body in question

  • iLat – Latitude at which you want to calculate the OLR

  • bModel – Type of EBM (annual or seasonal)

double fdOLRdThm16(BODY *body, int iBody, int iLat, int bModel)

Calculates the slope of the OLR from the Haqq-Misra+ 2016 formulae

Parameters:
  • body – Struct containing all body information

  • iBody – Body in question

  • iLat – Latitude at which you want to calculate the OLR

  • bModel – Type of EBM (annual or seasonal)

double fdOLRsms09(BODY *body, int iBody, int iLat, int bModel)

Calculates the OLR from the Spiegel+ 2009 formulae

Parameters:
  • body – Struct containing all body information

  • iBody – Body in question

  • iLat – Latitude at which you want to calculate the OLR

  • bModel – Type of EBM (annual or seasonal)

double fdOLRdTsms09(BODY *body, int iBody, int iLat, int bModel)

Calculates the slope of the OLR from the Spiegel+ 2009 formulae

Parameters:
  • body – Struct containing all body information

  • iBody – Body in question

  • iLat – Latitude at which you want to calculate the OLR

  • bModel – Type of EBM (annual or seasonal)

double fdOLRwk97(BODY *body, int iBody, int iLat, int bModel)

Calculates the OLR from the Williams & Kasting 1997 formulae

Parameters:
  • body – Struct containing all body information

  • iBody – Body in question

  • iLat – Latitude at which you want to calculate the OLR

  • bModel – Type of EBM (annual or seasonal)

double fdOLRdTwk97(BODY *body, int iBody, int iLat, int bModel)

Calculates the slope of the OLR from the Williams & Kasting 1997 formulae

Parameters:
  • body – Struct containing all body information

  • iBody – Body in question

  • iLat – Latitude at which you want to calculate the OLR

  • bModel – Type of EBM (annual or seasonal)

double AlbedoTOA250(double Temp, double phi, double zenith, double albsurf)

Calculates the “top-of-atmosphere” from the Haqq-Misra+ 2016 formulae at temperatures < 250 K

Parameters:
  • Temp – Temperature at grid point

  • pCO2 – Atmospheric partial pressure of CO2

  • zenith – Zenith angle of host star on sky

  • albsurf – Base albedo quantity of surface (ice/water/land)

double fdAlbedoTOA350(double Temp, double phi, double zenith, double albsurf)

Calculates the “top-of-atmosphere” from the Haqq-Misra+ 2016 formulae at 250 K < temperatures < 350 K

Parameters:
  • Temp – Temperature at grid point

  • pCO2 – Atmospheric partial pressure of CO2

  • zenith – Zenith angle of host star on sky

  • albsurf – Base albedo quantity of surface (ice/water/land)

double AlbedoTOA280(double Temp, double pCO2, double zenith, double albsurf)

Calculates the “top-of-atmosphere” from the Williams & Kasting 1997 formulae at temperatures < 280 K

Parameters:
  • Temp – Temperature at grid point

  • pCO2 – Atmospheric partial pressure of CO2

  • zenith – Zenith angle of host star on sky

  • albsurf – Base albedo quantity of surface (ice/water/land)

double AlbedoTOA370(double Temp, double pCO2, double zenith, double albsurf)

Calculates the “top-of-atmosphere” from the Williams & Kasting 1997 formulae at 280 K < temperatures < 370 K

Parameters:
  • Temp – Temperature at grid point

  • pCO2 – Atmospheric partial pressure of CO2

  • zenith – Zenith angle of host star on sky

  • albsurf – Base albedo quantity of surface (ice/water/land)

double AlbedoTaylor(double zenith)

Calculates albedo based on zenith angle (tuned to Earth)

Parameters:

zenith – Zenith angle of each latitude in radians

Returns:

Albedo

void AlbedoTOAhm16(BODY *body, double zenith, int iBody, int iLat)

Calculates the planetary albedo based on the formulae from Haqq-Misra+ 2016, accounting for temperature and surface type.

Parameters:
  • body – Struct containing all body information

  • zenith – Zenith angle of latitude iLat

  • iBody – Body in question

  • iLat – Latitude cell in question

void AlbedoTOAwk97(BODY *body, double zenith, int iBody, int iLat)

Calculates the planetary albedo based on the formulae from Williams & Kasting 1997, accounting for temperature and surface type.

Parameters:
  • body – Struct containing all body information

  • zenith – Zenith angle of latitude iLat

  • iBody – Body in question

  • iLat – Latitude cell in question

void AlbedoTOAsms09(BODY *body, double zenith, int iBody, int iLat)

Calculates the planetary albedo based on the formulae from Spiegel+ 2009, accounting for temperature and surface type.

Parameters:
  • body – Struct containing all body information

  • zenith – Zenith angle of latitude iLat

  • iBody – Body in question

  • iLat – Latitude cell in question

void fvAlbedoSeasonal(BODY *body, int iBody, int iDay)

Calculates the planetary albedo for the seasonal EBM at iNday iDay

Parameters:
  • body – Struct containing all body information

  • iBody – Body in question

  • iDay – Day of the planet’s year

void fvSeaIce(BODY *body, int iBody)

Modifies the ocean component to account for effects of sea ice (seasonal EBM only). This slows the EBM considerably so use with caution.

Parameters:
  • body – Struc containing all body information

  • iBody – Body in question

void fvMatrixSeasonal(BODY *body, int iBody)

Calculates the backwards-Euler matrix that integrates the seasonal EBM. Each operation of the inverse matrix is a “time-step”.

Parameters:
  • body – Struct containing all body information and variables

  • iBody – Body in question

void fvSourceFSeas(BODY *body, int iBody, int iNday)

Calculates non-matrix terms in the energy balance equation (I don’t remember why I called these “SourceF”). These terms are the OLR offset and the absorbed radiation (temperature independent quantities).

Parameters:
  • body – Struct containing all body information

  • iBody – Body in question

  • iNday – Day of the planet’s year

void EnergyResiduals(BODY *body, int iBody, int iNday)

Calculates average energy residual or “error” over course of the year. This should be used as a check on the physics in the EBM (should be ~0).

Parameters:
  • body – Struct containing all body information

  • iBody – Body in question

  • iNday – Day of the planet’s year

void fvPoiseSeasonalInitialize(BODY *body, int iBody, int iYear)
void fvCalcPlanckAB(BODY *body, int iBody, int iLat)
void fvFluxesByLatitude(BODY *body, int iBody, int iNyear, int iNstep)
void fvPoiseAnnualAveragesByLatitude(BODY *body, int iBody, int iLat)
void fvPoiseDailyProps(BODY *body, int iBody, int iLat, int iNyear, int iNstep)
void fvPoiseSeasonalMinMax(BODY *body, int iBody, int iLat)
void fvCalculateIceSheets(BODY *body, double dStepsize, int iBody, int iLat, int iNstep)
void fvCalculateFluxesByLatitude(BODY *body, int iBody, int iLat, int iNday)
void fvPoiseGlobalProps(BODY *body, int iBody)
void fvFinishSeaIce(BODY *body, double dStepsize, int iBody, int iLat, int iNyear, int iNday, int iNstep)
void fvCalculateSeaIce(BODY *body, double dStepsize, int iBody, int iNyear, int iNday, int iNstep)
void fvStaticSeaIce(BODY *body, double dStepsize, int iBody, int iNyear, int iNday, int iNstep)
void PoiseSeasonal(BODY *body, int iBody)

Runs the seasonal EBM, called from ForceBehavior. The seasonal EBM runs on a fixed time-step (of order days) to resolve the seasonal cycle. It can be said to be in “equilibrium” though not in “steady-state”.

Parameters:
  • body – Struct containing all body information and variables

  • iBody – Body in question

double fdIceMassBalance(BODY *body, int iBody, int iLat)

Calculates the net balance between melting and accumulation of ice on land at a given EBM time-step

Parameters:
  • body – Struct containing all body information

  • iBody – Body in question

  • iLat – Latitude cell in question

Returns:

Net gain/loss of ice

void IceSheetTriDiag(BODY *body, int iBody)

Construct matrix that evolves the ice sheet flow + net balance

Parameters:
  • body – Struct containing body information

  • iBody – Body in question

void PoiseIceSheets(BODY *body, EVOLVE *evolve, int iBody)

Main ice sheet routine. Integrates the ice sheets via Crank-Nicholson method in ForceBehavior in the same fashion as Huybers’ model.

Parameters:
  • body – Struct containing body information

  • evolve – Struct containing evolution information

  • iBody – Body in question

poise.h

Subroutines that control the energy balance model for climate.

Author

Russell Deitrick (deitrr)

Date

Sep 10 2015

Defines

ANN
SEA
WK97
HM16
SMS09
ALBFIXED
ALBTAYLOR
UNIFORM3
MODERN
LFICE
RHOICE
MOCEAN
a1ICE
a2ICE
Q1ICE
Q2ICE
nGLEN
RHOSED
RHOH2O
SEDPHI
SEDH
SEDD0
SEDMU
RHOBROCK
BROCKTIME
OPTSTARTPOISE
OPTENDPOISE
OPT_LATCELLNUM
OPT_PLANCKA
OPT_PLANCKB
OPT_DIFFUSION
OPT_HEATCAPANN
OPT_HADLEY
OPT_COLDSTART
OPT_FIXICELAT
OPT_ALBEDOZA
OPT_JORMUNGAND
OPT_CALCAB
OPT_TGLOBALEST
OPT_PCO2
OPT_MEPDIFF
OPT_ICESHEETS
OPT_INITICELAT
OPT_INITICEHEIGHT
OPT_ICEALBEDO
OPT_SURFALBEDO
OPT_ICEDEPRATE
OPT_SKIPSEASENABLED
OPT_DIFFROT
OPT_SPINUPTOL
OPT_READORBITOBLDATA
OPT_FILEORBITOBLDATA
OPT_LANDFRAC
OPT_HEATCAPLAND
OPT_HEATCAPWATER
OPT_FRZTSEAICE
OPT_ICECONDUCT
OPT_MIXINGDEPTH
OPT_NULANDWATER
OPT_NSTEPINYEAR
OPT_NUMYEARS
OPT_SEAICEMODEL
OPT_ALBEDOLAND
OPT_ALBEDOWATER
OPT_ICEDT
OPT_RERUNSEAS
OPT_ALBEDOTYPE
OPT_GEOGRAPHY
OPT_SEASOUTPUTTIME
OPT_FORCEOBLIQ
OPT_OBLIQAMP
OPT_OBLIQPER
OPT_ACCUMODE
OPT_ELEVFB
OPT_LAPSER
OPT_REFHEIGHT
OPT_ABLATEFF
OPT_FORCEECC
OPT_ECCAMP
OPT_ECCPER
OPT_MINICEHEIGHT
OPT_OLRMODEL
OPT_CLIMATEMODEL
OUTSTARTPOISE
OUTENDPOISE
OUTBODYSTARTPOISE
OUT_TGLOBAL
OUT_ALBEDOGLOBAL
OUT_FLUXINGLOBAL
OUT_FLUXOUTGLOBAL
OUT_TOTICEMASS
OUT_TOTICEFLOW
OUT_TOTICEBALANCE
OUT_SKIPSEAS
OUT_AREAICECOV
OUT_LATITUDE
OUT_TEMPLAT
OUT_ALBEDOLAT
OUT_ANNUALINSOL
OUT_DAILYINSOL
OUT_FLUXMERID
OUT_FLUXIN
OUT_FLUXOUT
OUT_DIVFLUX
OUT_ICEMASS
OUT_ICEHEIGHT
OUT_DICEMASSDT
OUT_ICEFLOW
OUT_ENERGYRESL
OUT_ENERGYRESW
OUT_BEDROCKH
OUT_TEMPLANDLAT
OUT_TEMPWATERLAT
OUT_ALBEDOLANDLAT
OUT_ALBEDOWATERLAT
OUT_TEMPMINLAT
OUT_TEMPMAXLAT
OUT_SNOWBALL
OUT_PLANCKBAVG
OUT_ICEACCUM
OUT_ICEABLATE
OUT_TEMPMAXLAND
OUT_TEMPMAXWATER
OUT_PEAKINSOL
OUT_NORTHICECAPLAND
OUT_NORTHICECAPSEA
OUT_SOUTHICECAPLAND
OUT_SOUTHICECAPSEA
OUT_ICEBELTLAND
OUT_ICEBELTSEA
OUT_SNOWBALLLAND
OUT_SNOWBALLSEA
OUT_ICEFREE
OUT_NORTHICECAPLATLAND
OUT_NORTHICECAPLATSEA
OUT_SOUTHICECAPLATLAND
OUT_SOUTHICECAPLATSEA
OUT_NORTHICEBELTLATLAND
OUT_NORTHICEBELTLATSEA
OUT_SOUTHICEBELTLATLAND
OUT_SOUTHICEBELTLATSEA