Skip to content

Commit

Permalink
Merge pull request #1318 from slevisconsulting/vert_res_in_mimics
Browse files Browse the repository at this point in the history
MIMICS into vertically resolved CTSM
  • Loading branch information
ekluzek authored Feb 2, 2022
2 parents 0b5d7e0 + be14cd1 commit 8d9f988
Show file tree
Hide file tree
Showing 44 changed files with 2,120 additions and 243 deletions.
6 changes: 2 additions & 4 deletions bld/CLMBuildNamelist.pm
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ OPTIONS
sp = Satellite Phenology (SP)
This toggles off the namelist variable: use_cn
bgc = Carbon Nitrogen with methane, nitrification, vertical soil C,
CENTURY decomposition
CENTURY or MIMICS decomposition
This toggles on the namelist variables:
use_cn, use_lch4, use_nitrif_denitrif
fates = FATES/Ecosystem Demography with below ground BGC
Expand Down Expand Up @@ -852,7 +852,6 @@ sub setup_cmdl_bgc {
$log->fatal_error("The namelist variable use_fates is inconsistent with the -bgc option");
}


# Now set use_cn and use_fates
foreach $var ( "use_cn", "use_fates" ) {
$val = $nl_flags->{$var};
Expand All @@ -876,7 +875,7 @@ sub setup_cmdl_bgc {
$log->fatal_error("$var must NOT be None if use_cn or use_fates are on");
}
} elsif ( $soil_decomp_method ne "None" ) {
$log->fatal_error("$var must be None if use_cn or use_fates are not");
$log->fatal_error("$var must be None if use_cn and use_fates are off");
}
#
# Soil decomposition control variables, methane and Nitrification-Denitrification
Expand Down Expand Up @@ -2825,7 +2824,6 @@ sub setup_logic_bgc_shared {
if ( $nl_flags->{'bgc_mode'} ne "sp" ) {
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'constrain_stress_deciduous_onset', 'phys'=>$physv->as_string() );
}
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'decomp_depth_efolding', 'phys'=>$physv->as_string() );
}

#-------------------------------------------------------------------------------
Expand Down
13 changes: 4 additions & 9 deletions bld/namelist_files/namelist_defaults_ctsm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -481,9 +481,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.c210923.nc</paramfile>
<paramfile phys="clm5_0" >lnd/clm2/paramdata/clm50_params.c210803.nc</paramfile>
<paramfile phys="clm4_5" >lnd/clm2/paramdata/clm45_params.c210803.nc</paramfile>
<paramfile phys="clm5_1" >lnd/clm2/paramdata/ctsm51_params.c211112.nc</paramfile>
<paramfile phys="clm5_0" >lnd/clm2/paramdata/clm50_params.c211112.nc</paramfile>
<paramfile phys="clm4_5" >lnd/clm2/paramdata/clm45_params.c211112.nc</paramfile>

<!-- ================================================================== -->
<!-- FATES default parameter file -->
Expand Down Expand Up @@ -566,11 +566,6 @@ attributes from the config_cache.xml file (with keys converted to upper-case).
<onset_thresh_depends_on_veg >.false.</onset_thresh_depends_on_veg>
<min_critical_dayl_method >Constant</min_critical_dayl_method>

<!-- turnover time modifications -->
<decomp_depth_efolding phys="clm4_5" >0.5</decomp_depth_efolding>
<decomp_depth_efolding phys="clm5_0" >10.0</decomp_depth_efolding>
<decomp_depth_efolding phys="clm5_1" >10.0</decomp_depth_efolding>

<!-- use additional stress deciduous onset trigger -->
<constrain_stress_deciduous_onset phys="clm4_5" >.false.</constrain_stress_deciduous_onset>
<constrain_stress_deciduous_onset phys="clm5_0" >.true.</constrain_stress_deciduous_onset>
Expand Down Expand Up @@ -2535,7 +2530,7 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts
>lnd/clm2/paramdata/finundated_inversiondata_0.9x1_ESMFmesh_cdf5_130621.nc</stream_meshfile_ch4finundated>

<!-- ========================================= -->
<!-- Defaults for different BGC modes -->
<!-- Defaults for different BGC/decomp modes -->
<!-- ========================================= -->

