atmesc

Contents

atmesc.c

Subroutines that control the integration of the atmospheric escape model.

Author

Rodrigo Luger (rodluger@gmail.com)

Date

May 12 2015

Description

This module defines differential equations controlling the evolution of planetary atmospheres under intense extreme ultraviolet (XUV) stellar irradiation. The atmesc module implements energy-limited and diffusion-limited escape for hydrogen/helium atmospheres and water vapor atmospheres following :cite:`Luger2015`, :cite:`LugerBarnes2015`, and :cite:`LehmerCatling17`.

Functions

void BodyCopyAtmEsc(BODY *dest, BODY *src, int foo, int iNumBodies, int iBody)

Create a copy of the body at index iBody. Used during integration of the differential equations.

Parameters:
  • dest – The body copy

  • src – The original body instance

  • foo – Who knows!?

  • iNumBodies – Number of bodies

  • iBody – Current body index

void ReadFXUV(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)

Read the XUV flux from the input file.

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the integration CONTROL instance

  • files – A pointer to the array of input FILES

  • options – A pointer to the OPTIONS instance

  • system – A pointer to the SYSTEM instance

  • iFile – The current file number

void ReadThermTemp(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)

Read the thermospheric temperature for the :cite:`LehmerCatling17` atmospheric escape model.

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the integration CONTROL instance

  • files – A pointer to the array of input FILES

  • options – A pointer to the OPTIONS instance

  • system – A pointer to the SYSTEM instance

  • iFile – The current file number

void ReadFlowTemp(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)

Read the temperature of the hydro flow for the Luger+Barnes escape model.

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the integration CONTROL instance

  • files – A pointer to the array of input FILES

  • options – A pointer to the OPTIONS instance

  • system – A pointer to the SYSTEM instance

  • iFile – The current file number

void ReadAtmGasConst(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)

Read the atmospheric gas constant the Lehmer and Catling (2017) atmospheric escape model.

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the integration CONTROL instance

  • files – A pointer to the array of input FILES

  • options – A pointer to the OPTIONS instance

  • system – A pointer to the SYSTEM instance

  • iFile – The current file number

void ReadJeansTime(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)

Read the Jeans time, the time at which the flow transitions from hydrodynamic to ballistic.

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the integration CONTROL instance

  • files – A pointer to the array of input FILES

  • options – A pointer to the OPTIONS instance

  • system – A pointer to the SYSTEM instance

  • iFile – The current file number

void ReadPresXUV(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)

Read the effective XUV absorption pressure for the Lehmner and Catling (2017) model.

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the integration CONTROL instance

  • files – A pointer to the array of input FILES

  • options – A pointer to the OPTIONS instance

  • system – A pointer to the SYSTEM instance

  • iFile – The current file number

void ReadWaterLossModel(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)

Read the water loss model for the Luger and Barnes (2015) atmospheric escape model.

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the integration CONTROL instance

  • files – A pointer to the array of input FILES

  • options – A pointer to the OPTIONS instance

  • system – A pointer to the SYSTEM instance

  • iFile – The current file number

void ReadAtmXAbsEffH2OModel(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)

Read the XUV absorption efficiency model for the Luger and Barnes (2015) atmospheric escape model.

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the integration CONTROL instance

  • files – A pointer to the array of input FILES

  • options – A pointer to the OPTIONS instance

  • system – A pointer to the SYSTEM instance

  • iFile – The current file number

void ReadPlanetRadiusModel(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)

Read the planet radius model.

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the integration CONTROL instance

  • files – A pointer to the array of input FILES

  • options – A pointer to the OPTIONS instance

  • system – A pointer to the SYSTEM instance

  • iFile – The current file number

void ReadInstantO2Sink(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)

Read the parameter that controls surface O2 sinks for the Luger and Barnes (2015) model.

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the integration CONTROL instance

  • files – A pointer to the array of input FILES

  • options – A pointer to the OPTIONS instance

  • system – A pointer to the SYSTEM instance

  • iFile – The current file number

void ReadStopWaterLossInHZ(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)

Read the parameter that controls water loss once planet reaches HZ.

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the integration CONTROL instance

  • files – A pointer to the array of input FILES

  • options – A pointer to the OPTIONS instance

  • system – A pointer to the SYSTEM instance

  • iFile – The current file number

void ReadBondiLimited(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)

Read the parameter that controls whether or not to limit envelope mass loss at the Bondi limit

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the integration CONTROL instance

  • files – A pointer to the array of input FILES

  • options – A pointer to the OPTIONS instance

  • system – A pointer to the SYSTEM instance

  • iFile – The current file number

void ReadEnergyLimited(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)

Read the parameter that controls whether or not to use energy-limited escape for H envelope mass loss

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the integration CONTROL instance

  • files – A pointer to the array of input FILES

  • options – A pointer to the OPTIONS instance

  • system – A pointer to the SYSTEM instance

  • iFile – The current file number

void ReadRRLimited(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)

Read the parameter that controls whether or not to use radiation/recombination-limited escape

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the integration CONTROL instance

  • files – A pointer to the array of input FILES

  • options – A pointer to the OPTIONS instance

  • system – A pointer to the SYSTEM instance

  • iFile – The current file number

void ReadAtmEscAuto(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)

Read the parameter that controls whether or not to let atmesc determine which escape regime the planet is in

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the integration CONTROL instance

  • files – A pointer to the array of input FILES

  • options – A pointer to the OPTIONS instance

  • system – A pointer to the SYSTEM instance

  • iFile – The current file number

void ReadXFrac(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)

Read the planet’s effective XUV radius.

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the integration CONTROL instance

  • files – A pointer to the array of input FILES

  • options – A pointer to the OPTIONS instance

  • system – A pointer to the SYSTEM instance

  • iFile – The current file number

