Skip to content

Commit 6d4e9d0

Browse files
committed
Merge branch 'dev_14_15_to_release' into release-clm5.0
From dev014 & dev015: CMIP6 compset modifiers, output usermods & fixes Bring in all changes from ctsm1.0.dev014 and ctsm1.0.dev015: From ctsm1.0.dev015: (1) Support %BGC-CROP-CMIP6DECK and %BGC-CROP-CMIP6WACCMDECK compset modifiers, so that we can turn on the necessary options (output-related and others) via new CMIP6-specific compsets. (2) Turn on carbon isotopes in CMIP6 runs (from Erik Kluzek) (3) Remove setting of CCSM_BGC=CO2A in the cmip6 usermods (4) Add usermods directories for getting typical extra output that's wanted in many cases: output_crop, output_crop_highfreq, output_bgc, output_bgc_highfreq, output_sp, and output_sp_highfreq. These can be enabled by adding something like '--user-mods-dir output_crop' on the create_newcase line (that short-hand works for an I compset; for F or B compsets, you need to provide the full path to the usermod directory). (4) Allow holes in the number of history tapes. Holes are cases where, for example, we have h0, h1 and h3 tapes, but no h2 tape (because there are no fields on the h2 tape). (This is needed for (3).) (5) Fix reading and writing of 1-d logical global arrays. This fixes #24 for real (rather than just preventing an attempt to read/write 1-d logical arrays, as was done in the previous 'fix'). (6) Add C13_NBP and C14_NBP diagnostic fields (from Keith Oleson) (7) Make a bunch of carbon isotope diagnostic fields inactive by default (8) Don't allow interpolation (use_init_interp) from a case without carbon isotopes to a case with carbon isotopes: Due to #67, interpolation from a case without carbon isotopes to a case with carbon isotopes yields incorrect initialization values for the carbon isotopes. Now that we're turning carbon isotopes on via some semi-out-of-the-box usermods (for cmip6), it is becoming more important to check to make sure someone doesn't shoot themselves in the foot this way. (9) Add tests of the new output usermods as well as of the CMIP6 compset modifiers From ctsm1.0.dev014: Four miscellaneous minor, bit-for-bit bug fixes: (1) Py3 pylint check and address cime issue ESMCI/cime#2822 (from Jim Edwards: #526) (2) Change uppercase DEBUG variables to lowercase debug (requested by Jim Edwards to avoid conflicting with the DEBUG CPP token) (Fixes #534) (3) Remove unnecessary line of code in LunaMod.F90 that was causing problems with some compilers due to an uninitialized variable (Fixes #322) (4) Add r8 to 0 constant to fix build issue with XLF compiler (from Jim Edwards: #531)
2 parents 86d298f + 0c8bc02 commit 6d4e9d0

File tree

75 files changed

+1289
-281
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+1289
-281
lines changed

bld/namelist_files/namelist_definition_clm4_5.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1973,6 +1973,16 @@ Flag to use the atmospheric time series of C13 concentrations from natural abund
19731973
Filename with time series of atmospheric Delta C13 data, which use CMIP6 format. variables in file are "time" and "delta13co2_in_air". time variable is in format: years since 1850-01-01 0:0:0.0. units are permil.
19741974
</entry>
19751975

