Skip to content

Commit

Permalink
Merge pull request #1340 from slevisconsulting/premimics_refactor
Browse files Browse the repository at this point in the history
MIMICS-related refactor before introducing MIMICS
  • Loading branch information
ekluzek authored Jun 3, 2021
2 parents 448fa92 + a1186e3 commit 1e3cc27
Show file tree
Hide file tree
Showing 30 changed files with 1,044 additions and 1,327 deletions.
22 changes: 0 additions & 22 deletions bld/CLMBuildNamelist.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1645,11 +1645,6 @@ sub process_namelist_inline_logic {
#############################################
setup_logic_friction_vel($opts, $nl_flags, $definition, $defaults, $nl);

################################################
# namelist group: century_soilbgcdecompcascade #
################################################
setup_logic_century_soilbgcdecompcascade($opts, $nl_flags, $definition, $defaults, $nl);

#############################
# namelist group: cngeneral #
#############################
Expand Down Expand Up @@ -3621,23 +3616,6 @@ sub setup_logic_soilwater_movement {
}
#-------------------------------------------------------------------------------

sub setup_logic_century_soilbgcdecompcascade {
#
my ($opts, $nl_flags, $definition, $defaults, $nl) = @_;

if ( (&value_is_true($nl->get_value('use_cn')) || &value_is_true($nl->get_value('use_fates'))) &&
&value_is_true($nl->get_value('use_century_decomp')) ) {
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'initial_Cstocks',
'use_cn' => $nl->get_value('use_cn'), 'use_fates' => $nl->get_value('use_fates'),
'use_century_decomp' => $nl->get_value('use_century_decomp') );
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'initial_Cstocks_depth',
'use_cn' => $nl->get_value('use_cn'), 'use_fates' => $nl->get_value('use_fates'),
'use_century_decomp' => $nl->get_value('use_century_decomp') );
}
}

#-------------------------------------------------------------------------------

