Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…ory/vplanet into ConstXUV
  • Loading branch information
Rory Barnes committed Apr 16, 2024
2 parents ebdf1f5 + 9526f31 commit b6ef1d0
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 23 deletions.
52 changes: 29 additions & 23 deletions src/atmesc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2108,31 +2108,37 @@ void VerifyAtmEsc(BODY *body, CONTROL *control, FILES *files, OPTIONS *options,
}

if (body[iBody].iPlanetRadiusModel == ATMESC_LEHMER17) {
if (body[iBody].dEnvelopeMass > 0.5 * body[iBody].dMass) {
fprintf(stderr,
"ERROR: %s's Envelope mass is greater than 50%% of its total "
"mass, which ",
if (body[0].bStellar) {
if (body[iBody].dEnvelopeMass > 0.5 * body[iBody].dMass) {
fprintf(stderr,
"ERROR: %s's Envelope mass is greater than 50%% of its total "
"mass, which ",
body[iBody].cName);
fprintf(
stderr,
"is not allowed for the Lehmer-Catling (2017) envelope model.\n");
DoubleLineExit(files->Infile[iBody + 1].cIn, files->Infile[iBody + 1].cIn,
options[OPT_ENVELOPEMASS].iLine[iBody + 1],
options[OPT_MASS].iLine[iBody + 1]);
}
if (body[iBody].dEnvelopeMass >= 0.1 * body[iBody].dMass) {
fprintf(
stderr,
"WARNING: Envelope masses more than 10%% of the total mass are not "
"recommended for the Lehmer-Catling (2017) envelope model. %s's "
"envelope ",
body[iBody].cName);
fprintf(
stderr,
"is not allowed for the Lehmer-Catling (2017) envelope model.\n");
DoubleLineExit(files->Infile[iBody + 1].cIn, files->Infile[iBody + 1].cIn,
options[OPT_ENVELOPEMASS].iLine[iBody + 1],
options[OPT_MASS].iLine[iBody + 1]);
}
if (body[iBody].dEnvelopeMass >= 0.1 * body[iBody].dMass) {
fprintf(
stderr,
"WARNING: Envelope masses more than 10%% of the total mass are not "
"recommended for the Lehmer-Catling (2017) envelope model. %s's "
"envelope ",
body[iBody].cName);
fprintf(stderr, "mass exceeds this threshold.\n");
}
fprintf(stderr, "mass exceeds this threshold.\n");
}

// Calculate auxiliary properties
body[iBody].dRadSolid = fdMassToRad_LehmerCatling17(body[iBody].dMass - body[iBody].dEnvelopeMass);
AuxPropsLehmer17(body,iBody);
// Calculate auxiliary properties
body[iBody].dRadSolid = fdMassToRad_LehmerCatling17(body[iBody].dMass - body[iBody].dEnvelopeMass);
AuxPropsLehmer17(body,iBody);
} else {
fprintf(stderr,
"ERROR: The Lehmer & Catling (2017) model requires a star.\n");
exit(EXIT_INPUT);
}
} else {
int iCol, bError = 0;
for (iCol = 0; iCol < files->Outfile[iBody].iNumCols; iCol++) {
Expand Down
5 changes: 5 additions & 0 deletions tests/floatingpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ def Main():
if last_line != "Simulation completed.\n":
tot_fail += 1
print("Fail", flush=True)
print("\n------------\n")
with open(outfile, "r") as f:
print(f.read())
print("\n------------\n")

else:
print("Pass", flush=True)
os.chdir("../../")
Expand Down

0 comments on commit b6ef1d0

Please sign in to comment.