eqtide

Contents

eqtide.c

Subroutines that control the integration of the tidal model. Also includes subroutines that switch between the two models.

Author

Rory Barnes (RoryBarnes)

Date

May 29 2014

Functions

void InitializeControlEqtide(CONTROL *control, int iBody)
void BodyCopyEqtide(BODY *dest, BODY *src, int iTideModel, int iNumBodies, int iBody)
void InitializeBodyEqtide(BODY *body, CONTROL *control, UPDATE *update, int iBody, int iModule)
void InitializeUpdateTmpBodyEqtide(BODY *body, CONTROL *control, UPDATE *update, int iBody)
void ReadTidalQMantle(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadDiscreteRot(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadHaltDblSync(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadFixOrbit(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadForceEqSpin(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadHaltTideLock(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadHaltSyncRot(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadK2(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadTidalRadius(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadK2Ocean(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadK2Env(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadK2Mantle(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadMaxLockDiff(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadSyncEcc(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadTidalQOcean(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadTidalQEnv(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadTidalTau(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadTideModel(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadTidePerts(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadEqtideOceanTides(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadEqtideMantleTides(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadUseTidalRadius(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void ReadEqtideEnvTides(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, int iFile)
void InitializeOptionsEqtide(OPTIONS *options, fnReadOption fnRead[])
void ReadOptionsEqtide(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, SYSTEM *system, fnReadOption fnRead[], int iBody)
void VerifyRotationEqtideWarning(char cName1[], char cName2[], char cFile[], int iLine1, int iLine2, int iVerbose)
void VerifyLostEngEqtide(BODY *body, UPDATE *update, CONTROL *control, OPTIONS *options, int iBody)
void VerifyRotationEqtide(BODY *body, CONTROL *control, UPDATE *update, OPTIONS *options, char cFile[], int iBody)
int fiTideFile(int *iLine, int iNumFiles)
void InitializeXoblEqtide(BODY *body, UPDATE *update, int iBody, int iPert)
void InitializeYoblEqtide(BODY *body, UPDATE *update, int iBody, int iPert)
void InitializeZoblEqtide(BODY *body, UPDATE *update, int iBody, int iPert)
void InitializeRotEqtide(BODY *body, UPDATE *update, int iBody, int iPert)
void InitializeHeccEqtide(BODY *body, UPDATE *update, int iBody)
void InitializeKeccEqtide(BODY *body, UPDATE *update, int iBody)
void InitializeSemiEqtide(BODY *body, UPDATE *update, int iBody)
void VerifyCTL(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, OUTPUT *output, UPDATE *update, int iBody, int iModule)
void VerifyCPL(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, OUTPUT *output, UPDATE *update, int iBody, int iModule)
void VerifyPerturbersEqtide(BODY *body, FILES *files, OPTIONS *options, UPDATE *update, int iNumBodies, int iBody)

Verify all arguments to saTidePerturbers. This subroutine will called from each body using module eqtide, but we must make sure that each pair of perturbing bodies points to each other, so we must loop through verify all the bodies at the same time. This means all these lines will be repeated for each tidally evolving body. But, if it’s verified the first time, it should verify every time!

void VerifyOrbitEqtide(BODY *body, CONTROL *control, FILES *files, OPTIONS *options)
int fiGetModuleIntEqtide(MODULE *module, int iBody)
void VerifyTideModel(CONTROL *control, FILES *files, OPTIONS *options)
void AssignEqtideDerivatives(BODY *body, EVOLVE *evolve, UPDATE *update, fnUpdateVariable ***fnUpdate, int iBody)
void NullEqtideDerivatives(BODY *body, EVOLVE *evolve, UPDATE *update, fnUpdateVariable ***fnUpdate, int iBody)
void VerifyEqtide(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, OUTPUT *output, SYSTEM *system, UPDATE *update, int iBody, int iModule)
void InitializeUpdateEqtide(BODY *body, UPDATE *update, int iBody)
void FinalizeUpdateHeccEqtide(BODY *body, UPDATE *update, int *iEqn, int iVar, int iBody, int iFoo)
void FinalizeUpdateLostEngEqtide(BODY *body, UPDATE *update, int *iEqn, int iVar, int iBody, int iFoo)
void FinalizeUpdateKeccEqtide(BODY *body, UPDATE *update, int *iEqn, int iVar, int iBody, int iFoo)
void FinalizeUpdateXoblEqtide(BODY *body, UPDATE *update, int *iEqn, int iVar, int iBody, int iFoo)
void FinalizeUpdateYoblEqtide(BODY *body, UPDATE *update, int *iEqn, int iVar, int iBody, int iFoo)
void FinalizeUpdateZoblEqtide(BODY *body, UPDATE *update, int *iEqn, int iVar, int iBody, int iFoo)
void FinalizeUpdateRotEqtide(BODY *body, UPDATE *update, int *iEqn, int iVar, int iBody, int iFoo)
void FinalizeUpdateSemiEqtide(BODY *body, UPDATE *update, int *iEqn, int iVar, int iBody, int iFoo)
int HaltDblSync(BODY *body, EVOLVE *evolve, HALT *halt, IO *io, UPDATE *update, fnUpdateVariable ***fnUpdate, int iBody)
int HaltTideLock(BODY *body, EVOLVE *evolve, HALT *halt, IO *io, UPDATE *update, fnUpdateVariable ***fnUpdate, int iBody)
int HaltSyncRot(BODY *body, EVOLVE *evolve, HALT *halt, IO *io, UPDATE *update, fnUpdateVariable ***fnUpdate, int iBody)
void CountHaltsEqtide(HALT *halt, int *iNumHalts)
void VerifyHaltEqtide(BODY *body, CONTROL *control, OPTIONS *options, int iBody, int *iHalt)
void WriteBodyDsemiDtEqtide(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)
void WriteBodyDeccDtEqtide(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)
void WriteLockTime(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)
void WriteTidalRadius(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)
void WriteDOblDtEqtide(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)
void WriteTidalQOcean(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)
void WriteTidalQEnv(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)
void WriteDSemiDtEqtide(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)
void WriteDEccDtEqtide(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)
void WriteDMeanMotionDtEqtide(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)
void WriteDOrbPerDtEqtide(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)
void WriteDRotPerDtEqtide(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)
void WriteDRotRateDtEqtide(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)
void WriteDHeccDtEqtide(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)
void WriteDKeccDtEqtide(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)
void WriteDXoblDtEqtide(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)
void WriteDYoblDtEqtide(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)
void WriteDZoblDtEqtide(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)
void WriteEccTimescaleEqtide(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)
void WriteEqRotPer(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)
void WriteEqRotPerCont(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)
void WriteEqRotPerDiscrete(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)
void WriteEqRotRate(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)
void WriteEqRotRateCont(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)
void WriteEqRotRateDiscrete(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)
void WriteEqTidePower(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)
void WriteGammaOrb(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)
void WriteGammaRot(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)
void WriteK2Ocean(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)
void WriteK2Env(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)
void WriteOblTimescaleEqtide(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)
void WriteRotTimescaleEqtide(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)
void WriteSemiTimescaleEqtide(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)
void WritePowerEqtide(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)
void WriteEnergyFluxEqtide(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)
void WriteTidalTau(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)
void WriteTideLock(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UNITS *units, UPDATE *update, int iBody, double *dTmp, char **cUnit)
void InitializeOutputEqtide(OUTPUT *output, fnWriteOutput fnWrite[])
void LogOptionsEqtide(CONTROL *control, FILE *fp)
void LogEqtide(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UPDATE *update, fnWriteOutput fnWrite[], FILE *fp)
void LogBodyEqtide(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system, UPDATE *update, fnWriteOutput fnWrite[], FILE *fp, int iBody)
void AddModuleEqtide(CONTROL *control, MODULE *module, int iBody, int iModule)
double fdEqRotRate(BODY *body, int iBody, double dMeanMotion, double dEccSq, int iTideModel, int bDiscreteRot)
void fdaChi(BODY *body, double dMeanMotion, double dSemi, int iBody, int iPert)
int fbTidalLock(BODY *body, EVOLVE *evolve, IO *io, int iBody, int iOrbiter, UPDATE *update, fnUpdateVariable ***fnUpdate, SYSTEM *system)
void PropsAuxEqtide(BODY *body, EVOLVE *evolve, IO *io, UPDATE *update, int iBody)
void PropsAuxOrbiterGeneral(BODY *body, int iBody)
void PropsAuxOrbiterCPL(BODY *body, UPDATE *update, int iBody)
void PropsAuxOrbiterCTL(BODY *body, UPDATE *update, int iBody)
void PropsAuxOrbiterDB15(BODY *body, UPDATE *update, int iBody)
void PropsAuxCPL(BODY *body, EVOLVE *evolve, IO *io, UPDATE *update, int iBody)
void PropsAuxCTL(BODY *body, EVOLVE *evolve, IO *io, UPDATE *update, int iBody)
void PropsAuxDB15(BODY *body, EVOLVE *evolve, IO *io, UPDATE *update, int iBody)
double fdDEdTCPLEqtide(BODY *body, SYSTEM *system, int *iaBody)

Lost energy due to tidal heating in the CPL model.

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

Lost energy due to tidal heating in the CTL model.

double fdTidePower(BODY *body, int iBody, int iTideModel)
double fdSurfEnFluxEqtide(BODY *body, SYSTEM *foo, UPDATE *bar, int iBody, int iTideModel)
void ForceBehaviorEqtide(BODY *body, MODULE *module, EVOLVE *evolve, IO *io, SYSTEM *system, UPDATE *update, fnUpdateVariable ***fnUpdate, int iBody, int iModule)
int fiAssignTidalPerturber(BODY *body, int iBody)

Identify and return the index for the perturbing body.

int fiAssignTidalOrbiter(BODY *body, int iBody)
double fdCPLTidePower(BODY *body, int iBody)
double fdTidePowerOcean(BODY *body, int iBody)
double fdSurfEnFluxOcean(BODY *body, int iBody)
double fdGammaRot(double dEccSq, double dPsi, int *epsilon)
double fdGammaOrb(double dEccSq, double dPsi, int *epsilon)
void fiaCPLEpsilon(double dRotRate, double dMeanMotion, double dObliquity, int *iEpsilon)
void fdCPLZ(BODY *body, double dMeanMotion, double dSemi, int iBody, int iPert)
double fdCPLTidePowerEq(double dTidalZ, double dEccSq, double dMeanMotion, double dObliquity, int bDiscrete)
double fdCPLEqRotRateCont(double dMeanMotion, double dEccSq)
double fdCPLEqRotRateDiscrete(double dMeanMotion, double dEccSq)
double fdCPLEqRotRate(double dEccSq, double dMeanMotion, int bDiscrete)
double fdCPLDsemiDt(BODY *body, SYSTEM *system, int *iaBody)

Equations governing semi-major axis derivative from Ferraz-Mello 2008 Combines tidally-locked and not-tidally locked equations

double fdCPLDeccDt(BODY *body, int *iaBody)
double fdCPLDHeccDt(BODY *body, SYSTEM *system, int *iaBody)
double fdCPLDKeccDt(BODY *body, SYSTEM *system, int *iaBody)
double fdCPLDrotrateDt(BODY *body, SYSTEM *system, int *iaBody)
double fdCPLDoblDt(BODY *body, int *iaBody)
double fdCPLDXoblDt(BODY *body, SYSTEM *system, int *iaBody)
double fdCPLDYoblDt(BODY *body, SYSTEM *system, int *iaBody)
double fdCPLDZoblDt(BODY *body, SYSTEM *system, int *iaBody)
double fdCTLBeta(double dEcc)
double fdCTLF1(double dEcc)
double fdCTLF2(double dEcc)
double fdCTLF3(double dEcc)
double fdCTLF4(double dEcc)
double fdCTLF5(double dEcc)
void fdaCTLF(BODY *body, double dEcc, int iBody, int iPert)
double fdCTLTidePower(BODY *body, int iBody)
double fdCTLTidePowerEq(BODY body, double dEcc)
double fdCTLEqRotRate(double dEccSq, double dObliquity, double dMeanMotion)
void fdaCTLZ(BODY *body, double dSemi, int iBody, int iPert)
double fdCTLDXoblDt(BODY *body, SYSTEM *system, int *iaBody)
double fdCTLDYoblDt(BODY *body, SYSTEM *system, int *iaBody)
double fdCTLDZoblDt(BODY *body, SYSTEM *system, int *iaBody)
double fdCTLDHeccDt(BODY *body, SYSTEM *system, int *iaBody)
double fdCTLDKeccDt(BODY *body, SYSTEM *system, int *iaBody)
double fdCTLDsemiDt(BODY *body, SYSTEM *system, int *iaBody)
double fdCTLDeccDt(BODY *body, UPDATE *update, int *iaBody)
double fdCTLDrotrateDt(BODY *body, SYSTEM *system, int *iaBody)
double fdCTLDoblDt(BODY *body, int *iaBody)
double fdPowerEqtideDB15(BODY *body, int iBody)
double fdDB15DsemiDt(BODY *body, SYSTEM *system, int *iaBody)
double fdDB15DeccDt(BODY *body, UPDATE *update, int *iaBody)
double fdDB15DHeccDt(BODY *body, SYSTEM *system, int *iaBody)
double fdDB15DKeccDt(BODY *body, SYSTEM *system, int *iaBody)
void VerifyDB15(BODY *body, CONTROL *control, FILES *files, OPTIONS *options, OUTPUT *output, UPDATE *update, int iBody, int iModule)

eqtide.h

Subroutines that control the integration of the tidal model. Also includes subroutines that switch between the two models.

Author

Rory Barnes (RoryBarnes)

Date

May 29 2014

Defines

CPL
CTL
DB15
OPTSTARTEQTIDE
OPTENDEQTIDE
OPT_USETIDALRADIUS
OPT_TIDALRADIUS
OPT_DISCRETEROT
OPT_FIXORBIT
OPT_FORCEEQSPIN
OPT_HALTDBLSYNC
OPT_HALTTIDELOCK
OPT_HALTSYNCROT
OPT_K2
OPT_K2OCEAN
OPT_K2ENV
OPT_MAXLOCKDIFF
OPT_SYNCECC
OPT_TIDEMODEL
OPT_TIDEPERTS
OPT_TIDALTAU
OPT_TIDALQOCEAN
OPT_OCEANTIDES
OPT_TIDALQENV
OPT_ENVTIDES
OUT_ECCA
OPT_MANTLETIDES
OPT_TIDALQMANTLE
OPT_K2MANTLE
EQTIDEHALTSYSEND
EQTIDEHALTBODYEND
OUTSTARTEQTIDE
OUT_TIDALRADIUS
OUTBODYSTARTEQTIDE
OUTENDEQTIDE
OUT_DSEMIDTEQTIDE
OUT_DECCDTEQTIDE
OUT_DMMDTEQTIDE
OUT_DORBPERDTEQTIDE
OUT_DORBEPSILON
OUT_ECCTIMEEQTIDE
OUT_SEMITIMEEQTIDE
OUT_DHECCDTEQTIDE
OUT_DKECCDTEQTIDE
OUT_DXOBLDTEQTIDE
OUT_DYOBLDTEQTIDE
OUT_DZOBLDTEQTIDE
OUT_LOCKTIME
OUT_BODYDSEMIDTEQTIDE
OUT_BODYDECCDTEQTIDE
OUT_DOBLDTEQTIDE
OUT_DROTPERDTEQTIDE
OUT_DROTRATEDTEQTIDE
OUT_EQROTRATEEQTIDE
OUT_EQROTRATEDISCRETE
OUT_EQROTPERDISCRETE
OUT_EQROTRATECONT
OUT_EQROTPERCONT
OUT_EQROTPER
OUT_EQROTRATE
OUT_EQTIDEPOWER
OUT_GAMMAROT
OUT_GAMMAORB
OUT_K2OCEAN
OUT_TIDALQOCEAN
OUT_TIDALQENV
OUT_TIDALTAU
OUT_TIDELOCK
OUT_ROTRATETIMEEQTIDE
OUT_K2ENV
OUT_OBLTIMEEQTIDE
OUT_POWEREQTIDE
OUT_ENFLUXEQTIDE
OUT_BENV
OUT_BOCEAN