void ReadAtmXAbsEffH(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)

Read the XUV absorption efficiency for hydrogen.

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the integration CONTROL instance

  • files – A pointer to the array of input FILES

  • options – A pointer to the OPTIONS instance

  • system – A pointer to the SYSTEM instance

  • iFile – The current file number

void ReadMinKTide(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)

Minimum value for KTide

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the integration CONTROL instance

  • files – A pointer to the array of input FILES

  • options – A pointer to the OPTIONS instance

  • system – A pointer to the SYSTEM instance

  • iFile – The current file number

void ReadAtmXAbsEffH2O(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)

Read the XUV absorption efficiency for water.

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the integration CONTROL instance

  • files – A pointer to the array of input FILES

  • options – A pointer to the OPTIONS instance

  • system – A pointer to the SYSTEM instance

  • iFile – The current file number

void ReadOxygenMass(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)

Read the planet’s initial atmospheric oxygen mass (Luger and Barnes 2015 model).

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the integration CONTROL instance

  • files – A pointer to the array of input FILES

  • options – A pointer to the OPTIONS instance

  • system – A pointer to the SYSTEM instance

  • iFile – The current file number

void ReadOxygenMantleMass(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)

Read the planet’s initial mantle oxygen mass (Luger and Barnes 2015 model).

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the integration CONTROL instance

  • files – A pointer to the array of input FILES

  • options – A pointer to the OPTIONS instance

  • system – A pointer to the SYSTEM instance

  • iFile – The current file number

void ReadHaltMinSurfaceWaterMass(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)

Read the parameter that controls whether the code halts when the planet is desiccated.

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the integration CONTROL instance

  • files – A pointer to the array of input FILES

  • options – A pointer to the OPTIONS instance

  • system – A pointer to the SYSTEM instance

  • iFile – The current file number

void ReadHaltMinEnvelopeMass(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)

Read the parameter that controls whether the code halts when the planet’s envelope is fully evaporated.

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the integration CONTROL instance

  • files – A pointer to the array of input FILES

  • options – A pointer to the OPTIONS instance

  • system – A pointer to the SYSTEM instance

  • iFile – The current file number

void InitializeOptionsAtmEsc(OPTIONS *options, fnReadOption fnRead[])

Initialize the user options for the atmospheric escape model.

Parameters:
  • options – A pointer to the OPTIONS instance

  • fnRead – Array of pointers to the functions that read in the options

void ReadOptionsAtmEsc(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, fnReadOption fnRead[], int iBody)

Loops through the input files and reads all user options for the atmospheric escape model.

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the integration CONTROL instance

  • files – A pointer to the array of input FILES

  • options – A pointer to the OPTIONS instance

  • system – A pointer to the SYSTEM instance

  • fnRead – Array of pointers to the functions that read in the options

  • iBody – The current BODY number

void VerifySurfaceWaterMass(BODY *body, OPTIONS *options, UPDATE *update, double dAge, int iBody)

Initializes the differential equation matrix for the surface water mass.

Parameters:
  • body – A pointer to the current BODY instance

  • options – A pointer to the OPTIONS instance

  • update – A pointer to the UPDATE instance

  • dAge – The current age of the system

  • iBody – The current BODY number

void VerifyOxygenMass(BODY *body, OPTIONS *options, UPDATE *update, double dAge, int iBody)

Initializes the differential equation matrix for the atmospheric oxygen mass.

Parameters:
  • body – A pointer to the current BODY instance

  • options – A pointer to the OPTIONS instance

  • update – A pointer to the UPDATE instance

  • dAge – The current age of the system

  • iBody – The current BODY number

void VerifyOxygenMantleMass(BODY *body, OPTIONS *options, UPDATE *update, double dAge, int iBody)

Initializes the differential equation matrix for the mantle oxygen mass.

Parameters:
  • body – A pointer to the current BODY instance

  • options – A pointer to the OPTIONS instance

  • update – A pointer to the UPDATE instance

  • dAge – The current age of the system

  • iBody – The current BODY number

void VerifyEnvelopeMass(BODY *body, OPTIONS *options, UPDATE *update, double dAge, int iBody)

Initializes the differential equation matrix for the gaseous envelope mass.

Parameters:
  • body – A pointer to the current BODY instance

  • options – A pointer to the OPTIONS instance

  • update – A pointer to the UPDATE instance

  • dAge – The current age of the system

  • iBody – The current BODY number

void VerifyMassAtmEsc(BODY *body, OPTIONS *options, UPDATE *update, double dAge, int iBody)

Initializes the differential equation matrix for the planet mass.

Parameters:
  • body – A pointer to the current BODY instance

  • options – A pointer to the OPTIONS instance

  • update – A pointer to the UPDATE instance

  • dAge – The current age of the system

  • iBody – The current BODY number

void VerifyRadiusAtmEsc(BODY *body, CONTROL *control, OPTIONS *options, UPDATE *update, double dAge, int iBody)

Initializes the differential equation matrix for the planet radius.

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the CONTROL instance

  • options – A pointer to the OPTIONS instance

  • update – A pointer to the UPDATE instance

  • dAge – The current age of the system

  • iBody – The current BODY number

void EnvelopeLost(BODY *body, EVOLVE *evolve, IO *io, UPDATE *update, fnUpdateVariable ***fnUpdate, int iBody)
double fdAtmEscXi(BODY *body, int iBody)
double fdKTide(BODY *body, IO *io, int iNumBodies, int iBody)
void ForceBehaviorEnvelopeEscape(BODY *body, MODULE *module, EVOLVE *evolve, IO *io, SYSTEM *system, UPDATE *update, fnUpdateVariable ***fnUpdate, int iBody, int iModule)

If necessary, change how the code handle hydrogen envelope escape

