diff --git a/bld/namelist_files/namelist_definition_clm4_5.xml b/bld/namelist_files/namelist_definition_clm4_5.xml
index fdf2f5e9e2..e3b5b80b4b 100644
--- a/bld/namelist_files/namelist_definition_clm4_5.xml
+++ b/bld/namelist_files/namelist_definition_clm4_5.xml
@@ -1973,6 +1973,16 @@ Flag to use the atmospheric time series of C13 concentrations from natural abund
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.
+
+
+There is a bug that causes incorrect values for C isotopes if running
+init_interp from a case without C isotopes to a case with C isotopes
+(https://github.com/ESCOMP/ctsm/issues/67). Normally, an error-check
+prevents you from doing this interpolation (until we have fixed that
+bug). However, we sometimes want to bypass this error-check in system
+tests. This namelist flag bypasses this error-check.
+
diff --git a/cime_config/buildlib b/cime_config/buildlib
index 6b86bb0b65..6c7914be86 100755
--- a/cime_config/buildlib
+++ b/cime_config/buildlib
@@ -3,7 +3,7 @@
"""
build clm library
"""
-import sys, os, time, filecmp, shutil, imp
+import sys, os, shutil, imp
_CIMEROOT = os.environ.get("CIMEROOT")
if _CIMEROOT is None:
diff --git a/cime_config/buildnml b/cime_config/buildnml
index 73855da4dd..3f5d9d3655 100755
--- a/cime_config/buildnml
+++ b/cime_config/buildnml
@@ -3,7 +3,7 @@
"""
CLM namelist creator
"""
-import sys, os, time, shutil, re, imp, filecmp
+import sys, os, shutil, imp, filecmp
_CIMEROOT = os.environ.get("CIMEROOT")
if _CIMEROOT is None:
@@ -46,7 +46,6 @@ def buildnml(case, caseroot, compname):
clm_force_coldstart = case.get_value("CLM_FORCE_COLDSTART")
lnd_tuning_mode = case.get_value("LND_TUNING_MODE")
clm_accelerated_spinup = case.get_value("CLM_ACCELERATED_SPINUP")
- comp_glc = case.get_value("COMP_GLC")
comp_atm = case.get_value("COMP_ATM")
lnd_grid = case.get_value("LND_GRID")
lnd_ncpl = case.get_value("LND_NCPL")
@@ -62,14 +61,6 @@ def buildnml(case, caseroot, compname):
glc_nec = case.get_value("GLC_NEC")
mask = case.get_value("MASK_GRID")
- # -----------------------------------------------------
- # Clear out old data
- # -----------------------------------------------------
-
- input_data_list = os.path.join(caseroot,"Buildconf","clm.input_data_list")
- if os.path.exists(input_data_list):
- os.remove(input_data_list)
-
# -----------------------------------------------------
# Set clmconf
# -----------------------------------------------------
@@ -133,10 +124,10 @@ def buildnml(case, caseroot, compname):
if run_type == "branch":
startfile_type = "nrevsn"
if clm_force_coldstart == "on":
- clm_force_coldstart = "off"
- 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" +
- " turn off CLM_FORCE_COLDSTART, or set RUN_TYPE=hybrid to get rid of this warning"
- )
+ clm_force_coldstart = "off"
+ 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" +
+ " turn off CLM_FORCE_COLDSTART, or set RUN_TYPE=hybrid to get rid of this warning")
+
if (clm_force_coldstart == "on"):
logger.warning( "WARNING: CLM is starting up from a cold state" )
@@ -168,9 +159,9 @@ def buildnml(case, caseroot, compname):
usecase = ""
if ( (mask != "null") and (mask != "UNSET") ):
- gridmask = "-mask %s" %mask
+ gridmask = "-mask %s" %mask
else:
- gridmask = ""
+ gridmask = ""
start_ymd = run_startdate.replace('-','')
@@ -191,6 +182,13 @@ def buildnml(case, caseroot, compname):
config_cache_file = os.path.join(caseroot,"Buildconf","clmconf","config_cache.xml")
+ # -----------------------------------------------------
+ # Clear out old data
+ # -----------------------------------------------------
+
+ if os.path.exists(inputdata_file):
+ os.remove(inputdata_file)
+
# -----------------------------------------------------
# loop over instances
# -----------------------------------------------------
diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml
index bd95959f94..edfa521d2e 100644
--- a/cime_config/config_component.xml
+++ b/cime_config/config_component.xml
@@ -14,9 +14,9 @@
- clm4.0:
- clm4.5:
- clm5.0:
+ clm4.0:
+ clm4.5:
+ clm5.0:Satellite phenology:CN: Carbon Nitrogen modelCNDV: CN with Dynamic Vegetation
@@ -29,6 +29,8 @@
FATES (Functionally Assembled Terrestrial Ecosystem Simulator) Ecosystem Demography model: (experimental)BGC (vert. resol. CN and methane) with dynamic vegetation:BGC (vert. resol. CN and methane) with dynamic vegetation and prognostic crop:
+ BGC (vert. resol. CN and methane) with prognostic crop, with modifications appropriate for CMIP6 DECK experiments:
+ BGC (vert. resol. CN and methane) with prognostic crop, with modifications appropriate for CMIP6 WACCM DECK experiments:
@@ -224,6 +226,19 @@
precedence over any settings for finidat in the $CASEROOT/user_clm_clm file.
+
+ char
+
+
+
+ $COMP_ROOT_DIR_LND/cime_config/usermods_dirs/cmip6_deck
+ $COMP_ROOT_DIR_LND/cime_config/usermods_dirs/cmip6_waccm_deck
+
+ run_component_clm
+ env_case.xml
+ User mods to apply to specific compset matches.
+
+
=========================================
CLM naming conventions
diff --git a/cime_config/config_compsets.xml b/cime_config/config_compsets.xml
index c628110a9c..4b820c1ffa 100644
--- a/cime_config/config_compsets.xml
+++ b/cime_config/config_compsets.xml
@@ -96,6 +96,18 @@
+
+
+ I1850Clm50BgcCropCmip6
+ 1850_DATM%GSWP3v1_CLM50%BGC-CROP-CMIP6DECK_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV
+
+
+
+
+ I1850Clm50BgcCropCmip6waccm
+ 1850_DATM%GSWP3v1_CLM50%BGC-CROP-CMIP6WACCMDECK_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV
+
+
I1850Clm50BgcCropCru1850_DATM%CRUv7_CLM50%BGC-CROP_SICE_SOCN_MOSART_CISM2%NOEVOLVE_SWAV
diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml
index fe7373dc38..5a33dec0ab 100644
--- a/cime_config/testdefs/ExpectedTestFails.xml
+++ b/cime_config/testdefs/ExpectedTestFails.xml
@@ -5,9 +5,10 @@
FAIL ERP_D_Ld10_P36x2.f10_f10_musgs.IHistClm50BgcCrop.cheyenne_intel.clm-ciso_decStart RUNFAIL ERS_Lm20_Mmpi-serial.1x1_smallvilleIA.I2000Clm50BgcCropGs.cheyenne_gnu.clm-monthly RUNFAIL ERS_Lm20_Mmpi-serial.1x1_smallvilleIA.I2000Clm50BgcCropGs.cheyenne_intel.clm-monthly RUN
+ FAIL ERP_D_Ld5.f09_g17.I2000Clm50Vic.cheyenne_intel.clm-vrtlay RUNFAIL SMS.f10_f10_musgs.I2000Clm50BgcCrop.hobart_pgi.clm-crop RUNFAIL SMS_D.f10_f10_musgs.I2000Clm50BgcCrop.hobart_pgi.clm-crop RUN
- FAIL ERS_D_Ln9_P480x3.f19_g16.I2000Clm50SpGs.cheyenne_intel.clm-waccmx_offline MODEL_BUILD
+ FAIL ERS_D_Ln9_P480x3.f19_g16.I2000Clm50SpGs.cheyenne_intel.clm-waccmx_offline COMPARE_base_restFAIL ERS_Ld60.f45_f45_mg37.I2000Clm45Fates.hobart_nag.clm-Fates COMPARE_base_rest
diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml
index 96d93654ae..ae27810ec1 100644
--- a/cime_config/testdefs/testlist_clm.xml
+++ b/cime_config/testdefs/testlist_clm.xml
@@ -984,13 +984,13 @@
-
+
-
+
@@ -1492,13 +1492,13 @@
-
+
-
+
@@ -1926,4 +1926,43 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/cime_config/testdefs/testmods_dirs/clm/basic/README b/cime_config/testdefs/testmods_dirs/clm/basic/README
new file mode 100644
index 0000000000..9193464848
--- /dev/null
+++ b/cime_config/testdefs/testmods_dirs/clm/basic/README
@@ -0,0 +1,8 @@
+This testmods directory is for tests where we want to use the
+out-of-the-box output options, but still want the minimal changes that
+we apply for nearly all tests.
+
+("default" would probably be a good name for this, but we already use
+"default" to mean "the standard output changes that are applied for most
+tests" (adding some streams and fields, double precision, etc.). We may
+want to consider renaming that one and using "default" for this one.)
diff --git a/cime_config/testdefs/testmods_dirs/clm/cmip6/shell_commands b/cime_config/testdefs/testmods_dirs/clm/basic/shell_commands
similarity index 100%
rename from cime_config/testdefs/testmods_dirs/clm/cmip6/shell_commands
rename to cime_config/testdefs/testmods_dirs/clm/basic/shell_commands
diff --git a/cime_config/testdefs/testmods_dirs/clm/ciso/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/ciso/user_nl_clm
index 0a40cd33a8..3b12a2772b 100644
--- a/cime_config/testdefs/testmods_dirs/clm/ciso/user_nl_clm
+++ b/cime_config/testdefs/testmods_dirs/clm/ciso/user_nl_clm
@@ -1,2 +1,10 @@
use_c13 = .true.
use_c14 = .true.
+
+ ! BUG(wjs, 2018-10-25, ESCOMP/ctsm#67) There is a bug that causes incorrect values for C
+ ! isotopes if running init_interp from a case without C isotopes to a case with C
+ ! isotopes (https://github.com/ESCOMP/ctsm/issues/67). Normally, an error-check prevents
+ ! you from doing this interpolation (until we have fixed that bug). However, we
+ ! sometimes want to bypass this error-check in system tests. This namelist flag bypasses
+ ! this error-check.
+ for_testing_allow_interp_non_ciso_to_ciso = .true.
diff --git a/cime_config/testdefs/testmods_dirs/clm/ciso_flexCN_FUN/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/ciso_flexCN_FUN/user_nl_clm
index 9db1957c1c..32e584af82 100644
--- a/cime_config/testdefs/testmods_dirs/clm/ciso_flexCN_FUN/user_nl_clm
+++ b/cime_config/testdefs/testmods_dirs/clm/ciso_flexCN_FUN/user_nl_clm
@@ -2,3 +2,11 @@
use_c14 = .true.
use_fun = .true.
use_flexibleCN = .true.
+
+ ! BUG(wjs, 2018-10-25, ESCOMP/ctsm#67) There is a bug that causes incorrect values for C
+ ! isotopes if running init_interp from a case without C isotopes to a case with C
+ ! isotopes (https://github.com/ESCOMP/ctsm/issues/67). Normally, an error-check prevents
+ ! you from doing this interpolation (until we have fixed that bug). However, we
+ ! sometimes want to bypass this error-check in system tests. This namelist flag bypasses
+ ! this error-check.
+ for_testing_allow_interp_non_ciso_to_ciso = .true.
diff --git a/cime_config/testdefs/testmods_dirs/clm/cmip6/README b/cime_config/testdefs/testmods_dirs/clm/cmip6/README
deleted file mode 100644
index 40b90f9ce0..0000000000
--- a/cime_config/testdefs/testmods_dirs/clm/cmip6/README
+++ /dev/null
@@ -1,6 +0,0 @@
-Note that this testmod directory includes cmip6_evolving_icesheet rather
-than simply cmip6: cmip6_evolving_icesheet includes cmip6 and adds to
-it. So, rather than having tests of the cmip6 usermods and separate
-tests of cmip6_evolving_icesheet, it's more efficient to just have tests
-of the cmip6_evolving_icesheet usermods directory, which then also cover
-the cmip6 usermods directory.
diff --git a/cime_config/testdefs/testmods_dirs/clm/cmip6/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/cmip6/include_user_mods
deleted file mode 100644
index 7e8fa5ec83..0000000000
--- a/cime_config/testdefs/testmods_dirs/clm/cmip6/include_user_mods
+++ /dev/null
@@ -1 +0,0 @@
-../../../../usermods_dirs/cmip6_evolving_icesheet
diff --git a/cime_config/testdefs/testmods_dirs/clm/cmip6_deck/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/cmip6_deck/include_user_mods
new file mode 100644
index 0000000000..45859d47f6
--- /dev/null
+++ b/cime_config/testdefs/testmods_dirs/clm/cmip6_deck/include_user_mods
@@ -0,0 +1 @@
+../../../../usermods_dirs/cmip6_deck
diff --git a/cime_config/testdefs/testmods_dirs/clm/cmip6_deck/shell_commands b/cime_config/testdefs/testmods_dirs/clm/cmip6_deck/shell_commands
new file mode 100644
index 0000000000..070b7ba1a8
--- /dev/null
+++ b/cime_config/testdefs/testmods_dirs/clm/cmip6_deck/shell_commands
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+./xmlchange BFBFLAG="TRUE"
diff --git a/cime_config/testdefs/testmods_dirs/clm/output_bgc_highfreq/README b/cime_config/testdefs/testmods_dirs/clm/output_bgc_highfreq/README
new file mode 100644
index 0000000000..7798a3ce70
--- /dev/null
+++ b/cime_config/testdefs/testmods_dirs/clm/output_bgc_highfreq/README
@@ -0,0 +1 @@
+Tests the output_bgc_highfreq usermods
diff --git a/cime_config/testdefs/testmods_dirs/clm/output_bgc_highfreq/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/output_bgc_highfreq/include_user_mods
new file mode 100644
index 0000000000..de8b9039c8
--- /dev/null
+++ b/cime_config/testdefs/testmods_dirs/clm/output_bgc_highfreq/include_user_mods
@@ -0,0 +1,2 @@
+../../../../usermods_dirs/output_bgc_highfreq
+../basic
diff --git a/cime_config/testdefs/testmods_dirs/clm/output_crop_highfreq/README b/cime_config/testdefs/testmods_dirs/clm/output_crop_highfreq/README
new file mode 100644
index 0000000000..253d84414c
--- /dev/null
+++ b/cime_config/testdefs/testmods_dirs/clm/output_crop_highfreq/README
@@ -0,0 +1 @@
+Tests the output_crop_highfreq usermods
diff --git a/cime_config/testdefs/testmods_dirs/clm/output_crop_highfreq/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/output_crop_highfreq/include_user_mods
new file mode 100644
index 0000000000..770abf5cf9
--- /dev/null
+++ b/cime_config/testdefs/testmods_dirs/clm/output_crop_highfreq/include_user_mods
@@ -0,0 +1,2 @@
+../../../../usermods_dirs/output_crop_highfreq
+../basic
diff --git a/cime_config/testdefs/testmods_dirs/clm/output_sp_highfreq/README b/cime_config/testdefs/testmods_dirs/clm/output_sp_highfreq/README
new file mode 100644
index 0000000000..330964f61f
--- /dev/null
+++ b/cime_config/testdefs/testmods_dirs/clm/output_sp_highfreq/README
@@ -0,0 +1 @@
+Tests the output_sp_highfreq usermods
diff --git a/cime_config/testdefs/testmods_dirs/clm/output_sp_highfreq/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/output_sp_highfreq/include_user_mods
new file mode 100644
index 0000000000..8c117e01ed
--- /dev/null
+++ b/cime_config/testdefs/testmods_dirs/clm/output_sp_highfreq/include_user_mods
@@ -0,0 +1,2 @@
+../../../../usermods_dirs/output_sp_highfreq
+../basic
diff --git a/cime_config/usermods_dirs/_includes/README b/cime_config/usermods_dirs/_includes/README
new file mode 100644
index 0000000000..44484d36bc
--- /dev/null
+++ b/cime_config/usermods_dirs/_includes/README
@@ -0,0 +1,2 @@
+This directory contains usermods directories that are meant to be
+included in other usermods directories, not used directly
diff --git a/cime_config/usermods_dirs/_includes/cmip6_carbon_isotopes/user_nl_clm b/cime_config/usermods_dirs/_includes/cmip6_carbon_isotopes/user_nl_clm
new file mode 100644
index 0000000000..e7c6fbf7e8
--- /dev/null
+++ b/cime_config/usermods_dirs/_includes/cmip6_carbon_isotopes/user_nl_clm
@@ -0,0 +1,12 @@
+!----------------------------------------------------------------------------------
+! Settings from cmip6_carbon_isotopes
+!----------------------------------------------------------------------------------
+
+use_c13 = .true.
+use_c14 = .true.
+use_c13_timeseries = .true.
+use_c14_bombspike = .true.
+
+! h3 stream (yearly average, gridcell-level)
+hist_fincl4 += 'C14_SOIL1C_vr', 'C14_SOIL2C_vr', 'C14_SOIL3C_vr'
+
diff --git a/cime_config/usermods_dirs/cmip6_output/user_nl_cpl b/cime_config/usermods_dirs/_includes/cmip6_glaciers_cplhist/user_nl_cpl
similarity index 100%
rename from cime_config/usermods_dirs/cmip6_output/user_nl_cpl
rename to cime_config/usermods_dirs/_includes/cmip6_glaciers_cplhist/user_nl_cpl
diff --git a/cime_config/usermods_dirs/cmip6_glaciers/user_nl_clm b/cime_config/usermods_dirs/_includes/cmip6_glaciers_virtual_antarctica/user_nl_clm
similarity index 59%
rename from cime_config/usermods_dirs/cmip6_glaciers/user_nl_clm
rename to cime_config/usermods_dirs/_includes/cmip6_glaciers_virtual_antarctica/user_nl_clm
index 4963c4945a..3486d7abfb 100644
--- a/cime_config/usermods_dirs/cmip6_glaciers/user_nl_clm
+++ b/cime_config/usermods_dirs/_includes/cmip6_glaciers_virtual_antarctica/user_nl_clm
@@ -1,5 +1,9 @@
+!----------------------------------------------------------------------------------
+! Settings from cmip6_glaciers_virtual_antarctica
+!----------------------------------------------------------------------------------
! This differs from the default in that it turns on virtual columns over Antarctica
! This is desired so that we have the output needed to drive a later offline CISM Antarctica simulation
! However, this increases the cost of CLM by about 10%
glacier_region_behavior = 'single_at_atm_topo', 'virtual', 'virtual', 'virtual'
+
diff --git a/cime_config/usermods_dirs/_includes/output_base/README b/cime_config/usermods_dirs/_includes/output_base/README
new file mode 100644
index 0000000000..12022992fb
--- /dev/null
+++ b/cime_config/usermods_dirs/_includes/output_base/README
@@ -0,0 +1,6 @@
+This usermods directory provides a common base on which other usermods
+can build for changing the out-of-the-box output to something more
+generally useful.
+
+This should not be used directly. Instead, use one of the other usermods
+directories that builds on this.
diff --git a/cime_config/usermods_dirs/_includes/output_base/user_nl_clm b/cime_config/usermods_dirs/_includes/output_base/user_nl_clm
new file mode 100644
index 0000000000..8ed36a1fa3
--- /dev/null
+++ b/cime_config/usermods_dirs/_includes/output_base/user_nl_clm
@@ -0,0 +1,66 @@
+!----------------------------------------------------------------------------------
+! Users should add all user specific namelist changes below in the form of
+! namelist_var = new_namelist_value
+!
+! EXCEPTIONS:
+! Set use_cndv by the compset you use and the CLM_BLDNML_OPTS -dynamic_vegetation setting
+! Set use_vichydro by the compset you use and the CLM_BLDNML_OPTS -vichydro setting
+! Set use_cn by the compset you use and CLM_BLDNML_OPTS -bgc setting
+! Set use_crop by the compset you use and CLM_BLDNML_OPTS -crop setting
+! Set spinup_state by the CLM_BLDNML_OPTS -bgc_spinup setting
+! Set irrigate by the CLM_BLDNML_OPTS -irrig setting
+! Set co2_ppmv with CCSM_CO2_PPMV option
+! Set dtime with L_NCPL option
+! Set fatmlndfrc with LND_DOMAIN_PATH/LND_DOMAIN_FILE options
+! Set finidat with RUN_REFCASE/RUN_REFDATE/RUN_REFTOD options for hybrid or branch cases
+! (includes $inst_string for multi-ensemble cases)
+! Set maxpatch_glcmec with GLC_NEC option
+! Set glc_do_dynglacier with GLC_TWO_WAY_COUPLING env variable
+!----------------------------------------------------------------------------------
+
+!----------------------------------------------------------------------------------
+! Settings from output_base
+!----------------------------------------------------------------------------------
+
+! h0 stream (monthly average, gridcell-level)
+! h0 stream ICE variables and other variables inactive by default (monthly average, gridcell-level)
+! Emon, Lmon, LIMon
+hist_mfilt(1) = 1
+hist_dov2xy(1) = .true.
+hist_nhtfrq(1) = 0
+hist_type1d_pertape(1) = ' '
+hist_fexcl1 += 'PCT_GLC_MEC','PCT_NAT_PFT'
+hist_fincl1 += 'EFLX_LH_TOT_ICE', 'FIRE_ICE', 'FLDS_ICE', 'FSH_ICE', 'FSNO_ICE', 'FSR_ICE', 'QFLX_SUB_SNOW_ICE', 'QRUNOFF_ICE', 'QSNOFRZ_ICE', 'QSNOMELT_ICE', 'RAIN_ICE', 'SNOW_ICE', 'SNOWICE_ICE', 'SNOWLIQ_ICE', 'SNOTXMASS_ICE', 'TG_ICE', 'TOPO_COL_ICE', 'TSA_ICE', 'TSOI_ICE'
+
+! h1 stream (monthly average, finest sub-grid)
+! Emon, Lmon
+hist_mfilt(2) = 1
+hist_dov2xy(2) = .false.
+hist_nhtfrq(2) = 0
+hist_type1d_pertape(2) = ' '
+hist_fincl2 += 'TLAI', 'TSA','TREFMNAV','TREFMXAV', 'BTRANMN', 'Vcmx25Z', 'FSH', 'VEGWP', 'FCTR', 'FCEV', 'FGEV', 'FIRE', 'FSR', 'FIRA', 'FSA', 'GSSUNLN', 'GSSHALN', 'TSKIN'
+
+! h2 stream (monthly average, landunit-level)
+! Emon
+hist_mfilt(3) = 1
+hist_dov2xy(3) = .false.
+hist_nhtfrq(3) = 0
+hist_type1d_pertape(3) = 'LAND'
+hist_fincl3 += 'FSR', 'H2OSNO', 'Q2M', 'SNOWDP', 'TSA', 'TREFMNAV', 'TREFMXAV', 'TG', 'QRUNOFF', 'FSH', 'FIRE', 'FIRA', 'FGR', 'EFLX_LH_TOT', 'RH2M', 'TLAI', 'SOILWATER_10CM', 'TOTSOILLIQ', 'TOTSOILICE', 'U10', 'TSOI_10CM', 'QIRRIG', 'URBAN_HEAT', 'WASTEHEAT', 'TSKIN'
+
+! h3 stream (yearly average, gridcell-level)
+! Eyr
+hist_mfilt(4) = 1
+hist_dov2xy(4) = .true.
+hist_nhtfrq(4) = -8760
+hist_type1d_pertape(4) = ' '
+hist_fincl4 += 'PCT_GLC_MEC', 'QICE_FORC', 'TSRF_FORC', 'TOPO_FORC', 'PCT_NAT_PFT','PCT_LANDUNIT','FSNO_ICE'
+
+! h4 stream (yearly average, landunit-level)
+! Eyr landuse tiles
+! (No fields in base, but other usermods add to this stream)
+hist_mfilt(5) = 1
+hist_dov2xy(5) = .false.
+hist_nhtfrq(5) = -8760
+hist_type1d_pertape(5) = 'LAND'
+
diff --git a/cime_config/usermods_dirs/_includes/output_base_highfreq/README b/cime_config/usermods_dirs/_includes/output_base_highfreq/README
new file mode 100644
index 0000000000..fe6c7e0999
--- /dev/null
+++ b/cime_config/usermods_dirs/_includes/output_base_highfreq/README
@@ -0,0 +1,7 @@
+This usermods directory provides a common base on which other usermods
+can build for changing the out-of-the-box output to something useful
+when you want to include high-frequency output (daily and more
+frequent).
+
+This should not be used directly. Instead, use one of the other usermods
+directories that builds on this.
diff --git a/cime_config/usermods_dirs/_includes/output_base_highfreq/include_user_mods b/cime_config/usermods_dirs/_includes/output_base_highfreq/include_user_mods
new file mode 100644
index 0000000000..bee18982f6
--- /dev/null
+++ b/cime_config/usermods_dirs/_includes/output_base_highfreq/include_user_mods
@@ -0,0 +1 @@
+../output_base
diff --git a/cime_config/usermods_dirs/_includes/output_base_highfreq/user_nl_clm b/cime_config/usermods_dirs/_includes/output_base_highfreq/user_nl_clm
new file mode 100644
index 0000000000..0972d19bb5
--- /dev/null
+++ b/cime_config/usermods_dirs/_includes/output_base_highfreq/user_nl_clm
@@ -0,0 +1,30 @@
+!----------------------------------------------------------------------------------
+! Settings from output_base_highfreq
+!----------------------------------------------------------------------------------
+
+! h5 stream (daily average, gridcell-level)
+! day, Eday
+hist_mfilt(6) = 365
+hist_dov2xy(6) = .true.
+hist_nhtfrq(6) = -24
+hist_type1d_pertape(6) = ' '
+hist_fincl6 += 'SOILWATER_10CM', 'TOTSOILLIQ', 'TOTSOILICE', 'EFLX_LH_TOT', 'FSH', 'FGR12', 'FSM', 'QSNOEVAP', 'TLAI', 'QDRAI', 'QDRAI_PERCH', 'QOVER', 'QFLX_SUB_SNOW', 'FSA', 'FIRA', 'H2OSNO', 'SNOCAN', 'QSNOFRZ', 'QFLX_SNOW_DRAIN', 'SNOWDP', 'H2OSFC', 'TV', 'TG', 'TAUX', 'TAUY', 'QVEGT', 'TWS', 'H2OCAN', 'QVEGE', 'QSOIL', 'TSKIN', 'FSDS','FSNO','SNOFSRVD','SNOFSRVI','SNOFSRND','SNOFSRNI','FSDSVD','FSDSVI','FSDSND','FSDSNI','SNOWLIQ','SOILICE','SOILLIQ','QINTR','SNOBCMSL','TSOI','SNOTXMASS','SNOWICE','SNOWLIQ','QRUNOFF','RAIN','SNOW'
+
+! h6 stream (daily average, landunit-level)
+! Eday
+hist_mfilt(7) = 365
+hist_dov2xy(7) = .false.
+hist_nhtfrq(7) = -24
+hist_type1d_pertape(7) = 'LAND'
+hist_fincl7 += 'TREFMXAV','TREFMNAV'
+
+! h7 stream (3-hourly average, gridcell-level)
+! 3hr, E3hr, CF3hr
+! 3hr requires QRUNOFF for time mean, and SOILWATER_10CM, TSKIN for time point (I)
+! CF3hr requires QFLX_SUB_SNOW for time point (I)
+hist_mfilt(8) = 2920
+hist_dov2xy(8) = .true.
+hist_nhtfrq(8) = -3
+hist_type1d_pertape(8) = ' '
+hist_fincl8 += 'TSA','RH2M','SOILWATER_10CM:I','FSH','EFLX_LH_TOT','FSDS','QRUNOFF','QFLX_SUB_SNOW:I','TSKIN:I'
+
diff --git a/cime_config/usermods_dirs/cmip6/include_user_mods b/cime_config/usermods_dirs/cmip6/include_user_mods
deleted file mode 100644
index 012ab60771..0000000000
--- a/cime_config/usermods_dirs/cmip6/include_user_mods
+++ /dev/null
@@ -1,2 +0,0 @@
-../cmip6_glaciers
-../cmip6_output
diff --git a/cime_config/usermods_dirs/cmip6_deck/include_user_mods b/cime_config/usermods_dirs/cmip6_deck/include_user_mods
new file mode 100644
index 0000000000..2cadcc0b93
--- /dev/null
+++ b/cime_config/usermods_dirs/cmip6_deck/include_user_mods
@@ -0,0 +1,4 @@
+../_includes/cmip6_glaciers_cplhist
+../_includes/cmip6_glaciers_virtual_antarctica
+../_includes/cmip6_carbon_isotopes
+../output_crop
diff --git a/cime_config/usermods_dirs/cmip6_evolving_icesheet/include_user_mods b/cime_config/usermods_dirs/cmip6_evolving_icesheet/include_user_mods
index d8d7dacfae..58e17babd3 100644
--- a/cime_config/usermods_dirs/cmip6_evolving_icesheet/include_user_mods
+++ b/cime_config/usermods_dirs/cmip6_evolving_icesheet/include_user_mods
@@ -1 +1 @@
-../cmip6
+../cmip6_deck
diff --git a/cime_config/usermods_dirs/cmip6_evolving_icesheet/user_nl_clm b/cime_config/usermods_dirs/cmip6_evolving_icesheet/user_nl_clm
index 193f0624e7..70ca6a3946 100644
--- a/cime_config/usermods_dirs/cmip6_evolving_icesheet/user_nl_clm
+++ b/cime_config/usermods_dirs/cmip6_evolving_icesheet/user_nl_clm
@@ -1 +1,7 @@
+!----------------------------------------------------------------------------------
+! Settings from cmip6_evolving_icesheet
+!----------------------------------------------------------------------------------
+
+! h3 stream (yearly average, gridcell-level)
hist_fincl4 += 'ICE_MODEL_FRACTION'
+
diff --git a/cime_config/usermods_dirs/cmip6_output/README b/cime_config/usermods_dirs/cmip6_output/README
deleted file mode 100644
index f073548a51..0000000000
--- a/cime_config/usermods_dirs/cmip6_output/README
+++ /dev/null
@@ -1,5 +0,0 @@
-This directory turns on a variety of extra output fields that are desired for
-cmip6 runs.
-
-To use these mods, you must be using a configuration with CLM50%BGC-CROP using
-glc_mec (which is the standard cmip6 configuration).
diff --git a/cime_config/usermods_dirs/cmip6_output/shell_commands b/cime_config/usermods_dirs/cmip6_output/shell_commands
deleted file mode 100644
index d742a80f83..0000000000
--- a/cime_config/usermods_dirs/cmip6_output/shell_commands
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/bash
-
-./xmlchange CCSM_BGC=CO2A
-
diff --git a/cime_config/usermods_dirs/cmip6_output/user_nl_clm b/cime_config/usermods_dirs/cmip6_output/user_nl_clm
deleted file mode 100644
index 5c9890a64f..0000000000
--- a/cime_config/usermods_dirs/cmip6_output/user_nl_clm
+++ /dev/null
@@ -1,77 +0,0 @@
-!----------------------------------------------------------------------------------
-! Users should add all user specific namelist changes below in the form of
-! namelist_var = new_namelist_value
-!
-! EXCEPTIONS:
-! Set use_cndv by the compset you use and the CLM_BLDNML_OPTS -dynamic_vegetation setting
-! Set use_vichydro by the compset you use and the CLM_BLDNML_OPTS -vichydro setting
-! Set use_cn by the compset you use and CLM_BLDNML_OPTS -bgc setting
-! Set use_crop by the compset you use and CLM_BLDNML_OPTS -crop setting
-! Set spinup_state by the CLM_BLDNML_OPTS -bgc_spinup setting
-! Set irrigate by the CLM_BLDNML_OPTS -irrig setting
-! Set co2_ppmv with CCSM_CO2_PPMV option
-! Set dtime with L_NCPL option
-! Set fatmlndfrc with LND_DOMAIN_PATH/LND_DOMAIN_FILE options
-! Set finidat with RUN_REFCASE/RUN_REFDATE/RUN_REFTOD options for hybrid or branch cases
-! (includes $inst_string for multi-ensemble cases)
-! Set maxpatch_glcmec with GLC_NEC option
-! Set glc_do_dynglacier with GLC_TWO_WAY_COUPLING env variable
-!----------------------------------------------------------------------------------
-
-! h0 stream (monthly average, gridcell-level)
-! Emon, Lmon, LIMon
-hist_fexcl1 = 'PCT_CFT', 'PCT_GLC_MEC', 'SOIL1C_vr', 'SOIL1N_vr', 'SOIL2C_vr', 'SOIL2N_vr', 'SOIL3C_vr', 'SOIL3N_vr', 'CWDC_vr',
-'LITR1C_vr', 'LITR2C_vr', 'LITR3C_vr', 'LITR1N_vr', 'LITR2N_vr', 'LITR3N_vr','CWDN_vr',
-'PCT_NAT_PFT','SMIN_NO3_vr','CONC_O2_UNSAT', 'CONC_O2_SAT','SMIN_NH4_vr','SMINN_vr'
-
-! h0 stream ICE variables and other variables inactive by default (monthly average, gridcell-level)
-! Emon, Lmon, LIMon
-hist_fincl1 = 'EFLX_LH_TOT_ICE', 'FIRE_ICE', 'FLDS_ICE', 'FSH_ICE', 'FSNO_ICE', 'FSR_ICE',
-'QFLX_SUB_SNOW_ICE', 'QRUNOFF_ICE', 'QSNOFRZ_ICE', 'QSNOMELT_ICE', 'RAIN_ICE', 'SNOW_ICE',
-'SNOWICE_ICE', 'SNOWLIQ_ICE', 'SNOTXMASS_ICE', 'TG_ICE', 'TOPO_COL_ICE', 'TSA_ICE', 'TSOI_ICE',
-'LEAFC_TO_LITTER', 'FROOTC_TO_LITTER','LITR1C_TO_SOIL1C','LITR1N_TO_SOIL1N','LITR2C_TO_SOIL1C',
-'LITR2N_TO_SOIL1N','LITR3C_TO_SOIL2C','LITR3N_TO_SOIL2N','DWT_WOOD_PRODUCTC_GAIN_PATCH'
-
-! h1 stream (monthly average, finest sub-grid)
-! Emon, Lmon
-hist_fincl2 = 'GPP', 'NPP', 'AGNPP', 'TLAI', 'TOTVEGC', 'TSA','TREFMNAV','TREFMXAV', 'BTRANMN', 'NPP_NUPTAKE', 'GRAINC_TO_FOOD',
-'Vcmx25Z', 'FSH', 'NFERTILIZATION', 'AR', 'VEGWP', 'FCTR', 'FCEV', 'FGEV', 'FIRE', 'FSR', 'HTOP',
-'FIRA', 'FSA', 'HR', 'GSSUNLN', 'GSSHALN', 'TSKIN'
-
-! h2 stream (monthly average, landunit-level)
-! Emon
-! TOT_WOODPRODC:I, CROPPROD1C:I, and NEE are not available at the landunit level
-hist_fincl3 = 'FSR', 'H2OSNO', 'Q2M', 'SNOWDP', 'TSA', 'TREFMNAV', 'TREFMXAV', 'TG', 'QRUNOFF', 'FSH', 'FIRE', 'FIRA', 'FGR',
-'EFLX_LH_TOT', 'RH2M', 'TLAI', 'GPP', 'NPP', 'SOILWATER_10CM', 'TOTSOILLIQ', 'TOTSOILICE', 'AR', 'HR', 'DWT_CONV_CFLUX_PATCH',
-'WOOD_HARVESTC', 'U10', 'DWT_WOOD_PRODUCTC_GAIN_PATCH', 'GRAINC_TO_FOOD', 'SLASH_HARVESTC', 'TSOI_10CM', 'COL_FIRE_CLOSS',
-'DWT_SLASH_CFLUX', 'QIRRIG', 'URBAN_HEAT', 'WASTEHEAT', 'HTOP', 'TSKIN', 'FROOTC:I'
-
-! h3 stream (yearly average, gridcell-level)
-! Eyr
-hist_fincl4 = 'PCT_CFT', 'PCT_GLC_MEC', 'SOIL1C_vr', 'SOIL1N_vr', 'SOIL2C_vr', 'SOIL2N_vr', 'SOIL3C_vr', 'SOIL3N_vr', 'CWDC_vr',
-'LITR1C_vr', 'LITR2C_vr', 'LITR3C_vr', 'LITR1N_vr', 'LITR2N_vr', 'LITR3N_vr','CWDN_vr', 'QICE_FORC', 'TSRF_FORC', 'TOPO_FORC'
-'PCT_NAT_PFT','PCT_LANDUNIT','TOTLITC:I','TOT_WOODPRODC:I','CROPPROD1C:I','TOTSOMC:I','TOTVEGC:I','FSNO_ICE'
-
-! h4 stream (yearly average, landunit-level)
-! Eyr landuse tiles
-hist_fincl5 = 'TOTSOMC:I', 'TOTSOMC_1m:I', 'TOTECOSYSC:I', 'TOTVEGC:I', 'WOODC:I', 'TOTLITC:I', 'LIVECROOTC:I', 'DEADCROOTC:I', 'FROOTC:I'
-
-! h5 stream (daily average, gridcell-level)
-! day, Eday
-hist_fincl6 = 'SOILWATER_10CM', 'TOTSOILLIQ', 'TOTSOILICE', 'GPP', 'NPP', 'AR', 'HR', 'EFLX_LH_TOT', 'FSH', 'FGR12', 'FSM', 'QSNOEVAP', 'TLAI', 'QDRAI', 'QDRAI_PERCH', 'QOVER', 'QFLX_SUB_SNOW', 'FSA', 'FIRA', 'H2OSNO', 'SNOCAN', 'QSNOFRZ', 'QFLX_SNOW_DRAIN', 'SNOWDP', 'H2OSFC', 'TV', 'TG', 'TAUX', 'TAUY', 'QVEGT', 'TWS', 'H2OCAN', 'ALT', 'QVEGE', 'QSOIL', 'TSKIN', 'FSDS','FSNO','SNOFSRVD','SNOFSRVI','SNOFSRND','SNOFSRNI','FSDSVD','FSDSVI','FSDSND','FSDSNI','SNOWLIQ','SOILICE','SOILLIQ','QINTR','SNOBCMSL','TSOI','SNOTXMASS','SNOWICE','SNOWLIQ','QRUNOFF','RAIN','SNOW'
-
-! h6 stream (daily average, landunit-level)
-! Eday
-hist_fincl7 = 'TREFMXAV','TREFMNAV'
-
-! h7 stream (3-hourly average, gridcell-level)
-! 3hr, E3hr, CF3hr
-! 3hr requires QRUNOFF for time mean, and SOILWATER_10CM, TSKIN for time point (I)
-! E3hr requires GPP, AR, HR for time mean
-! CF3hr requires QFLX_SUB_SNOW for time point (I)
-hist_fincl8 = 'GPP','AR','HR','TSA','RH2M','SOILWATER_10CM:I','FSH','EFLX_LH_TOT','FSDS','QRUNOFF','QFLX_SUB_SNOW:I','TSKIN:I'
-
-hist_mfilt = 1,1,1,1,1,365,365,2920
-hist_dov2xy = .true.,.false.,.false.,.true.,.false.,.true.,.false.,.true.
-hist_nhtfrq = 0,0,0,-8760,-8760,-24,-24,-3
-hist_type1d_pertape = ' ',' ','LAND',' ','LAND',' ','LAND',' '
diff --git a/cime_config/usermods_dirs/cmip6_waccm_deck/README b/cime_config/usermods_dirs/cmip6_waccm_deck/README
new file mode 100644
index 0000000000..8f85af14a3
--- /dev/null
+++ b/cime_config/usermods_dirs/cmip6_waccm_deck/README
@@ -0,0 +1,16 @@
+WACCM DECK runs should be configured similarly to CAM DECK runs, but
+without virtual elevation classes over Antarctica.
+
+(2018-10-22) In discussions between Bill Sacks and Bill Lipscomb: We
+have decided NOT to turn on virtual Antarctica columns for any of the
+WACCM simulations (DECK or ScenarioMIP): these weren't turned on in the
+WACCM PI-Control or historical runs (either by accident or
+intentionally: I'm not sure which, and can't find emails describing this
+decision). Since this setting needs to be compatible with the REFCASE,
+it's simpler if we keep it consistent for all WACCM runs, and there
+seems to be only limited value in turning on virtual Antarctica columns
+in the remaining WACCM runs (1% CO2, 4xCO2 and ScenarioMIP) when they
+weren't on in the WACCM PI-Control or Historical runs. And Mike Mills
+says that there won't be any more sharing of initial conditions between
+CAM and WACCM CMIP6 runs, so it's fine if the two sets remain different
+in this respect.
diff --git a/cime_config/usermods_dirs/cmip6_waccm_deck/include_user_mods b/cime_config/usermods_dirs/cmip6_waccm_deck/include_user_mods
new file mode 100644
index 0000000000..ad94a3093c
--- /dev/null
+++ b/cime_config/usermods_dirs/cmip6_waccm_deck/include_user_mods
@@ -0,0 +1,3 @@
+../_includes/cmip6_glaciers_cplhist
+../_includes/cmip6_carbon_isotopes
+../output_crop
diff --git a/cime_config/usermods_dirs/output_bgc/include_user_mods b/cime_config/usermods_dirs/output_bgc/include_user_mods
new file mode 100644
index 0000000000..f274805316
--- /dev/null
+++ b/cime_config/usermods_dirs/output_bgc/include_user_mods
@@ -0,0 +1 @@
+../_includes/output_base
diff --git a/cime_config/usermods_dirs/output_bgc/user_nl_clm b/cime_config/usermods_dirs/output_bgc/user_nl_clm
new file mode 100644
index 0000000000..c97c282ff6
--- /dev/null
+++ b/cime_config/usermods_dirs/output_bgc/user_nl_clm
@@ -0,0 +1,21 @@
+!----------------------------------------------------------------------------------
+! Settings from output_bgc
+!----------------------------------------------------------------------------------
+
+! h0 stream (monthly average, gridcell-level)
+hist_fexcl1 += 'SOIL1C_vr', 'SOIL1N_vr', 'SOIL2C_vr', 'SOIL2N_vr', 'SOIL3C_vr', 'SOIL3N_vr', 'CWDC_vr', 'LITR1C_vr', 'LITR2C_vr', 'LITR3C_vr', 'LITR1N_vr', 'LITR2N_vr', 'LITR3N_vr', 'CWDN_vr', 'SMIN_NO3_vr', 'CONC_O2_UNSAT', 'CONC_O2_SAT','SMIN_NH4_vr','SMINN_vr'
+hist_fincl1 += 'LEAFC_TO_LITTER', 'FROOTC_TO_LITTER','LITR1C_TO_SOIL1C','LITR1N_TO_SOIL1N','LITR2C_TO_SOIL1C', 'LITR2N_TO_SOIL1N','LITR3C_TO_SOIL2C','LITR3N_TO_SOIL2N','DWT_WOOD_PRODUCTC_GAIN_PATCH'
+
+! h1 stream (monthly average, finest sub-grid)
+hist_fincl2 += 'GPP', 'NPP', 'AGNPP', 'TOTVEGC', 'NPP_NUPTAKE', 'AR', 'HR', 'HTOP'
+
+! h2 stream (monthly average, landunit-level)
+! TOT_WOODPRODC:I, CROPPROD1C:I, and NEE are not available at the landunit level
+hist_fincl3 += 'GPP', 'NPP', 'AR', 'HR', 'DWT_CONV_CFLUX_PATCH', 'WOOD_HARVESTC', 'DWT_WOOD_PRODUCTC_GAIN_PATCH', 'SLASH_HARVESTC', 'COL_FIRE_CLOSS', 'DWT_SLASH_CFLUX', 'FROOTC:I', 'HTOP'
+
+! h3 stream (yearly average, gridcell-level)
+hist_fincl4 += 'SOIL1C_vr', 'SOIL1N_vr', 'SOIL2C_vr', 'SOIL2N_vr', 'SOIL3C_vr', 'SOIL3N_vr', 'CWDC_vr', 'LITR1C_vr', 'LITR2C_vr', 'LITR3C_vr', 'LITR1N_vr', 'LITR2N_vr', 'LITR3N_vr','CWDN_vr', 'TOTLITC:I', 'TOT_WOODPRODC:I', 'TOTSOMC:I','TOTVEGC:I'
+
+! h4 stream (yearly average, landunit-level)
+hist_fincl5 += 'TOTSOMC:I', 'TOTSOMC_1m:I', 'TOTECOSYSC:I', 'TOTVEGC:I', 'WOODC:I', 'TOTLITC:I', 'LIVECROOTC:I', 'DEADCROOTC:I', 'FROOTC:I'
+
diff --git a/cime_config/usermods_dirs/output_bgc_highfreq/include_user_mods b/cime_config/usermods_dirs/output_bgc_highfreq/include_user_mods
new file mode 100644
index 0000000000..206b1ad95e
--- /dev/null
+++ b/cime_config/usermods_dirs/output_bgc_highfreq/include_user_mods
@@ -0,0 +1,2 @@
+../output_bgc
+../_includes/output_base_highfreq
diff --git a/cime_config/usermods_dirs/output_bgc_highfreq/user_nl_clm b/cime_config/usermods_dirs/output_bgc_highfreq/user_nl_clm
new file mode 100644
index 0000000000..b6fc0b1133
--- /dev/null
+++ b/cime_config/usermods_dirs/output_bgc_highfreq/user_nl_clm
@@ -0,0 +1,11 @@
+!----------------------------------------------------------------------------------
+! Settings from output_bgc_highfreq
+!----------------------------------------------------------------------------------
+
+! h5 stream (daily average, gridcell-level)
+hist_fincl6 += 'GPP', 'NPP', 'AR', 'HR', 'ALT'
+
+! h7 stream (3-hourly average, gridcell-level)
+! E3hr requires GPP, AR, HR for time mean
+hist_fincl8 += 'GPP','AR','HR'
+
diff --git a/cime_config/usermods_dirs/output_crop/include_user_mods b/cime_config/usermods_dirs/output_crop/include_user_mods
new file mode 100644
index 0000000000..3f5a274997
--- /dev/null
+++ b/cime_config/usermods_dirs/output_crop/include_user_mods
@@ -0,0 +1 @@
+../output_bgc
diff --git a/cime_config/usermods_dirs/output_crop/user_nl_clm b/cime_config/usermods_dirs/output_crop/user_nl_clm
new file mode 100644
index 0000000000..638fea8815
--- /dev/null
+++ b/cime_config/usermods_dirs/output_crop/user_nl_clm
@@ -0,0 +1,16 @@
+!----------------------------------------------------------------------------------
+! Settings from output_crop
+!----------------------------------------------------------------------------------
+
+! h0 stream (monthly average, gridcell-level)
+hist_fexcl1 += 'PCT_CFT'
+
+! h1 stream (monthly average, finest sub-grid)
+hist_fincl2 += 'GRAINC_TO_FOOD','NFERTILIZATION'
+
+! h2 stream (monthly average, landunit-level)
+hist_fincl3 += 'GRAINC_TO_FOOD'
+
+! h3 stream (yearly average, gridcell-level)
+hist_fincl4 += 'PCT_CFT','CROPPROD1C:I'
+
diff --git a/cime_config/usermods_dirs/output_crop_highfreq/include_user_mods b/cime_config/usermods_dirs/output_crop_highfreq/include_user_mods
new file mode 100644
index 0000000000..62e8c58697
--- /dev/null
+++ b/cime_config/usermods_dirs/output_crop_highfreq/include_user_mods
@@ -0,0 +1,2 @@
+../output_crop
+../output_bgc_highfreq
diff --git a/cime_config/usermods_dirs/output_sp/include_user_mods b/cime_config/usermods_dirs/output_sp/include_user_mods
new file mode 100644
index 0000000000..f274805316
--- /dev/null
+++ b/cime_config/usermods_dirs/output_sp/include_user_mods
@@ -0,0 +1 @@
+../_includes/output_base
diff --git a/cime_config/usermods_dirs/output_sp/user_nl_clm b/cime_config/usermods_dirs/output_sp/user_nl_clm
new file mode 100644
index 0000000000..1dfb4970b5
--- /dev/null
+++ b/cime_config/usermods_dirs/output_sp/user_nl_clm
@@ -0,0 +1,10 @@
+!----------------------------------------------------------------------------------
+! Settings from output_sp
+!----------------------------------------------------------------------------------
+
+! h1 stream (monthly average, finest sub-grid)
+hist_fincl2 += 'FPSN'
+
+! h2 stream (monthly average, landunit-level)
+hist_fincl3 += 'FPSN'
+
diff --git a/cime_config/usermods_dirs/output_sp_highfreq/include_user_mods b/cime_config/usermods_dirs/output_sp_highfreq/include_user_mods
new file mode 100644
index 0000000000..0915682e36
--- /dev/null
+++ b/cime_config/usermods_dirs/output_sp_highfreq/include_user_mods
@@ -0,0 +1,2 @@
+../output_sp
+../_includes/output_base_highfreq
diff --git a/cime_config/usermods_dirs/output_sp_highfreq/user_nl_clm b/cime_config/usermods_dirs/output_sp_highfreq/user_nl_clm
new file mode 100644
index 0000000000..a8f6e30965
--- /dev/null
+++ b/cime_config/usermods_dirs/output_sp_highfreq/user_nl_clm
@@ -0,0 +1,10 @@
+!----------------------------------------------------------------------------------
+! Settings from output_sp_highfreq
+!----------------------------------------------------------------------------------
+
+! h5 stream (daily average, gridcell-level)
+hist_fincl6 += 'FPSN'
+
+! h7 stream (3-hourly average, gridcell-level)
+hist_fincl8 += 'FPSN'
+
diff --git a/doc/ChangeLog b/doc/ChangeLog
index 5bf6f59553..96569f387b 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,4 +1,318 @@
===============================================================
+Tag name: ctsm1.0.dev015
+Originator(s): sacks (Bill Sacks)
+Date: Sun Oct 28 14:29:30 MDT 2018
+One-line Summary: CMIP6 compset modifiers, usermods for typical output, and other output enhancements
+
+Purpose of changes
+------------------
+
+(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
+ ESCOMP/ctsm#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
+ https://github.com/ESCOMP/ctsm/issues/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
+
+Bugs fixed or introduced
+------------------------
+
+Issues fixed (include CTSM Issue #):
+- Fixes #24 for real (ncd_io_1d_log_glob is broken)
+- Fixes #529 (Organize usermods_dirs to facilitate running cases with
+ the right output)
+
+
+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
+
+[ ] clm4_5
+
+[ ] clm4_0
+
+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):
+- New namelist variable, just for testing purposes:
+ for_testing_allow_interp_non_ciso_to_ciso. This bypasses an error
+ check, and should only be used in tests.
+
+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: none
+
+Notes of particular relevance for developers: (including Code reviews and testing)
+---------------------------------------------
+NOTE: Be sure to review the steps in ../CTSMMasterChecklist 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:
+- Reworked tests of cmip6_deck usermods to use the new
+ %BGC-CROP-CMIP6DECK compset modifier, and changed f09_g16 to f09_g17
+- Added a test of the %BGC-CROP-CMIP6WACCMDECK compset modifier
+- Added tests of output_crop_highfreq, output_bgc_highfreq and
+ output_sp_highfreq usermods directories
+- Note that there are NO tests covering the cmip6_evolving_icesheet
+ usermods: this usermod directory adds very little beyond cmip6_deck,
+ so it didn't seem worth its own test
+
+Code reviewed by: Erik Kluzek
+
+
+CTSM testing:
+
+ [PASS means all tests PASS and OK means tests PASS other than expected fails.]
+
+ build-namelist tests:
+
+ cheyenne - not run
+
+ unit-tests (components/clm/src):
+
+ cheyenne - pass
+
+ tools-tests (components/clm/test/tools):
+
+ cheyenne - not run
+
+ PTCLM testing (components/clm/tools/shared/PTCLM/test):
+
+ cheyenne - not run
+
+ regular tests (aux_clm):
+
+ cheyenne_intel ---- pass
+ cheyenne_gnu ------ pass
+ hobart_nag -------- pass
+ hobart_pgi -------- pass
+ hobart_intel ------ pass
+
+ ERI_D_Ld9.T31_g37.I2000Clm50Sp.cheyenne_intel.clm-SNICARFRC
+ initially failed COMPARE_base_hybrid, COMPARE_base_rest and BASELINE
+ comparisons. I reran it and it passed.
+
+ Manually compared all history files from
+ ERS_Ly3.f10_f10_musgs.I1850Clm50BgcCropCmip6.cheyenne_intel.clm-basic
+ with baseline
+ ERS_Ly3.f10_f10_musgs.I1850Clm50BgcCrop.cheyenne_intel.clm-cmip6. They
+ were all identical. Also compared all history files from
+ SMS_Ld5_D.f09_g17.I1850Clm50BgcCropCmip6.cheyenne_intel.clm-basic
+ with baseline
+ SMS_Ld5_D.f09_g17.I1850Clm50BgcCrop.cheyenne_intel.clm-cmip6. They
+ were all identical (but note that this basically just compared the
+ cpl.hi file: the test was too short to produce monthly files.)
+
+CTSM tag used for the baseline comparisons: ctsm1.0.dev014
+
+
+Answer changes
+--------------
+
+Changes answers relative to baseline: NO
+
+
+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/536 - Allow holes in the number of
+ history tapes and reorganize cmip6 usermods (main PR containing all of
+ these changes)
+- https://github.com/ESCOMP/ctsm/pull/527 - Add carbon_isotope user-mod
+ directory to turn on c13 and c14
+- https://github.com/ESCOMP/ctsm/pull/539 - Support a %CMIP6DECK compset
+ modifier
+
+===============================================================
+===============================================================
+Tag name: ctsm1.0.dev014
+Originator(s): sacks (Bill Sacks)
+Date: Fri Oct 26 06:20:34 MDT 2018
+One-line Summary: Miscellaneous minor, bit-for-bit bug fixes
+
+Purpose of changes
+------------------
+
+Four miscellaneous minor, bit-for-bit bug fixes:
+
+(1) Py3 pylint check and address cime issue ESMCI/cime#2822 (from Jim
+ Edwards: ESCOMP/ctsm#526)
+
+(2) Change uppercase DEBUG variables to lowercase debug (requested by
+ Jim Edwards to avoid conflicting with the DEBUG CPP token)
+ (Fixes ESCOMP/ctsm#534)
+
+(3) Remove unnecessary line of code in LunaMod.F90 that was causing
+ problems with some compilers due to an uninitialized variable
+ (Fixes ESCOMP/ctsm#322)
+
+(4) Add r8 to 0 constant to fix build issue with XLF compiler (from Jim
+ Edwards: ESCOMP/ctsm#531)
+
+
+Bugs fixed or introduced
+------------------------
+
+Issues fixed (include CTSM Issue #):
+- Fixes ESCOMP/ctsm#322 (ERS_D_Ld5.f19_g16.I2000Clm50BgcCruGs run FAIL (intel))
+- Fixes ESCOMP/ctsm#534 (Rename DEBUG to debug in a few places)
+
+
+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
+
+[ ] clm4_5
+
+[ ] clm4_0
+
+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: none
+
+Notes of particular relevance for developers: (including Code reviews and testing)
+---------------------------------------------
+NOTE: Be sure to review the steps in ../CTSMMasterChecklist as well as the coding style in the Developers Guide
+
+Caveats for developers (e.g., code that is duplicated that requires double maintenance):
+
+Changes to tests or testing: none
+
+Code reviewed by: different pieces reviewed by different people
+
+
+CTSM testing:
+
+ [PASS means all tests PASS and OK means tests PASS other than expected fails.]
+
+ build-namelist tests:
+
+ cheyenne - not run
+
+ unit-tests (components/clm/src):
+
+ cheyenne - pass
+
+ tools-tests (components/clm/test/tools):
+
+ cheyenne - not run
+
+ PTCLM testing (components/clm/tools/shared/PTCLM/test):
+
+ cheyenne - not run
+
+ regular tests (aux_clm):
+
+ cheyenne_intel ---- ok
+ cheyenne_gnu ------ ok
+ hobart_nag -------- ok
+ hobart_pgi -------- ok
+ hobart_intel ------ ok
+
+ ok means tests and baseline comparisons pass. There were unexpected
+ NLCOMP diffs. From spot-checking a few tests, I see the following:
+
+
+ (1) On both cheyenne and hobart: Diffs in logfile. This looks like a
+ problem in cime: it says:
+
+ BASE: logfile = 'rof.log.136342.hobart.cgd.ucar.edu
+ COMP: logfile = 'rof.log
+
+ (2) On hobart: Diffs in pio_typename: netcdf vs. pnetcdf (says that
+ new uses pnetcdf): but when I compare files by hand, they look
+ the same in this respect (both baseline and new use netcdf), so
+ maybe this is due to a problem in the timing of when nlcomp is
+ run?
+
+ Since these both look like problems in the comparison script rather
+ than in the tag, I'm letting these go, but will open a cime issue if
+ we see this again.
+
+
+CTSM tag used for the baseline comparisons: ctsm1.0.dev013
+
+
+Answer changes
+--------------
+
+Changes answers relative to baseline: NO
+
+
+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/531 (fix build issue with xlf compiler)
+- https://github.com/ESCOMP/ctsm/pull/526 (fix cime issue 2822 and pylint chk)
+
+===============================================================
+===============================================================
Tag name: ctsm1.0.dev012
Originator(s): erik (Erik Kluzek)
Date: Sat Sep 29 11:49:35 MDT 2018
diff --git a/doc/ChangeSum b/doc/ChangeSum
index 5df2922ee9..1f019d7460 100644
--- a/doc/ChangeSum
+++ b/doc/ChangeSum
@@ -1,5 +1,8 @@
Tag Who Date Summary
============================================================================================================================
+release-clm5.0.10 sacks 10/29/2018 Bring in CMIP6 compset modifiers, output usermods and bit-for-bit fixes from dev014 and dev015
+ ctsm1.0.dev015 sacks 10/28/2018 CMIP6 compset modifiers, usermods for typical output, and other output enhancements
+ ctsm1.0.dev014 sacks 10/26/2018 Miscellaneous minor, bit-for-bit bug fixes
release-clm5.0.09 erik 10/23/2018 Bring in bit-for-bit changes from master up to ctsm1.0.dev012: AnnEt init, snowmip fields
ctsm1.0.dev012 erik 09/29/2018 Add snow-free fields for snowmip, fix several issues
ctsm1.0.dev011 sacks 09/12/2018 SKIPPED ON RELEASE BRANCH -- water tracer consistency checks
diff --git a/doc/release-clm5.0.ChangeLog b/doc/release-clm5.0.ChangeLog
index c0fd701b3c..9fdba22f7c 100644
--- a/doc/release-clm5.0.ChangeLog
+++ b/doc/release-clm5.0.ChangeLog
@@ -1,4 +1,181 @@
===============================================================
+Tag name: release-clm5.0.10
+Originator(s): sacks (Bill Sacks)
+Date: Mon Oct 29 06:55:41 MDT 2018
+One-line Summary: Bring in CMIP6 compset modifiers, output usermods and bit-for-bit fixes from dev014 and dev015
+
+Purpose of this version:
+------------------------
+
+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
+ ESCOMP/ctsm#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
+ https://github.com/ESCOMP/ctsm/issues/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: ESCOMP/ctsm#526)
+
+(2) Change uppercase DEBUG variables to lowercase debug (requested by
+ Jim Edwards to avoid conflicting with the DEBUG CPP token)
+ (Fixes ESCOMP/ctsm#534)
+
+(3) Remove unnecessary line of code in LunaMod.F90 that was causing
+ problems with some compilers due to an uninitialized variable
+ (Fixes ESCOMP/ctsm#322)
+
+(4) Add r8 to 0 constant to fix build issue with XLF compiler (from Jim
+ Edwards: ESCOMP/ctsm#531)
+
+
+CTSM Master Tag This Corresponds To: ctsm1.0.dev015 (but doesn't yet
+include ctsm1.0.dev013)
+
+Summary of changes:
+-------------------
+
+Issues fixed (include CTSM Issue #):
+- Fixes #322 (ERS_D_Ld5.f19_g16.I2000Clm50BgcCruGs run FAIL (intel))
+- Fixes #534 (Rename DEBUG to debug in a few places)
+- Fixes #24 for real (ncd_io_1d_log_glob is broken)
+- Fixes #529 (Organize usermods_dirs to facilitate running cases with
+ the right output)
+
+Science changes since: release-clm5.0.09
+
+None
+
+Software changes since: release-clm5.0.09
+
+See above for full list
+
+Changes to User Interface since: release-clm5.0.09
+
+- New namelist variable, just for testing purposes:
+ for_testing_allow_interp_non_ciso_to_ciso. This bypasses an error
+ check, and should only be used in tests.
+
+Testing:
+--------
+
+ [PASS means all tests PASS and OK means tests PASS other than expected fails.]
+
+ build-namelist tests:
+
+ cheyenne - not run
+
+ unit-tests (components/clm/src):
+
+ cheyenne - pass
+ hobart --- not run
+
+ tools-tests (components/clm/test/tools):
+
+ cheyenne - not run
+ hobart --- not run
+
+ PTCLM testing (components/clm/tools/shared/PTCLM/test):
+
+ cheyenne - not run
+ hobart --- not run
+
+ regular tests (aux_clm):
+
+ cheyenne_intel ---- pass
+ cheyenne_gnu ------ pass
+ hobart_nag -------- pass
+ hobart_pgi -------- pass
+ hobart_intel ------ pass
+
+ regular tests (prealpha):
+
+ cheyenne_intel - not run
+ cheyenne_gnu --- not run
+ hobart_nag ----- not run
+
+ regular tests (prebeta):
+
+ cheyenne_intel - not run
+ cheyenne_gnu --- not run
+ hobart_nag ----- not run
+
+Summary of Answer changes:
+-------------------------
+
+Baseline version for comparison: release-clm5.0.09
+
+Changes answers relative to baseline: NO
+
+
+Detailed list of changes:
+------------------------
+
+Externals being used:
+
+ cism: release-cesm2.0.04
+ rtm: release-cesm2.0.00
+ mosart: release-cesm2.0.00
+ cime: cime_cesm2_0_rel_05
+ FATES: fates_s1.8.1_a3.0.0
+ PTCLM: PTCLM2_180611
+
+CTSM Tag versions pulled over from master development branch:
+- ctsm1.0.dev014
+- ctsm1.0.dev015
+
+Pull Requests that document the changes (include PR ids):
+- https://github.com/ESCOMP/ctsm/pull/531 - fix build issue with xlf compiler
+- https://github.com/ESCOMP/ctsm/pull/526 - fix cime issue 2822 and pylint chk
+- https://github.com/ESCOMP/ctsm/pull/536 - Allow holes in the number of
+ history tapes and reorganize cmip6 usermods (main PR containing all of
+ these changes)
+- https://github.com/ESCOMP/ctsm/pull/527 - Add carbon_isotope user-mod
+ directory to turn on c13 and c14
+- https://github.com/ESCOMP/ctsm/pull/539 - Support a %CMIP6DECK compset
+ modifier
+
+===============================================================
+===============================================================
Tag name: release-clm5.0.09
Originator(s): erik (Erik Kluzek)
Date: Tue Oct 23 00:00:50 MDT 2018
diff --git a/src/biogeochem/CNCIsoAtmTimeSeriesReadMod.F90 b/src/biogeochem/CNCIsoAtmTimeSeriesReadMod.F90
index 5e15c98d3b..83b174379e 100644
--- a/src/biogeochem/CNCIsoAtmTimeSeriesReadMod.F90
+++ b/src/biogeochem/CNCIsoAtmTimeSeriesReadMod.F90
@@ -122,13 +122,13 @@ subroutine C14_init_BombSpike()
character(len=*), parameter :: vname = 'Delta14co2_in_air' ! Variable name on file
!-----------------------------------------------------------------------
+ call getfil(atm_c14_filename, locfn, 0)
+
if ( masterproc ) then
write(iulog, *) 'C14_init_BombSpike: preparing to open file:'
write(iulog, *) trim(locfn)
endif
- call getfil(atm_c14_filename, locfn, 0)
-
call ncd_pio_openfile (ncid, trim(locfn), 0)
call ncd_inqdlen(ncid,dimid,ntim,'time')
@@ -241,13 +241,13 @@ subroutine C13_init_TimeSeries()
character(len=*), parameter :: vname = 'delta13co2_in_air' ! Variable name on file
!-----------------------------------------------------------------------
+ call getfil(atm_c13_filename, locfn, 0)
+
if ( masterproc ) then
write(iulog, *) 'C13_init_TimeSeries: preparing to open file:'
write(iulog, *) trim(locfn)
endif
- call getfil(atm_c13_filename, locfn, 0)
-
call ncd_pio_openfile (ncid, trim(locfn), 0)
call ncd_inqdlen(ncid,dimid,ntim,'time')
diff --git a/src/biogeochem/CNProductsMod.F90 b/src/biogeochem/CNProductsMod.F90
index 59891ba330..ed2c67d56b 100644
--- a/src/biogeochem/CNProductsMod.F90
+++ b/src/biogeochem/CNProductsMod.F90
@@ -162,6 +162,7 @@ subroutine InitHistory(this, bounds)
!
! !LOCAL VARIABLES:
integer :: begg,endg
+ character(len=:), allocatable :: active_if_non_isotope
character(len=*), parameter :: subname = 'InitHistory'
!-----------------------------------------------------------------------
@@ -169,13 +170,19 @@ subroutine InitHistory(this, bounds)
begg = bounds%begg
endg = bounds%endg
+ if (this%species%is_isotope()) then
+ active_if_non_isotope = 'inactive'
+ else
+ active_if_non_isotope = 'active'
+ end if
+
this%cropprod1_grc(begg:endg) = spval
call hist_addfld1d( &
fname = this%species%hist_fname('CROPPROD1'), &
units = 'g' // this%species%get_species() // '/m^2', &
avgflag = 'A', &
long_name = '1-yr grain product ' // this%species%get_species(), &
- ptr_gcell = this%cropprod1_grc)
+ ptr_gcell = this%cropprod1_grc, default=active_if_non_isotope)
this%prod10_grc(begg:endg) = spval
call hist_addfld1d( &
@@ -199,7 +206,7 @@ subroutine InitHistory(this, bounds)
units = 'g' // this%species%get_species() // '/m^2', &
avgflag = 'A', &
long_name = 'total wood product ' // this%species%get_species(), &
- ptr_gcell = this%tot_woodprod_grc)
+ ptr_gcell = this%tot_woodprod_grc, default=active_if_non_isotope)
this%dwt_prod10_gain_grc(begg:endg) = spval
call hist_addfld1d( &
@@ -223,7 +230,7 @@ subroutine InitHistory(this, bounds)
units = 'g' // this%species%get_species() // '/m^2/s', &
avgflag = 'A', &
long_name = 'landcover change-driven addition to wood product pools', &
- ptr_gcell = this%dwt_woodprod_gain_grc)
+ ptr_gcell = this%dwt_woodprod_gain_grc, default=active_if_non_isotope)
this%dwt_cropprod1_gain_grc(begg:endg) = spval
call hist_addfld1d( &
@@ -231,7 +238,7 @@ subroutine InitHistory(this, bounds)
units = 'g' // this%species%get_species() // '/m^2/s', &
avgflag = 'A', &
long_name = 'landcover change-driven addition to 1-year crop product pool', &
- ptr_gcell = this%dwt_cropprod1_gain_grc)
+ ptr_gcell = this%dwt_cropprod1_gain_grc, default=active_if_non_isotope)
this%cropprod1_loss_grc(begg:endg) = spval
call hist_addfld1d( &
@@ -239,7 +246,7 @@ subroutine InitHistory(this, bounds)
units = 'g' // this%species%get_species() // '/m^2/s', &
avgflag = 'A', &
long_name = 'loss from 1-yr grain product pool', &
- ptr_gcell = this%cropprod1_loss_grc)
+ ptr_gcell = this%cropprod1_loss_grc, default=active_if_non_isotope)
this%prod10_loss_grc(begg:endg) = spval
call hist_addfld1d( &
@@ -263,7 +270,7 @@ subroutine InitHistory(this, bounds)
units = 'g' // this%species%get_species() // '/m^2/s', &
avgflag = 'A', &
long_name = 'total loss from wood product pools', &
- ptr_gcell = this%tot_woodprod_loss_grc)
+ ptr_gcell = this%tot_woodprod_loss_grc, default=active_if_non_isotope)
end subroutine InitHistory
diff --git a/src/biogeochem/CNVegCarbonFluxType.F90 b/src/biogeochem/CNVegCarbonFluxType.F90
index 2ec35353f0..079813d2a3 100644
--- a/src/biogeochem/CNVegCarbonFluxType.F90
+++ b/src/biogeochem/CNVegCarbonFluxType.F90
@@ -1695,17 +1695,17 @@ subroutine InitHistory(this, bounds, carbon_type)
this%rr_patch(begp:endp) = spval
call hist_addfld1d (fname='C13_RR', units='gC13/m^2/s', &
avgflag='A', long_name='C13 root respiration (fine root MR + total root GR)', &
- ptr_patch=this%rr_patch)
+ ptr_patch=this%rr_patch, default='inactive')
this%mr_patch(begp:endp) = spval
call hist_addfld1d (fname='C13_MR', units='gC13/m^2/s', &
avgflag='A', long_name='C13 maintenance respiration', &
- ptr_patch=this%mr_patch)
+ ptr_patch=this%mr_patch, default='inactive')
this%gr_patch(begp:endp) = spval
call hist_addfld1d (fname='C13_GR', units='gC13/m^2/s', &
avgflag='A', long_name='C13 total growth respiration', &
- ptr_patch=this%gr_patch)
+ ptr_patch=this%gr_patch, default='inactive')
this%ar_patch(begp:endp) = spval
call hist_addfld1d (fname='C13_AR', units='gC13/m^2/s', &
@@ -1715,17 +1715,17 @@ subroutine InitHistory(this, bounds, carbon_type)
this%npp_patch(begp:endp) = spval
call hist_addfld1d (fname='C13_NPP', units='gC13/m^2/s', &
avgflag='A', long_name='C13 net primary production', &
- ptr_patch=this%npp_patch)
+ ptr_patch=this%npp_patch, default='inactive')
this%agnpp_patch(begp:endp) = spval
call hist_addfld1d (fname='C13_AGNPP', units='gC13/m^2/s', &
avgflag='A', long_name='C13 aboveground NPP', &
- ptr_patch=this%agnpp_patch)
+ ptr_patch=this%agnpp_patch, default='inactive')
this%bgnpp_patch(begp:endp) = spval
call hist_addfld1d (fname='C13_BGNPP', units='gC13/m^2/s', &
avgflag='A', long_name='C13 belowground NPP', &
- ptr_patch=this%bgnpp_patch)
+ ptr_patch=this%bgnpp_patch, default='inactive')
this%litfall_patch(begp:endp) = spval
call hist_addfld1d (fname='C13_LITFALL', units='gC13/m^2/s', &
@@ -1735,7 +1735,7 @@ subroutine InitHistory(this, bounds, carbon_type)
this%fire_closs_patch(begp:endp) = spval
call hist_addfld1d (fname='C13_PFT_FIRE_CLOSS', units='gC13/m^2/s', &
avgflag='A', long_name='C13 total patch-level fire C loss', &
- ptr_patch=this%fire_closs_patch)
+ ptr_patch=this%fire_closs_patch, default='inactive')
this%m_leafc_to_litter_patch(begp:endp) = spval
call hist_addfld1d (fname='C13_M_LEAFC_TO_LITTER', units='gC13/m^2/s', &
@@ -2010,12 +2010,12 @@ subroutine InitHistory(this, bounds, carbon_type)
this%psnsun_to_cpool_patch(begp:endp) = spval
call hist_addfld1d (fname='C13_PSNSUN_TO_CPOOL', units='gC13/m^2/s', &
avgflag='A', long_name='C13 C fixation from sunlit canopy', &
- ptr_patch=this%psnsun_to_cpool_patch)
+ ptr_patch=this%psnsun_to_cpool_patch, default='inactive')
this%psnshade_to_cpool_patch(begp:endp) = spval
call hist_addfld1d (fname='C13_PSNSHADE_TO_CPOOL', units='gC13/m^2/s', &
avgflag='A', long_name='C13 C fixation from shaded canopy', &
- ptr_patch=this%psnshade_to_cpool_patch)
+ ptr_patch=this%psnshade_to_cpool_patch, default='inactive')
this%cpool_to_leafc_patch(begp:endp) = spval
call hist_addfld1d (fname='C13_CPOOL_TO_LEAFC', units='gC13/m^2/s', &
@@ -2518,12 +2518,12 @@ subroutine InitHistory(this, bounds, carbon_type)
this%psnsun_to_cpool_patch(begp:endp) = spval
call hist_addfld1d (fname='C14_PSNSUN_TO_CPOOL', units='gC14/m^2/s', &
avgflag='A', long_name='C14 C fixation from sunlit canopy', &
- ptr_patch=this%psnsun_to_cpool_patch)
+ ptr_patch=this%psnsun_to_cpool_patch, default='inactive')
this%psnshade_to_cpool_patch(begp:endp) = spval
call hist_addfld1d (fname='C14_PSNSHADE_TO_CPOOL', units='gC14/m^2/s', &
avgflag='A', long_name='C14 C fixation from shaded canopy', &
- ptr_patch=this%psnshade_to_cpool_patch)
+ ptr_patch=this%psnshade_to_cpool_patch, default='inactive')
this%cpool_to_leafc_patch(begp:endp) = spval
call hist_addfld1d (fname='C14_CPOOL_TO_LEAFC', units='gC14/m^2/s', &
@@ -2748,17 +2748,17 @@ subroutine InitHistory(this, bounds, carbon_type)
this%rr_patch(begp:endp) = spval
call hist_addfld1d (fname='C14_RR', units='gC14/m^2/s', &
avgflag='A', long_name='C14 root respiration (fine root MR + total root GR)', &
- ptr_patch=this%rr_patch)
+ ptr_patch=this%rr_patch, default='inactive')
this%mr_patch(begp:endp) = spval
call hist_addfld1d (fname='C14_MR', units='gC14/m^2/s', &
avgflag='A', long_name='C14 maintenance respiration', &
- ptr_patch=this%mr_patch)
+ ptr_patch=this%mr_patch, default='inactive')
this%gr_patch(begp:endp) = spval
call hist_addfld1d (fname='C14_GR', units='gC14/m^2/s', &
avgflag='A', long_name='C14 total growth respiration', &
- ptr_patch=this%gr_patch)
+ ptr_patch=this%gr_patch, default='inactive')
this%ar_patch(begp:endp) = spval
call hist_addfld1d (fname='C14_AR', units='gC14/m^2/s', &
@@ -2768,17 +2768,17 @@ subroutine InitHistory(this, bounds, carbon_type)
this%npp_patch(begp:endp) = spval
call hist_addfld1d (fname='C14_NPP', units='gC14/m^2/s', &
avgflag='A', long_name='C14 net primary production', &
- ptr_patch=this%npp_patch)
+ ptr_patch=this%npp_patch, default='inactive')
this%agnpp_patch(begp:endp) = spval
call hist_addfld1d (fname='C14_AGNPP', units='gC14/m^2/s', &
avgflag='A', long_name='C14 aboveground NPP', &
- ptr_patch=this%agnpp_patch)
+ ptr_patch=this%agnpp_patch, default='inactive')
this%bgnpp_patch(begp:endp) = spval
call hist_addfld1d (fname='C14_BGNPP', units='gC14/m^2/s', &
avgflag='A', long_name='C14 belowground NPP', &
- ptr_patch=this%bgnpp_patch)
+ ptr_patch=this%bgnpp_patch, default='inactive')
this%litfall_patch(begp:endp) = spval
call hist_addfld1d (fname='C14_LITFALL', units='gC14/m^2/s', &
@@ -2788,7 +2788,7 @@ subroutine InitHistory(this, bounds, carbon_type)
this%fire_closs_patch(begp:endp) = spval
call hist_addfld1d (fname='C14_PFT_FIRE_CLOSS', units='gC14/m^2/s', &
avgflag='A', long_name='C14 total patch-level fire C loss', &
- ptr_patch=this%fire_closs_patch)
+ ptr_patch=this%fire_closs_patch, default='inactive')
endif
!-------------------------------
@@ -3034,7 +3034,7 @@ subroutine InitHistory(this, bounds, carbon_type)
call hist_addfld1d (fname='C13_DWT_CONV_CFLUX', units='gC13/m^2/s', &
avgflag='A', long_name='C13 conversion C flux (immediate loss to atm) ' // &
'(0 at all times except first timestep of year)', &
- ptr_gcell=this%dwt_conv_cflux_grc)
+ ptr_gcell=this%dwt_conv_cflux_grc, default='inactive')
this%dwt_conv_cflux_patch(begp:endp) = spval
call hist_addfld1d (fname='C13_DWT_CONV_CFLUX_PATCH', units='gC13/m^2/s', &
@@ -3048,12 +3048,12 @@ subroutine InitHistory(this, bounds, carbon_type)
call hist_addfld1d (fname='C13_DWT_CONV_CFLUX_DRIBBLED', units='gC13/m^2/s', &
avgflag='A', &
long_name='C13 conversion C flux (immediate loss to atm), dribbled throughout the year', &
- ptr_gcell=this%dwt_conv_cflux_dribbled_grc)
+ ptr_gcell=this%dwt_conv_cflux_dribbled_grc, default='inactive')
this%dwt_slash_cflux_col(begc:endc) = spval
call hist_addfld1d (fname='C13_DWT_SLASH_CFLUX', units='gC/m^2/s', &
avgflag='A', long_name='C13 slash C flux to litter and CWD due to land use', &
- ptr_col=this%dwt_slash_cflux_col)
+ ptr_col=this%dwt_slash_cflux_col, default='inactive')
this%dwt_frootc_to_litr_met_c_col(begc:endc,:) = spval
call hist_addfld_decomp (fname='C13_DWT_FROOTC_TO_LITR_MET_C', units='gC13/m^2/s', type2d='levdcmp', &
@@ -3088,12 +3088,12 @@ subroutine InitHistory(this, bounds, carbon_type)
this%sr_col(begc:endc) = spval
call hist_addfld1d (fname='C13_SR', units='gC13/m^2/s', &
avgflag='A', long_name='C13 total soil respiration (HR + root resp)', &
- ptr_col=this%sr_col)
+ ptr_col=this%sr_col, default='inactive')
this%er_col(begc:endc) = spval
call hist_addfld1d (fname='C13_ER', units='gC13/m^2/s', &
avgflag='A', long_name='C13 total ecosystem respiration, autotrophic + heterotrophic', &
- ptr_col=this%er_col)
+ ptr_col=this%er_col, default='inactive')
this%litfire_col(begc:endc) = spval
call hist_addfld1d (fname='C13_LITFIRE', units='gC13/m^2/s', &
@@ -3113,17 +3113,24 @@ subroutine InitHistory(this, bounds, carbon_type)
this%fire_closs_col(begc:endc) = spval
call hist_addfld1d (fname='C13_COL_FIRE_CLOSS', units='gC13/m^2/s', &
avgflag='A', long_name='C13 total column-level fire C loss', &
- ptr_col=this%fire_closs_col)
+ ptr_col=this%fire_closs_col, default='inactive')
this%nep_col(begc:endc) = spval
call hist_addfld1d (fname='C13_NEP', units='gC13/m^2/s', &
avgflag='A', long_name='C13 net ecosystem production, excludes fire flux, positive for sink', &
- ptr_col=this%nep_col)
+ ptr_col=this%nep_col, default='inactive')
this%nee_grc(begg:endg) = spval
call hist_addfld1d (fname='C13_NEE', units='gC13/m^2/s', &
avgflag='A', long_name='C13 net ecosystem exchange of carbon, includes fire flux, positive for source', &
- ptr_gcell=this%nee_grc)
+ ptr_gcell=this%nee_grc, default='inactive')
+
+ this%nbp_grc(begg:endg) = spval
+ call hist_addfld1d (fname='C13_NBP', units='gC13/m^2/s', &
+ avgflag='A', long_name='C13 net biome production, includes fire, landuse,'&
+ //' harvest and hrv_xsmrpool flux (latter smoothed over the year), positive for sink'&
+ //' (same as net carbon exchange between land and atmosphere)', &
+ ptr_gcell=this%nbp_grc)
endif
@@ -3183,7 +3190,7 @@ subroutine InitHistory(this, bounds, carbon_type)
call hist_addfld1d (fname='C14_DWT_CONV_CFLUX', units='gC14/m^2/s', &
avgflag='A', long_name='C14 conversion C flux (immediate loss to atm) ' // &
'(0 at all times except first timestep of year)', &
- ptr_gcell=this%dwt_conv_cflux_grc)
+ ptr_gcell=this%dwt_conv_cflux_grc, default='inactive')
this%dwt_conv_cflux_patch(begp:endp) = spval
call hist_addfld1d (fname='C14_DWT_CONV_CFLUX_PATCH', units='gC14/m^2/s', &
@@ -3197,12 +3204,12 @@ subroutine InitHistory(this, bounds, carbon_type)
call hist_addfld1d (fname='C14_DWT_CONV_CFLUX_DRIBBLED', units='gC14/m^2/s', &
avgflag='A', &
long_name='C14 conversion C flux (immediate loss to atm), dribbled throughout the year', &
- ptr_gcell=this%dwt_conv_cflux_dribbled_grc)
+ ptr_gcell=this%dwt_conv_cflux_dribbled_grc, default='inactive')
this%dwt_slash_cflux_col(begc:endc) = spval
call hist_addfld1d (fname='C14_DWT_SLASH_CFLUX', units='gC/m^2/s', &
avgflag='A', long_name='C14 slash C flux to litter and CWD due to land use', &
- ptr_col=this%dwt_slash_cflux_col)
+ ptr_col=this%dwt_slash_cflux_col, default='inactive')
this%dwt_frootc_to_litr_met_c_col(begc:endc,:) = spval
call hist_addfld_decomp (fname='C14_DWT_FROOTC_TO_LITR_MET_C', units='gC14/m^2/s', type2d='levdcmp', &
@@ -3237,12 +3244,12 @@ subroutine InitHistory(this, bounds, carbon_type)
this%sr_col(begc:endc) = spval
call hist_addfld1d (fname='C14_SR', units='gC14/m^2/s', &
avgflag='A', long_name='C14 total soil respiration (HR + root resp)', &
- ptr_col=this%sr_col)
+ ptr_col=this%sr_col, default='inactive')
this%er_col(begc:endc) = spval
call hist_addfld1d (fname='C14_ER', units='gC14/m^2/s', &
avgflag='A', long_name='C14 total ecosystem respiration, autotrophic + heterotrophic', &
- ptr_col=this%er_col)
+ ptr_col=this%er_col, default='inactive')
this%litfire_col(begc:endc) = spval
call hist_addfld1d (fname='C14_LITFIRE', units='gC14/m^2/s', &
@@ -3262,17 +3269,24 @@ subroutine InitHistory(this, bounds, carbon_type)
this%fire_closs_col(begc:endc) = spval
call hist_addfld1d (fname='C14_COL_FIRE_CLOSS', units='gC14/m^2/s', &
avgflag='A', long_name='C14 total column-level fire C loss', &
- ptr_col=this%fire_closs_col)
+ ptr_col=this%fire_closs_col, default='inactive')
this%nep_col(begc:endc) = spval
call hist_addfld1d (fname='C14_NEP', units='gC14/m^2/s', &
avgflag='A', long_name='C14 net ecosystem production, excludes fire flux, positive for sink', &
- ptr_col=this%nep_col)
+ ptr_col=this%nep_col, default='inactive')
this%nee_grc(begg:endg) = spval
call hist_addfld1d (fname='C14_NEE', units='gC14/m^2/s', &
avgflag='A', long_name='C14 net ecosystem exchange of carbon, includes fire flux, positive for source', &
- ptr_gcell=this%nee_grc)
+ ptr_gcell=this%nee_grc, default='inactive')
+
+ this%nbp_grc(begg:endg) = spval
+ call hist_addfld1d (fname='C14_NBP', units='gC13/m^2/s', &
+ avgflag='A', long_name='C14 net biome production, includes fire, landuse,'&
+ //' harvest and hrv_xsmrpool flux (latter smoothed over the year), positive for sink'&
+ //' (same as net carbon exchange between land and atmosphere)', &
+ ptr_gcell=this%nbp_grc)
endif
diff --git a/src/biogeochem/CNVegCarbonStateType.F90 b/src/biogeochem/CNVegCarbonStateType.F90
index 41eb79134f..a6dd0dfd96 100644
--- a/src/biogeochem/CNVegCarbonStateType.F90
+++ b/src/biogeochem/CNVegCarbonStateType.F90
@@ -495,7 +495,7 @@ subroutine InitHistory(this, bounds, carbon_type)
this%leafc_patch(begp:endp) = spval
call hist_addfld1d (fname='C13_LEAFC', units='gC13/m^2', &
avgflag='A', long_name='C13 leaf C', &
- ptr_patch=this%leafc_patch)
+ ptr_patch=this%leafc_patch, default='inactive')
this%leafc_storage_patch(begp:endp) = spval
call hist_addfld1d (fname='C13_LEAFC_STORAGE', units='gC13/m^2', &
@@ -515,7 +515,7 @@ subroutine InitHistory(this, bounds, carbon_type)
this%frootc_patch(begp:endp) = spval
call hist_addfld1d (fname='C13_FROOTC', units='gC13/m^2', &
avgflag='A', long_name='C13 fine root C', &
- ptr_patch=this%frootc_patch)
+ ptr_patch=this%frootc_patch, default='inactive')
this%frootc_storage_patch(begp:endp) = spval
call hist_addfld1d (fname='C13_FROOTC_STORAGE', units='gC13/m^2', &
@@ -530,7 +530,7 @@ subroutine InitHistory(this, bounds, carbon_type)
this%livestemc_patch(begp:endp) = spval
call hist_addfld1d (fname='C13_LIVESTEMC', units='gC13/m^2', &
avgflag='A', long_name='C13 live stem C', &
- ptr_patch=this%livestemc_patch)
+ ptr_patch=this%livestemc_patch, default='inactive')
this%livestemc_storage_patch(begp:endp) = spval
call hist_addfld1d (fname='C13_LIVESTEMC_STORAGE', units='gC13/m^2', &
@@ -545,7 +545,7 @@ subroutine InitHistory(this, bounds, carbon_type)
this%deadstemc_patch(begp:endp) = spval
call hist_addfld1d (fname='C13_DEADSTEMC', units='gC13/m^2', &
avgflag='A', long_name='C13 dead stem C', &
- ptr_patch=this%deadstemc_patch)
+ ptr_patch=this%deadstemc_patch, default='inactive')
this%deadstemc_storage_patch(begp:endp) = spval
call hist_addfld1d (fname='C13_DEADSTEMC_STORAGE', units='gC13/m^2', &
@@ -560,7 +560,7 @@ subroutine InitHistory(this, bounds, carbon_type)
this%livecrootc_patch(begp:endp) = spval
call hist_addfld1d (fname='C13_LIVECROOTC', units='gC13/m^2', &
avgflag='A', long_name='C13 live coarse root C', &
- ptr_patch=this%livecrootc_patch)
+ ptr_patch=this%livecrootc_patch, default='inactive')
this%livecrootc_storage_patch(begp:endp) = spval
call hist_addfld1d (fname='C13_LIVECROOTC_STORAGE', units='gC13/m^2', &
@@ -575,7 +575,7 @@ subroutine InitHistory(this, bounds, carbon_type)
this%deadcrootc_patch(begp:endp) = spval
call hist_addfld1d (fname='C13_DEADCROOTC', units='gC13/m^2', &
avgflag='A', long_name='C13 dead coarse root C', &
- ptr_patch=this%deadcrootc_patch)
+ ptr_patch=this%deadcrootc_patch, default='inactive')
this%deadcrootc_storage_patch(begp:endp) = spval
call hist_addfld1d (fname='C13_DEADCROOTC_STORAGE', units='gC13/m^2', &
@@ -600,12 +600,12 @@ subroutine InitHistory(this, bounds, carbon_type)
this%cpool_patch(begp:endp) = spval
call hist_addfld1d (fname='C13_CPOOL', units='gC13/m^2', &
avgflag='A', long_name='C13 temporary photosynthate C pool', &
- ptr_patch=this%cpool_patch)
+ ptr_patch=this%cpool_patch, default='inactive')
this%xsmrpool_patch(begp:endp) = spval
call hist_addfld1d (fname='C13_XSMRPOOL', units='gC13/m^2', &
avgflag='A', long_name='C13 temporary photosynthate C pool', &
- ptr_patch=this%xsmrpool_patch)
+ ptr_patch=this%xsmrpool_patch, default='inactive')
this%ctrunc_patch(begp:endp) = spval
call hist_addfld1d (fname='C13_PFT_CTRUNC', units='gC13/m^2', &
@@ -615,12 +615,12 @@ subroutine InitHistory(this, bounds, carbon_type)
this%dispvegc_patch(begp:endp) = spval
call hist_addfld1d (fname='C13_DISPVEGC', units='gC13/m^2', &
avgflag='A', long_name='C13 displayed veg carbon, excluding storage and cpool', &
- ptr_patch=this%dispvegc_patch)
+ ptr_patch=this%dispvegc_patch, default='inactive')
this%storvegc_patch(begp:endp) = spval
call hist_addfld1d (fname='C13_STORVEGC', units='gC13/m^2', &
avgflag='A', long_name='C13 stored vegetation carbon, excluding cpool', &
- ptr_patch=this%storvegc_patch)
+ ptr_patch=this%storvegc_patch, default='inactive')
this%totvegc_patch(begp:endp) = spval
call hist_addfld1d (fname='C13_TOTVEGC', units='gC13/m^2', &
@@ -630,17 +630,17 @@ subroutine InitHistory(this, bounds, carbon_type)
this%totc_patch(begp:endp) = spval
call hist_addfld1d (fname='C13_TOTPFTC', units='gC13/m^2', &
avgflag='A', long_name='C13 total patch-level carbon, including cpool', &
- ptr_patch=this%totc_patch)
+ ptr_patch=this%totc_patch, default='inactive')
this%seedc_grc(begg:endg) = spval
call hist_addfld1d (fname='C13_SEEDC', units='gC13/m^2', &
avgflag='A', long_name='C13 pool for seeding new PFTs via dynamic landcover', &
- ptr_gcell=this%seedc_grc)
+ ptr_gcell=this%seedc_grc, default='inactive')
this%totc_col(begc:endc) = spval
call hist_addfld1d (fname='C13_TOTCOLC', units='gC13/m^2', &
avgflag='A', long_name='C13 total column carbon, incl veg and cpool but excl product pools', &
- ptr_col=this%totc_col)
+ ptr_col=this%totc_col, default='inactive')
this%totecosysc_col(begc:endc) = spval
call hist_addfld1d (fname='C13_TOTECOSYSC', units='gC13/m^2', &
@@ -651,11 +651,11 @@ subroutine InitHistory(this, bounds, carbon_type)
this%grainc_patch(begp:endp) = spval
call hist_addfld1d (fname='C13_GRAINC', units='gC/m^2', &
avgflag='A', long_name='C13 grain C (does not equal yield)', &
- ptr_patch=this%grainc_patch)
+ ptr_patch=this%grainc_patch, default='inactive')
this%cropseedc_deficit_patch(begp:endp) = spval
call hist_addfld1d (fname='C13_CROPSEEDC_DEFICIT', units='gC/m^2', &
avgflag='A', long_name='C13 C used for crop seed that needs to be repaid', &
- ptr_patch=this%cropseedc_deficit_patch)
+ ptr_patch=this%cropseedc_deficit_patch, default='inactive')
end if
@@ -670,7 +670,7 @@ subroutine InitHistory(this, bounds, carbon_type)
this%leafc_patch(begp:endp) = spval
call hist_addfld1d (fname='C14_LEAFC', units='gC14/m^2', &
avgflag='A', long_name='C14 leaf C', &
- ptr_patch=this%leafc_patch)
+ ptr_patch=this%leafc_patch, default='inactive')
this%leafc_storage_patch(begp:endp) = spval
call hist_addfld1d (fname='C14_LEAFC_STORAGE', units='gC14/m^2', &
@@ -690,7 +690,7 @@ subroutine InitHistory(this, bounds, carbon_type)
this%frootc_patch(begp:endp) = spval
call hist_addfld1d (fname='C14_FROOTC', units='gC14/m^2', &
avgflag='A', long_name='C14 fine root C', &
- ptr_patch=this%frootc_patch)
+ ptr_patch=this%frootc_patch, default='inactive')
this%frootc_storage_patch(begp:endp) = spval
call hist_addfld1d (fname='C14_FROOTC_STORAGE', units='gC14/m^2', &
@@ -705,7 +705,7 @@ subroutine InitHistory(this, bounds, carbon_type)
this%livestemc_patch(begp:endp) = spval
call hist_addfld1d (fname='C14_LIVESTEMC', units='gC14/m^2', &
avgflag='A', long_name='C14 live stem C', &
- ptr_patch=this%livestemc_patch)
+ ptr_patch=this%livestemc_patch, default='inactive')
this%livestemc_storage_patch(begp:endp) = spval
call hist_addfld1d (fname='C14_LIVESTEMC_STORAGE', units='gC14/m^2', &
@@ -720,7 +720,7 @@ subroutine InitHistory(this, bounds, carbon_type)
this%deadstemc_patch(begp:endp) = spval
call hist_addfld1d (fname='C14_DEADSTEMC', units='gC14/m^2', &
avgflag='A', long_name='C14 dead stem C', &
- ptr_patch=this%deadstemc_patch)
+ ptr_patch=this%deadstemc_patch, default='inactive')
this%deadstemc_storage_patch(begp:endp) = spval
call hist_addfld1d (fname='C14_DEADSTEMC_STORAGE', units='gC14/m^2', &
@@ -735,7 +735,7 @@ subroutine InitHistory(this, bounds, carbon_type)
this%livecrootc_patch(begp:endp) = spval
call hist_addfld1d (fname='C14_LIVECROOTC', units='gC14/m^2', &
avgflag='A', long_name='C14 live coarse root C', &
- ptr_patch=this%livecrootc_patch)
+ ptr_patch=this%livecrootc_patch, default='inactive')
this%livecrootc_storage_patch(begp:endp) = spval
call hist_addfld1d (fname='C14_LIVECROOTC_STORAGE', units='gC14/m^2', &
@@ -750,7 +750,7 @@ subroutine InitHistory(this, bounds, carbon_type)
this%deadcrootc_patch(begp:endp) = spval
call hist_addfld1d (fname='C14_DEADCROOTC', units='gC14/m^2', &
avgflag='A', long_name='C14 dead coarse root C', &
- ptr_patch=this%deadcrootc_patch)
+ ptr_patch=this%deadcrootc_patch, default='inactive')
this%deadcrootc_storage_patch(begp:endp) = spval
call hist_addfld1d (fname='C14_DEADCROOTC_STORAGE', units='gC14/m^2', &
@@ -775,27 +775,27 @@ subroutine InitHistory(this, bounds, carbon_type)
this%cpool_patch(begp:endp) = spval
call hist_addfld1d (fname='C14_CPOOL', units='gC14/m^2', &
avgflag='A', long_name='C14 temporary photosynthate C pool', &
- ptr_patch=this%cpool_patch)
+ ptr_patch=this%cpool_patch, default='inactive')
this%xsmrpool_patch(begp:endp) = spval
call hist_addfld1d (fname='C14_XSMRPOOL', units='gC14/m^2', &
avgflag='A', long_name='C14 temporary photosynthate C pool', &
- ptr_patch=this%xsmrpool_patch)
+ ptr_patch=this%xsmrpool_patch, default='inactive')
this%ctrunc_patch(begp:endp) = spval
call hist_addfld1d (fname='C14_PFT_CTRUNC', units='gC14/m^2', &
avgflag='A', long_name='C14 patch-level sink for C truncation', &
- ptr_patch=this%ctrunc_patch)
+ ptr_patch=this%ctrunc_patch, default='inactive')
this%dispvegc_patch(begp:endp) = spval
call hist_addfld1d (fname='C14_DISPVEGC', units='gC14/m^2', &
avgflag='A', long_name='C14 displayed veg carbon, excluding storage and cpool', &
- ptr_patch=this%dispvegc_patch)
+ ptr_patch=this%dispvegc_patch, default='inactive')
this%storvegc_patch(begp:endp) = spval
call hist_addfld1d (fname='C14_STORVEGC', units='gC14/m^2', &
avgflag='A', long_name='C14 stored vegetation carbon, excluding cpool', &
- ptr_patch=this%storvegc_patch)
+ ptr_patch=this%storvegc_patch, default='inactive')
this%totvegc_patch(begp:endp) = spval
call hist_addfld1d (fname='C14_TOTVEGC', units='gC14/m^2', &
@@ -805,17 +805,17 @@ subroutine InitHistory(this, bounds, carbon_type)
this%totc_patch(begp:endp) = spval
call hist_addfld1d (fname='C14_TOTPFTC', units='gC14/m^2', &
avgflag='A', long_name='C14 total patch-level carbon, including cpool', &
- ptr_patch=this%totc_patch)
+ ptr_patch=this%totc_patch, default='inactive')
this%seedc_grc(begg:endg) = spval
call hist_addfld1d (fname='C14_SEEDC', units='gC14/m^2', &
avgflag='A', long_name='C14 pool for seeding new PFTs via dynamic landcover', &
- ptr_gcell=this%seedc_grc)
+ ptr_gcell=this%seedc_grc, default='inactive')
this%totc_col(begc:endc) = spval
call hist_addfld1d (fname='C14_TOTCOLC', units='gC14/m^2', &
avgflag='A', long_name='C14 total column carbon, incl veg and cpool but excl product pools', &
- ptr_col=this%totc_col)
+ ptr_col=this%totc_col, default='inactive')
this%totecosysc_col(begc:endc) = spval
call hist_addfld1d (fname='C14_TOTECOSYSC', units='gC14/m^2', &
@@ -826,11 +826,11 @@ subroutine InitHistory(this, bounds, carbon_type)
this%grainc_patch(begp:endp) = spval
call hist_addfld1d (fname='C14_GRAINC', units='gC/m^2', &
avgflag='A', long_name='C14 grain C (does not equal yield)', &
- ptr_patch=this%grainc_patch)
+ ptr_patch=this%grainc_patch, default='inactive')
this%cropseedc_deficit_patch(begp:endp) = spval
call hist_addfld1d (fname='C14_CROPSEEDC_DEFICIT', units='gC/m^2', &
avgflag='A', long_name='C14 C used for crop seed that needs to be repaid', &
- ptr_patch=this%cropseedc_deficit_patch)
+ ptr_patch=this%cropseedc_deficit_patch, default='inactive')
end if
diff --git a/src/biogeochem/CropType.F90 b/src/biogeochem/CropType.F90
index eaed486bc5..0b2c0fc1db 100644
--- a/src/biogeochem/CropType.F90
+++ b/src/biogeochem/CropType.F90
@@ -574,7 +574,7 @@ subroutine CropUpdateAccVars(this, bounds, t_ref2m_patch, t_soisno_col)
call extract_accum_field ('GDDPLANT', rbufslp, nstep)
do p = begp,endp
- rbufslp(p) = max(0.,this%gddplant_patch(p)-rbufslp(p))
+ rbufslp(p) = max(0.0_r8,this%gddplant_patch(p)-rbufslp(p))
end do
call update_accum_field ('GDDPLANT', rbufslp, nstep)
do p = begp,endp
diff --git a/src/biogeochem/SpeciesBaseType.F90 b/src/biogeochem/SpeciesBaseType.F90
index 239ca91fe3..02f8636557 100644
--- a/src/biogeochem/SpeciesBaseType.F90
+++ b/src/biogeochem/SpeciesBaseType.F90
@@ -22,6 +22,9 @@ module SpeciesBaseType
! Get the full species name
procedure(get_species_interface), public, deferred :: get_species
+
+ ! Return true if this is an isotope, false if not
+ procedure(is_isotope_interface), public, deferred :: is_isotope
end type species_base_type
abstract interface
@@ -62,6 +65,14 @@ pure function get_species_interface(this) result(species_name)
character(len=:), allocatable :: species_name
class(species_base_type) , intent(in) :: this
end function get_species_interface
+
+ pure function is_isotope_interface(this) result(is_isotope)
+ ! Return true if this is an isotope, false if not
+ import :: species_base_type
+
+ logical :: is_isotope ! function result
+ class(species_base_type), intent(in) :: this
+ end function is_isotope_interface
end interface
end module SpeciesBaseType
diff --git a/src/biogeochem/SpeciesIsotopeType.F90 b/src/biogeochem/SpeciesIsotopeType.F90
index b5fb749823..8a9dcd94f5 100644
--- a/src/biogeochem/SpeciesIsotopeType.F90
+++ b/src/biogeochem/SpeciesIsotopeType.F90
@@ -39,6 +39,7 @@ module SpeciesIsotopeType
procedure, public :: hist_fname
procedure, public :: rest_fname
procedure, public :: get_species
+ procedure, public :: is_isotope
end type species_isotope_type
interface species_isotope_type
@@ -133,4 +134,14 @@ pure function get_species(this) result(species_name)
end function get_species
+ pure function is_isotope(this)
+ ! Return true if this is an isotope, false if not
+
+ logical :: is_isotope ! function result
+ class(species_isotope_type), intent(in) :: this
+ !-----------------------------------------------------------------------
+
+ is_isotope = .true.
+ end function is_isotope
+
end module SpeciesIsotopeType
diff --git a/src/biogeochem/SpeciesNonIsotopeType.F90 b/src/biogeochem/SpeciesNonIsotopeType.F90
index 0daf6b3f72..a1dc9d4e0e 100644
--- a/src/biogeochem/SpeciesNonIsotopeType.F90
+++ b/src/biogeochem/SpeciesNonIsotopeType.F90
@@ -37,6 +37,7 @@ module SpeciesNonIsotopeType
procedure, public :: hist_fname
procedure, public :: rest_fname
procedure, public :: get_species
+ procedure, public :: is_isotope
end type species_non_isotope_type
interface species_non_isotope_type
@@ -122,4 +123,14 @@ pure function get_species(this) result(species_name)
end function get_species
+ pure function is_isotope(this)
+ ! Return true if this is an isotope, false if not
+
+ logical :: is_isotope ! function result
+ class(species_non_isotope_type), intent(in) :: this
+ !-----------------------------------------------------------------------
+
+ is_isotope = .false.
+ end function is_isotope
+
end module SpeciesNonIsotopeType
diff --git a/src/biogeophys/LunaMod.F90 b/src/biogeophys/LunaMod.F90
index 66b608022e..14faa9d9c6 100644
--- a/src/biogeophys/LunaMod.F90
+++ b/src/biogeophys/LunaMod.F90
@@ -36,10 +36,10 @@ module LunaMod
! PRIVATE MEMBER FUNCTIONS:
public :: LunaReadNML !subroutine to read in the Luna namelist
public :: Update_Photosynthesis_Capacity !subroutine to update the canopy nitrogen profile
- public :: NitrogenAllocation !subroutine to update the Vcmax25 and Jmax25 at the leaf level
public :: Acc24_Climate_LUNA !subroutine to accumulate 24 hr climates
public :: Acc240_Climate_LUNA !subroutine to accumulate 10 day climates
public :: Clear24_Climate_LUNA !subroutine to clear 24 hr climates
+ private :: NitrogenAllocation !subroutine to update the Vcmax25 and Jmax25 at the leaf level
private :: NUEref !Calculate the Nitrogen use effieciency based on reference CO2 and leaf temperature
private :: NUE !Calculate the Nitrogen use effieciency based on current CO2 and leaf temperature
private :: JmxTLeuning !Calculate the temperature response for Jmax, based on Leunning 2002 Plant, Cell & Environment
@@ -367,7 +367,7 @@ subroutine Update_Photosynthesis_Capacity(bounds, fn, filterp, &
PNcbold = 0.0_r8
call NitrogenAllocation(FNCa,forc_pbot10(p), relh10, CO2a10, O2a10, PARi10, PARimx10, rb10v, hourpd, &
tair10, tleafd10, tleafn10, &
- Jmaxb0, Jmaxb1, Wc2Wjb0, relhExp, PNstoreold, PNlcold, PNetold, PNrespold, &
+ Jmaxb0, Jmaxb1, Wc2Wjb0, relhExp, PNlcold, PNetold, PNrespold, &
PNcbold, PNstoreopt, PNlcopt, PNetopt, PNrespopt, PNcbopt)
vcmx25_opt= PNcbopt * FNCa * Fc25
jmx25_opt= PNetopt * FNCa * Fj25
@@ -756,7 +756,7 @@ end subroutine Clear24_Climate_LUNA
!Use the LUNA model to calculate the Nitrogen partioning
subroutine NitrogenAllocation(FNCa,forc_pbot10, relh10, CO2a10,O2a10, PARi10,PARimx10,rb10, hourpd, tair10, tleafd10, tleafn10, &
Jmaxb0, Jmaxb1, Wc2Wjb0, relhExp,&
- PNstoreold, PNlcold, PNetold, PNrespold, PNcbold, &
+ PNlcold, PNetold, PNrespold, PNcbold, &
PNstoreopt, PNlcopt, PNetopt, PNrespopt, PNcbopt)
implicit none
real(r8), intent (in) :: FNCa !Area based functional nitrogen content (g N/m2 leaf)
@@ -775,7 +775,6 @@ subroutine NitrogenAllocation(FNCa,forc_pbot10, relh10, CO2a10,O2a10, PARi10,PAR
real(r8), intent (in) :: Jmaxb1 !coefficient determining the response of electron transport rate to light availability (unitless)
real(r8), intent (in) :: Wc2Wjb0 !the baseline ratio of rubisco-limited rate vs light-limited photosynthetic rate (Wc:Wj)
real(r8), intent (in) :: relhExp !specifies the impact of relative humidity on electron transport rate (unitless)
- real(r8), intent (in) :: PNstoreold !old value of the proportion of nitrogen allocated to storage (unitless)
real(r8), intent (in) :: PNlcold !old value of the proportion of nitrogen allocated to light capture (unitless)
real(r8), intent (in) :: PNetold !old value of the proportion of nitrogen allocated to electron transport (unitless)
real(r8), intent (in) :: PNrespold !old value of the proportion of nitrogen allocated to respiration (unitless)
@@ -848,7 +847,6 @@ subroutine NitrogenAllocation(FNCa,forc_pbot10, relh10, CO2a10,O2a10, PARi10,PAR
call NUEref(NUEjref, NUEcref, Kj2Kcref)
theta_cj = 0.95_r8
- Nstore = PNstoreold * FNCa !proportion of storage nitrogen in functional nitrogen
Nlc = PNlcold * FNCa !proportion of light capturing nitrogen in functional nitrogen
Net = PNetold * FNCa !proportion of light harvesting (electron transport) nitrogen in functional nitrogen
Nresp = PNrespold * FNCa !proportion of respirational nitrogen in functional nitrogen
diff --git a/src/biogeophys/PhotosynthesisMod.F90 b/src/biogeophys/PhotosynthesisMod.F90
index 3c6cef748d..b5f2a67810 100644
--- a/src/biogeophys/PhotosynthesisMod.F90
+++ b/src/biogeophys/PhotosynthesisMod.F90
@@ -405,41 +405,41 @@ subroutine InitHistory(this, bounds)
this%c13_psnsun_patch(begp:endp) = spval
call hist_addfld1d (fname='C13_PSNSUN', units='umolCO2/m^2/s', &
avgflag='A', long_name='C13 sunlit leaf photosynthesis', &
- ptr_patch=this%c13_psnsun_patch)
+ ptr_patch=this%c13_psnsun_patch, default='inactive')
this%c13_psnsha_patch(begp:endp) = spval
call hist_addfld1d (fname='C13_PSNSHA', units='umolCO2/m^2/s', &
avgflag='A', long_name='C13 shaded leaf photosynthesis', &
- ptr_patch=this%c13_psnsha_patch)
+ ptr_patch=this%c13_psnsha_patch, default='inactive')
end if
if ( use_c14 ) then
this%c14_psnsun_patch(begp:endp) = spval
call hist_addfld1d (fname='C14_PSNSUN', units='umolCO2/m^2/s', &
avgflag='A', long_name='C14 sunlit leaf photosynthesis', &
- ptr_patch=this%c14_psnsun_patch)
+ ptr_patch=this%c14_psnsun_patch, default='inactive')
this%c14_psnsha_patch(begp:endp) = spval
call hist_addfld1d (fname='C14_PSNSHA', units='umolCO2/m^2/s', &
avgflag='A', long_name='C14 shaded leaf photosynthesis', &
- ptr_patch=this%c14_psnsha_patch)
+ ptr_patch=this%c14_psnsha_patch, default='inactive')
end if
if ( use_c13 ) then
this%rc13_canair_patch(begp:endp) = spval
call hist_addfld1d (fname='RC13_CANAIR', units='proportion', &
avgflag='A', long_name='C13/C(12+13) for canopy air', &
- ptr_patch=this%rc13_canair_patch)
+ ptr_patch=this%rc13_canair_patch, default='inactive')
this%rc13_psnsun_patch(begp:endp) = spval
call hist_addfld1d (fname='RC13_PSNSUN', units='proportion', &
avgflag='A', long_name='C13/C(12+13) for sunlit photosynthesis', &
- ptr_patch=this%rc13_psnsun_patch)
+ ptr_patch=this%rc13_psnsun_patch, default='inactive')
this%rc13_psnsha_patch(begp:endp) = spval
call hist_addfld1d (fname='RC13_PSNSHA', units='proportion', &
avgflag='A', long_name='C13/C(12+13) for shaded photosynthesis', &
- ptr_patch=this%rc13_psnsha_patch)
+ ptr_patch=this%rc13_psnsha_patch, default='inactive')
endif
! Canopy physiology
diff --git a/src/biogeophys/SurfaceRadiationMod.F90 b/src/biogeophys/SurfaceRadiationMod.F90
index 8af0aaa633..e28dc0b6a5 100644
--- a/src/biogeophys/SurfaceRadiationMod.F90
+++ b/src/biogeophys/SurfaceRadiationMod.F90
@@ -25,7 +25,7 @@ module SurfaceRadiationMod
implicit none
private
- logical :: DEBUG = .false. ! for debugging this module
+ logical, parameter :: debug = .false. ! for debugging this module
!
! !PUBLIC MEMBER FUNCTIONS:
@@ -977,7 +977,7 @@ subroutine SurfaceRadiation(bounds, num_nourbanp, filter_nourbanp, &
g = patch%gridcell(p)
if(elai(p)==0.0_r8.and.fabd(p,1)>0._r8)then
- if ( DEBUG ) write(iulog,*) 'absorption without LAI',elai(p),tlai(p),fabd(p,1),p
+ if ( debug ) write(iulog,*) 'absorption without LAI',elai(p),tlai(p),fabd(p,1),p
endif
! Solar incident
diff --git a/src/init_interp/initInterp.F90 b/src/init_interp/initInterp.F90
index a5f31584bc..a45bda7fcc 100644
--- a/src/init_interp/initInterp.F90
+++ b/src/init_interp/initInterp.F90
@@ -49,6 +49,7 @@ module initInterpMod
private :: interp_1d_int
private :: interp_2d_double
private :: limit_snlsno
+ private :: check_interp_non_ciso_to_ciso
! Private data
@@ -227,12 +228,14 @@ subroutine initInterp (filei, fileo, bounds, glc_behavior)
end if
! --------------------------------------------
- ! Open input and output initial conditions files (both just for reading now)
+ ! Open input and output initial conditions files
! --------------------------------------------
call ncd_pio_openfile (ncidi, trim(filei) , 0)
call ncd_pio_openfile (ncido, trim(fileo), ncd_write)
+ call check_interp_non_ciso_to_ciso(ncidi)
+
! --------------------------------------------
! Determine dimensions and error checks on dimensions
! --------------------------------------------
@@ -1258,4 +1261,84 @@ subroutine limit_snlsno(ncido, bounds_o)
deallocate(snlsno)
end subroutine limit_snlsno
+ !-----------------------------------------------------------------------
+ subroutine check_interp_non_ciso_to_ciso(ncidi)
+ !
+ ! !DESCRIPTION:
+ ! BUG(wjs, 2018-10-25, ESCOMP/ctsm#67) There is a bug that causes incorrect values for
+ ! C isotopes if running init_interp from a case without C isotopes to a case with C
+ ! isotopes (https://github.com/ESCOMP/ctsm/issues/67). Here we check that the user
+ ! isn't trying to do an interpolation in that case. This check should be removed once
+ ! bug #67 is resolved.
+ !
+ ! !USES:
+ use clm_varctl, only : use_c13, use_c14, for_testing_allow_interp_non_ciso_to_ciso
+ !
+ ! !ARGUMENTS:
+ type(file_desc_t), intent(inout) :: ncidi
+ !
+ ! !LOCAL VARIABLES:
+ type(Var_desc_t) :: vardesc ! pio variable descriptor
+ integer :: status ! return code
+ logical :: missing_ciso ! whether C isotope fields are missing from the input file, despite the run containing C isotopes
+
+ character(len=*), parameter :: subname = 'check_interp_non_ciso_to_ciso'
+ !-----------------------------------------------------------------------
+
+ missing_ciso = .false.
+
+ if (use_c13) then
+ call pio_seterrorhandling(ncidi, PIO_BCAST_ERROR)
+ ! arbitrarily check leafc_13 (we could pick any c13 restart field)
+ status = pio_inq_varid(ncidi, name='leafc_13', vardesc=vardesc)
+ call pio_seterrorhandling(ncidi, PIO_INTERNAL_ERROR)
+ if (status /= PIO_noerr) then
+ if (masterproc) then
+ write(iulog,*) 'Cannot interpolate from a run without c13 to a run with c13,'
+ write(iulog,*) 'due to .'
+ write(iulog,*) 'Either use an input initial conditions file with c13 information,'
+ write(iulog,*) 'or re-spinup from cold start.'
+ end if
+ missing_ciso = .true.
+ end if
+ end if
+
+ if (use_c14) then
+ call pio_seterrorhandling(ncidi, PIO_BCAST_ERROR)
+ ! arbitrarily check leafc_14 (we could pick any c14 restart field)
+ status = pio_inq_varid(ncidi, name='leafc_14', vardesc=vardesc)
+ call pio_seterrorhandling(ncidi, PIO_INTERNAL_ERROR)
+ if (status /= PIO_noerr) then
+ if (masterproc) then
+ write(iulog,*) 'Cannot interpolate from a run without c14 to a run with c14,'
+ write(iulog,*) 'due to .'
+ write(iulog,*) 'Either use an input initial conditions file with c14 information,'
+ write(iulog,*) 'or re-spinup from cold start.'
+ end if
+ missing_ciso = .true.
+ end if
+ end if
+
+ if (for_testing_allow_interp_non_ciso_to_ciso) then
+ if (missing_ciso) then
+ write(iulog,*) ' '
+ write(iulog,*) 'Proceeding despite missing c13 and/or c14 fields on input finidat file,'
+ write(iulog,*) 'because for_testing_allow_interp_non_ciso_to_ciso is set.'
+ write(iulog,*) ' '
+ else
+ write(iulog,*) ' '
+ write(iulog,*) 'for_testing_allow_interp_non_ciso_to_ciso is .true., but it appears to be unnecessary in this run'
+ write(iulog,*) '(this is informational only - it does not indicate a problem)'
+ write(iulog,*) ' '
+ end if
+ else
+ if (missing_ciso) then
+ call endrun(msg='Cannot interpolate from a run without c13/c14 to a run with c13/c14', &
+ additional_msg=errMsg(sourcefile, __LINE__))
+ end if
+ end if
+
+ end subroutine check_interp_non_ciso_to_ciso
+
+
end module initInterpMod
diff --git a/src/main/abortutils.F90 b/src/main/abortutils.F90
index 9f9ce56272..eb276ca044 100644
--- a/src/main/abortutils.F90
+++ b/src/main/abortutils.F90
@@ -42,7 +42,7 @@ subroutine endrun_vanilla(msg, additional_msg)
!-----------------------------------------------------------------------
if (present (additional_msg)) then
- write(iulog,*)'ENDRUN: ', additional_msg
+ write(iulog,*)'ENDRUN: ', trim(additional_msg)
else
write(iulog,*)'ENDRUN:'
end if
diff --git a/src/main/clm_varctl.F90 b/src/main/clm_varctl.F90
index f7e5a793ca..ef8c25761e 100644
--- a/src/main/clm_varctl.F90
+++ b/src/main/clm_varctl.F90
@@ -189,6 +189,14 @@ module clm_varctl
logical, public :: use_c13 = .false. ! true => use C-13 model
logical, public :: use_c14 = .false. ! true => use C-14 model
+ ! BUG(wjs, 2018-10-25, ESCOMP/ctsm#67) There is a bug that causes incorrect values for C
+ ! isotopes if running init_interp from a case without C isotopes to a case with C
+ ! isotopes (https://github.com/ESCOMP/ctsm/issues/67). Normally, an error-check prevents
+ ! you from doing this interpolation (until we have fixed that bug). However, we
+ ! sometimes want to bypass this error-check in system tests. This namelist flag bypasses
+ ! this error-check.
+ logical, public :: for_testing_allow_interp_non_ciso_to_ciso = .false.
+
!----------------------------------------------------------
! FATES switches
!----------------------------------------------------------
diff --git a/src/main/controlMod.F90 b/src/main/controlMod.F90
index a78f56785e..d46df04a5d 100644
--- a/src/main/controlMod.F90
+++ b/src/main/controlMod.F90
@@ -214,7 +214,7 @@ subroutine control_init( )
namelist /clm_inparm/ no_frozen_nitrif_denitrif
- namelist /clm_inparm/ use_c13, use_c14
+ namelist /clm_inparm/ use_c13, use_c14, for_testing_allow_interp_non_ciso_to_ciso
! FATES Flags
@@ -628,6 +628,7 @@ subroutine control_spmd()
! isotopes
call mpi_bcast (use_c13, 1, MPI_LOGICAL, 0, mpicom, ier)
call mpi_bcast (use_c14, 1, MPI_LOGICAL, 0, mpicom, ier)
+ call mpi_bcast (for_testing_allow_interp_non_ciso_to_ciso, 1, MPI_LOGICAL, 0, mpicom, ier)
call mpi_bcast (use_fates, 1, MPI_LOGICAL, 0, mpicom, ier)
@@ -864,6 +865,7 @@ subroutine control_print ()
write(iulog, *) ' use_c14 : ', use_c14
write(iulog, *) ' use_c14_bombspike : ', use_c14_bombspike
write(iulog, *) ' atm_c14_filename : ', atm_c14_filename
+ write(iulog, *) ' for_testing_allow_interp_non_ciso_to_ciso : ', for_testing_allow_interp_non_ciso_to_ciso
end if
if (fsnowoptics == ' ') then
diff --git a/src/main/histFileMod.F90 b/src/main/histFileMod.F90
index 8899917c5f..a4eb5331ed 100644
--- a/src/main/histFileMod.F90
+++ b/src/main/histFileMod.F90
@@ -55,7 +55,11 @@ module histFileMod
!
! Counters
!
- integer , public :: ntapes = 0 ! index of max history file requested
+ ! ntapes gives the index of the max history file requested. There can be "holes" in the
+ ! numbering - e.g., we can have h0, h1 and h3 tapes, but no h2 tape (because there are
+ ! no fields on the h2 tape). In this case, ntapes will be 4 (for h0, h1, h2 and h3,
+ ! since h3 is the last requested file), not 3 (the number of files actually produced).
+ integer , private :: ntapes = 0 ! index of max history file requested
!
! Namelist
!
@@ -239,6 +243,11 @@ module histFileMod
!
type (master_entry) :: masterlist(max_flds) ! master field list
!
+ ! Whether each history tape is in use in this run. If history_tape_in_use(i) is false,
+ ! then data in tape(i) is undefined and should not be referenced.
+ !
+ logical :: history_tape_in_use(max_tapes) ! whether each history tape is in use in this run
+ !
! History tape: an array of history_tape entities (only active fields)
!
type (history_tape) :: tape(max_tapes) ! array history tapes
@@ -698,6 +707,7 @@ subroutine htapes_fieldlist()
end do
end do
+ history_tape_in_use(:) = .false.
tape(:)%nflds = 0
do t = 1,max_tapes
@@ -774,7 +784,7 @@ subroutine htapes_fieldlist()
end if
end do
- ! Determine total number of active history tapes
+ ! Determine index of max active history tape, and whether each tape is in use
ntapes = 0
do t = max_tapes,1,-1
@@ -784,24 +794,12 @@ subroutine htapes_fieldlist()
end if
end do
- ! Ensure there are no "holes" in tape specification, i.e. empty tapes.
- ! Enabling holes should not be difficult if necessary.
-
- do t = 1,ntapes
- if (tape(t)%nflds == 0) then
- write(iulog,*) trim(subname),' ERROR: Tape ',t,' is empty'
- call endrun(msg=errMsg(sourcefile, __LINE__))
+ do t = 1, ntapes
+ if (tape(t)%nflds > 0) then
+ history_tape_in_use(t) = .true.
end if
end do
- ! Check that the number of history files declared does not exceed
- ! the maximum allowed.
-
- if (ntapes > max_tapes) then
- write(iulog,*) trim(subname),' ERROR: Too many history files declared, max_tapes=',max_tapes
- call endrun(msg=errMsg(sourcefile, __LINE__))
- end if
-
! Change 1d output per tape output flag if requested - only for history
! tapes where 2d xy averaging is not enabled
@@ -834,6 +832,10 @@ subroutine htapes_fieldlist()
end if
write(iulog,*)'Number of time samples on history tape ',t,' is ',hist_mfilt(t)
write(iulog,*)'Output precision on history tape ',t,'=',hist_ndens(t)
+ if (.not. history_tape_in_use(t)) then
+ write(iulog,*) 'History tape ',t,' does not have any fields,'
+ write(iulog,*) 'so it will not be written!'
+ end if
write(iulog,*)
end do
call shr_sys_flush(iulog)
@@ -3381,9 +3383,15 @@ subroutine hist_htapes_wrapup( rstwr, nlend, bounds, &
! and write data to history files if end of history interval.
do t = 1, ntapes
+ if (.not. history_tape_in_use(t)) then
+ cycle
+ end if
+
! Skip nstep=0 if monthly average
- if (nstep==0 .and. tape(t)%nhtfrq==0) cycle
+ if (nstep==0 .and. tape(t)%nhtfrq==0) then
+ cycle
+ end if
! Determine if end of history interval
tape(t)%is_endhist = .false.
@@ -3486,6 +3494,10 @@ subroutine hist_htapes_wrapup( rstwr, nlend, bounds, &
! must reopen the files
do t = 1, ntapes
+ if (.not. history_tape_in_use(t)) then
+ cycle
+ end if
+
if (if_disphist(t)) then
if (tape(t)%ntimes /= 0) then
if (masterproc) then
@@ -3511,6 +3523,10 @@ subroutine hist_htapes_wrapup( rstwr, nlend, bounds, &
! Reset number of time samples to zero if file is full
do t = 1, ntapes
+ if (.not. history_tape_in_use(t)) then
+ cycle
+ end if
+
if (if_disphist(t) .and. tape(t)%ntimes==tape(t)%mfilt) then
tape(t)%ntimes = 0
end if
@@ -3559,7 +3575,9 @@ subroutine hist_restart_ncd (bounds, ncid, flag, rdate)
character(len=max_chars) :: units ! units of variable
character(len=max_chars) :: units_acc ! accumulator units
character(len=max_chars) :: fname ! full name of history file
- character(len=max_chars) :: locrest(max_tapes) ! local history restart file names
+ character(len=max_chars) :: locrest(max_tapes) ! local history restart file names
+ character(len=max_length_filename) :: my_locfnh ! temporary version of locfnh
+ character(len=max_length_filename) :: my_locfnhr ! temporary version of locfnhr
character(len=max_namlen),allocatable :: tname(:)
character(len=max_chars), allocatable :: tunits(:),tlongname(:)
@@ -3590,7 +3608,9 @@ subroutine hist_restart_ncd (bounds, ncid, flag, rdate)
integer :: dimid ! dimension ID
integer :: k ! 1d index
integer :: ntapes_onfile ! number of history tapes on the restart file
+ logical, allocatable :: history_tape_in_use_onfile(:) ! whether a given history tape is in use, according to the restart file
integer :: nflds_onfile ! number of history fields on the restart file
+ logical :: readvar ! whether a variable was read successfully
integer :: t ! tape index
integer :: f ! field index
integer :: varid ! variable id
@@ -3642,6 +3662,12 @@ subroutine hist_restart_ncd (bounds, ncid, flag, rdate)
call ncd_defdim( ncid, 'ntapes' , ntapes , dimid)
call ncd_defdim( ncid, 'max_chars' , max_chars , dimid)
+ call ncd_defvar(ncid=ncid, varname='history_tape_in_use', xtype=ncd_log, &
+ long_name="Whether this history tape is in use", &
+ dim1name="ntapes")
+ ier = PIO_inq_varid(ncid, 'history_tape_in_use', vardesc)
+ ier = PIO_put_att(ncid, vardesc%varid, 'interpinic_flag', iflag_skip)
+
call ncd_defvar(ncid=ncid, varname='locfnh', xtype=ncd_char, &
long_name="History filename", &
comment="This variable NOT needed for startup or branch simulations", &
@@ -3665,6 +3691,9 @@ subroutine hist_restart_ncd (bounds, ncid, flag, rdate)
! only read/write accumulators and counters if needed
do t = 1,ntapes
+ if (.not. history_tape_in_use(t)) then
+ cycle
+ end if
! Create the restart history filename and open it
write(hnum,'(i1.1)') t-1
@@ -3839,8 +3868,16 @@ subroutine hist_restart_ncd (bounds, ncid, flag, rdate)
! Add history filenames to master restart file
do t = 1,ntapes
- call ncd_io('locfnh', locfnh(t), 'write', ncid, nt=t)
- call ncd_io('locfnhr', locfnhr(t), 'write', ncid, nt=t)
+ call ncd_io('history_tape_in_use', history_tape_in_use(t), 'write', ncid, nt=t)
+ if (history_tape_in_use(t)) then
+ my_locfnh = locfnh(t)
+ my_locfnhr = locfnhr(t)
+ else
+ my_locfnh = 'non_existent_file'
+ my_locfnhr = 'non_existent_file'
+ end if
+ call ncd_io('locfnh', my_locfnh, 'write', ncid, nt=t)
+ call ncd_io('locfnhr', my_locfnhr, 'write', ncid, nt=t)
end do
fincl(:,1) = hist_fincl1(:)
@@ -3876,6 +3913,10 @@ subroutine hist_restart_ncd (bounds, ncid, flag, rdate)
allocate(itemp(max_nflds))
do t = 1,ntapes
+ if (.not. history_tape_in_use(t)) then
+ cycle
+ end if
+
call ncd_io(varname='fincl', data=fincl(:,t), ncid=ncid_hist(t), flag='write')
call ncd_io(varname='fexcl', data=fexcl(:,t), ncid=ncid_hist(t), flag='write')
@@ -3941,19 +3982,46 @@ subroutine hist_restart_ncd (bounds, ncid, flag, rdate)
!================================================
call ncd_inqdlen(ncid,dimid,ntapes_onfile, name='ntapes')
- if ( is_restart() .and. ntapes_onfile /= ntapes )then
- write(iulog,*) 'ntapes = ', ntapes, ' ntapes_onfile = ', ntapes_onfile
- call endrun(msg=' ERROR: number of ntapes different than on restart file!,'// &
- ' you can NOT change history options on restart!' //&
- errMsg(sourcefile, __LINE__))
- end if
- if ( is_restart() .and. ntapes > 0 )then
- call ncd_io('locfnh', locfnh(1:ntapes), 'read', ncid )
- call ncd_io('locfnhr', locrest(1:ntapes), 'read', ncid )
- do t = 1,ntapes
- call strip_null(locrest(t))
- call strip_null(locfnh(t))
- end do
+ if (is_restart()) then
+ if (ntapes_onfile /= ntapes) then
+ write(iulog,*) 'ntapes = ', ntapes, ' ntapes_onfile = ', ntapes_onfile
+ call endrun(msg=' ERROR: number of ntapes differs from restart file. '// &
+ 'You can NOT change history options on restart.', &
+ additional_msg=errMsg(sourcefile, __LINE__))
+ end if
+
+ if (ntapes > 0) then
+ allocate(history_tape_in_use_onfile(ntapes))
+ call ncd_io('history_tape_in_use', history_tape_in_use_onfile, 'read', ncid, &
+ readvar=readvar)
+ if (.not. readvar) then
+ ! BACKWARDS_COMPATIBILITY(wjs, 2018-10-06) Old restart files do not have
+ ! 'history_tape_in_use'. However, before now, this has implicitly been
+ ! true for all tapes <= ntapes.
+ history_tape_in_use_onfile(:) = .true.
+ end if
+ do t = 1, ntapes
+ if (history_tape_in_use_onfile(t) .neqv. history_tape_in_use(t)) then
+ write(iulog,*) subname//' ERROR: history_tape_in_use on restart file'
+ write(iulog,*) 'disagrees with current run: For tape ', t
+ write(iulog,*) 'On restart file: ', history_tape_in_use_onfile(t)
+ write(iulog,*) 'In current run : ', history_tape_in_use(t)
+ write(iulog,*) 'This suggests that this tape was empty in one case,'
+ write(iulog,*) 'but non-empty in the other. (history_tape_in_use .false.'
+ write(iulog,*) 'means that history tape is empty.)'
+ call endrun(msg=' ERROR: history_tape_in_use differs from restart file. '// &
+ 'You can NOT change history options on restart.', &
+ additional_msg=errMsg(sourcefile, __LINE__))
+ end if
+ end do
+
+ call ncd_io('locfnh', locfnh(1:ntapes), 'read', ncid )
+ call ncd_io('locfnhr', locrest(1:ntapes), 'read', ncid )
+ do t = 1,ntapes
+ call strip_null(locrest(t))
+ call strip_null(locfnh(t))
+ end do
+ end if
end if
! Determine necessary indices - the following is needed if model decomposition is different on restart
@@ -3962,6 +4030,9 @@ subroutine hist_restart_ncd (bounds, ncid, flag, rdate)
if ( is_restart() )then
do t = 1,ntapes
+ if (.not. history_tape_in_use(t)) then
+ cycle
+ end if
call getfil( locrest(t), locfnhr(t), 0 )
call ncd_pio_openfile (ncid_hist(t), trim(locfnhr(t)), ncd_nowrite)
@@ -4167,6 +4238,10 @@ subroutine hist_restart_ncd (bounds, ncid, flag, rdate)
if (flag == 'write') then
do t = 1,ntapes
+ if (.not. history_tape_in_use(t)) then
+ cycle
+ end if
+
if (.not. tape(t)%is_endhist) then
do f = 1,tape(t)%nflds
@@ -4218,6 +4293,9 @@ subroutine hist_restart_ncd (bounds, ncid, flag, rdate)
! Read history restart information if history files are not full
do t = 1,ntapes
+ if (.not. history_tape_in_use(t)) then
+ cycle
+ end if
if (.not. tape(t)%is_endhist) then
@@ -5106,7 +5184,7 @@ end subroutine strip_null
subroutine hist_do_disp (ntapes, hist_ntimes, hist_mfilt, if_stop, if_disphist, rstwr, nlend)
!
! !DESCRIPTION:
- ! Determine logic for closeing and/or disposing history file
+ ! Determine logic for closing and/or disposing history file
! Sets values for if_disphist, if_stop (arguments)
! Remove history files unless this is end of run or
! history file is not full.
diff --git a/src/main/ncdio_pio.F90.in b/src/main/ncdio_pio.F90.in
index 6de8acb363..970505918b 100644
--- a/src/main/ncdio_pio.F90.in
+++ b/src/main/ncdio_pio.F90.in
@@ -104,7 +104,7 @@ module ncdio_pio
interface ncd_io
module procedure ncd_io_char_var0_start_glob
- !DIMS 0
+ !DIMS 0,1
module procedure ncd_io_{DIMS}d_log_glob
!DIMS 0,1,2,3
@@ -1192,7 +1192,7 @@ contains
end subroutine ncd_io_char_var0_start_glob
!------------------------------------------------------------------------
- !DIMS 0
+ !DIMS 0,1
subroutine ncd_io_{DIMS}d_log_glob(varname, data, flag, ncid, readvar, nt, posNOTonfile)
!
! !DESCRIPTION:
@@ -1212,10 +1212,12 @@ contains
integer :: start(2), count(2) ! output bounds
integer :: status ! error code
logical :: varpresent ! if true, variable is on tape
+ logical :: found ! if true, found lat/lon dims on file
integer :: idata
integer, pointer :: idata1d(:) ! Temporary integer data to send to file
character(len=32) :: vname ! variable error checking
type(var_desc_t) :: vardesc ! local vardesc pointer
+ integer :: ndims
character(len=*),parameter :: subname='ncd_io_{DIMS}d_log_glob'
!-----------------------------------------------------------------------
@@ -1225,15 +1227,21 @@ contains
if (flag == 'read') then
call ncd_inqvid(ncid, varname, varid, vardesc, readvar=varpresent)
+
+ call pio_seterrorhandling(ncid, PIO_BCAST_ERROR)
+#if ({DIMS}==0)
if (varpresent) then
+ status = pio_get_var(ncid, vardesc, idata)
if (single_column .and. present(posNOTonfile) ) then
if ( .not. posNOTonfile )then
call shr_sys_abort(' ERROR: scalar var is NOT compatable with posNOTonfile = .false.'//&
errMsg(sourcefile, __LINE__))
end if
endif
-#if ({DIMS}==0)
- status = pio_get_var(ncid, varid, idata)
+ if ( status /= PIO_NOERR )then
+ call shr_sys_abort(' ERROR: reading variable: '//trim(varname)//' ' &
+ // errMsg(sourcefile, __LINE__))
+ end if
if ( idata == 0 )then
data = .false.
else if ( idata == 1 )then
@@ -1241,28 +1249,62 @@ contains
else
call shr_sys_abort(' ERROR: bad integer value for logical data'//errMsg(sourcefile, __LINE__))
end if
+ end if
#else
- call shr_sys_abort('ncd_io_*_log_glob not implemented for DIMS > 0')
-#endif
+ if (varpresent) then
+ allocate(idata1d(size(data)))
+ if (single_column) then
+ call scam_field_offsets(ncid,'undefined', vardesc,&
+ start, count, found=found, posNOTonfile=posNOTonfile)
+ if ( found )then
+ status = pio_get_var(ncid, varid, start, count, idata1d)
+ else
+ status = pio_get_var(ncid, varid, idata1d)
+ end if
+ else
+ status = pio_get_var(ncid, varid, idata1d)
+ endif
+ if ( status /= PIO_NOERR )then
+ call shr_sys_abort(' ERROR: reading variable: '//trim(varname)//' ' &
+ // errMsg(sourcefile, __LINE__))
+ end if
+ if ( any(idata1d /= 0 .and. idata1d /= 1) )then
+ call shr_sys_abort(' ERROR: read in bad integer value(s) for logical data'//errMsg(sourcefile, __LINE__))
+ end if
+ data = (idata1d == 1)
+ deallocate(idata1d)
endif
+#endif
+ call pio_seterrorhandling(ncid, PIO_INTERNAL_ERROR)
if (present(readvar)) readvar = varpresent
elseif (flag == 'write') then
-
+ ndims = {DIMS}
+ if(present(nt)) ndims=ndims+1
+ call ncd_inqvid (ncid, varname, varid, vardesc)
#if ({DIMS}==0)
start(1) = 1 ; count(1) = 1
if (present(nt)) start(1) = nt
- call ncd_inqvid (ncid, varname, varid, vardesc)
allocate(idata1d(1))
if ( data )then
idata1d(1) = 1
else
idata1d(1) = 0
end if
- status = pio_put_var(ncid, varid, start, count, idata1d)
+ status = pio_put_var(ncid, varid, start(1:1), count(1:1), idata1d)
deallocate(idata1d)
-#else
- call shr_sys_abort('ncd_io_*_log_glob not implemented for DIMS > 0')
+#elif ({DIMS}==1)
+ start(1) = 1 ; count(1) = size(data)
+ start(2) = 1 ; count(2) = 1
+ if (present(nt)) start(2) = nt
+ allocate(idata1d(size(data)))
+ where( data )
+ idata1d = 1
+ elsewhere
+ idata1d = 0
+ end where
+ status = pio_put_var(ncid, varid, start(1:ndims), count(1:ndims), idata1d)
+ deallocate( idata1d )
#endif
endif ! flag
@@ -1287,7 +1329,6 @@ contains
logical , optional, intent(in) :: posNOTonfile ! position is NOT on this file
!
! !LOCAL VARIABLES:
- integer :: m
integer :: varid ! netCDF variable id
integer :: start({DIMS}+1), count({DIMS}+1) ! output bounds
integer :: status ! error code
@@ -1295,9 +1336,9 @@ contains
logical :: found ! if true, found lat/lon dims on file
character(len=32) :: vname ! variable error checking
type(var_desc_t) :: vardesc ! local vardesc pointer
- {VTYPE} :: temp(1)
+ integer :: ndims
+ {VTYPE} :: temp(1)
character(len=*),parameter :: subname='ncd_io_{DIMS}d_{TYPE}_glob'
- integer :: ndims
!-----------------------------------------------------------------------
start(:) = 0
@@ -1350,7 +1391,7 @@ contains
call ncd_inqvid (ncid, varname, varid, vardesc)
#if ({DIMS}==0)
start(1) = 1 ; count(1) = 1
- if (present(nt)) start(1) = nt ; count(1) = 1
+ if (present(nt)) start(1) = nt
temp(1) = data
status = pio_put_var(ncid, varid, start(1:1), count(1:1), temp)
#elif ({DIMS}==1)
@@ -1376,7 +1417,7 @@ contains
end if
#endif
- endif
+ endif ! flag
end subroutine ncd_io_{DIMS}d_{TYPE}_glob
diff --git a/src/soilbiogeochem/SoilBiogeochemCarbonFluxType.F90 b/src/soilbiogeochem/SoilBiogeochemCarbonFluxType.F90
index 5d169527c5..e866ea280b 100644
--- a/src/soilbiogeochem/SoilBiogeochemCarbonFluxType.F90
+++ b/src/soilbiogeochem/SoilBiogeochemCarbonFluxType.F90
@@ -386,12 +386,12 @@ subroutine InitHistory(this, bounds, carbon_type)
this%lithr_col(begc:endc) = spval
call hist_addfld1d (fname='C13_LITTERC_HR', units='gC13/m^2/s', &
avgflag='A', long_name='C13 fine root C litterfall to litter 3 C', &
- ptr_col=this%lithr_col)
+ ptr_col=this%lithr_col, default='inactive')
this%somhr_col(begc:endc) = spval
call hist_addfld1d (fname='C13_SOILC_HR', units='gC13/m^2/s', &
avgflag='A', long_name='C13 soil organic matter heterotrophic respiration', &
- ptr_col=this%somhr_col)
+ ptr_col=this%somhr_col, default='inactive')
this%decomp_cascade_hr_col(begc:endc,:) = spval
@@ -456,12 +456,12 @@ subroutine InitHistory(this, bounds, carbon_type)
this%lithr_col(begc:endc) = spval
call hist_addfld1d (fname='C14_LITTERC_HR', units='gC14/m^2/s', &
avgflag='A', long_name='C14 litter carbon heterotrophic respiration', &
- ptr_col=this%lithr_col)
+ ptr_col=this%lithr_col, default='inactive')
this%somhr_col(begc:endc) = spval
call hist_addfld1d (fname='C14_SOILC_HR', units='gC14/m^2/s', &
avgflag='A', long_name='C14 soil organic matter heterotrophic respiration', &
- ptr_col=this%somhr_col)
+ ptr_col=this%somhr_col, default='inactive')
this%decomp_cascade_hr_col(begc:endc,:) = spval
this%decomp_cascade_hr_vr_col(begc:endc,:,:) = spval
diff --git a/src/soilbiogeochem/SoilBiogeochemCarbonStateType.F90 b/src/soilbiogeochem/SoilBiogeochemCarbonStateType.F90
index 78be5efd44..9b1f288f63 100644
--- a/src/soilbiogeochem/SoilBiogeochemCarbonStateType.F90
+++ b/src/soilbiogeochem/SoilBiogeochemCarbonStateType.F90
@@ -233,7 +233,7 @@ subroutine InitHistory(this, bounds, carbon_type)
longname = 'C13 '//trim(decomp_cascade_con%decomp_pool_name_history(l))//' C'
call hist_addfld1d (fname=fieldname, units='gC13/m^2', &
avgflag='A', long_name=longname, &
- ptr_col=data1dptr)
+ ptr_col=data1dptr, default='inactive')
end do
this%totlitc_col(begc:endc) = spval
@@ -250,14 +250,14 @@ subroutine InitHistory(this, bounds, carbon_type)
this%totlitc_1m_col(begc:endc) = spval
call hist_addfld1d (fname='C13_TOTLITC_1m', units='gC13/m^2', &
avgflag='A', long_name='C13 total litter carbon to 1 meter', &
- ptr_col=this%totlitc_1m_col)
+ ptr_col=this%totlitc_1m_col, default='inactive')
end if
if ( nlevdecomp_full > 1 ) then
this%totsomc_1m_col(begc:endc) = spval
call hist_addfld1d (fname='C13_TOTSOMC_1m', units='gC13/m^2', &
avgflag='A', long_name='C13 total soil organic matter carbon to 1 meter', &
- ptr_col=this%totsomc_1m_col)
+ ptr_col=this%totsomc_1m_col, default='inactive')
endif
this%ctrunc_col(begc:endc) = spval
@@ -293,7 +293,7 @@ subroutine InitHistory(this, bounds, carbon_type)
fieldname = 'C14_'//trim(decomp_cascade_con%decomp_pool_name_history(l))//'C'
longname = 'C14 '//trim(decomp_cascade_con%decomp_pool_name_history(l))//' C'
call hist_addfld1d (fname=fieldname, units='gC14/m^2', &
- avgflag='A', long_name=longname, ptr_col=data1dptr)
+ avgflag='A', long_name=longname, ptr_col=data1dptr, default='inactive')
if ( nlevdecomp_full > 1 ) then
data1dptr => this%decomp_cpools_1m_col(:,l)
@@ -318,12 +318,12 @@ subroutine InitHistory(this, bounds, carbon_type)
this%totlitc_1m_col(begc:endc) = spval
call hist_addfld1d (fname='C14_TOTLITC_1m', units='gC14/m^2', &
avgflag='A', long_name='C14 total litter carbon to 1 meter', &
- ptr_col=this%totlitc_1m_col)
+ ptr_col=this%totlitc_1m_col, default='inactive')
this%totsomc_1m_col(begc:endc) = spval
call hist_addfld1d (fname='C14_TOTSOMC_1m', units='gC14/m^2', &
avgflag='A', long_name='C14 total soil organic matter carbon to 1 meter', &
- ptr_col=this%totsomc_1m_col)
+ ptr_col=this%totsomc_1m_col, default='inactive')
endif
this%ctrunc_col(begc:endc) = spval
diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90
index fbbfbf99ea..9ebad09b40 100644
--- a/src/utils/clmfates_interfaceMod.F90
+++ b/src/utils/clmfates_interfaceMod.F90
@@ -196,7 +196,7 @@ module CLMFatesInterfaceMod
! developer will at least question its usage (RGK)
private :: hlm_bounds_to_fates_bounds
- logical :: DEBUG = .false.
+ logical :: debug = .false.
character(len=*), parameter, private :: sourcefile = &
__FILE__
@@ -365,7 +365,7 @@ subroutine init(this, bounds_proc )
! Check through FATES parameters to see if all have been set
call set_fates_ctrlparms('check_allset')
- if(DEBUG)then
+ if(debug)then
write(iulog,*) 'clm_fates%init(): allocating for ',nclumps,' threads'
end if
@@ -400,7 +400,7 @@ subroutine init(this, bounds_proc )
s = s + 1
collist(s) = c
this%f2hmap(nc)%hsites(c) = s
- if(DEBUG)then
+ if(debug)then
write(iulog,*) 'clm_fates%init(): thread',nc,': found column',c,'with lu',l
write(iulog,*) 'LU type:', lun%itype(l)
end if
@@ -408,7 +408,7 @@ subroutine init(this, bounds_proc )
enddo
- if(DEBUG)then
+ if(debug)then
write(iulog,*) 'clm_fates%init(): thread',nc,': allocated ',s,' sites'
end if
diff --git a/src/utils/clmfates_paraminterfaceMod.F90 b/src/utils/clmfates_paraminterfaceMod.F90
index 4fc12fdc31..9a3ce58ff7 100644
--- a/src/utils/clmfates_paraminterfaceMod.F90
+++ b/src/utils/clmfates_paraminterfaceMod.F90
@@ -15,7 +15,7 @@ module CLMFatesParamInterfaceMod
private :: SetParameterDimensions
private :: GetUsedDimensionSizes
- logical :: DEBUG = .false.
+ logical :: debug = .false.
character(len=*), parameter, private :: sourcefile = &
__FILE__
diff --git a/src/utils/domainMod.F90 b/src/utils/domainMod.F90
index 7cdd62b41f..a57d565b4d 100644
--- a/src/utils/domainMod.F90
+++ b/src/utils/domainMod.F90
@@ -215,7 +215,6 @@ subroutine domain_check(domain)
write(iulog,*) ' domain_check decomped = ',domain%decomped
write(iulog,*) ' domain_check ns = ',domain%ns
write(iulog,*) ' domain_check ni,nj = ',domain%ni,domain%nj
- write(iulog,*) ' domain_check clmlevel = ',trim(domain%clmlevel)
write(iulog,*) ' domain_check nbeg,nend = ',domain%nbeg,domain%nend
write(iulog,*) ' domain_check lonc = ',minval(domain%lonc),maxval(domain%lonc)
write(iulog,*) ' domain_check latc = ',minval(domain%latc),maxval(domain%latc)