<soil_decomp_method use_cn=".true." >CENTURYKoven2013</soil_decomp_method>
Expand Down
9 changes: 2 additions & 7 deletions bld/namelist_files/namelist_definition_ctsm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2127,12 +2127,6 @@ Base advective flux (downwards) for SOM.
Maximum depth to mix soils to by croturbation, in permafrost soils.
</entry>

<!-- turnover time modifications -->
<entry id="decomp_depth_efolding" type="real" category="clm_vertcn"
group="bgc_shared" valid_values="" >
E-folding depth over which decomposition is slowed with depth in all soils.
</entry>

<entry id="anoxia" type="logical" category="clm_vertcn"
group="clm_inparm" valid_values="" >
If TRUE, reduce heterotrophic respiration according to available oxygen predicted by CH4 submodel.
Expand Down Expand Up @@ -2169,10 +2163,11 @@ Number of days over which to use exponential relaxation of NPP in N fixation cal

<!-- Soil decomposition options -->
<entry id="soil_decomp_method" type="char*20" category="clm_physics"
group="soilbgc_decomp" valid_values="None,CENTURYKoven2013" >
group="soilbgc_decomp" valid_values="None,CENTURYKoven2013,MIMICSWieder2015" >
Soil decomposition method
None -- No soil decomposition is done
CENTURYKoven2013 -- CENTURY model in CTSM from Koven et. al. 2013
MIMICSWieder2015 -- MIMICS model in CTSM from Wieder et. al. 2015

An active soil decomposition method requires the BGC or FATES model to work
And both BGC and FATES models require an active soil decomposition model
Expand Down
27 changes: 27 additions & 0 deletions cime_config/testdefs/testlist_clm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,33 @@
<option name="wallclock">00:20:00</option>
</options>
</test>
<test name="ERP_D_P36x2_Ld3" grid="f10_f10_mg37" compset="I1850Clm51BgcCrop" testmods="clm/mimics">
<machines>
<machine name="cheyenne" compiler="gnu" category="aux_clm"/>
</machines>
<options>
<option name="wallclock">00:20:00</option>
<option name="comment" >Test soil_decomp_method = 'MIMICSWieder2015'</option>
</options>
</test>
<test name="SMS_Ld5_Mmpi-serial" grid="1x1_brazil" compset="IHistClm50BgcQianRs" testmods="clm/mimics">
<machines>
<machine name="izumi" compiler="gnu" category="aux_clm"/>
</machines>
<options>
<option name="wallclock">00:20:00</option>
<option name="comment" >Test soil_decomp_method = 'MIMICSWieder2015'</option>
</options>
</test>
<test name="SMS_Ly5_Mmpi-serial" grid="1x1_brazil" compset="IHistClm50BgcQianRs" testmods="clm/newton_krylov_spinup">
<machines>
<machine name="cheyenne" compiler="intel" category="aux_clm"/>
</machines>
<options>
<option name="wallclock">00:20:00</option>
<option name="comment" >Test soil_decomp_method = 'MIMICSWieder2015'</option>
</options>
</test>
<test name="ERP_D_P36x2_Ld3" grid="f10_f10_mg37" compset="I2000Clm50BgcCru" testmods="clm/flexCN_FUN">
<machines>
<machine name="cheyenne" compiler="intel" category="aux_clm"/>
Expand Down
2 changes: 1 addition & 1 deletion cime_config/testdefs/testmods_dirs/clm/ciso_cwd_hr/README
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
This points to an alternate params file with
rf_cwdl2_bgc = 0.5
rf_cwdl2 = 0.5
rf_cwdl3_bgc = 0.5
while by default these parameters equal zero.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
paramfile = '/glade/p/cesm/cseg/inputdata/lnd/clm2/paramdata/ctsm51_params.c210827.nc'
paramfile = '/glade/p/cesm/cseg/inputdata/lnd/clm2/paramdata/ctsm51_ciso_cwd_hr_params.c211112.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'
6 changes: 6 additions & 0 deletions cime_config/testdefs/testmods_dirs/clm/mimics/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
This test mod turns on the MIMICS instead of the CENTURY below-ground
biogeochemistry.

As of 2021/11/15 this test inherits mods from the ../coldStart directory;
however the plan is to change that to ../default when we have an acceptable
spun up finidat file to initialize MIMICS with.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
../coldStart
1 change: 1 addition & 0 deletions cime_config/testdefs/testmods_dirs/clm/mimics/user_nl_clm
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
soil_decomp_method = 'MIMICSWieder2015'
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
slevis 2022/2/1:
This testmod tests the newton_krylov_spinup usermod found in
cime_config/usermods_dirs/newton_krylov_spinup
combined with the mimics testmod.

