diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index 4e4cef7c7..2e8bdedd2 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -19,7 +19,7 @@ jobs: - python-version: '3.10' steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 @@ -35,7 +35,7 @@ jobs: - name: Set up Python id: setup_python - uses: conda-incubator/setup-miniconda@v2 + uses: conda-incubator/setup-miniconda@v3 with: activate-environment: vplanet environment-file: environment.yml diff --git a/.github/workflows/memcheck.yml b/.github/workflows/memcheck.yml index 3cbe46259..d98abf6e6 100644 --- a/.github/workflows/memcheck.yml +++ b/.github/workflows/memcheck.yml @@ -12,13 +12,13 @@ jobs: fail-fast: false steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up Python id: setup_python - uses: conda-incubator/setup-miniconda@v2 + uses: conda-incubator/setup-miniconda@v3 with: activate-environment: vplanet environment-file: environment.yml diff --git a/.github/workflows/pip-install.yml b/.github/workflows/pip-install.yml index e15b8ef42..3a2af3031 100644 --- a/.github/workflows/pip-install.yml +++ b/.github/workflows/pip-install.yml @@ -16,12 +16,12 @@ jobs: - os: ubuntu-22.04 python-version: '3.6' steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: true fetch-depth: 0 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 name: Install Python with: python-version: ${{ matrix.python }} @@ -49,7 +49,7 @@ jobs: CIBW_SKIP: '*-manylinux_i686' CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: path: ./wheelhouse/*.whl @@ -62,7 +62,7 @@ jobs: submodules: true fetch-depth: 0 - - uses: actions/setup-python@v3 + - uses: actions/setup-python@v5 name: Install Python with: python-version: ${{ matrix.python }} @@ -70,7 +70,7 @@ jobs: - name: Build sdist run: python setup.py sdist - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: path: dist/*.tar.gz @@ -78,7 +78,7 @@ jobs: needs: [build_wheels, build_sdist] runs-on: ubuntu-latest steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: artifact path: dist diff --git a/.github/workflows/tests-linux.yml b/.github/workflows/tests-linux.yml index 726ec8a3e..5bb2b3721 100644 --- a/.github/workflows/tests-linux.yml +++ b/.github/workflows/tests-linux.yml @@ -21,13 +21,13 @@ jobs: fail-fast: false steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up Python id: setup_python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} @@ -48,7 +48,7 @@ jobs: - name: Check test ouptut created id: check_test_file - uses: andstor/file-existence-action@v2 + uses: andstor/file-existence-action@v3 with: files: "/home/runner/work/vplanet/vplanet/junit/test-results.xml" fail: true @@ -64,6 +64,6 @@ jobs: files: junit/test-*.xml - name: CodeCov - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: files: ./.coverage diff --git a/.github/workflows/tests-macos.yml b/.github/workflows/tests-macos.yml index eb315d46b..b9bf0b3d0 100644 --- a/.github/workflows/tests-macos.yml +++ b/.github/workflows/tests-macos.yml @@ -13,16 +13,17 @@ jobs: strategy: matrix: os: [macos-11, macos-12, macos-13] - python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] + python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11'] + fail-fast: false steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up Python id: setup_python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} @@ -37,19 +38,7 @@ jobs: if: steps.setup_python.outcome == 'success' run: make test - - name: Check test ouptut created - id: check_test_file - uses: andstor/file-existence-action@v2 - with: - files: "/home/runner/work/vplanet/vplanet/junit/test-results.xml" - fail: true - - name: Get unique id uses: Tiryoh/gha-jobid-action@v1 id: jobs - - name: Publish unit test results - uses: EnricoMi/publish-unit-test-result-action/composite@v2 - if: always() - with: - files: junit/test-*.xml diff --git a/src/evolve.c b/src/evolve.c index 6aada70bd..ea0931ddf 100644 --- a/src/evolve.c +++ b/src/evolve.c @@ -632,8 +632,7 @@ void Evolve(BODY *body, CONTROL *control, FILES *files, MODULE *module, } /* Write out initial conditions */ - WriteOutput(body, control, files, output, system, update, fnWrite, - control->Evolve.dTime, dDt); + WriteOutput(body, control, files, output, system, update, fnWrite); /* If Runge-Kutta need to copy actual update to that in control->Evolve. This transfer all the meta-data about the @@ -670,9 +669,7 @@ void Evolve(BODY *body, CONTROL *control, FILES *files, MODULE *module, /* Halt? */ if (fbCheckHalt(body, control, update, fnUpdate)) { fdGetUpdateInfo(body, control, system, update, fnUpdate); - WriteOutput(body, control, files, output, system, update, fnWrite, - control->Evolve.dTime, - control->Io.dOutputTime / control->Evolve.nSteps); + WriteOutput(body, control, files, output, system, update, fnWrite); return; } @@ -686,12 +683,11 @@ void Evolve(BODY *body, CONTROL *control, FILES *files, MODULE *module, /* Time for Output? */ if (control->Evolve.dTime >= control->Io.dNextOutput) { control->Evolve.nSteps += nSteps; - WriteOutput(body, control, files, output, system, update, fnWrite, - control->Evolve.dTime, - control->Io.dOutputTime / control->Evolve.nSteps); + WriteOutput(body, control, files, output, system, update, fnWrite); // Timesteps are synchronized with the output time, so this statement is // sufficient control->Io.dNextOutput += control->Io.dOutputTime; + //printf("%d\n",nSteps); nSteps = 0; } diff --git a/src/flare.c b/src/flare.c index 3489fd84b..50bccbbbf 100644 --- a/src/flare.c +++ b/src/flare.c @@ -23,7 +23,7 @@ void BodyCopyFlare(BODY *dest, BODY *src, int foo, int iNumBodies, int iBody) { dest[iBody].iFlareFFD = src[iBody].iFlareFFD; dest[iBody].iFlareBandPass = src[iBody].iFlareBandPass; // dest[iBody].iFlareSlopeUnits = src[iBody].iFlareSlopeUnits; - dest[iBody].dEnergyBin = src[iBody].dEnergyBin; + dest[iBody].iEnergyBin = src[iBody].iEnergyBin; // dest[iBody].dFlareSlope = src[iBody].dFlareSlope; // dest[iBody].dFlareYInt = src[iBody].dFlareYInt; } @@ -38,11 +38,11 @@ void ReadFlareEnergyBin(BODY *body, int iFile) { // This parameter cannot exist in primary file int lTmp = -1; - double dTmp; + int iTmp; - AddOptionDouble(files->Infile[iFile].cIn, + AddOptionInt(files->Infile[iFile].cIn, options->cName, - &dTmp, + &iTmp, &lTmp, control->Io.iVerbose); if (lTmp >= 0) { @@ -51,10 +51,10 @@ void ReadFlareEnergyBin(BODY *body, files->Infile[iFile].cIn, lTmp, control->Io.iVerbose); - body[iFile - 1].dEnergyBin = dTmp; + body[iFile - 1].iEnergyBin = iTmp; UpdateFoundOption(&files->Infile[iFile], options, lTmp, iFile); } else if (iFile > 0) - body[iFile - 1].dEnergyBin = options->dDefault; + body[iFile - 1].iEnergyBin = (int)options->dDefault; } void ReadFlareFFD(BODY *body, @@ -525,14 +525,15 @@ void InitializeOptionsFlare(OPTIONS *options, fnReadOption fnRead[]) { sprintf(options[OPT_LXUVFLARECONST].cDimension, "energy/time"); fnRead[OPT_LXUVFLARECONST] = &ReadLXUVFlareConst; + // XXX Change to iEnergyBin for next major release sprintf(options[OPT_FLAREENERGYBIN].cName, "dEnergyBin"); sprintf(options[OPT_FLAREENERGYBIN].cDescr, "Number of energies consider between the minimum and maximum " "energies to calculate the luminosity by flares"); sprintf(options[OPT_FLAREENERGYBIN].cDefault, "100 energies between dFlareMinEnergy and dFlareMaxEnergy"); - options[OPT_FLAREENERGYBIN].dDefault = 100.0; - options[OPT_FLAREENERGYBIN].iType = 2; + options[OPT_FLAREENERGYBIN].dDefault = 100; + options[OPT_FLAREENERGYBIN].iType = 1; options[OPT_FLAREENERGYBIN].bMultiFile = 1; options[OPT_FLAREENERGYBIN].dNeg = 1; sprintf(options[OPT_FLAREENERGYBIN].cNeg, "None"); @@ -921,15 +922,15 @@ void InitializeBodyFlare(BODY *body, CONTROL *control, UPDATE *update, int iBody, int iModule) { // double *daEnergyERGXUV, *daLXUVFlare, *daFFD, *daEnergyJOUXUV, *daLogEner; // double *daLogEnerXUV, *daEnergyERG, *daEnergyJOU, *daEnerJOU; - body[iBody].daEnergyERGXUV = malloc(body[iBody].dEnergyBin * sizeof(double)); - body[iBody].daLXUVFlare = malloc(body[iBody].dEnergyBin * sizeof(double)); - body[iBody].daFFD = malloc(body[iBody].dEnergyBin * sizeof(double)); - body[iBody].daEnergyJOUXUV = malloc(body[iBody].dEnergyBin * sizeof(double)); - body[iBody].daLogEner = malloc(body[iBody].dEnergyBin * sizeof(double)); - body[iBody].daLogEnerXUV = malloc(body[iBody].dEnergyBin * sizeof(double)); - body[iBody].daEnergyERG = malloc(body[iBody].dEnergyBin * sizeof(double)); - body[iBody].daEnergyJOU = malloc(body[iBody].dEnergyBin * sizeof(double)); - body[iBody].daEnerJOU = malloc(body[iBody].dEnergyBin * sizeof(double)); + body[iBody].daEnergyERGXUV = malloc((body[iBody].iEnergyBin+1) * sizeof(double)); + body[iBody].daLXUVFlare = malloc((body[iBody].iEnergyBin+1) * sizeof(double)); + body[iBody].daEnergyJOUXUV = malloc((body[iBody].iEnergyBin+1) * sizeof(double)); + body[iBody].daFFD = malloc((body[iBody].iEnergyBin+1) * sizeof(double)); + body[iBody].daLogEner = malloc((body[iBody].iEnergyBin+1) * sizeof(double)); + body[iBody].daLogEnerXUV = malloc((body[iBody].iEnergyBin+1) * sizeof(double)); + body[iBody].daEnergyERG = malloc((body[iBody].iEnergyBin+1) * sizeof(double)); + body[iBody].daEnergyJOU = malloc((body[iBody].iEnergyBin+1) * sizeof(double)); + body[iBody].daEnerJOU = malloc((body[iBody].iEnergyBin+1) * sizeof(double)); body[iBody].dLXUVFlare = fdLXUVFlare(body, control->Evolve.dTimeStep, iBody); } @@ -1678,12 +1679,11 @@ double fdLXUVFlare(BODY *body, double dDeltaTime, int iBody) { double dLXUVFlare = 0.0; double dLogEnergyMinERG, dLogEnergyMaxERG, dEnergyMin, dEnergyMax, dLogEnergyMin, dLogEnergyMax; - int iEnergyBin = 0; int i, iLogEnergyMinERG, iLogEnergyMaxERG, iLogEnergyMin, iLogEnergyMax; double dEnergyMinXUV, dEnergyMaxXUV, dLogEnergyMinXUV; int iLogEnergyMinERGXUV, iLogEnergyMaxERGXUV, iLogEnergyMinXUV, iLogEnergyMaxXUV; - double dEnergyStep, dEnergyStepXUV, dEnergyBin; + double dEnergyStep, dEnergyStepXUV; // ######################### 1. Choosing how to calculate FFD: slopes(age) or @@ -1715,10 +1715,6 @@ double fdLXUVFlare(BODY *body, double dDeltaTime, int iBody) { dLogEnergyMinXUV = fdBandPassXUV(body, iBody, body[iBody].dFlareMinEnergy); - // Defining the array size (dEnergybin) of energies - dEnergyBin = body[iBody].dEnergyBin; - iEnergyBin = (int)dEnergyBin; - // Declaring the XUV Energy arrays of size dEnergyBin // double daEnergyJOUXUV[iEnergyBin + 1], daLogEnerXUV[iEnergyBin + 1], // daEnergyERGXUV[iEnergyBin + 1]; @@ -1738,7 +1734,7 @@ double fdLXUVFlare(BODY *body, double dDeltaTime, int iBody) { // Defining the energy step used in line 1097, 1099, and 1101 to fill the // energy arrays - dEnergyStep = (dLogEnergyMaxERG - dLogEnergyMinERG) / iEnergyBin; + dEnergyStep = (dLogEnergyMaxERG - dLogEnergyMinERG) / body[iBody].iEnergyBin; // Declaring the Kepler Energy arrays of size iEnergyBin // double daEnergyERG[iEnergyBin + 1], daEnergyJOU[iEnergyBin + 1], @@ -1747,7 +1743,7 @@ double fdLXUVFlare(BODY *body, double dDeltaTime, int iBody) { // ############################ 4. Filling the energy arrays // ######################################################################## - for (i = 0; i < iEnergyBin + 1; i++) { + for (i = 0; i < body[iBody].iEnergyBin + 1; i++) { // XUV energy (energy_joules) body[iBody].daEnergyJOUXUV[i] = fdEnergyJoulesXUV(dLogEnergyMinXUV + i * dEnergyStep); @@ -1762,8 +1758,8 @@ double fdLXUVFlare(BODY *body, double dDeltaTime, int iBody) { body[iBody].dFlareEnergy3 = body[iBody].daEnerJOU[2]; body[iBody].dFlareEnergy4 = body[iBody].daEnerJOU[3]; body[iBody].dFlareEnergyMin = body[iBody].daEnerJOU[0]; - body[iBody].dFlareEnergyMid = body[iBody].daEnerJOU[iEnergyBin / 2]; - body[iBody].dFlareEnergyMax = body[iBody].daEnerJOU[iEnergyBin]; + body[iBody].dFlareEnergyMid = body[iBody].daEnerJOU[(int)(body[iBody].iEnergyBin / 2.)]; + body[iBody].dFlareEnergyMax = body[iBody].daEnerJOU[body[iBody].iEnergyBin]; // ############################ 5. Filling the FFD arrays // ######################################################################## @@ -1772,7 +1768,7 @@ double fdLXUVFlare(BODY *body, double dDeltaTime, int iBody) { // double daFFD[iEnergyBin + 1]; // When DAVENPORT or LACY are selected, we have to calculate the FFD first. - for (i = 0; i < iEnergyBin + 1; i++) { + for (i = 0; i < body[iBody].iEnergyBin + 1; i++) { body[iBody].daFFD[i] = fdFFD(body, iBody, body[iBody].daLogEner[i], dFlareSlope, dFlareYInt); } @@ -1782,15 +1778,15 @@ double fdLXUVFlare(BODY *body, double dDeltaTime, int iBody) { body[iBody].dFlareFreq3 = body[iBody].daFFD[2]; body[iBody].dFlareFreq4 = body[iBody].daFFD[3]; body[iBody].dFlareFreqMin = body[iBody].daFFD[0]; - body[iBody].dFlareFreqMid = body[iBody].daFFD[iEnergyBin / 2]; - body[iBody].dFlareFreqMax = body[iBody].daFFD[iEnergyBin]; + body[iBody].dFlareFreqMid = body[iBody].daFFD[(int)(body[iBody].iEnergyBin / 2)]; + body[iBody].dFlareFreqMax = body[iBody].daFFD[body[iBody].iEnergyBin]; // ############################ 6. Calculating the XUV luminosity by flares // ######################################################################## // double daLXUVFlare[iEnergyBin]; // Calculating the luminosity by flares for DAVENPORT or LACY mode // if the user select to calculate the luminosity using a FFD model - for (i = 0; i < iEnergyBin; i++) { + for (i = 0; i < body[iBody].iEnergyBin; i++) { body[iBody].daLXUVFlare[i] = (body[iBody].daEnergyJOUXUV[i + 1] - body[iBody].daEnergyJOUXUV[i]) * diff --git a/src/output.c b/src/output.c index 3b6bb76cd..97e1009e5 100644 --- a/src/output.c +++ b/src/output.c @@ -2213,8 +2213,7 @@ void WriteLog(BODY *body, CONTROL *control, FILES *files, MODULE *module, } void WriteOutput(BODY *body, CONTROL *control, FILES *files, OUTPUT *output, - SYSTEM *system, UPDATE *update, fnWriteOutput *fnWrite, - double dTime, double dDt) { + SYSTEM *system, UPDATE *update, fnWriteOutput *fnWrite) { int iBody, iCol, iOut, iSubOut, iExtra = 0, iGrid, iLat, jBody, j; double dCol[NUMOPT], *dTmp, dGrid[NUMOPT]; FILE *fp; diff --git a/src/output.h b/src/output.h index 428b325db..dede94e80 100644 --- a/src/output.h +++ b/src/output.h @@ -118,7 +118,7 @@ void WriteLogEntry(BODY *, CONTROL *, OUTPUT *, SYSTEM *, UPDATE *, void InitializeOutputFunctions(MODULE *, OUTPUT *, int); void WriteOutput(BODY *, CONTROL *, FILES *, OUTPUT *, SYSTEM *, UPDATE *, - fnWriteOutput *, double, double); + fnWriteOutput *); void WriteLog(BODY *, CONTROL *, FILES *, MODULE *, OPTIONS *, OUTPUT *, SYSTEM *, UPDATE *, fnUpdateVariable ***, fnWriteOutput *, int); void InitializeOutput(FILES*,OUTPUT *, fnWriteOutput *); diff --git a/src/vplanet.h b/src/vplanet.h index 06037e0a5..d02d69eb0 100644 --- a/src/vplanet.h +++ b/src/vplanet.h @@ -878,7 +878,7 @@ struct BODY { int iFlareBandPass; /**< Option to choose in which band pass the input energy are*/ int iFlareSlopeUnits; /**< Mode to choose in which units the FFD slopes are*/ - double dEnergyBin; /**< Number of energies consider between the minimum and + int iEnergyBin; /**< Number of energies consider between the minimum and maximum energies to calculate the luminosity by flares*/ double *daEnergyERG; double *daEnergyJOU; diff --git a/tests/AtmescFlareStellar/AtmEscFlareDavenport/test_AtmEscFlareDavenport.py b/tests/AtmescFlareStellar/AtmEscFlareDavenport/test_AtmEscFlareDavenport.py index f4a6ead79..7a19a3521 100644 --- a/tests/AtmescFlareStellar/AtmEscFlareDavenport/test_AtmEscFlareDavenport.py +++ b/tests/AtmescFlareStellar/AtmEscFlareDavenport/test_AtmEscFlareDavenport.py @@ -1,226 +1,201 @@ -import astropy.units as u -import pytest -from benchmark import Benchmark, benchmark - - -@benchmark( - { - "log.initial.system.Age": {"value": 3.1557600000e14, "unit": u.sec}, - "log.initial.system.Time": {"value": 0.0000000000, "unit": u.sec}, - "log.initial.system.TotAngMom": { - "value": 3.7230704732e41, - "unit": (u.kg * u.m**2) / u.sec, - }, - "log.initial.system.TotEnergy": {"value": -7.1876127212e39, "unit": u.Joule}, - "log.initial.system.PotEnergy": {"value": -7.2010481575e39, "unit": u.Joule}, - "log.initial.system.KinEnergy": {"value": 1.3444021724e37, "unit": u.Joule}, - "log.initial.system.DeltaTime": {"value": 0.0000000000, "unit": u.sec}, - "log.initial.star.Mass": {"value": 2.3860992000e29, "unit": u.kg}, - "log.initial.star.Radius": {"value": 3.1661898155e08, "unit": u.m}, - "log.initial.star.RadGyra": {"value": 0.4610332834}, - "log.initial.star.RotAngMom": { - "value": 3.6973713815e41, - "unit": (u.kg * u.m**2) / u.sec, - }, - "log.initial.star.RotVel": {"value": 2.3025182093e04, "unit": u.m / u.sec}, - "log.initial.star.BodyType": {"value": 0.0000000000}, - "log.initial.star.RotRate": {"value": 7.2722052166e-05, "unit": 1 / u.sec}, - "log.initial.star.RotPer": {"value": 8.6400000000e04, "unit": u.sec}, - "log.initial.star.Density": {"value": 1794.6883475331, "unit": u.kg / u.m**3}, - "log.initial.star.HZLimitDryRunaway": {"value": 1.7757648517e10, "unit": u.m}, - "log.initial.star.HZLimRecVenus": {"value": 1.5942915196e10, "unit": u.m}, - "log.initial.star.HZLimRunaway": {"value": 2.1005311219e10, "unit": u.m}, - "log.initial.star.HZLimMoistGreenhouse": { - "value": 2.1095107199e10, - "unit": u.m, - }, - "log.initial.star.HZLimMaxGreenhouse": {"value": 4.0266652294e10, "unit": u.m}, - "log.initial.star.HZLimEarlyMars": {"value": 4.3914925610e10, "unit": u.m}, - "log.initial.star.Instellation": { - "value": -1.0000000000, - "unit": u.kg / u.sec**3, - }, - "log.initial.star.CriticalSemiMajorAxis": {"value": -1.0000000000, "unit": u.m}, - "log.initial.star.LXUVTot": { - "value": 7.4586842042e21, - "unit": u.kg / u.sec**3, - }, - "log.initial.star.LostEnergy": {"value": 5.5626846463e-309, "unit": u.Joule}, - "log.initial.star.LostAngMom": { - "value": 5.5626846463e-309, - "unit": (u.kg * u.m**2) / u.sec, - }, - "log.initial.star.Luminosity": {"value": 6.5779241790e24, "unit": u.W}, - "log.initial.star.LXUVStellar": {"value": 1.7103286997e-05, "unit": u.LSUN}, - "log.initial.star.Temperature": {"value": 3095.3300004448, "unit": u.K}, - "log.initial.star.LXUVFrac": {"value": 0.0010000000}, - "log.initial.star.RossbyNumber": {"value": 0.0155317554}, - "log.initial.star.DRotPerDtStellar": {"value": -1.1359491987e-10}, - "log.initial.star.LXUVFlare": {"value": 2.2900676680e-06, "unit": u.LSUN}, - "log.initial.star.FlareFreq1": {"value": 7.6539612209e-07, "unit": 1 / u.sec}, - "log.initial.star.FlareFreq2": {"value": 7.1257446845e-07, "unit": 1 / u.sec}, - "log.initial.star.FlareFreq3": {"value": 6.6339815220e-07, "unit": 1 / u.sec}, - "log.initial.star.FlareFreq4": {"value": 6.1761560065e-07, "unit": 1 / u.sec}, - "log.initial.star.FlareFreqMin": {"value": 7.6539612209e-07, "unit": 1 / u.sec}, - "log.initial.star.FlareFreqMid": {"value": 2.1433162542e-08, "unit": 1 / u.sec}, - "log.initial.star.FlareFreqMax": {"value": 6.0018654825e-10, "unit": 1 / u.sec}, - "log.initial.star.FlareEnergy1": {"value": 1.0000000000e26, "unit": u.Joule}, - "log.initial.star.FlareEnergy2": {"value": 1.0715193052e26, "unit": u.Joule}, - "log.initial.star.FlareEnergy3": {"value": 1.1481536215e26, "unit": u.Joule}, - "log.initial.star.FlareEnergy4": {"value": 1.2302687708e26, "unit": u.Joule}, - "log.initial.star.FlareEnergyMin": {"value": 1.0000000000e26, "unit": u.Joule}, - "log.initial.star.FlareEnergyMid": {"value": 3.1622776602e27, "unit": u.Joule}, - "log.initial.star.FlareEnergyMax": {"value": 1.0000000000e29, "unit": u.Joule}, - "log.initial.b.Mass": {"value": 7.5846762200e24, "unit": u.kg}, - "log.initial.b.Radius": {"value": 8.8005344212e06, "unit": u.m}, - "log.initial.b.RadGyra": {"value": 0.5000000000}, - "log.initial.b.BodyType": {"value": 0.0000000000}, - "log.initial.b.Density": {"value": 2656.5702144167, "unit": u.kg / u.m**3}, - "log.initial.b.HZLimitDryRunaway": {"value": 1.7814747212e10, "unit": u.m}, - "log.initial.b.HZLimRecVenus": {"value": 1.5942915196e10, "unit": u.m}, - "log.initial.b.HZLimRunaway": {"value": 2.1005311219e10, "unit": u.m}, - "log.initial.b.HZLimMoistGreenhouse": {"value": 2.1095107199e10, "unit": u.m}, - "log.initial.b.HZLimMaxGreenhouse": {"value": 4.0266652294e10, "unit": u.m}, - "log.initial.b.HZLimEarlyMars": {"value": 4.3914925610e10, "unit": u.m}, - "log.initial.b.Instellation": { - "value": 9975.5972427825, - "unit": u.kg / u.sec**3, - }, - "log.initial.b.MeanMotion": {"value": 6.4573248494e-06, "unit": 1 / u.sec}, - "log.initial.b.OrbPeriod": {"value": 9.7303224691e05, "unit": u.sec}, - "log.initial.b.SemiMajorAxis": {"value": 7.2554967289e09, "unit": u.m}, - "log.initial.b.LXUVTot": {"value": -1.0000000000, "unit": u.kg / u.sec**3}, - "log.initial.b.SurfWaterMass": {"value": 1.5000000000, "unit": u.TO}, - "log.initial.b.EnvelopeMass": {"value": 0.0010000000, "unit": u.Mearth}, - "log.initial.b.OxygenMass": {"value": 0.0000000000, "unit": u.bar}, - "log.initial.b.RGLimit": {"value": 2.0225735532e10, "unit": u.m}, - "log.initial.b.XO": {"value": 0.3333333333}, - "log.initial.b.EtaO": {"value": 0.0000000000}, - "log.initial.b.PlanetRadius": {"value": 1.3798050236, "unit": u.Rearth}, - "log.initial.b.OxygenMantleMass": {"value": 0.0000000000, "unit": u.kg}, - "log.initial.b.RadXUV": {"value": -1.0000000000, "unit": u.m}, - "log.initial.b.RadSolid": {"value": -1.0000000000, "unit": u.m}, - "log.initial.b.PresXUV": {"value": 5.0000000000}, - "log.initial.b.ScaleHeight": {"value": -1.0000000000, "unit": u.m}, - "log.initial.b.ThermTemp": {"value": 400.0000000000, "unit": u.K}, - "log.initial.b.AtmGasConst": {"value": 4124.0000000000}, - "log.initial.b.PresSurf": {"value": -1.0000000000, "unit": u.Pa}, - "log.initial.b.DEnvMassDt": {"value": -7.8244286870e06, "unit": u.kg / u.sec}, - "log.initial.b.FXUV": {"value": 11.3112932829, "unit": u.W / u.m**2}, - "log.initial.b.AtmXAbsEffH2O": {"value": 0.3000000000}, - "log.initial.b.RocheRadius": {"value": 1.5935887288e08, "unit": u.m}, - "log.initial.b.BondiRadius": {"value": 1.9083081091e08, "unit": u.m}, - "log.initial.b.HEscapeRegime": {"value": 3.0000000000}, - "log.initial.b.RRCriticalFlux": { - "value": 27.7437416693, - "unit": u.W / u.m**2, - }, - "log.initial.b.KTide": {"value": 0.9172472694}, - "log.initial.b.RGDuration": {"value": 0.00000e00, "unit": u.yr}, - "log.final.system.Age": {"value": 3.4713360000e15, "unit": u.sec}, - "log.final.system.Time": {"value": 3.1557600000e15, "unit": u.sec}, - "log.final.system.TotAngMom": { - "value": 3.7341162641e41, - "unit": (u.kg * u.m**2) / u.sec, - }, - "log.final.system.TotEnergy": {"value": -7.1773342023e39, "unit": u.Joule}, - "log.final.system.PotEnergy": {"value": -1.6690303200e40, "unit": u.Joule}, - "log.final.system.KinEnergy": {"value": 1.4205256840e37, "unit": u.Joule}, - "log.final.system.DeltaTime": {"value": 3.1862524358e09, "unit": u.sec}, - "log.final.star.Mass": {"value": 2.3860992000e29, "unit": u.kg}, - "log.final.star.Radius": {"value": 1.3660557908e08, "unit": u.m}, - "log.final.star.RadGyra": {"value": 0.4634687359}, - "log.final.star.RotAngMom": { - "value": 1.6484382022e41, - "unit": (u.kg * u.m**2) / u.sec, - }, - "log.final.star.RotVel": {"value": 2.3543707420e04, "unit": u.m / u.sec}, - "log.final.star.BodyType": {"value": 0.0000000000}, - "log.final.star.RotRate": {"value": 0.0001723481, "unit": 1 / u.sec}, - "log.final.star.RotPer": {"value": 3.6456372483e04, "unit": u.sec}, - "log.final.star.Density": {"value": 2.2345731490e04, "unit": u.kg / u.m**3}, - "log.final.star.HZLimitDryRunaway": {"value": 7.5300174373e09, "unit": u.m}, - "log.final.star.HZLimRecVenus": {"value": 6.7635711614e09, "unit": u.m}, - "log.final.star.HZLimRunaway": {"value": 8.9093399396e09, "unit": u.m}, - "log.final.star.HZLimMoistGreenhouse": {"value": 8.9493215229e09, "unit": u.m}, - "log.final.star.HZLimMaxGreenhouse": {"value": 1.7098864655e10, "unit": u.m}, - "log.final.star.HZLimEarlyMars": {"value": 1.8648060368e10, "unit": u.m}, - "log.final.star.Instellation": { - "value": -1.0000000000, - "unit": u.kg / u.sec**3, - }, - "log.final.star.CriticalSemiMajorAxis": {"value": -1.0000000000, "unit": u.m}, - "log.final.star.LXUVTot": {"value": 1.3924485711e21, "unit": u.kg / u.sec**3}, - "log.final.star.LostEnergy": {"value": 9.4987723965e39, "unit": u.Joule}, - "log.final.star.LostAngMom": { - "value": 2.0599992484e41, - "unit": (u.kg * u.m**2) / u.sec, - }, - "log.final.star.Luminosity": {"value": 1.1827961871e24, "unit": u.W}, - "log.final.star.LXUVStellar": {"value": 2.7351908390e-06, "unit": u.LSUN}, - "log.final.star.Temperature": {"value": 3070.1003556256, "unit": u.K}, - "log.final.star.LXUVFrac": {"value": 0.0008893793}, - "log.final.star.RossbyNumber": {"value": 0.0064694656}, - "log.final.star.DRotPerDtStellar": {"value": -2.9636378511e-12}, - "log.final.star.LXUVFlare": {"value": 8.8531477149e-07, "unit": u.LSUN}, - "log.final.star.FlareFreq1": {"value": 3.7279360348e-07, "unit": 1 / u.sec}, - "log.final.star.FlareFreq2": {"value": 3.4532301760e-07, "unit": 1 / u.sec}, - "log.final.star.FlareFreq3": {"value": 3.1987669684e-07, "unit": 1 / u.sec}, - "log.final.star.FlareFreq4": {"value": 2.9630547623e-07, "unit": 1 / u.sec}, - "log.final.star.FlareFreqMin": {"value": 3.7279360348e-07, "unit": 1 / u.sec}, - "log.final.star.FlareFreqMid": {"value": 8.1156296479e-09, "unit": 1 / u.sec}, - "log.final.star.FlareFreqMax": {"value": 1.7667536129e-10, "unit": 1 / u.sec}, - "log.final.star.FlareEnergy1": {"value": 1.0000000000e26, "unit": u.Joule}, - "log.final.star.FlareEnergy2": {"value": 1.0715193052e26, "unit": u.Joule}, - "log.final.star.FlareEnergy3": {"value": 1.1481536215e26, "unit": u.Joule}, - "log.final.star.FlareEnergy4": {"value": 1.2302687708e26, "unit": u.Joule}, - "log.final.star.FlareEnergyMin": {"value": 1.0000000000e26, "unit": u.Joule}, - "log.final.star.FlareEnergyMid": {"value": 3.1622776602e27, "unit": u.Joule}, - "log.final.star.FlareEnergyMax": {"value": 1.0000000000e29, "unit": u.Joule}, - "log.final.b.Mass": {"value": 7.5787040340e24, "unit": u.kg}, - "log.final.b.Radius": {"value": 6.8050745192e06, "unit": u.m}, - "log.final.b.RadGyra": {"value": 0.5000000000}, - "log.final.b.BodyType": {"value": 0.0000000000}, - "log.final.b.Density": {"value": 5741.2661742908, "unit": u.kg / u.m**3}, - "log.final.b.HZLimitDryRunaway": {"value": 7.5542297745e09, "unit": u.m}, - "log.final.b.HZLimRecVenus": {"value": 6.7635711614e09, "unit": u.m}, - "log.final.b.HZLimRunaway": {"value": 8.9093399396e09, "unit": u.m}, - "log.final.b.HZLimMoistGreenhouse": {"value": 8.9493215229e09, "unit": u.m}, - "log.final.b.HZLimMaxGreenhouse": {"value": 1.7098864655e10, "unit": u.m}, - "log.final.b.HZLimEarlyMars": {"value": 1.8648060368e10, "unit": u.m}, - "log.final.b.Instellation": { - "value": 1793.7419255380, - "unit": u.kg / u.sec**3, - }, - "log.final.b.MeanMotion": {"value": 6.4573247685e-06, "unit": 1 / u.sec}, - "log.final.b.OrbPeriod": {"value": 9.7303225908e05, "unit": u.sec}, - "log.final.b.SemiMajorAxis": {"value": 7.2554967289e09, "unit": u.m}, - "log.final.b.LXUVTot": {"value": -1.0000000000, "unit": u.kg / u.sec**3}, - "log.final.b.SurfWaterMass": {"value": 1.0402555565, "unit": u.TO}, - "log.final.b.EnvelopeMass": {"value": 0.0000000000, "unit": u.Mearth}, - "log.final.b.OxygenMass": {"value": 43.5900025681, "unit": u.bar}, - "log.final.b.RGLimit": {"value": 8.5788975828e09, "unit": u.m}, - "log.final.b.XO": {"value": 0.3712050013}, - "log.final.b.EtaO": {"value": 0.5563589055}, - "log.final.b.PlanetRadius": {"value": 1.0669438421, "unit": u.Rearth}, - "log.final.b.OxygenMantleMass": {"value": 0.0000000000, "unit": u.kg}, - "log.final.b.RadXUV": {"value": -1.0000000000, "unit": u.m}, - "log.final.b.RadSolid": {"value": -1.0000000000, "unit": u.m}, - "log.final.b.PresXUV": {"value": 5.0000000000}, - "log.final.b.ScaleHeight": {"value": -1.0000000000, "unit": u.m}, - "log.final.b.ThermTemp": {"value": 400.0000000000, "unit": u.K}, - "log.final.b.AtmGasConst": {"value": 4124.0000000000}, - "log.final.b.PresSurf": {"value": -1.0000000000, "unit": u.Pa}, - "log.final.b.DEnvMassDt": {"value": 5.5626846463e-309, "unit": u.kg / u.sec}, - "log.final.b.FXUV": {"value": 2.1116853506, "unit": u.W / u.m**2}, - "log.final.b.AtmXAbsEffH2O": {"value": 0.3000000000}, - "log.final.b.RocheRadius": {"value": 1.5931703542e08, "unit": u.m}, - "log.final.b.BondiRadius": {"value": 2.9268134182e08, "unit": u.m}, - "log.final.b.HEscapeRegime": {"value": 8.0000000000}, - "log.final.b.RRCriticalFlux": {"value": 62.3818675680, "unit": u.W / u.m**2}, - "log.final.b.KTide": {"value": 0.9359679029}, - "log.final.b.RGDuration": {"value": 0.00000e00, "unit": u.yr}, - } +from benchmark import Benchmark, benchmark +import astropy.units as u +import pytest + +@benchmark( + { + "log.initial.system.Age": {"value": 3.1557600000e+14, "unit": u.sec}, + "log.initial.system.Time": {"value": 0.0000000000, "unit": u.sec}, + "log.initial.system.TotAngMom": {"value": 3.7230704732e+41, "unit": (u.kg * u.m ** 2) / u.sec}, + "log.initial.system.TotEnergy": {"value": -7.1876127212e+39, "unit": u.Joule}, + "log.initial.system.PotEnergy": {"value": -7.2010481575e+39, "unit": u.Joule}, + "log.initial.system.KinEnergy": {"value": 1.3444021724e+37, "unit": u.Joule}, + "log.initial.system.DeltaTime": {"value": 0.0000000000, "unit": u.sec}, + "log.initial.star.Mass": {"value": 2.3860992000e+29, "unit": u.kg}, + "log.initial.star.Radius": {"value": 3.1661898155e+08, "unit": u.m}, + "log.initial.star.RadGyra": {"value": 0.4610332834}, + "log.initial.star.RotAngMom": {"value": 3.6973713815e+41, "unit": (u.kg * u.m ** 2) / u.sec}, + "log.initial.star.RotVel": {"value": 2.3025182093e+04, "unit": u.m / u.sec}, + "log.initial.star.BodyType": {"value": 0.0000000000}, + "log.initial.star.RotRate": {"value": 7.2722052166e-05, "unit": 1 / u.sec}, + "log.initial.star.RotPer": {"value": 8.6400000000e+04, "unit": u.sec}, + "log.initial.star.Density": {"value": 1794.6883475331, "unit": u.kg / u.m ** 3}, + "log.initial.star.HZLimitDryRunaway": {"value": 1.7757648517e+10, "unit": u.m}, + "log.initial.star.HZLimRecVenus": {"value": 1.5942915196e+10, "unit": u.m}, + "log.initial.star.HZLimRunaway": {"value": 2.1005311219e+10, "unit": u.m}, + "log.initial.star.HZLimMoistGreenhouse": {"value": 2.1095107199e+10, "unit": u.m}, + "log.initial.star.HZLimMaxGreenhouse": {"value": 4.0266652294e+10, "unit": u.m}, + "log.initial.star.HZLimEarlyMars": {"value": 4.3914925610e+10, "unit": u.m}, + "log.initial.star.Instellation": {"value": -1.0000000000, "unit": u.kg / u.sec ** 3}, + "log.initial.star.CriticalSemiMajorAxis": {"value": -1.0000000000, "unit": u.m}, + "log.initial.star.LXUVTot": {"value": 7.4586842042e+21, "unit": u.kg / u.sec ** 3}, + "log.initial.star.LostEnergy": {"value": 5.5626846463e-309, "unit": u.Joule}, + "log.initial.star.LostAngMom": {"value": 5.5626846463e-309, "unit": (u.kg * u.m ** 2) / u.sec}, + "log.initial.star.Luminosity": {"value": 6.5779241790e+24, "unit": u.W}, + "log.initial.star.LXUVStellar": {"value": 1.7103286997e-05, "unit": u.LSUN}, + "log.initial.star.Temperature": {"value": 3095.3300004448, "unit": u.K}, + "log.initial.star.LXUVFrac": {"value": 0.0010000000}, + "log.initial.star.RossbyNumber": {"value": 0.0155317554}, + "log.initial.star.DRotPerDtStellar": {"value": -1.1359491987e-10}, + "log.initial.star.LXUVFlare": {"value": 2.2900676680e-06, "unit": u.LSUN}, + "log.initial.star.FlareFreq1": {"value": 7.6539612209e-07, "unit": 1 / u.sec}, + "log.initial.star.FlareFreq2": {"value": 7.1257446845e-07, "unit": 1 / u.sec}, + "log.initial.star.FlareFreq3": {"value": 6.6339815220e-07, "unit": 1 / u.sec}, + "log.initial.star.FlareFreq4": {"value": 6.1761560065e-07, "unit": 1 / u.sec}, + "log.initial.star.FlareFreqMin": {"value": 7.6539612209e-07, "unit": 1 / u.sec}, + "log.initial.star.FlareFreqMid": {"value": 2.1433162542e-08, "unit": 1 / u.sec}, + "log.initial.star.FlareFreqMax": {"value": 6.0018654825e-10, "unit": 1 / u.sec}, + "log.initial.star.FlareEnergy1": {"value": 1.0000000000e+26, "unit": u.Joule}, + "log.initial.star.FlareEnergy2": {"value": 1.0715193052e+26, "unit": u.Joule}, + "log.initial.star.FlareEnergy3": {"value": 1.1481536215e+26, "unit": u.Joule}, + "log.initial.star.FlareEnergy4": {"value": 1.2302687708e+26, "unit": u.Joule}, + "log.initial.star.FlareEnergyMin": {"value": 1.0000000000e+26, "unit": u.Joule}, + "log.initial.star.FlareEnergyMid": {"value": 3.1622776602e+27, "unit": u.Joule}, + "log.initial.star.FlareEnergyMax": {"value": 1.0000000000e+29, "unit": u.Joule}, + "log.initial.b.Mass": {"value": 7.5846762200e+24, "unit": u.kg}, + "log.initial.b.Radius": {"value": 8.8005344212e+06, "unit": u.m}, + "log.initial.b.RadGyra": {"value": 0.5000000000}, + "log.initial.b.BodyType": {"value": 0.0000000000}, + "log.initial.b.Density": {"value": 2656.5702144167, "unit": u.kg / u.m ** 3}, + "log.initial.b.HZLimitDryRunaway": {"value": 1.7814747212e+10, "unit": u.m}, + "log.initial.b.HZLimRecVenus": {"value": 1.5942915196e+10, "unit": u.m}, + "log.initial.b.HZLimRunaway": {"value": 2.1005311219e+10, "unit": u.m}, + "log.initial.b.HZLimMoistGreenhouse": {"value": 2.1095107199e+10, "unit": u.m}, + "log.initial.b.HZLimMaxGreenhouse": {"value": 4.0266652294e+10, "unit": u.m}, + "log.initial.b.HZLimEarlyMars": {"value": 4.3914925610e+10, "unit": u.m}, + "log.initial.b.Instellation": {"value": 9975.5972427825, "unit": u.kg / u.sec ** 3}, + "log.initial.b.MeanMotion": {"value": 6.4573248494e-06, "unit": 1 / u.sec}, + "log.initial.b.OrbPeriod": {"value": 9.7303224691e+05, "unit": u.sec}, + "log.initial.b.SemiMajorAxis": {"value": 7.2554967289e+09, "unit": u.m}, + "log.initial.b.LXUVTot": {"value": -1.0000000000, "unit": u.kg / u.sec ** 3}, + "log.initial.b.SurfWaterMass": {"value": 1.5000000000, "unit": u.TO}, + "log.initial.b.EnvelopeMass": {"value": 0.0010000000, "unit": u.Mearth}, + "log.initial.b.OxygenMass": {"value": 0.0000000000, "unit": u.bar}, + "log.initial.b.RGLimit": {"value": 2.0225735532e+10, "unit": u.m}, + "log.initial.b.XO": {"value": 0.3333333333}, + "log.initial.b.EtaO": {"value": 0.0000000000}, + "log.initial.b.PlanetRadius": {"value": 1.3798050236, "unit": u.Rearth}, + "log.initial.b.OxygenMantleMass": {"value": 0.0000000000, "unit": u.kg}, + "log.initial.b.RadXUV": {"value": -1.0000000000, "unit": u.m}, + "log.initial.b.RadSolid": {"value": -1.0000000000, "unit": u.m}, + "log.initial.b.PresXUV": {"value": 5.0000000000}, + "log.initial.b.ScaleHeight": {"value": -1.0000000000, "unit": u.m}, + "log.initial.b.ThermTemp": {"value": 400.0000000000, "unit": u.K}, + "log.initial.b.AtmGasConst": {"value": 4124.0000000000}, + "log.initial.b.PresSurf": {"value": -1.0000000000, "unit": u.Pa}, + "log.initial.b.DEnvMassDt": {"value": -7.8244286870e+06, "unit": u.kg / u.sec}, + "log.initial.b.FXUV": {"value": 11.3112932829, "unit": u.W / u.m ** 2}, + "log.initial.b.AtmXAbsEffH2O": {"value": 0.3000000000}, + "log.initial.b.RocheRadius": {"value": 1.5935887288e+08, "unit": u.m}, + "log.initial.b.BondiRadius": {"value": 1.9083081091e+08, "unit": u.m}, + "log.initial.b.HEscapeRegime": {"value": 3.0000000000}, + "log.initial.b.RRCriticalFlux": {"value": 27.7437416693, "unit": u.W / u.m ** 2}, + "log.initial.b.CrossoverMass": {"value": 0.0000000000, "unit": u.kg}, + "log.initial.b.WaterEscapeRegime": {"value": 8.0000000000}, + "log.initial.b.FXUVCRITDRAG": {"value": 0.1090267838, "unit": u.W / u.m ** 2}, + "log.initial.b.HREFFLUX": {"value": 9.6829037992e+18, "unit": 1 / u.m ** 2 / u.sec}, + "log.initial.b.XO2": {"value": 0.0000000000}, + "log.initial.b.XH2O": {"value": 1.0000000000}, + "log.initial.b.HDiffFlux": {"value": 8.4375341524e+16, "unit": 1 / u.m ** 2 / u.sec}, + "log.initial.b.HRefODragMod": {"value": 0.0077519380}, + "log.initial.b.KTide": {"value": 0.9172472694}, + "log.initial.b.RGDuration": {"value": 0.00000e+00, "unit": u.yr}, + "log.final.system.Age": {"value": 3.4713360000e+15, "unit": u.sec, "rtol": 1e-4}, + "log.final.system.Time": {"value": 3.1557600000e+15, "unit": u.sec, "rtol": 1e-4}, + "log.final.system.TotAngMom": {"value": 3.7341579011e+41, "unit": (u.kg * u.m ** 2) / u.sec, "rtol": 1e-4}, + "log.final.system.TotEnergy": {"value": -7.1773447078e+39, "unit": u.Joule, "rtol": 1e-4}, + "log.final.system.PotEnergy": {"value": -1.6690355074e+40, "unit": u.Joule, "rtol": 1e-4}, + "log.final.system.KinEnergy": {"value": 1.4205267538e+37, "unit": u.Joule, "rtol": 1e-4}, + "log.final.star.Mass": {"value": 2.3860992000e+29, "unit": u.kg, "rtol": 1e-4}, + "log.final.star.Radius": {"value": 1.3660515451e+08, "unit": u.m, "rtol": 1e-4}, + "log.final.star.RadGyra": {"value": 0.4634687441, "rtol": 1e-4}, + "log.final.star.RotAngMom": {"value": 1.6484337287e+41, "unit": (u.kg * u.m ** 2) / u.sec, "rtol": 1e-4}, + "log.final.star.RotVel": {"value": 2.3543715870e+04, "unit": u.m / u.sec, "rtol": 1e-4}, + "log.final.star.BodyType": {"value": 0.0000000000, "rtol": 1e-4}, + "log.final.star.RotRate": {"value": 0.0001723487, "unit": 1 / u.sec, "rtol": 1e-4}, + "log.final.star.RotPer": {"value": 3.6456246094e+04, "unit": u.sec, "rtol": 1e-4}, + "log.final.star.Density": {"value": 2.2345939842e+04, "unit": u.kg / u.m ** 3, "rtol": 1e-4}, + "log.final.star.HZLimitDryRunaway": {"value": 7.5299891659e+09, "unit": u.m, "rtol": 1e-4}, + "log.final.star.HZLimRecVenus": {"value": 6.7635458270e+09, "unit": u.m, "rtol": 1e-4}, + "log.final.star.HZLimRunaway": {"value": 8.9093065315e+09, "unit": u.m, "rtol": 1e-4}, + "log.final.star.HZLimMoistGreenhouse": {"value": 8.9492880013e+09, "unit": u.m, "rtol": 1e-4}, + "log.final.star.HZLimMaxGreenhouse": {"value": 1.7098800924e+10, "unit": u.m, "rtol": 1e-4}, + "log.final.star.HZLimEarlyMars": {"value": 1.8647990862e+10, "unit": u.m, "rtol": 1e-4}, + "log.final.star.Instellation": {"value": -1.0000000000, "unit": u.kg / u.sec ** 3, "rtol": 1e-4}, + "log.final.star.CriticalSemiMajorAxis": {"value": -1.0000000000, "unit": u.m, "rtol": 1e-4}, + "log.final.star.LXUVTot": {"value": 1.3924392185e+21, "unit": u.kg / u.sec ** 3, "rtol": 1e-4}, + "log.final.star.LostEnergy": {"value": 9.4988137536e+39, "unit": u.Joule, "rtol": 1e-4}, + "log.final.star.LostAngMom": {"value": 2.0600453589e+41, "unit": (u.kg * u.m ** 2) / u.sec, "rtol": 1e-4}, + "log.final.star.Luminosity": {"value": 1.1827873055e+24, "unit": u.W, "rtol": 1e-4}, + "log.final.star.LXUVStellar": {"value": 2.7351703006e-06, "unit": u.LSUN, "rtol": 1e-4}, + "log.final.star.Temperature": {"value": 3070.0998661274, "unit": u.K, "rtol": 1e-4}, + "log.final.star.LXUVFrac": {"value": 0.0008893793, "rtol": 1e-4}, + "log.final.star.RossbyNumber": {"value": 0.0064694415, "rtol": 1e-4}, + "log.final.star.DRotPerDtStellar": {"value": -2.9636773892e-12, "rtol": 1e-4}, + "log.final.star.LXUVFlare": {"value": 8.8531477149e-07, "unit": u.LSUN, "rtol": 1e-4}, + "log.final.star.FlareFreq1": {"value": 3.7279360348e-07, "unit": 1 / u.sec, "rtol": 1e-4}, + "log.final.star.FlareFreq2": {"value": 3.4532301760e-07, "unit": 1 / u.sec, "rtol": 1e-4}, + "log.final.star.FlareFreq3": {"value": 3.1987669684e-07, "unit": 1 / u.sec, "rtol": 1e-4}, + "log.final.star.FlareFreq4": {"value": 2.9630547623e-07, "unit": 1 / u.sec, "rtol": 1e-4}, + "log.final.star.FlareFreqMin": {"value": 3.7279360348e-07, "unit": 1 / u.sec, "rtol": 1e-4}, + "log.final.star.FlareFreqMid": {"value": 8.1156296479e-09, "unit": 1 / u.sec, "rtol": 1e-4}, + "log.final.star.FlareFreqMax": {"value": 1.7667536129e-10, "unit": 1 / u.sec, "rtol": 1e-4}, + "log.final.star.FlareEnergy1": {"value": 1.0000000000e+26, "unit": u.Joule, "rtol": 1e-4}, + "log.final.star.FlareEnergy2": {"value": 1.0715193052e+26, "unit": u.Joule, "rtol": 1e-4}, + "log.final.star.FlareEnergy3": {"value": 1.1481536215e+26, "unit": u.Joule, "rtol": 1e-4}, + "log.final.star.FlareEnergy4": {"value": 1.2302687708e+26, "unit": u.Joule, "rtol": 1e-4}, + "log.final.star.FlareEnergyMin": {"value": 1.0000000000e+26, "unit": u.Joule, "rtol": 1e-4}, + "log.final.star.FlareEnergyMid": {"value": 3.1622776602e+27, "unit": u.Joule, "rtol": 1e-4}, + "log.final.star.FlareEnergyMax": {"value": 1.0000000000e+29, "unit": u.Joule, "rtol": 1e-4}, + "log.final.b.Mass": {"value": 7.5787040340e+24, "unit": u.kg, "rtol": 1e-4}, + "log.final.b.Radius": {"value": 6.8050745192e+06, "unit": u.m, "rtol": 1e-4}, + "log.final.b.RadGyra": {"value": 0.5000000000, "rtol": 1e-4}, + "log.final.b.BodyType": {"value": 0.0000000000, "rtol": 1e-4}, + "log.final.b.Density": {"value": 5741.2661742908, "unit": u.kg / u.m ** 3, "rtol": 1e-4}, + "log.final.b.HZLimitDryRunaway": {"value": 7.5542014122e+09, "unit": u.m, "rtol": 1e-4}, + "log.final.b.HZLimRecVenus": {"value": 6.7635458270e+09, "unit": u.m, "rtol": 1e-4}, + "log.final.b.HZLimRunaway": {"value": 8.9093065315e+09, "unit": u.m, "rtol": 1e-4}, + "log.final.b.HZLimMoistGreenhouse": {"value": 8.9492880013e+09, "unit": u.m, "rtol": 1e-4}, + "log.final.b.HZLimMaxGreenhouse": {"value": 1.7098800924e+10, "unit": u.m, "rtol": 1e-4}, + "log.final.b.HZLimEarlyMars": {"value": 1.8647990862e+10, "unit": u.m, "rtol": 1e-4}, + "log.final.b.Instellation": {"value": 1793.7284563913, "unit": u.kg / u.sec ** 3, "rtol": 1e-4}, + "log.final.b.MeanMotion": {"value": 6.4573247685e-06, "unit": 1 / u.sec, "rtol": 1e-4}, + "log.final.b.OrbPeriod": {"value": 9.7303225908e+05, "unit": u.sec, "rtol": 1e-4}, + "log.final.b.SemiMajorAxis": {"value": 7.2554967289e+09, "unit": u.m, "rtol": 1e-4}, + "log.final.b.LXUVTot": {"value": -1.0000000000, "unit": u.kg / u.sec ** 3, "rtol": 1e-4}, + "log.final.b.SurfWaterMass": {"value": 1.0402108220, "unit": u.TO, "rtol": 1e-4}, + "log.final.b.EnvelopeMass": {"value": 0.0000000000, "unit": u.Mearth, "rtol": 1e-4}, + "log.final.b.OxygenMass": {"value": 43.5932915978, "unit": u.bar, "rtol": 1e-4}, + "log.final.b.RGLimit": {"value": 8.5788654152e+09, "unit": u.m, "rtol": 1e-4}, + "log.final.b.XO": {"value": 0.3712092327, "rtol": 1e-4}, + "log.final.b.EtaO": {"value": 0.5563641730, "rtol": 1e-4}, + "log.final.b.PlanetRadius": {"value": 1.0669438421, "unit": u.Rearth, "rtol": 1e-4}, + "log.final.b.OxygenMantleMass": {"value": 0.0000000000, "unit": u.kg, "rtol": 1e-4}, + "log.final.b.RadXUV": {"value": -1.0000000000, "unit": u.m, "rtol": 1e-4}, + "log.final.b.RadSolid": {"value": -1.0000000000, "unit": u.m, "rtol": 1e-4}, + "log.final.b.PresXUV": {"value": 5.0000000000, "rtol": 1e-4}, + "log.final.b.ScaleHeight": {"value": -1.0000000000, "unit": u.m, "rtol": 1e-4}, + "log.final.b.ThermTemp": {"value": 400.0000000000, "unit": u.K, "rtol": 1e-4}, + "log.final.b.AtmGasConst": {"value": 4124.0000000000, "rtol": 1e-4}, + "log.final.b.PresSurf": {"value": -1.0000000000, "unit": u.Pa, "rtol": 1e-4}, + "log.final.b.DEnvMassDt": {"value": 5.5626846463e-309, "unit": u.kg / u.sec, "rtol": 1e-4}, + "log.final.b.FXUV": {"value": 2.1116711671, "unit": u.W / u.m ** 2, "rtol": 1e-4}, + "log.final.b.AtmXAbsEffH2O": {"value": 0.3000000000, "rtol": 1e-4}, + "log.final.b.RocheRadius": {"value": 1.5931703542e+08, "unit": u.m, "rtol": 1e-4}, + "log.final.b.BondiRadius": {"value": 2.9268184331e+08, "unit": u.m, "rtol": 1e-4}, + "log.final.b.HEscapeRegime": {"value": 8.0000000000, "rtol": 1e-4}, + "log.final.b.RRCriticalFlux": {"value": 62.3818675680, "unit": u.W / u.m ** 2, "rtol": 1e-4}, + "log.final.b.CrossoverMass": {"value": 4.8764660612e-26, "unit": u.kg, "rtol": 1e-4}, + "log.final.b.WaterEscapeRegime": {"value": 3.0000000000, "rtol": 1e-4}, + "log.final.b.FXUVCRITDRAG": {"value": 0.2220623340, "unit": u.W / u.m ** 2, "rtol": 1e-4}, + "log.final.b.HREFFLUX": {"value": 1.3709166600e+18, "unit": 1 / u.m ** 2 / u.sec, "rtol": 1e-4}, + "log.final.b.XO2": {"value": 0.0828667832, "rtol": 1e-4}, + "log.final.b.XH2O": {"value": 0.9171332168, "rtol": 1e-4}, + "log.final.b.HDiffFlux": {"value": 1.3299128469e+17, "unit": 1 / u.m ** 2 / u.sec, "rtol": 1e-4}, + "log.final.b.HRefODragMod": {"value": 0.1834554926, "rtol": 1e-4}, + "log.final.b.KTide": {"value": 0.9359679029, "rtol": 1e-4}, + "log.final.b.RGDuration": {"value": 0.00000e+00, "unit": u.yr, "rtol": 1e-4}, + } ) -class TestAtmEscFlareDavenport(Benchmark): - pass +class Test_AtmEscFlareDavenport(Benchmark): + pass diff --git a/tests/AtmescFlareStellar/AtmEscFlareDavenport/vpl.in b/tests/AtmescFlareStellar/AtmEscFlareDavenport/vpl.in index 67e5fdb69..e2b98800f 100644 --- a/tests/AtmescFlareStellar/AtmEscFlareDavenport/vpl.in +++ b/tests/AtmescFlareStellar/AtmEscFlareDavenport/vpl.in @@ -36,4 +36,4 @@ bDoForward 1 # Perform a forward evolution? bVarDt 1 # Use variable timestepping? dEta 0.01 # Coefficient for variable timestepping dStopTime 1e8 -dOutputTime 1e7 +dOutputTime 1e8 diff --git a/tests/AtmescFlareStellar/AtmEscFlareLacy/test_AtmEscFlareLacy.py b/tests/AtmescFlareStellar/AtmEscFlareLacy/test_AtmEscFlareLacy.py index ab0c79397..645ffe2e0 100644 --- a/tests/AtmescFlareStellar/AtmEscFlareLacy/test_AtmEscFlareLacy.py +++ b/tests/AtmescFlareStellar/AtmEscFlareLacy/test_AtmEscFlareLacy.py @@ -1,226 +1,201 @@ -import astropy.units as u -import pytest -from benchmark import Benchmark, benchmark - - -@benchmark( - { - "log.initial.system.Age": {"value": 3.1557600000e14, "unit": u.sec}, - "log.initial.system.Time": {"value": 0.0000000000, "unit": u.sec}, - "log.initial.system.TotAngMom": { - "value": 3.7230704732e41, - "unit": (u.kg * u.m**2) / u.sec, - }, - "log.initial.system.TotEnergy": {"value": -7.1876127212e39, "unit": u.Joule}, - "log.initial.system.PotEnergy": {"value": -7.2010481575e39, "unit": u.Joule}, - "log.initial.system.KinEnergy": {"value": 1.3444021724e37, "unit": u.Joule}, - "log.initial.system.DeltaTime": {"value": 0.0000000000, "unit": u.sec}, - "log.initial.star.Mass": {"value": 2.3860992000e29, "unit": u.kg}, - "log.initial.star.Radius": {"value": 3.1661898155e08, "unit": u.m}, - "log.initial.star.RadGyra": {"value": 0.4610332834}, - "log.initial.star.RotAngMom": { - "value": 3.6973713815e41, - "unit": (u.kg * u.m**2) / u.sec, - }, - "log.initial.star.RotVel": {"value": 2.3025182093e04, "unit": u.m / u.sec}, - "log.initial.star.BodyType": {"value": 0.0000000000}, - "log.initial.star.RotRate": {"value": 7.2722052166e-05, "unit": 1 / u.sec}, - "log.initial.star.RotPer": {"value": 8.6400000000e04, "unit": u.sec}, - "log.initial.star.Density": {"value": 1794.6883475331, "unit": u.kg / u.m**3}, - "log.initial.star.HZLimitDryRunaway": {"value": 1.7757648517e10, "unit": u.m}, - "log.initial.star.HZLimRecVenus": {"value": 1.5942915196e10, "unit": u.m}, - "log.initial.star.HZLimRunaway": {"value": 2.1005311219e10, "unit": u.m}, - "log.initial.star.HZLimMoistGreenhouse": { - "value": 2.1095107199e10, - "unit": u.m, - }, - "log.initial.star.HZLimMaxGreenhouse": {"value": 4.0266652294e10, "unit": u.m}, - "log.initial.star.HZLimEarlyMars": {"value": 4.3914925610e10, "unit": u.m}, - "log.initial.star.Instellation": { - "value": -1.0000000000, - "unit": u.kg / u.sec**3, - }, - "log.initial.star.CriticalSemiMajorAxis": {"value": -1.0000000000, "unit": u.m}, - "log.initial.star.LXUVTot": { - "value": 9.4027677015e21, - "unit": u.kg / u.sec**3, - }, - "log.initial.star.LostEnergy": {"value": 5.5626846463e-309, "unit": u.Joule}, - "log.initial.star.LostAngMom": { - "value": 5.5626846463e-309, - "unit": (u.kg * u.m**2) / u.sec, - }, - "log.initial.star.Luminosity": {"value": 6.5779241790e24, "unit": u.W}, - "log.initial.star.LXUVStellar": {"value": 1.7103286997e-05, "unit": u.LSUN}, - "log.initial.star.Temperature": {"value": 3095.3300004448, "unit": u.K}, - "log.initial.star.LXUVFrac": {"value": 0.0010000000}, - "log.initial.star.RossbyNumber": {"value": 0.0155317554}, - "log.initial.star.DRotPerDtStellar": {"value": -1.1359491987e-10}, - "log.initial.star.LXUVFlare": {"value": 7.3448869539e-06, "unit": u.LSUN}, - "log.initial.star.FlareFreq1": {"value": 1.9829469531e-06, "unit": 1 / u.sec}, - "log.initial.star.FlareFreq2": {"value": 1.8540389414e-06, "unit": 1 / u.sec}, - "log.initial.star.FlareFreq3": {"value": 1.7335110204e-06, "unit": 1 / u.sec}, - "log.initial.star.FlareFreq4": {"value": 1.6208184147e-06, "unit": 1 / u.sec}, - "log.initial.star.FlareFreqMin": {"value": 1.9829469531e-06, "unit": 1 / u.sec}, - "log.initial.star.FlareFreqMid": {"value": 6.8817495244e-08, "unit": 1 / u.sec}, - "log.initial.star.FlareFreqMax": {"value": 2.3882876161e-09, "unit": 1 / u.sec}, - "log.initial.star.FlareEnergy1": {"value": 1.0000000000e26, "unit": u.Joule}, - "log.initial.star.FlareEnergy2": {"value": 1.0715193052e26, "unit": u.Joule}, - "log.initial.star.FlareEnergy3": {"value": 1.1481536215e26, "unit": u.Joule}, - "log.initial.star.FlareEnergy4": {"value": 1.2302687708e26, "unit": u.Joule}, - "log.initial.star.FlareEnergyMin": {"value": 1.0000000000e26, "unit": u.Joule}, - "log.initial.star.FlareEnergyMid": {"value": 3.1622776602e27, "unit": u.Joule}, - "log.initial.star.FlareEnergyMax": {"value": 1.0000000000e29, "unit": u.Joule}, - "log.initial.b.Mass": {"value": 7.5846762200e24, "unit": u.kg}, - "log.initial.b.Radius": {"value": 8.8005344212e06, "unit": u.m}, - "log.initial.b.RadGyra": {"value": 0.5000000000}, - "log.initial.b.BodyType": {"value": 0.0000000000}, - "log.initial.b.Density": {"value": 2656.5702144167, "unit": u.kg / u.m**3}, - "log.initial.b.HZLimitDryRunaway": {"value": 1.7814747212e10, "unit": u.m}, - "log.initial.b.HZLimRecVenus": {"value": 1.5942915196e10, "unit": u.m}, - "log.initial.b.HZLimRunaway": {"value": 2.1005311219e10, "unit": u.m}, - "log.initial.b.HZLimMoistGreenhouse": {"value": 2.1095107199e10, "unit": u.m}, - "log.initial.b.HZLimMaxGreenhouse": {"value": 4.0266652294e10, "unit": u.m}, - "log.initial.b.HZLimEarlyMars": {"value": 4.3914925610e10, "unit": u.m}, - "log.initial.b.Instellation": { - "value": 9975.5972427825, - "unit": u.kg / u.sec**3, - }, - "log.initial.b.MeanMotion": {"value": 6.4573248494e-06, "unit": 1 / u.sec}, - "log.initial.b.OrbPeriod": {"value": 9.7303224691e05, "unit": u.sec}, - "log.initial.b.SemiMajorAxis": {"value": 7.2554967289e09, "unit": u.m}, - "log.initial.b.LXUVTot": {"value": -1.0000000000, "unit": u.kg / u.sec**3}, - "log.initial.b.SurfWaterMass": {"value": 1.5000000000, "unit": u.TO}, - "log.initial.b.EnvelopeMass": {"value": 0.0010000000, "unit": u.Mearth}, - "log.initial.b.OxygenMass": {"value": 0.0000000000, "unit": u.bar}, - "log.initial.b.RGLimit": {"value": 2.0225735532e10, "unit": u.m}, - "log.initial.b.XO": {"value": 0.3333333333}, - "log.initial.b.EtaO": {"value": 0.0000000000}, - "log.initial.b.PlanetRadius": {"value": 1.3798050236, "unit": u.Rearth}, - "log.initial.b.OxygenMantleMass": {"value": 0.0000000000, "unit": u.kg}, - "log.initial.b.RadXUV": {"value": -1.0000000000, "unit": u.m}, - "log.initial.b.RadSolid": {"value": -1.0000000000, "unit": u.m}, - "log.initial.b.PresXUV": {"value": 5.0000000000}, - "log.initial.b.ScaleHeight": {"value": -1.0000000000, "unit": u.m}, - "log.initial.b.ThermTemp": {"value": 400.0000000000, "unit": u.K}, - "log.initial.b.AtmGasConst": {"value": 4124.0000000000}, - "log.initial.b.PresSurf": {"value": -1.0000000000, "unit": u.Pa}, - "log.initial.b.DEnvMassDt": {"value": -9.8638423785e06, "unit": u.kg / u.sec}, - "log.initial.b.FXUV": {"value": 14.2595476939, "unit": u.W / u.m**2}, - "log.initial.b.AtmXAbsEffH2O": {"value": 0.3000000000}, - "log.initial.b.RocheRadius": {"value": 1.5935887288e08, "unit": u.m}, - "log.initial.b.BondiRadius": {"value": 1.9083081091e08, "unit": u.m}, - "log.initial.b.HEscapeRegime": {"value": 3.0000000000}, - "log.initial.b.RRCriticalFlux": { - "value": 27.7437416693, - "unit": u.W / u.m**2, - }, - "log.initial.b.KTide": {"value": 0.9172472694}, - "log.initial.b.RGDuration": {"value": 0.00000e00, "unit": u.yr}, - "log.final.system.Age": {"value": 3.4713360000e15, "unit": u.sec}, - "log.final.system.Time": {"value": 3.1557600000e15, "unit": u.sec}, - "log.final.system.TotAngMom": { - "value": 3.7312616335e41, - "unit": (u.kg * u.m**2) / u.sec, - }, - "log.final.system.TotEnergy": {"value": -7.1795920701e39, "unit": u.Joule}, - "log.final.system.PotEnergy": {"value": -1.6690041852e40, "unit": u.Joule}, - "log.final.system.KinEnergy": {"value": 1.4186306842e37, "unit": u.Joule}, - "log.final.system.DeltaTime": {"value": 3.5142876233e09, "unit": u.sec}, - "log.final.star.Mass": {"value": 2.3860992000e29, "unit": u.kg}, - "log.final.star.Radius": {"value": 1.3660771818e08, "unit": u.m}, - "log.final.star.RadGyra": {"value": 0.4634686947}, - "log.final.star.RotAngMom": { - "value": 1.6473639655e41, - "unit": (u.kg * u.m**2) / u.sec, - }, - "log.final.star.RotVel": {"value": 2.3528000463e04, "unit": u.m / u.sec}, - "log.final.star.BodyType": {"value": 0.0000000000}, - "log.final.star.RotRate": {"value": 0.0001722304, "unit": 1 / u.sec}, - "log.final.star.RotPer": {"value": 3.6481281488e04, "unit": u.sec}, - "log.final.star.Density": {"value": 2.2344681790e04, "unit": u.kg / u.m**3}, - "log.final.star.HZLimitDryRunaway": {"value": 7.5301598725e09, "unit": u.m}, - "log.final.star.HZLimRecVenus": {"value": 6.7636987997e09, "unit": u.m}, - "log.final.star.HZLimRunaway": {"value": 8.9095082541e09, "unit": u.m}, - "log.final.star.HZLimMoistGreenhouse": {"value": 8.9494904093e09, "unit": u.m}, - "log.final.star.HZLimMaxGreenhouse": {"value": 1.7099185746e10, "unit": u.m}, - "log.final.star.HZLimEarlyMars": {"value": 1.8648410552e10, "unit": u.m}, - "log.final.star.Instellation": { - "value": -1.0000000000, - "unit": u.kg / u.sec**3, - }, - "log.final.star.CriticalSemiMajorAxis": {"value": -1.0000000000, "unit": u.m}, - "log.final.star.LXUVTot": {"value": 3.8768377163e21, "unit": u.kg / u.sec**3}, - "log.final.star.LostEnergy": {"value": 9.4962721299e39, "unit": u.Joule}, - "log.final.star.LostAngMom": { - "value": 2.0582188545e41, - "unit": (u.kg * u.m**2) / u.sec, - }, - "log.final.star.Luminosity": {"value": 1.1828409343e24, "unit": u.W}, - "log.final.star.LXUVStellar": {"value": 2.7352943159e-06, "unit": u.LSUN}, - "log.final.star.Temperature": {"value": 3070.1028201381, "unit": u.K}, - "log.final.star.LXUVFrac": {"value": 0.0008893793}, - "log.final.star.RossbyNumber": {"value": 0.0064738940}, - "log.final.star.DRotPerDtStellar": {"value": -2.9654117549e-12}, - "log.final.star.LXUVFlare": {"value": 7.3448869539e-06, "unit": u.LSUN}, - "log.final.star.FlareFreq1": {"value": 1.9829469531e-06, "unit": 1 / u.sec}, - "log.final.star.FlareFreq2": {"value": 1.8540389414e-06, "unit": 1 / u.sec}, - "log.final.star.FlareFreq3": {"value": 1.7335110204e-06, "unit": 1 / u.sec}, - "log.final.star.FlareFreq4": {"value": 1.6208184147e-06, "unit": 1 / u.sec}, - "log.final.star.FlareFreqMin": {"value": 1.9829469531e-06, "unit": 1 / u.sec}, - "log.final.star.FlareFreqMid": {"value": 6.8817495244e-08, "unit": 1 / u.sec}, - "log.final.star.FlareFreqMax": {"value": 2.3882876161e-09, "unit": 1 / u.sec}, - "log.final.star.FlareEnergy1": {"value": 1.0000000000e26, "unit": u.Joule}, - "log.final.star.FlareEnergy2": {"value": 1.0715193052e26, "unit": u.Joule}, - "log.final.star.FlareEnergy3": {"value": 1.1481536215e26, "unit": u.Joule}, - "log.final.star.FlareEnergy4": {"value": 1.2302687708e26, "unit": u.Joule}, - "log.final.star.FlareEnergyMin": {"value": 1.0000000000e26, "unit": u.Joule}, - "log.final.star.FlareEnergyMid": {"value": 3.1622776602e27, "unit": u.Joule}, - "log.final.star.FlareEnergyMax": {"value": 1.0000000000e29, "unit": u.Joule}, - "log.final.b.Mass": {"value": 7.5787040340e24, "unit": u.kg}, - "log.final.b.Radius": {"value": 6.8050745192e06, "unit": u.m}, - "log.final.b.RadGyra": {"value": 0.5000000000}, - "log.final.b.BodyType": {"value": 0.0000000000}, - "log.final.b.Density": {"value": 5741.2661742908, "unit": u.kg / u.m**3}, - "log.final.b.HZLimitDryRunaway": {"value": 7.5543726676e09, "unit": u.m}, - "log.final.b.HZLimRecVenus": {"value": 6.7636987997e09, "unit": u.m}, - "log.final.b.HZLimRunaway": {"value": 8.9095082541e09, "unit": u.m}, - "log.final.b.HZLimMoistGreenhouse": {"value": 8.9494904093e09, "unit": u.m}, - "log.final.b.HZLimMaxGreenhouse": {"value": 1.7099185746e10, "unit": u.m}, - "log.final.b.HZLimEarlyMars": {"value": 1.8648410552e10, "unit": u.m}, - "log.final.b.Instellation": { - "value": 1793.8097857806, - "unit": u.kg / u.sec**3, - }, - "log.final.b.MeanMotion": {"value": 6.4573247685e-06, "unit": 1 / u.sec}, - "log.final.b.OrbPeriod": {"value": 9.7303225908e05, "unit": u.sec}, - "log.final.b.SemiMajorAxis": {"value": 7.2554967289e09, "unit": u.m}, - "log.final.b.LXUVTot": {"value": -1.0000000000, "unit": u.kg / u.sec**3}, - "log.final.b.SurfWaterMass": {"value": 0.3508535487, "unit": u.TO}, - "log.final.b.EnvelopeMass": {"value": 0.0000000000, "unit": u.Mearth}, - "log.final.b.OxygenMass": {"value": 46.4309612009, "unit": u.bar}, - "log.final.b.RGLimit": {"value": 8.5790596482e09, "unit": u.m}, - "log.final.b.XO": {"value": 0.4398761903}, - "log.final.b.EtaO": {"value": 0.0000000000}, - "log.final.b.PlanetRadius": {"value": 1.0669438421, "unit": u.Rearth}, - "log.final.b.OxygenMantleMass": {"value": 0.0000000000, "unit": u.kg}, - "log.final.b.RadXUV": {"value": -1.0000000000, "unit": u.m}, - "log.final.b.RadSolid": {"value": -1.0000000000, "unit": u.m}, - "log.final.b.PresXUV": {"value": 5.0000000000}, - "log.final.b.ScaleHeight": {"value": -1.0000000000, "unit": u.m}, - "log.final.b.ThermTemp": {"value": 400.0000000000, "unit": u.K}, - "log.final.b.AtmGasConst": {"value": 4124.0000000000}, - "log.final.b.PresSurf": {"value": -1.0000000000, "unit": u.Pa}, - "log.final.b.DEnvMassDt": {"value": 5.5626846463e-309, "unit": u.kg / u.sec}, - "log.final.b.FXUV": {"value": 5.8793276695, "unit": u.W / u.m**2}, - "log.final.b.AtmXAbsEffH2O": {"value": 0.3000000000}, - "log.final.b.RocheRadius": {"value": 1.5931703542e08, "unit": u.m}, - "log.final.b.BondiRadius": {"value": 2.9267881535e08, "unit": u.m}, - "log.final.b.HEscapeRegime": {"value": 8.0000000000}, - "log.final.b.RRCriticalFlux": {"value": 62.3818675680, "unit": u.W / u.m**2}, - "log.final.b.KTide": {"value": 0.9359679029}, - "log.final.b.RGDuration": {"value": 0.00000e00, "unit": u.yr}, - } +from benchmark import Benchmark, benchmark +import astropy.units as u +import pytest + +@benchmark( + { + "log.initial.system.Age": {"value": 3.1557600000e+14, "unit": u.sec}, + "log.initial.system.Time": {"value": 0.0000000000, "unit": u.sec}, + "log.initial.system.TotAngMom": {"value": 3.7230704732e+41, "unit": (u.kg * u.m ** 2) / u.sec}, + "log.initial.system.TotEnergy": {"value": -7.1876127212e+39, "unit": u.Joule}, + "log.initial.system.PotEnergy": {"value": -7.2010481575e+39, "unit": u.Joule}, + "log.initial.system.KinEnergy": {"value": 1.3444021724e+37, "unit": u.Joule}, + "log.initial.system.DeltaTime": {"value": 0.0000000000, "unit": u.sec}, + "log.initial.star.Mass": {"value": 2.3860992000e+29, "unit": u.kg}, + "log.initial.star.Radius": {"value": 3.1661898155e+08, "unit": u.m}, + "log.initial.star.RadGyra": {"value": 0.4610332834}, + "log.initial.star.RotAngMom": {"value": 3.6973713815e+41, "unit": (u.kg * u.m ** 2) / u.sec}, + "log.initial.star.RotVel": {"value": 2.3025182093e+04, "unit": u.m / u.sec}, + "log.initial.star.BodyType": {"value": 0.0000000000}, + "log.initial.star.RotRate": {"value": 7.2722052166e-05, "unit": 1 / u.sec}, + "log.initial.star.RotPer": {"value": 8.6400000000e+04, "unit": u.sec}, + "log.initial.star.Density": {"value": 1794.6883475331, "unit": u.kg / u.m ** 3}, + "log.initial.star.HZLimitDryRunaway": {"value": 1.7757648517e+10, "unit": u.m}, + "log.initial.star.HZLimRecVenus": {"value": 1.5942915196e+10, "unit": u.m}, + "log.initial.star.HZLimRunaway": {"value": 2.1005311219e+10, "unit": u.m}, + "log.initial.star.HZLimMoistGreenhouse": {"value": 2.1095107199e+10, "unit": u.m}, + "log.initial.star.HZLimMaxGreenhouse": {"value": 4.0266652294e+10, "unit": u.m}, + "log.initial.star.HZLimEarlyMars": {"value": 4.3914925610e+10, "unit": u.m}, + "log.initial.star.Instellation": {"value": -1.0000000000, "unit": u.kg / u.sec ** 3}, + "log.initial.star.CriticalSemiMajorAxis": {"value": -1.0000000000, "unit": u.m}, + "log.initial.star.LXUVTot": {"value": 9.4027677015e+21, "unit": u.kg / u.sec ** 3}, + "log.initial.star.LostEnergy": {"value": 5.5626846463e-309, "unit": u.Joule}, + "log.initial.star.LostAngMom": {"value": 5.5626846463e-309, "unit": (u.kg * u.m ** 2) / u.sec}, + "log.initial.star.Luminosity": {"value": 6.5779241790e+24, "unit": u.W}, + "log.initial.star.LXUVStellar": {"value": 1.7103286997e-05, "unit": u.LSUN}, + "log.initial.star.Temperature": {"value": 3095.3300004448, "unit": u.K}, + "log.initial.star.LXUVFrac": {"value": 0.0010000000}, + "log.initial.star.RossbyNumber": {"value": 0.0155317554}, + "log.initial.star.DRotPerDtStellar": {"value": -1.1359491987e-10}, + "log.initial.star.LXUVFlare": {"value": 7.3448869539e-06, "unit": u.LSUN}, + "log.initial.star.FlareFreq1": {"value": 1.9829469531e-06, "unit": 1 / u.sec}, + "log.initial.star.FlareFreq2": {"value": 1.8540389414e-06, "unit": 1 / u.sec}, + "log.initial.star.FlareFreq3": {"value": 1.7335110204e-06, "unit": 1 / u.sec}, + "log.initial.star.FlareFreq4": {"value": 1.6208184147e-06, "unit": 1 / u.sec}, + "log.initial.star.FlareFreqMin": {"value": 1.9829469531e-06, "unit": 1 / u.sec}, + "log.initial.star.FlareFreqMid": {"value": 6.8817495244e-08, "unit": 1 / u.sec}, + "log.initial.star.FlareFreqMax": {"value": 2.3882876161e-09, "unit": 1 / u.sec}, + "log.initial.star.FlareEnergy1": {"value": 1.0000000000e+26, "unit": u.Joule}, + "log.initial.star.FlareEnergy2": {"value": 1.0715193052e+26, "unit": u.Joule}, + "log.initial.star.FlareEnergy3": {"value": 1.1481536215e+26, "unit": u.Joule}, + "log.initial.star.FlareEnergy4": {"value": 1.2302687708e+26, "unit": u.Joule}, + "log.initial.star.FlareEnergyMin": {"value": 1.0000000000e+26, "unit": u.Joule}, + "log.initial.star.FlareEnergyMid": {"value": 3.1622776602e+27, "unit": u.Joule}, + "log.initial.star.FlareEnergyMax": {"value": 1.0000000000e+29, "unit": u.Joule}, + "log.initial.b.Mass": {"value": 7.5846762200e+24, "unit": u.kg}, + "log.initial.b.Radius": {"value": 8.8005344212e+06, "unit": u.m}, + "log.initial.b.RadGyra": {"value": 0.5000000000}, + "log.initial.b.BodyType": {"value": 0.0000000000}, + "log.initial.b.Density": {"value": 2656.5702144167, "unit": u.kg / u.m ** 3}, + "log.initial.b.HZLimitDryRunaway": {"value": 1.7814747212e+10, "unit": u.m}, + "log.initial.b.HZLimRecVenus": {"value": 1.5942915196e+10, "unit": u.m}, + "log.initial.b.HZLimRunaway": {"value": 2.1005311219e+10, "unit": u.m}, + "log.initial.b.HZLimMoistGreenhouse": {"value": 2.1095107199e+10, "unit": u.m}, + "log.initial.b.HZLimMaxGreenhouse": {"value": 4.0266652294e+10, "unit": u.m}, + "log.initial.b.HZLimEarlyMars": {"value": 4.3914925610e+10, "unit": u.m}, + "log.initial.b.Instellation": {"value": 9975.5972427825, "unit": u.kg / u.sec ** 3}, + "log.initial.b.MeanMotion": {"value": 6.4573248494e-06, "unit": 1 / u.sec}, + "log.initial.b.OrbPeriod": {"value": 9.7303224691e+05, "unit": u.sec}, + "log.initial.b.SemiMajorAxis": {"value": 7.2554967289e+09, "unit": u.m}, + "log.initial.b.LXUVTot": {"value": -1.0000000000, "unit": u.kg / u.sec ** 3}, + "log.initial.b.SurfWaterMass": {"value": 1.5000000000, "unit": u.TO}, + "log.initial.b.EnvelopeMass": {"value": 0.0010000000, "unit": u.Mearth}, + "log.initial.b.OxygenMass": {"value": 0.0000000000, "unit": u.bar}, + "log.initial.b.RGLimit": {"value": 2.0225735532e+10, "unit": u.m}, + "log.initial.b.XO": {"value": 0.3333333333}, + "log.initial.b.EtaO": {"value": 0.0000000000}, + "log.initial.b.PlanetRadius": {"value": 1.3798050236, "unit": u.Rearth}, + "log.initial.b.OxygenMantleMass": {"value": 0.0000000000, "unit": u.kg}, + "log.initial.b.RadXUV": {"value": -1.0000000000, "unit": u.m}, + "log.initial.b.RadSolid": {"value": -1.0000000000, "unit": u.m}, + "log.initial.b.PresXUV": {"value": 5.0000000000}, + "log.initial.b.ScaleHeight": {"value": -1.0000000000, "unit": u.m}, + "log.initial.b.ThermTemp": {"value": 400.0000000000, "unit": u.K}, + "log.initial.b.AtmGasConst": {"value": 4124.0000000000}, + "log.initial.b.PresSurf": {"value": -1.0000000000, "unit": u.Pa}, + "log.initial.b.DEnvMassDt": {"value": -9.8638423785e+06, "unit": u.kg / u.sec}, + "log.initial.b.FXUV": {"value": 14.2595476939, "unit": u.W / u.m ** 2}, + "log.initial.b.AtmXAbsEffH2O": {"value": 0.3000000000}, + "log.initial.b.RocheRadius": {"value": 1.5935887288e+08, "unit": u.m}, + "log.initial.b.BondiRadius": {"value": 1.9083081091e+08, "unit": u.m}, + "log.initial.b.HEscapeRegime": {"value": 3.0000000000}, + "log.initial.b.RRCriticalFlux": {"value": 27.7437416693, "unit": u.W / u.m ** 2}, + "log.initial.b.CrossoverMass": {"value": 0.0000000000, "unit": u.kg}, + "log.initial.b.WaterEscapeRegime": {"value": 8.0000000000}, + "log.initial.b.FXUVCRITDRAG": {"value": 0.1090267838, "unit": u.W / u.m ** 2}, + "log.initial.b.HREFFLUX": {"value": 1.2206723412e+19, "unit": 1 / u.m ** 2 / u.sec}, + "log.initial.b.XO2": {"value": 0.0000000000}, + "log.initial.b.XH2O": {"value": 1.0000000000}, + "log.initial.b.HDiffFlux": {"value": 8.4375341524e+16, "unit": 1 / u.m ** 2 / u.sec}, + "log.initial.b.HRefODragMod": {"value": 0.0077519380}, + "log.initial.b.KTide": {"value": 0.9172472694}, + "log.initial.b.RGDuration": {"value": 0.00000e+00, "unit": u.yr}, + "log.final.system.Age": {"value": 3.4713360000e+15, "unit": u.sec, "rtol": 1e-4}, + "log.final.system.Time": {"value": 3.1557600000e+15, "unit": u.sec, "rtol": 1e-4}, + "log.final.system.TotAngMom": {"value": 3.7311341059e+41, "unit": (u.kg * u.m ** 2) / u.sec, "rtol": 1e-4}, + "log.final.system.TotEnergy": {"value": -7.1802001227e+39, "unit": u.Joule, "rtol": 1e-4}, + "log.final.system.PotEnergy": {"value": -1.6690359127e+40, "unit": u.Joule, "rtol": 1e-4}, + "log.final.system.KinEnergy": {"value": 1.4184861863e+37, "unit": u.Joule, "rtol": 1e-4}, + "log.final.star.Mass": {"value": 2.3860992000e+29, "unit": u.kg, "rtol": 1e-4}, + "log.final.star.Radius": {"value": 1.3660512134e+08, "unit": u.m, "rtol": 1e-4}, + "log.final.star.RadGyra": {"value": 0.4634687447, "rtol": 1e-4}, + "log.final.star.RotAngMom": {"value": 1.6472489290e+41, "unit": (u.kg * u.m ** 2) / u.sec, "rtol": 1e-4}, + "log.final.star.RotVel": {"value": 2.3526799645e+04, "unit": u.m / u.sec, "rtol": 1e-4}, + "log.final.star.BodyType": {"value": 0.0000000000, "rtol": 1e-4}, + "log.final.star.RotRate": {"value": 0.0001722249, "unit": 1 / u.sec, "rtol": 1e-4}, + "log.final.star.RotPer": {"value": 3.6482449982e+04, "unit": u.sec, "rtol": 1e-4}, + "log.final.star.Density": {"value": 2.2345956122e+04, "unit": u.kg / u.m ** 3, "rtol": 1e-4}, + "log.final.star.HZLimitDryRunaway": {"value": 7.5299869568e+09, "unit": u.m, "rtol": 1e-4}, + "log.final.star.HZLimRecVenus": {"value": 6.7635438474e+09, "unit": u.m, "rtol": 1e-4}, + "log.final.star.HZLimRunaway": {"value": 8.9093039211e+09, "unit": u.m, "rtol": 1e-4}, + "log.final.star.HZLimMoistGreenhouse": {"value": 8.9492853820e+09, "unit": u.m, "rtol": 1e-4}, + "log.final.star.HZLimMaxGreenhouse": {"value": 1.7098795944e+10, "unit": u.m, "rtol": 1e-4}, + "log.final.star.HZLimEarlyMars": {"value": 1.8647985431e+10, "unit": u.m, "rtol": 1e-4}, + "log.final.star.Instellation": {"value": -1.0000000000, "unit": u.kg / u.sec ** 3, "rtol": 1e-4}, + "log.final.star.CriticalSemiMajorAxis": {"value": -1.0000000000, "unit": u.m, "rtol": 1e-4}, + "log.final.star.LXUVTot": {"value": 3.8767894028e+21, "unit": u.kg / u.sec ** 3, "rtol": 1e-4}, + "log.final.star.LostEnergy": {"value": 9.4959827978e+39, "unit": u.Joule, "rtol": 1e-4}, + "log.final.star.LostAngMom": {"value": 2.0582063633e+41, "unit": (u.kg * u.m ** 2) / u.sec, "rtol": 1e-4}, + "log.final.star.Luminosity": {"value": 1.1827866115e+24, "unit": u.W, "rtol": 1e-4}, + "log.final.star.LXUVStellar": {"value": 2.7351686957e-06, "unit": u.LSUN, "rtol": 1e-4}, + "log.final.star.Temperature": {"value": 3070.0998278738, "unit": u.K, "rtol": 1e-4}, + "log.final.star.LXUVFrac": {"value": 0.0008893793, "rtol": 1e-4}, + "log.final.star.RossbyNumber": {"value": 0.0064740915, "rtol": 1e-4}, + "log.final.star.DRotPerDtStellar": {"value": -2.9658114783e-12, "rtol": 1e-4}, + "log.final.star.LXUVFlare": {"value": 7.3448869539e-06, "unit": u.LSUN, "rtol": 1e-4}, + "log.final.star.FlareFreq1": {"value": 1.9829469531e-06, "unit": 1 / u.sec, "rtol": 1e-4}, + "log.final.star.FlareFreq2": {"value": 1.8540389414e-06, "unit": 1 / u.sec, "rtol": 1e-4}, + "log.final.star.FlareFreq3": {"value": 1.7335110204e-06, "unit": 1 / u.sec, "rtol": 1e-4}, + "log.final.star.FlareFreq4": {"value": 1.6208184147e-06, "unit": 1 / u.sec, "rtol": 1e-4}, + "log.final.star.FlareFreqMin": {"value": 1.9829469531e-06, "unit": 1 / u.sec, "rtol": 1e-4}, + "log.final.star.FlareFreqMid": {"value": 6.8817495244e-08, "unit": 1 / u.sec, "rtol": 1e-4}, + "log.final.star.FlareFreqMax": {"value": 2.3882876161e-09, "unit": 1 / u.sec, "rtol": 1e-4}, + "log.final.star.FlareEnergy1": {"value": 1.0000000000e+26, "unit": u.Joule, "rtol": 1e-4}, + "log.final.star.FlareEnergy2": {"value": 1.0715193052e+26, "unit": u.Joule, "rtol": 1e-4}, + "log.final.star.FlareEnergy3": {"value": 1.1481536215e+26, "unit": u.Joule, "rtol": 1e-4}, + "log.final.star.FlareEnergy4": {"value": 1.2302687708e+26, "unit": u.Joule, "rtol": 1e-4}, + "log.final.star.FlareEnergyMin": {"value": 1.0000000000e+26, "unit": u.Joule, "rtol": 1e-4}, + "log.final.star.FlareEnergyMid": {"value": 3.1622776602e+27, "unit": u.Joule, "rtol": 1e-4}, + "log.final.star.FlareEnergyMax": {"value": 1.0000000000e+29, "unit": u.Joule, "rtol": 1e-4}, + "log.final.b.Mass": {"value": 7.5787040340e+24, "unit": u.kg, "rtol": 1e-4}, + "log.final.b.Radius": {"value": 6.8050745192e+06, "unit": u.m, "rtol": 1e-4}, + "log.final.b.RadGyra": {"value": 0.5000000000, "rtol": 1e-4}, + "log.final.b.BodyType": {"value": 0.0000000000, "rtol": 1e-4}, + "log.final.b.Density": {"value": 5741.2661742908, "unit": u.kg / u.m ** 3, "rtol": 1e-4}, + "log.final.b.HZLimitDryRunaway": {"value": 7.5541991960e+09, "unit": u.m, "rtol": 1e-4}, + "log.final.b.HZLimRecVenus": {"value": 6.7635438474e+09, "unit": u.m, "rtol": 1e-4}, + "log.final.b.HZLimRunaway": {"value": 8.9093039211e+09, "unit": u.m, "rtol": 1e-4}, + "log.final.b.HZLimMoistGreenhouse": {"value": 8.9492853820e+09, "unit": u.m, "rtol": 1e-4}, + "log.final.b.HZLimMaxGreenhouse": {"value": 1.7098795944e+10, "unit": u.m, "rtol": 1e-4}, + "log.final.b.HZLimEarlyMars": {"value": 1.8647985431e+10, "unit": u.m, "rtol": 1e-4}, + "log.final.b.Instellation": {"value": 1793.7274039253, "unit": u.kg / u.sec ** 3, "rtol": 1e-4}, + "log.final.b.MeanMotion": {"value": 6.4573247685e-06, "unit": 1 / u.sec, "rtol": 1e-4}, + "log.final.b.OrbPeriod": {"value": 9.7303225908e+05, "unit": u.sec, "rtol": 1e-4}, + "log.final.b.SemiMajorAxis": {"value": 7.2554967289e+09, "unit": u.m, "rtol": 1e-4}, + "log.final.b.LXUVTot": {"value": -1.0000000000, "unit": u.kg / u.sec ** 3, "rtol": 1e-4}, + "log.final.b.SurfWaterMass": {"value": 0.3509650099, "unit": u.TO, "rtol": 1e-4}, + "log.final.b.EnvelopeMass": {"value": 0.0000000000, "unit": u.Mearth, "rtol": 1e-4}, + "log.final.b.OxygenMass": {"value": 46.4328090748, "unit": u.bar, "rtol": 1e-4}, + "log.final.b.RGLimit": {"value": 8.5788629016e+09, "unit": u.m, "rtol": 1e-4}, + "log.final.b.XO": {"value": 0.4398513218, "rtol": 1e-4}, + "log.final.b.EtaO": {"value": 0.0000000000, "rtol": 1e-4}, + "log.final.b.PlanetRadius": {"value": 1.0669438421, "unit": u.Rearth, "rtol": 1e-4}, + "log.final.b.OxygenMantleMass": {"value": 0.0000000000, "unit": u.kg, "rtol": 1e-4}, + "log.final.b.RadXUV": {"value": -1.0000000000, "unit": u.m, "rtol": 1e-4}, + "log.final.b.RadSolid": {"value": -1.0000000000, "unit": u.m, "rtol": 1e-4}, + "log.final.b.PresXUV": {"value": 5.0000000000, "rtol": 1e-4}, + "log.final.b.ScaleHeight": {"value": -1.0000000000, "unit": u.m, "rtol": 1e-4}, + "log.final.b.ThermTemp": {"value": 400.0000000000, "unit": u.K, "rtol": 1e-4}, + "log.final.b.AtmGasConst": {"value": 4124.0000000000, "rtol": 1e-4}, + "log.final.b.PresSurf": {"value": -1.0000000000, "unit": u.Pa, "rtol": 1e-4}, + "log.final.b.DEnvMassDt": {"value": 5.5626846463e-309, "unit": u.kg / u.sec, "rtol": 1e-4}, + "log.final.b.FXUV": {"value": 5.8792544008, "unit": u.W / u.m ** 2, "rtol": 1e-4}, + "log.final.b.AtmXAbsEffH2O": {"value": 0.3000000000, "rtol": 1e-4}, + "log.final.b.RocheRadius": {"value": 1.5931703542e+08, "unit": u.m, "rtol": 1e-4}, + "log.final.b.BondiRadius": {"value": 2.9268188250e+08, "unit": u.m, "rtol": 1e-4}, + "log.final.b.HEscapeRegime": {"value": 8.0000000000, "rtol": 1e-4}, + "log.final.b.RRCriticalFlux": {"value": 62.3818675680, "unit": u.W / u.m ** 2, "rtol": 1e-4}, + "log.final.b.CrossoverMass": {"value": 8.3894445387e-26, "unit": u.kg, "rtol": 1e-4}, + "log.final.b.WaterEscapeRegime": {"value": 4.0000000000, "rtol": 1e-4}, + "log.final.b.FXUVCRITDRAG": {"value": 0.1978208482, "unit": u.W / u.m ** 2, "rtol": 1e-4}, + "log.final.b.HREFFLUX": {"value": 3.8168669119e+18, "unit": 1 / u.m ** 2 / u.sec, "rtol": 1e-4}, + "log.final.b.XO2": {"value": 0.2219353904, "rtol": 1e-4}, + "log.final.b.XH2O": {"value": 0.7780646096, "rtol": 1e-4}, + "log.final.b.HDiffFlux": {"value": 1.1847326044e+17, "unit": 1 / u.m ** 2 / u.sec, "rtol": 1e-4}, + "log.final.b.HRefODragMod": {"value": 0.1024764157, "rtol": 1e-4}, + "log.final.b.KTide": {"value": 0.9359679029, "rtol": 1e-4}, + "log.final.b.RGDuration": {"value": 0.00000e+00, "unit": u.yr, "rtol": 1e-4}, + } ) -class TestAtmEscFlareLacy(Benchmark): - pass +class Test_AtmEscFlareLacy(Benchmark): + pass diff --git a/tests/AtmescFlareStellar/AtmEscFlareLacy/vpl.in b/tests/AtmescFlareStellar/AtmEscFlareLacy/vpl.in index 67e5fdb69..e2b98800f 100644 --- a/tests/AtmescFlareStellar/AtmEscFlareLacy/vpl.in +++ b/tests/AtmescFlareStellar/AtmEscFlareLacy/vpl.in @@ -36,4 +36,4 @@ bDoForward 1 # Perform a forward evolution? bVarDt 1 # Use variable timestepping? dEta 0.01 # Coefficient for variable timestepping dStopTime 1e8 -dOutputTime 1e7 +dOutputTime 1e8 diff --git a/tests/AtmescStellar/DiffLimWaterEscape/star.in b/tests/AtmescStellar/DiffLimWaterEscape/star.in index 8b34d092c..0a7048cdd 100755 --- a/tests/AtmescStellar/DiffLimWaterEscape/star.in +++ b/tests/AtmescStellar/DiffLimWaterEscape/star.in @@ -6,4 +6,4 @@ sStellarModel baraffe dSatXUVFrac 1.e-3.03 dSatXUVTime -3.146 dXUVBeta 1.172 -saOutputOrder Time -Luminosity -LXUVTot Temperature HZLimRecVenus HZLimRunaway HZLimMaxGreenhouse HZLimEarlyMars +saOutputOrder Time -Luminosity -LXUVTot Temperature HZLimRecVenus HZLimRunaway HZLimMaxGreenhouse HZLimEarlyMars DeltaTime diff --git a/tests/AtmescStellar/DiffLimWaterEscape/test_DiffLimWaterEscape.py b/tests/AtmescStellar/DiffLimWaterEscape/test_DiffLimWaterEscape.py index 3d835f2c5..e941677dd 100644 --- a/tests/AtmescStellar/DiffLimWaterEscape/test_DiffLimWaterEscape.py +++ b/tests/AtmescStellar/DiffLimWaterEscape/test_DiffLimWaterEscape.py @@ -139,7 +139,6 @@ "log.final.system.TotEnergy": {"value": -1.890023e+39, "unit": u.Joule, "rtol": 1e-4}, "log.final.system.PotEnergy": {"value": -1.631379e+40, "unit": u.Joule, "rtol": 1e-4}, "log.final.system.KinEnergy": {"value": 9.851807e+35, "unit": u.Joule, "rtol": 1e-4}, - "log.final.system.DeltaTime": {"value": 2.721322e+11, "unit": u.sec, "rtol": 1e-4}, "log.final.star.Mass": {"value": 1.789574e+29, "unit": u.kg, "rtol": 1e-4}, "log.final.star.Radius": {"value": 7.861410e+07, "unit": u.m, "rtol": 1e-4}, "log.final.star.RadGyra": {"value": 0.465100, "rtol": 1e-4}, diff --git a/tests/maketest.py b/tests/maketest.py index d168b5e31..3060b9a57 100644 --- a/tests/maketest.py +++ b/tests/maketest.py @@ -136,8 +136,9 @@ def GetSNames(bodyfiles): for line in content: if line: if line[0] == "saModules": - if "stellar" in line: + if "stellar".casefold() in line or "stellar,".casefold() in line: stellar = True + print("WARNING: Stellar module detected, rtol will be set to 1e-4 for all values.") if line[0] == "sName": body_names.append(line[1]) @@ -475,15 +476,18 @@ def WriteTest(data, dirname, stellar): if "log" in k and v[0] != "": if "final" in k and stellar == True: - t.write( - ' "' - + k - + '": {"value": ' - + str(v[1]) - + ', "unit": ' - + v[0] - + ', "rtol": 1e-4}, \n' - ) + if "DeltaTime" in k: + print("WARNING: Skipping final DeltaTime") + else: + t.write( + ' "' + + k + + '": {"value": ' + + str(v[1]) + + ', "unit": ' + + v[0] + + ', "rtol": 1e-4}, \n' + ) else: t.write( ' "' @@ -496,13 +500,16 @@ def WriteTest(data, dirname, stellar): ) if "log" in k and v[0] == "": if "final" in k and stellar == True: - t.write( - ' "' - + k - + '": {"value": ' - + str(v[1]) - + ', "rtol": 1e-4}, \n' - ) + if "DeltaTime" in k: + print("WARNING: Skipping final DeltaTime") + else: + t.write( + ' "' + + k + + '": {"value": ' + + str(v[1]) + + ', "rtol": 1e-4}, \n' + ) else: t.write(' "' + k + '": {"value": ' + str(v[1]) + "}, \n")