1976+
<!-- BUG(wjs, 2018-10-25, ESCOMP/ctsm#67) -->
1977+
<entry id="for_testing_allow_interp_non_ciso_to_ciso" type="logical" category="clm_isotope"
1978+
group="clm_inparm" valid_values="" >
1979+
There is a bug that causes incorrect values for C isotopes if running
1980+
init_interp from a case without C isotopes to a case with C isotopes
1981+
(https://github.com/ESCOMP/ctsm/issues/67). Normally, an error-check
1982+
prevents you from doing this interpolation (until we have fixed that
1983+
bug). However, we sometimes want to bypass this error-check in system
1984+
tests. This namelist flag bypasses this error-check.
1985+
</entry>
19761986

19771987
<!-- permfrost-specific flags -->
19781988

cime_config/buildlib

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""
44
build clm library
55
"""
6-
import sys, os, time, filecmp, shutil, imp
6+
import sys, os, shutil, imp
77

88
_CIMEROOT = os.environ.get("CIMEROOT")
99
if _CIMEROOT is None:

cime_config/buildnml

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""
44
CLM namelist creator
55
"""
6-
import sys, os, time, shutil, re, imp, filecmp
6+
import sys, os, shutil, imp, filecmp
77

88
_CIMEROOT = os.environ.get("CIMEROOT")
99
if _CIMEROOT is None:
@@ -46,7 +46,6 @@ def buildnml(case, caseroot, compname):
4646
clm_force_coldstart = case.get_value("CLM_FORCE_COLDSTART")
4747
lnd_tuning_mode = case.get_value("LND_TUNING_MODE")
4848
clm_accelerated_spinup = case.get_value("CLM_ACCELERATED_SPINUP")
49-
comp_glc = case.get_value("COMP_GLC")
5049
comp_atm = case.get_value("COMP_ATM")
5150
lnd_grid = case.get_value("LND_GRID")
5251
lnd_ncpl = case.get_value("LND_NCPL")
@@ -62,14 +61,6 @@ def buildnml(case, caseroot, compname):
6261
glc_nec = case.get_value("GLC_NEC")
6362
mask = case.get_value("MASK_GRID")
6463

65-
# -----------------------------------------------------
66-
# Clear out old data
67-
# -----------------------------------------------------
68-
69-
input_data_list = os.path.join(caseroot,"Buildconf","clm.input_data_list")
70-
if os.path.exists(input_data_list):
71-
os.remove(input_data_list)
72-
7364
# -----------------------------------------------------
7465
# Set clmconf
7566
# -----------------------------------------------------
@@ -133,10 +124,10 @@ def buildnml(case, caseroot, compname):
133124
if run_type == "branch":
134125
startfile_type = "nrevsn"
135126
if clm_force_coldstart == "on":
136-
clm_force_coldstart = "off"
137-
logger.warning( "WARNING: You've turned on CLM_FORCE_COLDSTART for a branch run_type, which is a contradiction, the coldstart will be ignored\n" +
138-
" turn off CLM_FORCE_COLDSTART, or set RUN_TYPE=hybrid to get rid of this warning"
139-
)
127+
clm_force_coldstart = "off"
128+
logger.warning( "WARNING: You've turned on CLM_FORCE_COLDSTART for a branch run_type, which is a contradiction, the coldstart will be ignored\n" +
129+
" turn off CLM_FORCE_COLDSTART, or set RUN_TYPE=hybrid to get rid of this warning")
130+
140131

141132
if (clm_force_coldstart == "on"):
142133
logger.warning( "WARNING: CLM is starting up from a cold state" )
@@ -168,9 +159,9 @@ def buildnml(case, caseroot, compname):
168159
usecase = ""
169160

170161
if ( (mask != "null") and (mask != "UNSET") ):
171-
gridmask = "-mask %s" %mask
162+
gridmask = "-mask %s" %mask
172163
else:
173-
gridmask = ""
164+
gridmask = ""
174165

175166
start_ymd = run_startdate.replace('-','')
176167

@@ -191,6 +182,13 @@ def buildnml(case, caseroot, compname):
191182

192183
config_cache_file = os.path.join(caseroot,"Buildconf","clmconf","config_cache.xml")
193184

185+
# -----------------------------------------------------
186+
# Clear out old data
187+
# -----------------------------------------------------
188+
189+
if os.path.exists(inputdata_file):
190+
os.remove(inputdata_file)
191+
194192
# -----------------------------------------------------
195193
# loop over instances
196194
# -----------------------------------------------------

cime_config/config_component.xml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414

1515
<!-- Descriptions of all the different valid configurations for different model versions -->
1616
<description modifier_mode="1">
17-
<desc lnd="CLM40[%SP][%CN][%CNDV][%CN-CROP][%CNDV-CROP]" >clm4.0:</desc>
18-
<desc lnd="CLM45[%SP][%SP-VIC][%CN][%CNDV][%CN-CROP][%CNDV-CROP][%BGC][%BGC-CROP][%FATES][%BGCDV][%BGCDV-CROP]" >clm4.5:</desc>
19-
<desc lnd="CLM50[%SP][%SP-VIC][%CN][%BGC][%BGC-CROP][%FATES][%BGCDV][%BGCDV-CROP]" >clm5.0:</desc>
17+
<desc lnd="CLM40[%SP][%CN][%CNDV][%CN-CROP][%CNDV-CROP]" >clm4.0:</desc>
18+
<desc lnd="CLM45[%SP][%SP-VIC][%CN][%CNDV][%CN-CROP][%CNDV-CROP][%BGC][%BGC-CROP][%FATES][%BGCDV][%BGCDV-CROP]" >clm4.5:</desc>
19+
<desc lnd="CLM50[%SP][%SP-VIC][%CN][%BGC][%BGC-CROP][%FATES][%BGCDV][%BGCDV-CROP][%BGC-CROP-CMIP6DECK][%BGC-CROP-CMIP6WACCMDECK]">clm5.0:</desc>
2020
<desc option="SP" >Satellite phenology:</desc>
2121
<desc option="CN" >CN: Carbon Nitrogen model</desc>
2222
<desc option="CNDV" >CNDV: CN with Dynamic Vegetation</desc>
@@ -29,6 +29,8 @@
2929
<desc option="FATES" >FATES (Functionally Assembled Terrestrial Ecosystem Simulator) Ecosystem Demography model: (experimental)</desc>
3030
<desc option="BGCDV" >BGC (vert. resol. CN and methane) with dynamic vegetation:</desc>
3131
<desc option="BGCDV-CROP" >BGC (vert. resol. CN and methane) with dynamic vegetation and prognostic crop:</desc>
32+
<desc option="BGC-CROP-CMIP6DECK">BGC (vert. resol. CN and methane) with prognostic crop, with modifications appropriate for CMIP6 DECK experiments:</desc>
33+
<desc option="BGC-CROP-CMIP6WACCMDECK">BGC (vert. resol. CN and methane) with prognostic crop, with modifications appropriate for CMIP6 WACCM DECK experiments:</desc>
3234
</description>
3335

3436
<entry id="COMP_LND">
@@ -224,6 +226,19 @@
224226
precedence over any settings for finidat in the $CASEROOT/user_clm_clm file.</desc>
225227
</entry>
226228

229+
<entry id="CLM_USER_MODS">
230+
<type>char</type>
231+
<valid_values></valid_values>
232+
<default_value></default_value>
233+
<values match="last">
234+
<value compset="_CLM50%[^_]*CMIP6DECK[%_]">$COMP_ROOT_DIR_LND/cime_config/usermods_dirs/cmip6_deck</value>
235+
<value compset="_CLM50%[^_]*CMIP6WACCMDECK[%_]">$COMP_ROOT_DIR_LND/cime_config/usermods_dirs/cmip6_waccm_deck</value>
236+
</values>
237+
<group>run_component_clm</group>
238+
<file>env_case.xml</file>
239+
<desc>User mods to apply to specific compset matches. </desc>
240+
</entry>
241+
227242
<help>
228243
=========================================
229244
CLM naming conventions

cime_config/config_compsets.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,18 @@
9696
<science_support grid="f19_g17"/>
9797
</compset>
9898

99+
<!-- Primarily for testing the CMIP6DECK compset option -->
100+
<compset>
101+
<alias>I1850Clm50BgcCropCmip6</alias>
102+
<lname>1850_DATM%GSWP3v1_CLM50%BGC-CROP-CMIP6DECK_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV</lname>
103+
</compset>
104+
105+
<!-- Primarily for testing the CMIP6WACCMDECK compset option -->
106+
<compset>
107+
<alias>I1850Clm50BgcCropCmip6waccm</alias>
108+
<lname>1850_DATM%GSWP3v1_CLM50%BGC-CROP-CMIP6WACCMDECK_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV</lname>
109+
</compset>
110+
99111
<compset>
100112
<alias>I1850Clm50BgcCropCru</alias>
101113
<lname>1850_DATM%CRUv7_CLM50%BGC-CROP_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV</lname>

cime_config/testdefs/ExpectedTestFails.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
<entry issue="#404" >FAIL ERP_D_Ld10_P36x2.f10_f10_musgs.IHistClm50BgcCrop.cheyenne_intel.clm-ciso_decStart RUN</entry>
66
<entry issue="#158" >FAIL ERS_Lm20_Mmpi-serial.1x1_smallvilleIA.I2000Clm50BgcCropGs.cheyenne_gnu.clm-monthly RUN</entry>
77
<entry issue="#158" >FAIL ERS_Lm20_Mmpi-serial.1x1_smallvilleIA.I2000Clm50BgcCropGs.cheyenne_intel.clm-monthly RUN</entry>
8+
<entry issue="#384" >FAIL ERP_D_Ld5.f09_g17.I2000Clm50Vic.cheyenne_intel.clm-vrtlay RUN</entry>
89
<entry issue="#442" >FAIL SMS.f10_f10_musgs.I2000Clm50BgcCrop.hobart_pgi.clm-crop RUN</entry>
910
<entry issue="#442" >FAIL SMS_D.f10_f10_musgs.I2000Clm50BgcCrop.hobart_pgi.clm-crop RUN</entry>
10-
<entry issue="ESMCI/cime#2804" >FAIL ERS_D_Ln9_P480x3.f19_g16.I2000Clm50SpGs.cheyenne_intel.clm-waccmx_offline MODEL_BUILD</entry>
11+
<entry issue="#550" >FAIL ERS_D_Ln9_P480x3.f19_g16.I2000Clm50SpGs.cheyenne_intel.clm-waccmx_offline COMPARE_base_rest</entry>
1112
</category>
1213
<category name="fates">
1314
<entry issue="NGEET/fates#315">FAIL ERS_Ld60.f45_f45_mg37.I2000Clm45Fates.hobart_nag.clm-Fates COMPARE_base_rest</entry>

cime_config/testdefs/testlist_clm.xml

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -984,13 +984,13 @@
984984
<option name="tput_tolerance">0.5</option>
985985
</options>
986986
</test>
987-
<test name="ERS_Ly3" grid="f10_f10_musgs" compset="I1850Clm50BgcCrop" testmods="clm/cmip6">
987+
<test name="ERS_Ly3" grid="f10_f10_musgs" compset="I1850Clm50BgcCropCmip6" testmods="clm/basic">
988988
<machines>
989989
<machine name="cheyenne" compiler="intel" category="aux_clm"/>
990990
</machines>
991991
<options>
992992
<option name="wallclock">01:40:00</option>
993-
<option name="comment" >Include a long ERS test of the cmip6 configuration, though at coarse resolution</option>
993+
<option name="comment" >Include a long ERS test of the cmip6 configuration, though at coarse resolution. This gives a year+ test covering the output_crop usermod, which is something we want: if this is removed, we should add a test of at least a year duration covering the output_crop usermod. This test needs to use init_interp to work, because of adding virtual Antarctica columns (currently the default out-of-the-box setting uses init_interp for this).</option>
994994
</options>
995995
</test>
996996
<test name="ERS_Ly3" grid="f10_f10_musgs" compset="I1850Clm50BgcCrop" testmods="clm/clm50KSinkMOut">
@@ -1492,13 +1492,13 @@
14921492
<option name="wallclock">00:20:00</option>
14931493
</options>
14941494
</test>
1495-
<test name="SMS_Ld5_D" grid="f09_g16" compset="I1850Clm50BgcCrop" testmods="clm/cmip6">
1495+
<test name="SMS_Ld5_D" grid="f09_g17" compset="I1850Clm50BgcCropCmip6" testmods="clm/basic">
14961496
<machines>
14971497
<machine name="cheyenne" compiler="intel" category="aux_clm"/>
14981498
</machines>
14991499
<options>
15001500
<option name="wallclock">00:20:00</option>
1501-
<option name="comment" >Include a short debug test of the cmip6 configuration at the production resolution</option>
1501+
<option name="comment" >This gives a short debug test of the cmip6 configuration as well as a test of the cmip6 configuration at the production resolution, both of which we want. This test needs to use init_interp to work, because of adding virtual Antarctica columns (currently the default out-of-the-box setting uses init_interp for this).</option>
15021502
</options>
15031503
</test>
15041504
<test name="SMS_Ld5_D_P48x1" grid="f10_f10_musgs" compset="IHistClm50Bgc" testmods="clm/monthly">
@@ -1926,4 +1926,43 @@
19261926
<option name="wallclock">00:40:00</option>
19271927
</options>
19281928
</test>
1929+
<test name="SMS_Lm1" grid="f10_f10_musgs" compset="I1850Clm50BgcCropCmip6waccm" testmods="clm/basic">
1930+
<machines>
1931+
<machine name="cheyenne" compiler="gnu" category="aux_clm"/>
1932+
</machines>
1933+
<options>
1934+
<option name="wallclock">00:20:00</option>
1935+
<option name="comment" >The main point of this test is simply to make sure that the CMIP6WACCMDECK moifierd works. (This configuration is basically the same as I1850Clm50BgcCropCmip6, but without cmip6_glaciers_virtual_antarctica - so we don't need huge coverage of this.) Month-long so that we actually get some history output (because this test exercises a usermods directory with only monthly and yearly output).</option>
1936+
</options>
1937+
</test>
1938+
<test name="SMS_Lm1_D" grid="f10_f10_musgs" compset="I1850Clm50BgcCrop" testmods="clm/output_crop_highfreq">
1939+
<machines>
1940+
<machine name="cheyenne" compiler="intel" category="aux_clm">
1941+
<options>
1942+
<option name="wallclock">00:20:00</option>
1943+
<option name="comment">Want at least a month-long debug test covering the output_crop usermod, as well as a test covering the output_crop_highfreq usermod. (Note that we already have a year+ test of output_crop via a cmip6 test, so having this test just be a month, rather than a year, seems good enough.)</option>
1944+
</options>
1945+
</machine>
1946+
</machines>
1947+
</test>
1948+
<test name="SMS_Ly1_Mmpi-serial" grid="1x1_brazil" compset="IHistClm50BgcQianGs" testmods="clm/output_bgc_highfreq">
1949+
<machines>
1950+
<machine name="cheyenne" compiler="gnu" category="aux_clm">
1951+
<options>
1952+
<option name="wallclock">00:20:00</option>
1953+
<option name="comment">Want a year-long test covering the output_bgc and output_bgc_highfreq usermods; don't want a highfreq, year-long global test because of the output volume, so this is single-point.</option>
1954+
</options>
1955+
</machine>
1956+
</machines>
1957+
</test>
1958+
<test name="SMS_Ly1_Mmpi-serial" grid="1x1_vancouverCAN" compset="I1PtClm50SpGs" testmods="clm/output_sp_highfreq">
1959+
<machines>
1960+
<machine name="cheyenne" compiler="gnu" category="aux_clm">
1961+
<options>
1962+
<option name="wallclock">00:10:00</option>
1963+
<option name="comment">Want a year-long test covering the output_sp and output_sp_highfreq usermods; don't want a highfreq, year-long global test because of the output volume, so this is single-point.</option>
1964+
</options>
1965+
</machine>
1966+
</machines>
1967+
</test>
19291968
</testlist>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
This testmods directory is for tests where we want to use the
2+
out-of-the-box output options, but still want the minimal changes that
3+
we apply for nearly all tests.
4+
5+
("default" would probably be a good name for this, but we already use
6+
"default" to mean "the standard output changes that are applied for most
7+
tests" (adding some streams and fields, double precision, etc.). We may
8+
want to consider renaming that one and using "default" for this one.)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,10 @@
11
use_c13 = .true.
22
use_c14 = .true.
3+
4+
! BUG(wjs, 2018-10-25, ESCOMP/ctsm#67) There is a bug that causes incorrect values for C
5+
! isotopes if running init_interp from a case without C isotopes to a case with C
6+
! isotopes (https://github.com/ESCOMP/ctsm/issues/67). Normally, an error-check prevents
7+
! you from doing this interpolation (until we have fixed that bug). However, we
8+
! sometimes want to bypass this error-check in system tests. This namelist flag bypasses
9+
! this error-check.
10+
for_testing_allow_interp_non_ciso_to_ciso = .true.

0 commit comments

Comments
 (0)