By default this usermod runs for 20 yrs and writes a history file at that
time. To save time running the test-suite, we're changing
hist_nhtfrq = 0,-43800 (from 0,-175200)
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
../mimics
../../../../usermods_dirs/newton_krylov_spinup
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hist_nhtfrq = 0,-43800
4 changes: 4 additions & 0 deletions cime_config/usermods_dirs/newton_krylov_spinup/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
user_nl_clm contains this line:
hist_nhtfrq = 0,-175200
0 means monthly history frequency and
-175200 means 20 years history frequency (indicated in hours)
3 changes: 3 additions & 0 deletions cime_config/usermods_dirs/newton_krylov_spinup/shell_commands
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
./xmlchange CLM_FORCE_COLDSTART="on"

15 changes: 15 additions & 0 deletions cime_config/usermods_dirs/newton_krylov_spinup/user_nl_clm
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
hist_dov2xy = .true.,.false.
hist_nhtfrq = 0,-175200
hist_mfilt = 1,1
hist_fincl2 = 'FPI_vr', 'K_PAS_SOM', 'K_SLO_SOM', 'K_ACT_SOM',
'K_CWD', 'K_CEL_LIT', 'K_LIG_LIT', 'K_MET_LIT',
'CWD_PATHFRAC_L2_vr', 'CWD_RESP_FRAC_L2_vr',
'CWD_PATHFRAC_L3_vr', 'CWD_RESP_FRAC_L3_vr',
'L1_PATHFRAC_S1_vr', 'L1_RESP_FRAC_S1_vr',
'L2_PATHFRAC_S1_vr', 'L2_RESP_FRAC_S1_vr',
'L3_PATHFRAC_S2_vr', 'L3_RESP_FRAC_S2_vr',
'S1_PATHFRAC_S2_vr', 'S1_RESP_FRAC_S2_vr'
'S1_PATHFRAC_S3_vr', 'S1_RESP_FRAC_S3_vr'
'S2_PATHFRAC_S1_vr', 'S2_RESP_FRAC_S1_vr'
'S2_PATHFRAC_S3_vr', 'S2_RESP_FRAC_S3_vr'
'S3_PATHFRAC_S1_vr', 'S3_RESP_FRAC_S1_vr'
114 changes: 114 additions & 0 deletions doc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,118 @@
===============================================================
Tag name: ctsm5.1.dev074
Originator(s): slevis (Samuel Levis,SLevis Consulting,303-665-1310)
Date: Wed Feb 2 00:44:27 MST 2022
One-line Summary: Introduce vert. resolved MIMICS as new method to solve below ground decomp.

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

Introducing new option to solve below ground decomposition: MIMICSWieder2015.
The old option (CENTURYKoven2013) remains available. User will select one or
the other via the namelist variable soil_decomp_method.

Elin's MIMICS+ github issue relates: #1260.
MIMICS spinup issues relate and are listed in caveats for users.


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 or introduced
------------------------
Issues fixed (include CTSM Issue #):
#1473 : decomp_depth_efolding appears (with the same value) in the namelist
and the params files; the model ends up using the one from the namelist


Notes of particular relevance for users
---------------------------------------
Caveats for users (e.g., need to interpolate initial conditions):
MIMICS spinup method is in development
Issues related to spinup
#1451 -- MIMICS spinup
#1455 -- Additional history output for Newton-Krylov spinup
#1457 -- Adding history variables for Newton-Krylov spinup

Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables):
New option MIMICSWieder2015 for use with namelist variable soil_decomp_method
decomp_depth_efolding removed as values on param files was already being used

Changes to the datasets (e.g., parameter, surface or initial files):
CLM parameter files now include new MIMICS-related parameters prefixed with
mimics_. Existing CENTURYKoven-specific parameters were renamed to include the
prefix bgc_. Parameters used by both CENTURYKoven2013 and MIMICSWieder2015 have
neither prefix.

Substantial timing or memory changes:
Timing comparison between CENTURYKoven (BGC for short) and MIMICSWieder:
In a 1x1_brazil test writing annual output and restarts every 10 yrs,
BGC took ~2.8 hrs/100 yrs, MIMICS took ~3.6 hrs/100 yrs.