Parameters:
  • body – A pointer to the current BODY instance

  • module – A pointer to the MODULE instance

  • evolve – A pointer to the EVOLVE instance

  • io – A pointer to the IO instance

  • system – A pointer to the SYSTEM instance

  • update – A pointer to the UPDATE instance

  • fnUpdate – A triple-pointer to the function that updates each variable

  • iBody – The current BODY number

  • iModule – The current MODULE number

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

If necessary, change how the code handle hwater loss

Parameters:
  • body – A pointer to the current BODY instance

  • module – A pointer to the MODULE instance

  • evolve – A pointer to the EVOLVE instance

  • io – A pointer to the IO instance

  • system – A pointer to the SYSTEM instance

  • update – A pointer to the UPDATE instance

  • fnUpdate – A triple-pointer to the function that updates each variable

  • iBody – The current BODY number

  • iModule – The current MODULE number

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

This function is run during every step of the integrator to perform checks and force certain non-diffeq behavior.

Parameters:
  • body – A pointer to the current BODY instance

  • module – A pointer to the MODULE instance

  • evolve – A pointer to the EVOLVE instance

  • io – A pointer to the IO instance

  • system – A pointer to the SYSTEM instance

  • update – A pointer to the UPDATE instance

  • fnUpdate – A triple-pointer to the function that updates each variable

  • iBody – The current BODY number

  • iModule – The current MODULE number

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

Initializes several helper variables and properties used in the integration.

Parameters:
  • body – A pointer to the current BODY instance

  • evolve – A pointer to the EVOLVE instance

  • update – A pointer to the UPDATE instance

  • iBody – The current BODY number

void AssignAtmEscDerivatives(BODY *body, EVOLVE *evolve, UPDATE *update, fnUpdateVariable ***fnUpdate, int iBody)

Assigns functions returning the time-derivatives of each variable to the magical matrix of function pointers.

Parameters:
  • body – A pointer to the current BODY instance

  • evolve – A pointer to the EVOLVE instance

  • update – A pointer to the UPDATE instance

  • fnUpdate – A triple-pointer to the function that updates each variable

  • iBody – The current BODY number

void NullAtmEscDerivatives(BODY *body, EVOLVE *evolve, UPDATE *update, fnUpdateVariable ***fnUpdate, int iBody)

Assigns null functions to the magical matrix of function pointers for variables that will not get updated.

Parameters:
  • body – A pointer to the current BODY instance

  • evolve – A pointer to the EVOLVE instance

  • update – A pointer to the UPDATE instance

  • fnUpdate – A triple-pointer to the function that updates each variable

  • iBody – The current BODY number

void VerifyAtmEsc(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, OUTPUT *output, SYSTEM *system, UPDATE *update, int iBody, int iModule)

Verify all the inputs for the atmospheric escape module.

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the CONTROL instance

  • files – A pointer to the FILES instance

  • options – A pointer to the OPTIONS instance

  • output – A pointer to the OUTPUT instance

  • system – A pointer to the SYSTEM instance

  • update – A pointer to the UPDATE instance

  • iBody – The current BODY number

  • iModule – The current MODULE number

void InitializeUpdateAtmEsc(BODY *body, UPDATE *update, int iBody)

Internal housekeeping function that determines which variables get updated every time step.

Parameters:
  • body – A pointer to the current BODY instance

  • update – A pointer to the UPDATE instance

  • iBody – The current BODY number

void FinalizeUpdateEccAtmEsc(BODY *body, UPDATE *update, int *iEqn, int iVar, int iBody, int iFoo)

Internal housekeeping function that determines which variables get updated every time step.

Parameters:
  • body – A pointer to the current BODY instance

  • update – A pointer to the UPDATE instance

  • iEqn – The current equation number

  • iVar – The current variable number

  • iBody – The current BODY number

  • iFoo – ?!

void FinalizeUpdateSurfaceWaterMassAtmEsc(BODY *body, UPDATE *update, int *iEqn, int iVar, int iBody, int iFoo)

Internal housekeeping function that determines which variables get updated every time step.

Parameters:
  • body – A pointer to the current BODY instance

  • update – A pointer to the UPDATE instance

  • iEqn – The current equation number

  • iVar – The current variable number

  • iBody – The current BODY number

  • iFoo – ?!

void FinalizeUpdateOxygenMassAtmEsc(BODY *body, UPDATE *update, int *iEqn, int iVar, int iBody, int iFoo)

Internal housekeeping function that determines which variables get updated every time step.

Parameters:
  • body – A pointer to the current BODY instance

  • update – A pointer to the UPDATE instance

  • iEqn – The current equation number

  • iVar – The current variable number

  • iBody – The current BODY number

  • iFoo – ?!

void FinalizeUpdateOxygenMantleMassAtmEsc(BODY *body, UPDATE *update, int *iEqn, int iVar, int iBody, int iFoo)

Internal housekeeping function that determines which variables get updated every time step.

Parameters:
  • body – A pointer to the current BODY instance

  • update – A pointer to the UPDATE instance

  • iEqn – The current equation number

  • iVar – The current variable number

  • iBody – The current BODY number

  • iFoo – ?!

void FinalizeUpdateEnvelopeMassAtmEsc(BODY *body, UPDATE *update, int *iEqn, int iVar, int iBody, int iFoo)

Internal housekeeping function that determines which variables get updated every time step.

Parameters:
  • body – A pointer to the current BODY instance

  • update – A pointer to the UPDATE instance

  • iEqn – The current equation number

  • iVar – The current variable number

  • iBody – The current BODY number

  • iFoo – ?!

void FinalizeUpdateMassAtmEsc(BODY *body, UPDATE *update, int *iEqn, int iVar, int iBody, int iFoo)

Internal housekeeping function that determines which variables get updated every time step.

