Use different suffixes for the two ERI comparisons#4920
Use different suffixes for the two ERI comparisons#4920billsacks merged 3 commits intoESMCI:masterfrom
Conversation
Prior to this change, ERI cprnc.out files from the base-hybrid comparison are clobbered by the cprnc.out files from the base-rest comparison. This commit fixes this issue. Resolves ESMCI#4912
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4920 +/- ##
==========================================
- Coverage 36.72% 31.38% -5.35%
==========================================
Files 133 264 +131
Lines 19761 38869 +19108
Branches 4210 8260 +4050
==========================================
+ Hits 7258 12199 +4941
- Misses 11872 25430 +13558
- Partials 631 1240 +609 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
I have confirmed that, with my changes, ERI_Ld9_P8x1.f10_f10_mg37.I2000Clm50BgcCropQianRs.green_gnu.clm-default passes (as it did before - i.e., I didn't break the ERI test). And, in contrast to before, I now get separate cprnc.out files for the two sets of comparisons. I also confirmed that the ERI test still reports failures when it should: With this diff: diff --git a/src/biogeophys/TemperatureType.F90 b/src/biogeophys/TemperatureType.F90
index 58e4c93e7..ce6362067 100644
--- a/src/biogeophys/TemperatureType.F90
+++ b/src/biogeophys/TemperatureType.F90
@@ -933,6 +933,7 @@ subroutine Restart(this, bounds, ncid, flag, is_simple_buildtemp, is_prog_buildt
use abortutils , only : endrun
use ncdio_pio , only : file_desc_t, ncd_double, ncd_int
use restUtilMod
+ use clm_varctl , only : nsrest, nsrStartup, nsrContinue, nsrBranch
!
! !ARGUMENTS:
class(temperature_type) :: this
@@ -959,6 +960,10 @@ subroutine Restart(this, bounds, ncid, flag, is_simple_buildtemp, is_prog_buildt
long_name='vegetation temperature', units='K', &
interpinic_flag='interp', readvar=readvar, data=this%t_veg_patch)
+ if (nsrest == nsrContinue) then
+ this%t_veg_patch = this%t_veg_patch * 1.01_r8
+ end if
+
call restartvar(ncid=ncid, flag=flag, varname='T_STEM', xtype=ncd_double, &
dim1name='pft', &
long_name='stem temperature', units='K', &I get a failure in COMPARE_base_rest as expected and with this diff: diff --git a/src/biogeophys/TemperatureType.F90 b/src/biogeophys/TemperatureType.F90
index 58e4c93e7..ae468bd8d 100644
--- a/src/biogeophys/TemperatureType.F90
+++ b/src/biogeophys/TemperatureType.F90
@@ -933,6 +933,7 @@ subroutine Restart(this, bounds, ncid, flag, is_simple_buildtemp, is_prog_buildt
use abortutils , only : endrun
use ncdio_pio , only : file_desc_t, ncd_double, ncd_int
use restUtilMod
+ use clm_varctl , only : nsrest, nsrStartup, nsrContinue, nsrBranch
!
! !ARGUMENTS:
class(temperature_type) :: this
@@ -959,6 +960,10 @@ subroutine Restart(this, bounds, ncid, flag, is_simple_buildtemp, is_prog_buildt
long_name='vegetation temperature', units='K', &
interpinic_flag='interp', readvar=readvar, data=this%t_veg_patch)
+ if (nsrest == nsrBranch .and. flag == 'read') then
+ this%t_veg_patch = this%t_veg_patch * 1.01_r8
+ end if
+
call restartvar(ncid=ncid, flag=flag, varname='T_STEM', xtype=ncd_double, &
dim1name='pft', &
long_name='stem temperature', units='K', &I get a failure in COMPARE_hybrid_base, as expected |
|
I'll also note that I did a pretty detailed dive into the code to see if I would break anything by reordering the suffixes. Specifically, I looked for any asymmetries between the two suffixes. For the most part it looks like the two are treated symmetrically. But:
Based on this, I feel fine about swapping the suffixes in the ERI test. |
Previously it had a "base" suffix, which was vague for this test.
This way the cprnc output iles will be named with the test case rather than the control case, which is more intuitive.
|
@ekluzek and @mnlevy1981 - this is now ready for review. See the edited description in the top-level comment in this PR. I have redone the testing that I noted above with the latest version of this code to ensure that an ERI passes when it should and fails in the correct comparison step when it should. |
ekluzek
left a comment
There was a problem hiding this comment.
OK, I think this is good. I looked at it close enough that I could understand what's going on and it makes sense. I have two comments that you can close, that are just my thinking out loud.
In the first one, I suggest possibly labelling the suffix for the first case run (currently using suffix==None). It isn't compared to anything so doesn't matter, and I think it's pretty common for the first case to use None here. But, since there are so many cases run here, it seemed like it could be helpful to label it?
Your reasoning and testing all makes sense to me.
So approving.
mnlevy1981
left a comment
There was a problem hiding this comment.
This looks much clearer than what we had before!
Description
Prior to this change, ERI cprnc.out files from the base-hybrid comparison were clobbered by the cprnc.out files from the base-rest comparison. This PR fixes this issue. It also renames the comparison steps and the cprnc.out files to try to be more intuitive - labeling these cprnc.out files with the name of the case that's being tested, either "branch" (for the branch-vs-hybrid test) or "rest" (for the rest-vs-branch test). The phases are now named
COMPARE_branch_hybridandCOMPARE_rest_branch.Checklist