Skip to content

Commit

Permalink
Added unit tests for Poise:SeasonalNC79*.
Browse files Browse the repository at this point in the history
Also temporarily set units to the following outputs to non-dimensional to enable testing:
- AreaIceCov
- IceMass
- IceAblate
- PlackBAvg
- IceAccum
  • Loading branch information
Rory Barnes committed Oct 9, 2024
1 parent e70b0a8 commit 9d82317
Show file tree
Hide file tree
Showing 17 changed files with 1,300 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/poise.c
Original file line number Diff line number Diff line change
Expand Up @@ -3700,13 +3700,7 @@ void WriteAreaIceCov(BODY *body, CONTROL *control, OUTPUT *output,
fvAreaIceCovered(body, iBody);
*dTmp = body[iBody].dAreaIceCov;

// if (output->bDoNeg[iBody]) {
// // Negative option is SI
// fvFormattedString(cUnit,output->cNeg);
// } else {
// *dTmp /= fdUnitsMass(units->iMass);
// fsUnitsMass(units->iMass,cUnit);
// }
fvFormattedString(cUnit,"");
}

void WriteIceBalanceTot(BODY *body, CONTROL *control, OUTPUT *output,
Expand Down Expand Up @@ -4186,6 +4180,7 @@ void WriteIceMass(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system,
if (output->bDoNeg[iBody]) {
fvFormattedString(cUnit, output->cNeg);
} else {
fvFormattedString(cUnit,"");
/* XXX Need to fix units!
*dTmp /= fdUnitsMass(units->iMass)/pow(fdUnitsLength(units->iLength),2);
fsUnitsMass(units->iMass,cUnit);
Expand Down Expand Up @@ -4239,6 +4234,8 @@ void WritePlanckBAvg(BODY *body, CONTROL *control, OUTPUT *output,
*dTmp = 0.0;
}

fvFormattedString(cUnit,"");

// if (output->bDoNeg[iBody]) {
// fvFormattedString(cUnit,output->cNeg);
// } else {
Expand Down Expand Up @@ -4277,6 +4274,7 @@ void WriteIceAccum(BODY *body, CONTROL *control, OUTPUT *output, SYSTEM *system,
*dTmp = 0.0;
}

fvFormattedString(cUnit,"");
// if (output->bDoNeg[iBody]) {
// fvFormattedString(cUnit,output->cNeg);
// } else {
Expand All @@ -4296,6 +4294,7 @@ void WriteIceAblate(BODY *body, CONTROL *control, OUTPUT *output,
*dTmp = 0.0;
}

fvFormattedString(cUnit,"");
// if (output->bDoNeg[iBody]) {
// fvFormattedString(cUnit,output->cNeg);
// } else {
Expand Down
71 changes: 71 additions & 0 deletions tests/Poise/SeasonalNC79Equatorial/equatorial.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
sName equatorial #name of planet
saModules poise #what vplanet modules you want to use
sGeography equitorial
dLandWaterLatitude 16.4

dMass 3.00316726e-06 #mass of planet
dRadius -1.00 #radius (not important right now)
dRotPeriod -1.00000 #rotation period (minus = days)
dObliquity 23.5
dSemi 1
dEcc 0.0 #eccentricity of orbit
dLongP 0 #pericenter, wrt Earth's position at spring equinox
# note that this is the typical value +180,
# since that one is solar position
dDynEllip 0.0 #shape of planet (0 = a sphere)
dPrecA 0.0 #orientation of spin axis

#_______addition disorb/distrot parameters (leave these alone for now)__________________
#dInc 5e-5 #inclination of orbit
#dLongA 348.73936 #orientation of orbital plane
#bGRCorr 0 #use GR correction (not important)
#bInvPlane 1 #convert to invariable plane coords
#bOverrideMaxEcc 1 #override max ecc halt (not recommended)
#dHaltMaxEcc 0.4 #eccentricity at which to halt simulation

#_______poise parameters (have fun with these!)_________________________________________
iLatCellNum 151 #number of latitude cells
sClimateModel sea #use seasonal or annual model
dTGlobalInit 14.85 #initial guess at average surface temp
iNumYears 4 #number of years (orbits) to run clim model
iNStepInYear 80 #number of steps to take in a "year"
#dSurfAlbedo 0.35 #average surface albedo (annual model only)

#__ice params_________
bIceSheets 1 #enable ice sheets
dInitIceLat 90. #how low do initial ice sheet extend?
dInitIceHeight 0. #height of initial ice sheets
dIceDepRate 2.25e-5 #rate of snow build up (when T < 0)
dIceAlbedo 0.6 #albedo of ice
iIceDt 1 #time step of ice-sheet model (orbits)
iReRunSeas 500 #how often to re-run seasonal model
bSeaIceModel 0 #use sea ice model (slow!)
bSkipSeasEnabled 0 #can skip seasonal if snowball state present

#__heat diffusion______
#bMEPDiff 1 #calculate diffusion using max entropy production
#bHadley 1 #mimic hadley heat diffusion
dDiffusion 0.58 #diffusion coefficient (fixed)
dNuLandWater 0.8 #Heat diffusion coefficient between Land and Water

#__outgoing flux_______
dPlanckA 203.3 #offset for OLR calculation (greenhouse)
dPlanckB 2.09 #slope of OLR calc (water vapor feedback)
bCalcAB 0 #calculate A & B from Kasting model fits
#dpCO2 0.00028 #partial pressure of co2

#__surface properties__
dAlbedoLand 0.363 #albedo of land
dAlbedoWater 0.263 #albedo of water
dHeatCapLand 1.55e7 #land heat capacity
dHeatCapWater 4.428e6 #water heat capacity
dMixingDepth 70 #mixing depth of ocean


#________output options!_____________________________________________
saOutputOrder Time PrecA -TGlobal AlbedoGlobal -FluxOutGlobal $
-TotIceMass -TotIceFlow -TotIceBalance DeltaTime AreaIceCov Snowball Obliq $
IceBeltLand IceBeltSea Ecce

saGridOutput Time -Latitude -TempLat AlbedoLat -AnnInsol -FluxIn -FluxOut IceMass -IceHeight DIceMassDt $
-IceFlow -BedrockH -TempMaxLat -TempMinLat -FluxMerid -DivFlux
9 changes: 9 additions & 0 deletions tests/Poise/SeasonalNC79Equatorial/sun.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# sun parameters
sName sun
dMass 1
dSemi 0
dEcc 0
dRadius 0.00135
dLuminosity -1
sStellarModel none #sun does not change over time
saModules stellar #use stellar module (needed for luminosity)
Loading

0 comments on commit 9d82317

Please sign in to comment.