Parameters:
  • body – A pointer to the current BODY instance

  • update – A pointer to the UPDATE instance

  • iEqn – The current equation number

  • iVar – The current variable number

  • iBody – The current BODY number

  • iFoo – ?!

void FinalizeUpdateOblAtmEsc(BODY *body, UPDATE *update, int *iEqn, int iVar, int iBody, int iFoo)

Internal housekeeping function that determines which variables get updated every time step.

Parameters:
  • body – A pointer to the current BODY instance

  • update – A pointer to the UPDATE instance

  • iEqn – The current equation number

  • iVar – The current variable number

  • iBody – The current BODY number

  • iFoo – ?!

void FinalizeUpdateRotAtmEsc(BODY *body, UPDATE *update, int *iEqn, int iVar, int iBody, int iFoo)

Internal housekeeping function that determines which variables get updated every time step.

Parameters:
  • body – A pointer to the current BODY instance

  • update – A pointer to the UPDATE instance

  • iEqn – The current equation number

  • iVar – The current variable number

  • iBody – The current BODY number

  • iFoo – ?!

void FinalizeUpdateSemiAtmEsc(BODY *body, UPDATE *update, int *iEqn, int iVar, int iBody, int iFoo)

Internal housekeeping function that determines which variables get updated every time step.

Parameters:
  • body – A pointer to the current BODY instance

  • update – A pointer to the UPDATE instance

  • iEqn – The current equation number

  • iVar – The current variable number

  • iBody – The current BODY number

  • iFoo – ?!

void FinalizeUpdateRadiusAtmEsc(BODY *body, UPDATE *update, int *iEqn, int iVar, int iBody, int iFoo)

Internal housekeeping function that determines which variables get updated every time step.

Parameters:
  • body – A pointer to the current BODY instance

  • update – A pointer to the UPDATE instance

  • iEqn – The current equation number

  • iVar – The current variable number

  • iBody – The current BODY number

  • iFoo – ?!

int fbHaltSurfaceDesiccated(BODY *body, EVOLVE *evolve, HALT *halt, IO *io, UPDATE *update, fnUpdateVariable ***fnUpdate, int iBody)

Checks for surface desiccation and halts if necessary.

Parameters:
  • body – A pointer to the current BODY instance

  • evolve – A pointer to the EVOLVE instance

  • halt – A pointer to the HALT instance

  • io – A pointer to the IO instance

  • update – A pointer to the UPDATE instance

  • iBody – The current BODY number

int fbHaltEnvelopeGone(BODY *body, EVOLVE *evolve, HALT *halt, IO *io, UPDATE *update, fnUpdateVariable ***fnUpdate, int iBody)

Checks for envelope evaporation and halts if necessary.

Parameters:
  • body – A pointer to the current BODY instance

  • evolve – A pointer to the EVOLVE instance

  • halt – A pointer to the HALT instance

  • io – A pointer to the IO instance

  • update – A pointer to the UPDATE instance

  • iBody – The current BODY number

void CountHaltsAtmEsc(HALT *halt, int *iHalt)

Count the number of halting conditions.

Parameters:
  • halt – A pointer to the HALT instance

  • iHalt – The current HALT number

void VerifyHaltAtmEsc(BODY *body, CONTROL *control, OPTIONS *options, int iBody, int *iHalt)

Check whether the user wants to halt on certain conditions.

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the CONTROL instance

  • options – A pointer to the OPTIONS instance

  • iBody – The current BODY number

  • iHalt – The current HALT number

void WriteSurfaceWaterMass(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)

Logs the surface water mass.

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the current CONTROL instance

  • output – A pointer to the current OUTPUT instance

  • system – A pointer to the current SYSTEM instance

  • units – A pointer to the current UNITS instance

  • update – A pointer to the current UPDATE instance

  • iBody – The current body Number

  • dTmp – Temporary variable used for unit conversions

  • cUnit – The unit for this variable

void WriteHEscapeRegime(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)

Logs the H escape regime

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the current CONTROL instance

  • output – A pointer to the current OUTPUT instance

  • system – A pointer to the current SYSTEM instance

  • units – A pointer to the current UNITS instance

  • update – A pointer to the current UPDATE instance

  • iBody – The current body Number

  • dTmp – Temporary variable used for unit conversions

  • cUnit – The unit for this variable

void WriteOxygenMass(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)

Logs the atmospheric oxygen mass.

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the current CONTROL instance

  • output – A pointer to the current OUTPUT instance

  • system – A pointer to the current SYSTEM instance

  • units – A pointer to the current UNITS instance

  • update – A pointer to the current UPDATE instance

  • iBody – The current body Number

  • dTmp – Temporary variable used for unit conversions

  • cUnit – The unit for this variable

void WriteKTide(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)

Logs Ktide, the gravitational enhancement of mass loss.

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the current CONTROL instance

  • output – A pointer to the current OUTPUT instance

  • system – A pointer to the current SYSTEM instance

  • units – A pointer to the current UNITS instance

  • update – A pointer to the current UPDATE instance

  • iBody – The current body Number

  • dTmp – Temporary variable used for unit conversions

  • cUnit – The unit for this variable

void WriteOxygenMantleMass(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)

Logs the mantle oxygen mass.

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the current CONTROL instance

  • output – A pointer to the current OUTPUT instance

  • system – A pointer to the current SYSTEM instance

  • units – A pointer to the current UNITS instance

  • update – A pointer to the current UPDATE instance

  • iBody – The current body Number

  • dTmp – Temporary variable used for unit conversions

  • cUnit – The unit for this variable

void WritePlanetRadius(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)