More timing comparisons shown here:
https://github.com/ESCOMP/CTSM/pull/1318#issuecomment-1008211485

Notes of particular relevance for developers:
---------------------------------------------
Changes to tests or testing:
New test-suite tests:
ERP_D_P36x2_Ld3.f10_f10_mg37.I1850Clm51BgcCrop.cheyenne_gnu.clm-mimics
SMS_Ld5_Mmpi-serial.1x1_brazil.IHistClm50BgcQianRs.izumi_gnu.clm-mimics
SMS_Ly5_Mmpi-serial.1x1_brazil.IHistClm50BgcQianRs.cheyenne_intel.clm-newton_krylov_spinup

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 (831 tests are different from baseline because of new param files)

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

cheyenne ---- OK (black test fails)

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

cheyenne ---- PASS
izumi ------- OK (see one answer change below)


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

Changes answers relative to baseline: NO (almost)

One test in the izumi test-suite fails
SMS_Vmct.f10_f10_mg37.I2000Clm50BgcCrop.izumi_pgi.clm-crop
and this is due to diffs from baseline (dev073).
cprnc.out shows diffs only in one variable:
RMS TOTECOSYSC 1.9853E-12 NORMALIZED 6.5087E-17


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

Pull Requests that document the changes (include PR ids):
https://github.com/ESCOMP/ctsm/pull/1318 -- MIMICS into vertically resolved CTSM

===============================================================
===============================================================
Tag name: ctsm5.1.dev073
Originator(s): sacks (Bill Sacks)
Date: Tue Jan 25 16:33:06 MST 2022
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.dev074 slevis 02/02/2022 Introduce vert. resolved MIMICS as new method to solve below ground decomp.
ctsm5.1.dev073 sacks 01/25/2022 Some fixes for Gregorian calendar
ctsm5.1.dev072 negins 01/17/2022 mksurfdat toolchain part 1: gen_mksurf_namelist
ctsm5.1.dev071 glemieux 01/16/2022 Small changes to enable new fates dimension and update fates tag
Expand Down
4 changes: 2 additions & 2 deletions src/biogeochem/CNBalanceCheckMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ subroutine CBalanceCheck(this, bounds, num_soilc, filter_soilc, &
do g = bounds%begg, bounds%endg
! calculate gridcell-level carbon storage for mass conservation check
! Notes:
! totgrcc = totcolc = totc_p2c_col(c) + soilbiogeochem_cwdc_col(c) + soilbiogeochem_totlitc_col(c) + soilbiogeochem_totsomc_col(c) + soilbiogeochem_ctrunc_col(c)
! totgrcc = totcolc = totc_p2c_col(c) + soilbiogeochem_cwdc_col(c) + soilbiogeochem_totlitc_col(c) + soilbiogeochem_totmicc_col(c) + soilbiogeochem_totsomc_col(c) + soilbiogeochem_ctrunc_col(c)
! totc_p2c_col = totc_patch = totvegc_patch(p) + xsmrpool_patch(p) + ctrunc_patch(p) + cropseedc_deficit_patch(p)
! Not including seedc_grc in grc_begcb and grc_endcb because
! seedc_grc forms out of thin air, for now, and equals
Expand Down Expand Up @@ -540,7 +540,7 @@ subroutine NBalanceCheck(this, bounds, num_soilc, filter_soilc, &
write(iulog,*)'output mass = ',col_noutputs(c)*dt
write(iulog,*)'net flux = ',(col_ninputs(c)-col_noutputs(c))*dt
write(iulog,*)'inputs,ffix,nfix,ndep = ',ffix_to_sminn(c)*dt,nfix_to_sminn(c)*dt,ndep_to_sminn(c)*dt
write(iulog,*)'outputs,ffix,nfix,ndep = ',smin_no3_leached(c)*dt, smin_no3_runoff(c)*dt,f_n2o_nit(c)*dt
write(iulog,*)'outputs,lch,roff,dnit = ',smin_no3_leached(c)*dt, smin_no3_runoff(c)*dt,f_n2o_nit(c)*dt
call endrun(subgrid_index=c, subgrid_level=subgrid_level_column, msg=errMsg(sourcefile, __LINE__))
end if

Expand Down
Loading

0 comments on commit 8d9f988

Please sign in to comment.