Skip to content

Commit

Permalink
Merge tag 'ctsm5.1.dev168' into merge-b4bdev-20240222
Browse files Browse the repository at this point in the history
Remove a case of negative snocan in CanopyFluxesMod to resolve ESCOMP#2366

One-line change that now includes "max(0._r8," to prevent negative
snocan in that part of the code.
  • Loading branch information
samsrabin committed Feb 22, 2024
2 parents 1200056 + e3e2e80 commit bf8a6bb
Show file tree
Hide file tree
Showing 5 changed files with 141 additions and 5 deletions.
6 changes: 3 additions & 3 deletions bld/namelist_files/namelist_defaults_ctsm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -484,9 +484,9 @@ attributes from the config_cache.xml file (with keys converted to upper-case).
<!-- The default filenames are given relative to the root directory
for the CLM2 data in the CESM distribution -->
<!-- Plant function types (relative to {csmdata}) -->
<paramfile phys="clm5_1" >lnd/clm2/paramdata/ctsm51_params.c240105.nc</paramfile>
<paramfile phys="clm5_0" >lnd/clm2/paramdata/clm50_params.c240105.nc</paramfile>
<paramfile phys="clm4_5" >lnd/clm2/paramdata/clm45_params.c240105.nc</paramfile>
<paramfile phys="clm5_1" >lnd/clm2/paramdata/ctsm51_params.c240207b.nc</paramfile>
<paramfile phys="clm5_0" >lnd/clm2/paramdata/clm50_params.c240207b.nc</paramfile>
<paramfile phys="clm4_5" >lnd/clm2/paramdata/clm45_params.c240207b.nc</paramfile>

<!-- ================================================================== -->
<!-- FATES default parameter file -->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
paramfile = '$DIN_LOC_ROOT/lnd/clm2/paramdata/ctsm51_ciso_cwd_hr_params.c240105.nc'
paramfile = '$DIN_LOC_ROOT/lnd/clm2/paramdata/ctsm51_ciso_cwd_hr_params.c240207b.nc'
hist_fincl1 = 'CWDC_HR','C13_CWDC_HR','C14_CWDC_HR','CWD_HR_L2','CWD_HR_L2_vr','CWD_HR_L3','CWD_HR_L3_vr'
133 changes: 133 additions & 0 deletions doc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,137 @@
===============================================================
Tag name: ctsm5.1.dev168
Originator(s): slevis (Samuel Levis,UCAR/TSS,303-665-1310)
Date: Fri 16 Feb 2024 01:27:41 PM MST
One-line Summary: Remove a source of negative snocan in CanopyFluxesMod

Purpose and description of changes
----------------------------------

In ctsm5.2 testing, this test
LWISO_Ld10.f10_f10_mg37.I2000Clm50BgcCrop.derecho_gnu.clm-coldStart
complained of a tiny negative ice1_grc tracer not matching the bulk
value. My troubleshooting led me to more than tiny negative snocan
originating in a line of code that this PR now changes to prevent
negative values.

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_1

[ ] clm5_0

[ ] ctsm5_0-nwp

[ ] clm4_5


Bugs fixed
----------
CTSM issues fixed (include CTSM Issue #):
Fixes #2366

Notes of particular relevance for developers:
---------------------------------------------
Caveats for developers (e.g., code that is duplicated that requires double maintenance):
It was suggested at the ctsm software meeting yesterday that, in addition to
including "max(0._r8," in this line of code, that I reorder the code
by bringing "liqcan(p) =" before "snocan(p) =". I have decided against this
because the existing order repeats in a following paragraph of code right
after this one. It's likely that the group's suggestion would have worked, but
I did not want to delay this PR for a longer evaluation because CTSM5.2 is
waiting for this merge, in order to proceed with next steps.


Testing summary:
----------------

regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing):

derecho ----- OK
izumi ------- OK


Answer changes
--------------

Changes answers relative to baseline: YES

Summarize any changes to answers, i.e.,
- what code configurations: all
- what platforms/compilers: all
- nature of change: roundoff
A short test, e.g.
SMS_Ln9.ne30pg2_ne30pg2_mg17.I1850Clm50Sp.derecho_intel.clm-clm50cam6LndTuningMode
has these maximum differences:
RMS H2OCAN 4.7359E-19 NORMALIZED 4.0163E-18
RMS SNOCAN 4.4873E-19 NORMALIZED 9.1036E-18
while the differences grow in longer tests.

Other details
-------------
Pull Requests that document the changes (include PR ids):
https://github.com/ESCOMP/ctsm/pull/2371

===============================================================
===============================================================
Tag name: ctsm5.1.dev167
Originator(s): samrabin (Sam Rabin, UCAR/TSS, [email protected])
Date: Thu 08 Feb 2024 01:56:05 PM MST
One-line Summary: Delete _FillValue and history from parameter files

Purpose and description of changes
----------------------------------

Updates parameter files to c240207b. These are the same as c240105 except:
- Attribute _FillValue has been removed from all variables
- Global attributes history, history_of_appended_files, and latest_git_log have been removed


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.)

[ ] clm5_1

[ ] clm5_0

[ ] ctsm5_0-nwp

[ ] clm4_5


Bugs fixed
----------

CTSM issues fixed (include CTSM Issue #):
- Fixes #2347


Testing summary:
----------------

regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing):

derecho ----- OK
izumi ------- OK


Other details
-------------

Pull Requests that document the changes (include PR ids):
- #2350: Delete _FillValue and history from parameter files (https://github.com/ESCOMP/CTSM/pull/2350)

===============================================================
===============================================================
Tag name: ctsm5.1.dev166
Originator(s): slevis (Samuel Levis,UCAR/TSS,303-665-1310), tking (Teagan King), samrabin (Sam Rabin)
Date: Wed 24 Jan 2024 05:39:41 PM MST
Expand Down
2 changes: 2 additions & 0 deletions doc/ChangeSum
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
Tag Who Date Summary
============================================================================================================================
ctsm5.1.dev168 slevis 02/16/2024 Remove a source of negative snocan in CanopyFluxesMod
ctsm5.1.dev167 samrabin 02/08/2024 Delete _FillValue and history from parameter files
ctsm5.1.dev166 multiple 01/24/2024 BFB merge tag
ctsm5.1.dev165 slevis 01/19/2024 Turn Meier2022, tillage, residue removal on for ctsm5.1, fix #2212
ctsm5.1.dev164 rgknox 01/17/2024 Compatibility and tests for FATES 2-Stream
Expand Down
3 changes: 2 additions & 1 deletion src/biogeophys/CanopyFluxesMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1605,7 +1605,8 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp,
if (t_veg(p) > tfrz ) then ! above freezing, update accumulation in liqcan
if ((qflx_evap_veg(p)-qflx_tran_veg(p))*dtime > liqcan(p)) then ! all liq evap
! In this case, all liqcan will evap. Take remainder from snocan
snocan(p)=snocan(p)+liqcan(p)+(qflx_tran_veg(p)-qflx_evap_veg(p))*dtime
snocan(p) = max(0._r8, &
snocan(p) + liqcan(p) + (qflx_tran_veg(p) - qflx_evap_veg(p)) * dtime)
end if
liqcan(p) = max(0._r8,liqcan(p)+(qflx_tran_veg(p)-qflx_evap_veg(p))*dtime)

Expand Down

0 comments on commit bf8a6bb

Please sign in to comment.