Logs the planet radius.

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the current CONTROL instance

  • output – A pointer to the current OUTPUT instance

  • system – A pointer to the current SYSTEM instance

  • units – A pointer to the current UNITS instance

  • update – A pointer to the current UPDATE instance

  • iBody – The current body Number

  • dTmp – Temporary variable used for unit conversions

  • cUnit – The unit for this variable

void WriteEnvelopeMass(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)

Logs the envelope mass.

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the current CONTROL instance

  • output – A pointer to the current OUTPUT instance

  • system – A pointer to the current SYSTEM instance

  • units – A pointer to the current UNITS instance

  • update – A pointer to the current UPDATE instance

  • iBody – The current body Number

  • dTmp – Temporary variable used for unit conversions

  • cUnit – The unit for this variable

void WriteRGLimit(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)

Logs the semi-major axis corresponding to the current runaway greenhouse limit.

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the current CONTROL instance

  • output – A pointer to the current OUTPUT instance

  • system – A pointer to the current SYSTEM instance

  • units – A pointer to the current UNITS instance

  • update – A pointer to the current UPDATE instance

  • iBody – The current body Number

  • dTmp – Temporary variable used for unit conversions

  • cUnit – The unit for this variable

void WriteOxygenMixingRatio(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)

Logs the oxygen mixing ratio at the base of the hydrodynamic wind.

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the current CONTROL instance

  • output – A pointer to the current OUTPUT instance

  • system – A pointer to the current SYSTEM instance

  • units – A pointer to the current UNITS instance

  • update – A pointer to the current UPDATE instance

  • iBody – The current body Number

  • dTmp – Temporary variable used for unit conversions

  • cUnit – The unit for this variable

void WriteOxygenEta(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)

Logs the oxygen eta parameter from Luger and Barnes (2015).

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the current CONTROL instance

  • output – A pointer to the current OUTPUT instance

  • system – A pointer to the current SYSTEM instance

  • units – A pointer to the current UNITS instance

  • update – A pointer to the current UPDATE instance

  • iBody – The current body Number

  • dTmp – Temporary variable used for unit conversions

  • cUnit – The unit for this variable

void WriteAtmXAbsEffH2O(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)

Logs the XUV absorption efficiency for water.

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the current CONTROL instance

  • output – A pointer to the current OUTPUT instance

  • system – A pointer to the current SYSTEM instance

  • units – A pointer to the current UNITS instance

  • update – A pointer to the current UPDATE instance

  • iBody – The current body Number

  • dTmp – Temporary variable used for unit conversions

  • cUnit – The unit for this variable

void WritePlanetRadXUV(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)

Logs the planet’s radius in the XUV.

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the current CONTROL instance

  • output – A pointer to the current OUTPUT instance

  • system – A pointer to the current SYSTEM instance

  • units – A pointer to the current UNITS instance

  • update – A pointer to the current UPDATE instance

  • iBody – The current body Number

  • dTmp – Temporary variable used for unit conversions

  • cUnit – The unit for this variable

void WriteDEnvMassDt(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)

Logs the atmospheric mass loss rate.

Warning

This routine is currently broken.

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the current CONTROL instance

  • output – A pointer to the current OUTPUT instance

  • system – A pointer to the current SYSTEM instance

  • units – A pointer to the current UNITS instance

  • update – A pointer to the current UPDATE instance

  • iBody – The current body Number

  • dTmp – Temporary variable used for unit conversions

  • cUnit – The unit for this variable

void WriteThermTemp(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)

Logs the thermospheric temperature.

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the current CONTROL instance

  • output – A pointer to the current OUTPUT instance

  • system – A pointer to the current SYSTEM instance

  • units – A pointer to the current UNITS instance

  • update – A pointer to the current UPDATE instance

  • iBody – The current body Number

  • dTmp – Temporary variable used for unit conversions

  • cUnit – The unit for this variable

void WriteFlowTemp(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)

Logs the temperature of the flow.

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the current CONTROL instance

  • output – A pointer to the current OUTPUT instance

  • system – A pointer to the current SYSTEM instance

  • units – A pointer to the current UNITS instance

  • update – A pointer to the current UPDATE instance

  • iBody – The current body Number

  • dTmp – Temporary variable used for unit conversions

  • cUnit – The unit for this variable

void WritePresSurf(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)

Logs the surface pressure.

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the current CONTROL instance

  • output – A pointer to the current OUTPUT instance

  • system – A pointer to the current SYSTEM instance

  • units – A pointer to the current UNITS instance

  • update – A pointer to the current UPDATE instance

  • iBody – The current body Number

  • dTmp – Temporary variable used for unit conversions

  • cUnit – The unit for this variable

void WritePresXUV(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)

Logs the pressure at the XUV absorption radius.

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the current CONTROL instance

  • output – A pointer to the current OUTPUT instance

  • system – A pointer to the current SYSTEM instance

  • units – A pointer to the current UNITS instance

  • update – A pointer to the current UPDATE instance

  • iBody – The current body Number

  • dTmp – Temporary variable used for unit conversions

  • cUnit – The unit for this variable

void WriteJeansTime(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)

Logs the time at which the flow transitioned to Jeans escape.

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the current CONTROL instance

  • output – A pointer to the current OUTPUT instance

  • system – A pointer to the current SYSTEM instance

  • units – A pointer to the current UNITS instance

  • update – A pointer to the current UPDATE instance

  • iBody – The current body Number

  • dTmp – Temporary variable used for unit conversions

  • cUnit – The unit for this variable

void WriteScaleHeight(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)

Logs the atmospheric scale height.

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the current CONTROL instance

  • output – A pointer to the current OUTPUT instance

  • system – A pointer to the current SYSTEM instance

  • units – A pointer to the current UNITS instance

  • update – A pointer to the current UPDATE instance

  • iBody – The current body Number

  • dTmp – Temporary variable used for unit conversions

  • cUnit – The unit for this variable