sub setup_logic_cnvegcarbonstate {
# MUST be AFTER: setup_logic_dynamic_plant_nitrogen_alloc as depends on mm_nuptake_opt which is set there
my ($opts, $nl_flags, $definition, $defaults, $nl) = @_;
Expand Down
20 changes: 3 additions & 17 deletions bld/namelist_files/namelist_defaults_ctsm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -483,9 +483,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.c210305.nc</paramfile>
<paramfile phys="clm5_0" >lnd/clm2/paramdata/clm50_params.c210217.nc</paramfile>
<paramfile phys="clm4_5" >lnd/clm2/paramdata/clm45_params.c210217.nc</paramfile>
<paramfile phys="clm5_1" >lnd/clm2/paramdata/ctsm51_params.c210528.nc</paramfile>
<paramfile phys="clm5_0" >lnd/clm2/paramdata/clm50_params.c210528.nc</paramfile>
<paramfile phys="clm4_5" >lnd/clm2/paramdata/clm45_params.c210528.nc</paramfile>

<!-- ================================================================== -->
<!-- FATES default parameter file -->
Expand Down Expand Up @@ -1422,20 +1422,6 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts
<leaf_mr_vcm phys="clm5_0" >0.015d00</leaf_mr_vcm>
<leaf_mr_vcm phys="clm4_5" >0.015d00</leaf_mr_vcm>

<!-- Initial Carbon stocks for BGC -->
<initial_Cstocks phys="clm4_5" use_cn=".true." use_fates=".false." use_century_decomp=".true." >20.0d00, 20.0d00, 20.0d00</initial_Cstocks>
<initial_Cstocks phys="clm5_0" use_cn=".true." use_fates=".false." use_century_decomp=".true." >200.0d00, 200.0d00, 200.0d00</initial_Cstocks>
<initial_Cstocks phys="clm5_1" use_cn=".true." use_fates=".false." use_century_decomp=".true." >200.0d00, 200.0d00, 200.0d00</initial_Cstocks>
<initial_Cstocks phys="clm4_5" use_cn=".false." use_fates=".true." use_century_decomp=".true." >20.0d00, 20.0d00, 20.0d00</initial_Cstocks>
<initial_Cstocks phys="clm5_0" use_cn=".false." use_fates=".true." use_century_decomp=".true." >200.0d00, 200.0d00, 200.0d00</initial_Cstocks>
<initial_Cstocks phys="clm5_1" use_cn=".false." use_fates=".true." use_century_decomp=".true." >200.0d00, 200.0d00, 200.0d00</initial_Cstocks>

<initial_Cstocks_depth phys="clm5_1" use_cn=".true." use_fates=".false." use_century_decomp=".true." >1.50d00</initial_Cstocks_depth>
<initial_Cstocks_depth phys="clm5_0" use_cn=".true." use_fates=".false." use_century_decomp=".true." >1.50d00</initial_Cstocks_depth>
<initial_Cstocks_depth phys="clm4_5" use_cn=".true." use_fates=".false." use_century_decomp=".true." >0.3</initial_Cstocks_depth>
<initial_Cstocks_depth phys="clm5_1" use_cn=".false." use_fates=".true." use_century_decomp=".true." >1.50d00</initial_Cstocks_depth>
<initial_Cstocks_depth phys="clm5_0" use_cn=".false." use_fates=".true." use_century_decomp=".true." >1.50d00</initial_Cstocks_depth>
<initial_Cstocks_depth phys="clm4_5" use_cn=".false." use_fates=".true." use_century_decomp=".true." >0.3</initial_Cstocks_depth>

<initial_vegC phys="clm5_1" use_cn=".true." mm_nuptake_opt=".true." >100.d00</initial_vegC>
<initial_vegC phys="clm5_0" use_cn=".true." mm_nuptake_opt=".true." >100.d00</initial_vegC>
Expand Down
10 changes: 0 additions & 10 deletions bld/namelist_files/namelist_definition_ctsm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -306,16 +306,6 @@ Critical threshold of negative Nitrogen to die (abort when Nitrogen states are b
Critical threshold of negative Carbon to die (abort when Carbon states are below this value)
</entry>

<entry id="initial_Cstocks" type="real(3)" category="clm_physics"
group="century_soilbgcdecompcascade" >
Initial stocks of Carbon to use in soil organic matter pools for CENTURY decomposition
</entry>

<entry id="initial_Cstocks_depth" type="real(3)" category="clm_physics"
group="century_soilbgcdecompcascade" >
Soil depth to place initial stocks of Carbon in soil organic matter pools for CENTURY decomposition
</entry>

<entry id="freelivfix_slope_wET" type="real" category="clm_physics"
group="mineral_nitrogen_dynamics" >
Slope of free living Nitrogen fixation with annual ET
Expand Down
42 changes: 42 additions & 0 deletions cime_config/testdefs/ExpectedTestFails.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,48 @@
</phase>
</test>

<test name="ERP_D_Ld9.f19_g17.I2000Clm50Cn.cheyenne_intel.clm-drydepnomegan"
<phase name="RUN">
<status>FAIL</status>
<issue>#1356</issue>
</phase>
</test>

<test name="ERP_P36x2_D_Ld5.f10_f10_mg37.I1850Clm45Cn.cheyenne_intel.clm-default">
<phase name="RUN">
<status>FAIL</status>
<issue>#1356</issue>
</phase>
</test>

<test name="ERP_P36x2_D_Ld5.f10_f10_mg37.I2000Clm50Cn.cheyenne_gnu.clm-default">
<phase name="RUN">
<status>FAIL</status>
<issue>#1356</issue>
</phase>
</test>

<test name="ERP_P36x2_D_Ld5.f10_f10_mg37.I2000Clm50Cn.cheyenne_intel.clm-default"
<phase name="RUN">
<status>FAIL</status>
<issue>#1356</issue>
</phase>
</test>

<test name="SMS.f19_g17.I2000Clm50Cn.cheyenne_intel.clm-default">
<phase name="RUN">
<status>FAIL</status>
<issue>#1356</issue>
</phase>
</test>

<test name="SMS_D_Ld1.f19_g17.I1850Clm45Cn.izumi_gnu.clm-default">
<phase name="RUN">
<status>FAIL</status>
<issue>#1356</issue>
</phase>
</test>

<!-- fates test suite failures -->

<test name="ERS_Ld60.f45_f45_mg37.I2000Clm45Fates.hobart_nag.clm-Fates">
Expand Down
107 changes: 107 additions & 0 deletions doc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,111 @@
===============================================================
Tag name: ctsm5.1.dev043
Originator(s): slevis/ekluzek (Samuel Levis,SLevis Consulting,303-665-1310)
Date: Thu Jun 3 17:14:30 MDT 2021
One-line Summary: Refactor in preparation for MIMICS

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

Refactor aspects of the CTSM in preparation for our introduction of
MIMICS, which has started in #1318 .


Significant changes to scientifically-supported configurations
--------------------------------------------------------------

Does this tag change answers significantly for any of the following physics configurations? NO
(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 or introduced
------------------------
Known bugs introduced in this tag (include issue #): #1356, #1392
#1356 -- CN is no longer just deprecated it breaks when you try to use it
#1392 -- Some soil decomposition history fields have the pool number rather than a descr.

Notes of particular relevance for users
---------------------------------------
Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables):
Moved initial_Cstocks_depth_bgc and initial_Cstocks_bgc from the
namelist to the params file. Also renamed tau_cwd to tau_cwd_bgc and
k_frag to k_frag_cn in the params file according to the models that use
these parameters.

Changes made to namelist defaults (e.g., changed parameter values):
initial_Cstocks_depth_bgc and initial_Cstocks_bgc are not namelist
variables anymore.

Changes to the datasets (e.g., parameter, surface or initial files):
There are new params files for clm45, clm50, and ctsm51.

Substantial timing or memory changes:
FAIL PFS_Ld20.f09_g17.I2000Clm50BgcCrop.cheyenne_intel MEMCOMP Error: Memory usage increase > 10% from baseline
Throughput doesn't seem to change. There might be an increase in memory as it's indicated for 20 tests.
And some arrays were changed to add an extra dimension.

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

[PASS means all tests PASS; OK means tests PASS other than expected fails.]

build-namelist tests (if CLMBuildNamelist.pm has changed):

cheyenne - PASS (785 tests are different because of new params files and removed namelist items)

python testing (if python code has changed; see instructions in python/README.md; document testing done):

cheyenne - PASS

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

cheyenne ---- OK (read above in "bugs introduced" about CN failures)
izumi ------- OK (read below in "other testing" about pgi failures)

any other testing (give details below):
Two unexpected tests fail on izumi, so I performed additional testing.
The tests that fail:
1) SMS_D.f10_f10_mg37.I2000Clm51BgcCrop.izumi_pgi.clm-crop
BASELINE ctsm5.1.dev042: DIFF roundoff
2) SMS.f10_f10_mg37.I2000Clm50BgcCrop.izumi_pgi.clm-crop
BASELINE ctsm5.1.dev042: DIFF greater than roundoff for CH4-related vars
I confirmed same result with my earlier commit against BASELINE dev033.

Same tests but with gnu/intel instead of pgi pass on izumi for both
comparisons to dev042 and to dev033. These tests are part of the izumi
test-suite already.

Additional testing:
Repeated these gnu/intel tests (had to run for baseline first) on cheyenne
and they passed.

If the tag used for baseline comparisons was NOT the previous tag, note that here:


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

Changes answers relative to baseline: NO


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

Pull Requests that document the changes (include PR ids):
https://github.com/ESCOMP/CTSM/pull/1340

===============================================================
===============================================================
Tag name: ctsm5.1.dev042
Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326)
Date: Fri May 28 14:07:45 MDT 2021
Expand Down
1 change: 1 addition & 0 deletions doc/ChangeSum
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Tag Who Date Summary
============================================================================================================================
ctsm5.1.dev043 slevis 06/03/2021 Refactor of CascadeBGC code in preparation for MIMICS
ctsm5.1.dev042 erik 05/28/2021 Small answer changes for double precision constants and soil limits
ctsm5.1.dev041 rgknox 05/27/2021 bring FATES API up to sci.1.46.0_api.16.0.0 (methane and cn hooks)
ctsm5.1.dev040 slevis 05/20/2021 mksurfdata_map: replace SRC files of various masks with SRC files w no mask
Expand Down
2 changes: 1 addition & 1 deletion src/biogeochem/CNC14DecayMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module CNC14DecayMod
! !USES:
use shr_kind_mod , only : r8 => shr_kind_r8
use clm_time_manager , only : get_step_size_real, get_days_per_year
use clm_varpar , only : ndecomp_cascade_transitions, nlevdecomp, ndecomp_pools
use clm_varpar , only : nlevdecomp, ndecomp_pools
use clm_varcon , only : secspday
use clm_varctl , only : spinup_state
use decompMod , only : bounds_type
Expand Down
Loading

0 comments on commit 1e3cc27

Please sign in to comment.