From 08e5a90e715a2134a82be20c79c7c9278a743c15 Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Tue, 29 Sep 2020 15:16:45 -0600 Subject: [PATCH 1/2] Fix issue#1163 --- src/biogeochem/CNPhenologyMod.F90 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/biogeochem/CNPhenologyMod.F90 b/src/biogeochem/CNPhenologyMod.F90 index eba25818c5..28c0ff99ec 100644 --- a/src/biogeochem/CNPhenologyMod.F90 +++ b/src/biogeochem/CNPhenologyMod.F90 @@ -772,7 +772,7 @@ subroutine CNSeasonDecidPhenology (num_soilp, filter_soilp , & ! if this is the end of the offset_period, reset phenology ! flags and indices - if (offset_counter(p) == 0.0_r8) then + if (offset_counter(p) < dt/2._r8) then ! this code block was originally handled by call cn_offset_cleanup(p) ! inlined during vectorization @@ -797,7 +797,7 @@ subroutine CNSeasonDecidPhenology (num_soilp, filter_soilp , & ! if this is the end of the onset period, reset phenology ! flags and indices - if (onset_counter(p) == 0.0_r8) then + if (onset_counter(p) < dt/2._r8) then ! this code block was originally handled by call cn_onset_cleanup(p) ! inlined during vectorization @@ -1092,7 +1092,7 @@ subroutine CNStressDecidPhenology (num_soilp, filter_soilp , & ! if this is the end of the offset_period, reset phenology ! flags and indices - if (offset_counter(p) == 0._r8) then + if (offset_counter(p) < dt/2._r8) then ! this code block was originally handled by call cn_offset_cleanup(p) ! inlined during vectorization offset_flag(p) = 0._r8 @@ -1113,7 +1113,7 @@ subroutine CNStressDecidPhenology (num_soilp, filter_soilp , & ! if this is the end of the onset period, reset phenology ! flags and indices - if (onset_counter(p) == 0.0_r8) then + if (onset_counter(p) < dt/2._r8) then ! this code block was originally handled by call cn_onset_cleanup(p) ! inlined during vectorization onset_flag(p) = 0._r8 @@ -2282,7 +2282,7 @@ subroutine CNOnsetGrowth (num_soilp, filter_soilp, & ! The transfer rate is a linearly decreasing function of time, ! going to zero on the last timestep of the onset period - if (onset_counter(p) == dt) then + if (abs(onset_counter(p) - dt) <= dt/2._r8) then t1 = 1.0_r8 / dt else t1 = 2.0_r8 / (onset_counter(p)) @@ -2427,7 +2427,7 @@ subroutine CNOffsetLitterfall (num_soilp, filter_soilp, & ! only calculate fluxes during offset period if (offset_flag(p) == 1._r8) then - if (offset_counter(p) == dt) then + if (abs(offset_counter(p) - dt) <= dt/2._r8) then t1 = 1.0_r8 / dt frootc_to_litter(p) = t1 * frootc(p) + cpool_to_frootc(p) From c072fa5c1dbf92a611b21e695729915ca3f7632d Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Wed, 30 Sep 2020 10:57:34 -0600 Subject: [PATCH 2/2] Update ChangeLog --- doc/.ChangeLog_template | 6 +- doc/ChangeLog | 127 ++++++++++++++++++++++++++++++++++++++++ doc/ChangeSum | 1 + 3 files changed, 131 insertions(+), 3 deletions(-) diff --git a/doc/.ChangeLog_template b/doc/.ChangeLog_template index 1e0dae6bd9..1a33e89e6d 100644 --- a/doc/.ChangeLog_template +++ b/doc/.ChangeLog_template @@ -101,9 +101,9 @@ Answer changes Changes answers relative to baseline: - If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section): - And always remove these three lines and parts that don't apply. + [ If a tag changes answers relative to baseline comparison the + following should be filled in (otherwise remove this section). + And always remove these three lines and parts that don't apply. ] Summarize any changes to answers, i.e., - what code configurations: diff --git a/doc/ChangeLog b/doc/ChangeLog index 419b9cc203..ef35c20835 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,131 @@ =============================================================== +Tag name: ctsm5.1.dev004 +Originator(s): oleson (Keith Oleson), sacks (Bill Sacks) +Date: Wed Sep 30 10:45:25 MDT 2020 +One-line Summary: Improve robustness of onset and offset counters when changing dt + +Purpose of changes +------------------ + +The logic in CNPhenology for onset_counter and offset_counter was not +robust when the model time step differed from the time step used to +generate the finidat file. This showed up when running with a 20-minute +time step using a finidat file that was generated with a 30-minute time +step. See https://github.com/ESCOMP/CTSM/issues/1163 for details. + +The fix here improves the situation significantly, but I believe still +leaves some issues remaining; see +https://github.com/ESCOMP/CTSM/issues/1167 for details. + + +Bugs fixed or introduced +------------------------ + +Issues fixed (include CTSM Issue #): +- Resolves ESCOMP/CTSM#1163 (onset_counter variable on (all?) restart + files is not compatible with subsequent model runs using a 20 minute + time step) + +Known bugs introduced in this tag (include github issue ID): +- ESCOMP/CTSM#1167 (Rework CNPhenology onset and offset triggers to be + more robust to changes in dt) + - This issue was not exactly introduced in this tag, but it captures + some things that I think still need to be done for complete robustness + +Significant changes to scientifically-supported configurations +-------------------------------------------------------------- + +Does this tag change answers significantly for any of the following physics configurations? +(Details of any changes will be given in the "Answer changes" section below.) + + [Put an [X] in the box for any configuration with significant answer changes.] + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): none + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): none + +Changes made to namelist defaults (e.g., changed parameter values): none + +Changes to the datasets (e.g., parameter, surface or initial files): none + +Substantial timing or memory changes: not checked (none expected) + +Notes of particular relevance for developers: (including Code reviews and testing) +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): none + +Changes to tests or testing: none + +CTSM testing: + + [PASS means all tests PASS and OK means tests PASS other than expected fails.] + + build-namelist tests: + + cheyenne - not run + + tools-tests (test/tools): + + cheyenne - not run + + PTCLM testing (tools/shared/PTCLM/test): + + cheyenne - not run + + python testing (see instructions in python/README.md; document testing done): + + (any machine) - not run + + regular tests (aux_clm): + + cheyenne ---- ok + izumi ------- pass + + ok: tests pass, one test had answer changes as noted below + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: YES, but in very limited circumstances + + Summarize any changes to answers, i.e., + - what code configurations: Only when the model run uses a different + time step than the initial conditions file + - what platforms/compilers: all + - nature of change (roundoff; larger than roundoff/same climate; new climate): + larger than roundoff; magnitude not investigated; in some cases, + the differences might be significant if the model actually + continues without aborting + + In the aux_clm test suite, this only appears in one test: + SMS_Ln9.ne30pg2_ne30pg2_mg17.I2000Clm50BgcCrop.cheyenne_intel.clm-clm50cam6LndTuningMode + + but it might appear more widely in cam / fully coupled testing + +Detailed list of changes +------------------------ + +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): none + +Pull Requests that document the changes (include PR ids): +https://github.com/ESCOMP/CTSM/pull/1165 + +=============================================================== +=============================================================== Tag name: ctsm5.1.dev003 Originator(s): ivanderkelen (Inne Vanderkelen) / sacks (Bill Sacks) Date: Tue Sep 29 10:16:00 MDT 2020 diff --git a/doc/ChangeSum b/doc/ChangeSum index 0be3fbeb78..5b86617538 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ + ctsm5.1.dev004 oleson 09/30/2020 Improve robustness of onset and offset counters when changing dt ctsm5.1.dev003 ivanderk 09/29/2020 Add capability for dynamic lakes ctsm5.1.dev002 slevis 09/25/2020 Reduce duplication between caps ctsm5.1.dev001 erik 09/23/2020 Start the clm5_1 physics series, with some changes to the fire model from Fang Li