void WriteAtmGasConst(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)

Logs the gas constant.

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the current CONTROL instance

  • output – A pointer to the current OUTPUT instance

  • system – A pointer to the current SYSTEM instance

  • units – A pointer to the current UNITS instance

  • update – A pointer to the current UPDATE instance

  • iBody – The current body Number

  • dTmp – Temporary variable used for unit conversions

  • cUnit – The unit for this variable

void WriteRadSolid(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)

Logs the planet’s solid radius.

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the current CONTROL instance

  • output – A pointer to the current OUTPUT instance

  • system – A pointer to the current SYSTEM instance

  • units – A pointer to the current UNITS instance

  • update – A pointer to the current UPDATE instance

  • iBody – The current body Number

  • dTmp – Temporary variable used for unit conversions

  • cUnit – The unit for this variable

void WriteRocheRadius(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)

Logs the planet’s Roche radius.

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the current CONTROL instance

  • output – A pointer to the current OUTPUT instance

  • system – A pointer to the current SYSTEM instance

  • units – A pointer to the current UNITS instance

  • update – A pointer to the current UPDATE instance

  • iBody – The current body Number

  • dTmp – Temporary variable used for unit conversions

  • cUnit – The unit for this variable

void WriteBondiRadius(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)

Logs the planet’s Bondi radius.

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the current CONTROL instance

  • output – A pointer to the current OUTPUT instance

  • system – A pointer to the current SYSTEM instance

  • units – A pointer to the current UNITS instance

  • update – A pointer to the current UPDATE instance

  • iBody – The current body Number

  • dTmp – Temporary variable used for unit conversions

  • cUnit – The unit for this variable

void WriteFXUV(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)

Logs the XUV flux received by the planet.

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the current CONTROL instance

  • output – A pointer to the current OUTPUT instance

  • system – A pointer to the current SYSTEM instance

  • units – A pointer to the current UNITS instance

  • update – A pointer to the current UPDATE instance

  • iBody – The current body Number

  • dTmp – Temporary variable used for unit conversions

  • cUnit – The unit for this variable

void WriteRRCriticalFlux(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)

Logs the critical XUV flux that separates the radiation/recombination-limited and energy-limited H envelope escape regimes

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the current CONTROL instance

  • output – A pointer to the current OUTPUT instance

  • system – A pointer to the current SYSTEM instance

  • units – A pointer to the current UNITS instance

  • update – A pointer to the current UPDATE instance

  • iBody – The current body Number

  • dTmp – Temporary variable used for unit conversions

  • cUnit – The unit for this variable

void WriteCrossoverMass(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)

Logs the crossover mass.

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the current CONTROL instance

  • output – A pointer to the current OUTPUT instance

  • system – A pointer to the current SYSTEM instance

  • units – A pointer to the current UNITS instance

  • update – A pointer to the current UPDATE instance

  • iBody – The current body Number

  • dTmp – Temporary variable used for unit conversions

  • cUnit – The unit for this variable

void WriteWaterEscapeRegime(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)

Logs the Water escape regime

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the current CONTROL instance

  • output – A pointer to the current OUTPUT instance

  • system – A pointer to the current SYSTEM instance

  • units – A pointer to the current UNITS instance

  • update – A pointer to the current UPDATE instance

  • iBody – The current body Number

  • dTmp – Temporary variable used for unit conversions

  • cUnit – The unit for this variable

void WriteFXUVCRITDRAG(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)

Logs the XUV flux received by the planet.

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the current CONTROL instance

  • output – A pointer to the current OUTPUT instance

  • system – A pointer to the current SYSTEM instance

  • units – A pointer to the current UNITS instance

  • update – A pointer to the current UPDATE instance

  • iBody – The current body Number

  • dTmp – Temporary variable used for unit conversions

  • cUnit – The unit for this variable

void WriteHREFFLUX(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)

Logs the Hydrogen Reference Flux

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the current CONTROL instance

  • output – A pointer to the current OUTPUT instance

  • system – A pointer to the current SYSTEM instance

  • units – A pointer to the current UNITS instance

  • update – A pointer to the current UPDATE instance

  • iBody – The current body Number

  • dTmp – Temporary variable used for unit conversions

  • cUnit – The unit for this variable

void WriteHDiffLimFlux(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)

Logs the H flux if it was diffusion limited (or the true flux in the diffusion limited regime)

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the current CONTROL instance

  • output – A pointer to the current OUTPUT instance

  • system – A pointer to the current SYSTEM instance

  • units – A pointer to the current UNITS instance

  • update – A pointer to the current UPDATE instance

  • iBody – The current body Number

  • dTmp – Temporary variable used for unit conversions

  • cUnit – The unit for this variable

void WriteHRefODragMod(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)

Modifier for H Ref Flux to include oxygen drag at a snapshot in time

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the current CONTROL instance

  • output – A pointer to the current OUTPUT instance

  • system – A pointer to the current SYSTEM instance

  • units – A pointer to the current UNITS instance

  • update – A pointer to the current UPDATE instance

  • iBody – The current body Number

  • dTmp – Temporary variable used for unit conversions

  • cUnit – The unit for this variable

void WriteMolecOxygenMixingRatio(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)

Logs the molecular oxygen mixing ratio.

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the current CONTROL instance

  • output – A pointer to the current OUTPUT instance

  • system – A pointer to the current SYSTEM instance

  • units – A pointer to the current UNITS instance

  • update – A pointer to the current UPDATE instance

  • iBody – The current body Number

  • dTmp – Temporary variable used for unit conversions

  • cUnit – The unit for this variable

void WriteWaterAtmMixingRatio(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)

