MPAS-Dev / MPAS

Repository for private MPAS development prior to the MPAS v6.0 release.
Other
4 stars 0 forks source link

One more salinity restoring fix #1494

Closed mark-petersen closed 6 years ago

mark-petersen commented 6 years ago

It turns out that the previous "salinity restoring fix" (PR #1491) missed a few things, corrected here:

  1. I used landIceMask without checking if it is associated. I added an if-statement check for that. I put the if statements on the outside, and repeated iCell loops on the inside. This repeats some lines, but avoids ifs within an iCell loop.

  2. The firstTimeStep section does not yet have access to the activeTracersPistonVelocity variable, resulting in "invalid memory reference" error. I removed that. Instead, I use the scalar value from config_salinity_restoring_constant_piston_velocity directly. This makes more sense because it reduces memory access to activeTracersPistonVelocity(iTracer,iCell), and that flag is designed to be a single global variable anyway.

mark-petersen commented 6 years ago

When I use this PR in E3SM it passes:

PET_Ln9.T62_oEC60to30v3.GMPAS-IAF.cori-knl_intel
PET_Ln9.T62_oEC60to30v3.GMPAS-IAF.cori-knl_gnu
PEM_Ln9.T62_oEC60to30v3.GMPAS-IAF.cori-knl_intel

and it didn't pass those before this PR.

mark-petersen commented 6 years ago

I also get bfb match on EC60to30 with land ice between the head of this PR and the images @vanroekel added here on previous PR: https://github.com/MPAS-Dev/MPAS/pull/1491#issuecomment-361754835 Here is ncdiff for reference:

cori08:cori-knl$ pwd
/global/cscratch1/sd/mpeterse/acme_scratch/cori-knl
cori08:cori-knl$ ncdiff -v timeMonthly_avg_salinitySurfaceRestoringTendency a25f/run/mpaso.hist.am.timeSeriesStatsMonthly.0001-02-01.nc a25h/run/mpaso.hist.am.timeSeriesStatsMonthly.0001-02-01.nc ncdiff_a25f_a25h_salinitySurfaceRestoringTendency.nc
xylar commented 6 years ago

@mark-petersen, to be clear, does this eliminate the ability to have a piston velocity that varies with space, supplied as part of the initial condition? If so, I think that might break some test cases (notably ISOMIP+) where I think I use salinity restoring with variable piston velocity. I'll double check.

xylar commented 6 years ago

Okay, looks good to me as well.

mark-petersen commented 6 years ago

I clarified the variable descriptions. Ran a G case test with land ice on the head here. All looks good. Light contours show ice fraction. screen shot 2018-02-06 at 7 51 28 am