Logs the water mixing ratio.

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the current CONTROL instance

  • output – A pointer to the current OUTPUT instance

  • system – A pointer to the current SYSTEM instance

  • units – A pointer to the current UNITS instance

  • update – A pointer to the current UPDATE instance

  • iBody – The current body Number

  • dTmp – Temporary variable used for unit conversions

  • cUnit – The unit for this variable

void InitializeOutputAtmEsc(OUTPUT *output, fnWriteOutput fnWrite[])

Set up stuff to be logged for atmesc.

Parameters:
  • output – A pointer to the current OUTPUT instance

  • fnWrite – A pointer to the function that does the logging

void LogOptionsAtmEsc(CONTROL *control, FILE *fp)

Log the global atmesc options.

Warning

This routine currently does nothing!

Parameters:
  • control – A pointer to the current CONTROL instance

  • fp – A FILE pointer

void LogAtmEsc(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UPDATE *update, fnWriteOutput fnWrite[], FILE *fp)

Log the global atmesc parameters.

Warning

This routine currently does nothing!

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the current CONTROL instance

  • output – A pointer to the current OUTPUT instance

  • system – A pointer to the current SYSTEM instance

  • update – A pointer to the current UPDATE instance

  • fnWrite – A pointer to the function doing the logging

  • fp – A FILE pointer

void LogBodyAtmEsc(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UPDATE *update, fnWriteOutput fnWrite[], FILE *fp, int iBody)

Log the body-specific atmesc parameters.

Parameters:
  • body – A pointer to the current BODY instance

  • control – A pointer to the current CONTROL instance

  • output – A pointer to the current OUTPUT instance

  • system – A pointer to the current SYSTEM instance

  • update – A pointer to the current UPDATE instance

  • fnWrite – A pointer to the function doing the logging

  • fp – A FILE pointer

  • iBody – The current BODY number

void AddModuleAtmEsc(CONTROL *control, MODULE *module, int iBody, int iModule)

Adds atmesc to the current array of MODULEs.

Parameters:
  • module – A pointer to the current array of MODULE instances

  • iBody – The current BODY number

  • iModule – The current MODULE number

double fdDSurfaceWaterMassDt(BODY *body, SYSTEM *system, int *iaBody)

The rate of change of the surface water mass.

Parameters:
  • body – A pointer to the current BODY instance

  • system – A pointer to the current SYSTEM instance

  • iaBody – An array of body indices. The current body is index 0.

double fdDOxygenMassDt(BODY *body, SYSTEM *system, int *iaBody)

The rate of change of the oxygen mass in the atmosphere.

Parameters:
  • body – A pointer to the current BODY instance

  • system – A pointer to the current SYSTEM instance

  • iaBody – An array of body indices. The current body is index 0.

double fdDOxygenMantleMassDt(BODY *body, SYSTEM *system, int *iaBody)

The rate of change of the oxygen mass in the mantle.

Parameters:
  • body – A pointer to the current BODY instance

  • system – A pointer to the current SYSTEM instance

  • iaBody – An array of body indices. The current body is index 0.

double fdDEnvelopeMassDt(BODY *body, SYSTEM *system, int *iaBody)

The rate of change of the envelope mass given energy-limited escape.

Parameters:
  • body – A pointer to the current BODY instance

  • system – A pointer to the current SYSTEM instance

  • iaBody – An array of body indices. The current body is index 0.

double fdDEnvelopeMassDtBondiLimited(BODY *body, SYSTEM *system, int *iaBody)

The rate of change of the envelope mass given Bondi-limited escape.

Parameters:
  • body – A pointer to the current BODY instance

  • system – A pointer to the current SYSTEM instance

  • iaBody – An array of body indices. The current body is index 0.

double fdDEnvelopeMassDtRRLimited(BODY *body, SYSTEM *system, int *iaBody)

The rate of change of the envelope mass given raditation/recombination-limited escape.

Parameters:
  • body – A pointer to the current BODY instance

  • system – A pointer to the current SYSTEM instance

  • iaBody – An array of body indices. The current body is index 0.

double fdSurfEnFluxAtmEsc(BODY *body, SYSTEM *system, UPDATE *update, int iBody, int iFoo)

This function does nothing in atmesc.

Parameters:
  • body – A pointer to the current BODY instance

  • system – A pointer to the current SYSTEM instance

  • update – A pointer to the current UPDATE instance

  • iBody – The current body index

  • iFoo – An example of pretty lousy programming

double fdPlanetRadius(BODY *body, SYSTEM *system, int *iaBody)

Returns the planet radius at the current time.

Parameters:
  • body – A pointer to the current BODY instance

  • system – A pointer to the current SYSTEM instance

  • iaBody – An array of body indices. The current body is index 0.

int fbDoesWaterEscape(BODY *body, EVOLVE *evolve, IO *io, int iBody)

Computes whether or not water is escaping.

Parameters:
  • body – A pointer to the current BODY instance

  • iBody – The current BODY index

double fdAtomicOxygenMixingRatio(double dSurfaceWaterMass, double dOxygenMass)

Computes the atomic oxygen mixing ratio in the hydrodynamic flow.

Parameters:
  • dSurfaceWaterMass – The amount of water in the atmosphere

  • dOxygenMass – The amount of oxygen in the atmosphere

double fdMolecOxygenMixingRatio(double dSurfaceWaterMass, double dOxygenMass)

Computes the molecular oxygen mixing ratio in atmosphere. ASSUMING PURE WATER/OXYGEN ATMOSPHERE

Parameters:
  • dSurfaceWaterMass – The amount of water in the atmosphere

  • dOxygenMass – The amount of oxygen in the atmosphere

double fdWaterAtmMixingRatio(double dSurfaceWaterMass, double dOxygenMass)

Computes the water mixing ratio in atmosphere. ASSUMING PURE WATER/OXYGEN ATMOSPHERE

Parameters:
  • dSurfaceWaterMass – The amount of water in the atmosphere

  • dOxygenMass – The amount of oxygen in the atmosphere

double fdHZRG14(BODY *body, int iBody)

Performs a simple log-linear fit to the Kopparapu et al. (2014) mass-dependent runaway greenhouse limit.

Warning

Something is wrong with this linear fit in the first 5 Myr or so, as it diverges.

Parameters:
  • dLuminosity – The stellar luminosity

  • dTeff – The stellar effective temperature

  • dEcc – The planet’s eccentricity — RB: Why is ecc passed?

  • dPlanetMass – The planet mass

double fdXUVEfficiencyBolmont2016(double dFXUV)

Computes the XUV absorption efficiency for a water vapor atmosphere based on a fit to the figure in Bolmont et al. (2017).

Parameters:

dFXUV – The XUV flux incident on the planet.

void fvLinearFit(double *x, double *y, int iLen, double *daCoeffs)

Performs a really simple linear least-squares fit on data.

Parameters:
  • x – The independent coordinates

  • y – The dependent coordinates

  • iLen – The length of the arrays

  • daCoeffs – The slope and the intercept of the fit

int fbRRCriticalFlux(BODY *body, int iBody)

Calculate the whether or not incident XUV flux exceeds critical flux between the radiation/recombination-limited and energy-limited H envelope escape regimes following Luger+2015 Eqn. 13

Parameters:
  • bodyBODY struct

  • iBody – int body indentifier

Returns:

whether or not the flux is radiation/recombination-limited

double fdRRCriticalFlux(BODY *body, int iBody)

Calculate the critical flux between the radiation/recombination-limited and energy-limited H envelope escape regimes following Luger+2015 Eqn. A23-25

Parameters:
  • bodyBODY struct

  • iBody – int body indentifier

Returns:

critical flux between radiation/recombination and Energy-limited regimes

int fbBondiCriticalDmDt(BODY *body, int iBody)

Estimate if mass loss is Bondi-limited, i.e. is planet in Roche lobe overflow

Parameters:
  • bodyBODY struct

  • iBody – int body indentifier

Returns:

whether or not the flux is Bondi-limited

void fvAtmEscRegimeChangeOutput(int iRegimeOld, int iRegimeNew, double dTime)

Determine correct print statement to identify atmospheric escape regime change string

Parameters:
  • iRegimeOld – int previoius atmospheric escape regime

  • iRegimeNew – int new atmospheric escape regime

  • dTime – double time when regime change occurs

Returns:

None

atmesc.h

Subroutines that control the integration of the atmospheric escape model.

Author

Rodrigo Luger (rodluger@gmail.com)

Date

May 12 2015

Defines

TOMASS

Mass of one terrestrial ocean in kg (TO)

TOHMASS

Hydrogen mass in one TO

ATMESC_LB15

Flag: Luger and Barnes (2015) atmospheric escape formulae

ATMESC_LBEXACT

Flag: Luger and Barnes (2015) atmospheric escape formulae w/ updated \ oxygen mixing ratio calculations

ATMESC_TIAN

Flag: Tian (2015) atmospheric escape formulae flag \

ATMESC_ELIM

Flag: Energy-limited escape

ATMESC_DIFFLIM

Flag: Diffusion-limited escape

ATMESC_BONDILIM

Flag: Bondi-limited escape

ATMESC_RRLIM

Flag: Radiation/recombination-limited escape

ATMESC_BALLISTIC

Flag: Ballistic escape regime

ATMESC_NONE

Flag: No atmospheric escape

ATMESC_LOP12

Flag: Lopez (2012) gaseous planet radius model

ATMESC_PROXCENB

Flag: Proxima Centauri b gaseous planet radius model

ATMESC_LEHMER17

Flag: Lehmer & Catling (2017) planet radius model

ATMESC_BOL16

Flag: Bolmont (2016) XUV absorption efficiency model

ATMESC_LS2016

Schaefer et al (2016) atmospheric escape model

QOH

Atomic mass ratio oxygen/hydrogen

OPTSTARTATMESC

Start of AtmEsc options

OPTENDATMESC

End of AtmEsc options

OPT_HALTDESICCATED

Halt if desiccated?

OPT_XFRAC

X-ray absorption radius as a fraction of planet radius

OPT_ATMXABSEFFH

Hydrogen Absorption efficiency (epsilon)

OPT_HALTENVELOPEGONE

Halt if evaporated?

OPT_OXYGENMASS

Initial oxygen mass

OPT_WATERLOSSMODEL

Oxygen buildup / water loss model

OPT_PLANETRADIUSMODEL

Gaseous planet radius model (for atmesc)

OPT_INSTANTO2SINK

Gaseous planet radius model (for atmesc) \

OPT_ATMXABSEFFH2O

Water Absorption efficiency (epsilon)

OPT_OXYGENMANTLEMASS

Initial oxygen mass in mantle

OPT_THERMTEMP

thermosphere temperature

OPT_PRESXUV

Pressure at bottom of thermosphere

OPT_ATMGASCONST

Atmospheric Gas Constant

OPT_FXUV

The value of the XUV flux

OPT_ATMXABSEFFH2OMODEL

Model for time evolution of epsilon for H2O

OPT_JEANSTIME

Time at which flow becomes ballistic (Jeans escape)

OPT_FLOWTEMP

Flow temperature

OPT_BONDILIMITED

Whether or not to use Bondi-limited escape \

OPT_ENERGYLIMITED

Whether or not to use energy-limited escape

OPT_RRLIMITED

Whether or not to use radiation/recombination-limited escape

OPT_ATMESCAUTO

Whether or not to let atmesc determine escape regime

OPT_STOPWATERLOSSINHZ

Stop water loss once planet reaches HZ?

OPT_MINKTIDE

Minimum KTide value