Skip to content

Commit

Permalink
Merge tag 'ctsm5.1.dev174' into zendersource_dev
Browse files Browse the repository at this point in the history
Changes to improve vegetation health at high latitudes

Details in PR ESCOMP#2348

 Conflicts:
	bld/unit_testers/build-namelist_test.pl
  • Loading branch information
ekluzek committed Mar 15, 2024
2 parents 9dc57da + f448885 commit dd87593
Show file tree
Hide file tree
Showing 151 changed files with 5,815 additions and 1,368 deletions.
1 change: 1 addition & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ d866510188d26d51bcd6d37239283db690af7e82
8a168bb0895f4f2421608dd2589398e13a6663e6
183fc26a6691bbdf87f515dc47924a64be3ced9b
6fccf682eaf718615407d9bacdd3903b8786a03d
2500534eb0a83cc3aff94b30fb62e915054030bf
16 changes: 8 additions & 8 deletions Externals.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@ required = True
local_path = components/cism
protocol = git
repo_url = https://github.com/ESCOMP/CISM-wrapper
tag = cismwrap_2_1_96
tag = cismwrap_2_1_97
externals = Externals_CISM.cfg
required = True

[rtm]
local_path = components/rtm
protocol = git
repo_url = https://github.com/ESCOMP/RTM
tag = rtm1_0_78
tag = rtm1_0_79
required = True

[mosart]
local_path = components/mosart
protocol = git
repo_url = https://github.com/ESCOMP/MOSART
tag = mosart1_0_48
tag = mosart1_0_49
required = True

[mizuRoute]
Expand All @@ -34,7 +34,7 @@ hash = 34723c2
required = True

[ccs_config]
tag = ccs_config_cesm0.0.84
tag = ccs_config_cesm0.0.92
protocol = git
repo_url = https://github.com/ESMCI/ccs_config_cesm.git
local_path = ccs_config
Expand All @@ -44,18 +44,18 @@ required = True
local_path = cime
protocol = git
repo_url = https://github.com/ESMCI/cime
tag = cime6.0.175
tag = cime6.0.217_httpsbranch03
required = True

[cmeps]
tag = cmeps0.14.43
tag = cmeps0.14.50
protocol = git
repo_url = https://github.com/ESCOMP/CMEPS.git
local_path = components/cmeps
required = True

[cdeps]
tag = cdeps1.0.24
tag = cdeps1.0.28
protocol = git
repo_url = https://github.com/ESCOMP/CDEPS.git
local_path = components/cdeps
Expand All @@ -70,7 +70,7 @@ local_path = components/cpl7
required = True

[share]
tag = share1.0.17
tag = share1.0.18
protocol = git
repo_url = https://github.com/ESCOMP/CESM_share
local_path = share
Expand Down
4 changes: 2 additions & 2 deletions Externals_CLM.cfg
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[fates]
local_path = src/fates
protocol = git
repo_url = https://github.com/NGEET/fates
tag = sci.1.71.0_api.33.0.0
repo_url = https://github.com/rgknox/fates
tag = sci.1.72.2_api.34.0.0
required = True

[externals_description]
Expand Down
56 changes: 41 additions & 15 deletions bld/CLMBuildNamelist.pm
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,8 @@ sub setup_cmdl_fates_mode {
my @list = ( "fates_spitfire_mode", "use_fates_planthydro", "use_fates_ed_st3", "use_fates_ed_prescribed_phys",
"use_fates_cohort_age_tracking","use_fates_inventory_init","use_fates_fixed_biogeog",
"use_fates_nocomp","use_fates_sp","fates_inventory_ctrl_filename","use_fates_logging",
"fates_parteh_mode","use_fates_tree_damage","fates_seeddisp_cadence","use_fates_luh","fluh_timeseries" );
"fates_parteh_mode","use_fates_tree_damage","fates_history_dimlevel","fates_seeddisp_cadence",
"use_fates_luh","fluh_timeseries" );
# dis-allow fates specific namelist items with non-fates runs
foreach my $var ( @list ) {
if ( defined($nl->get_value($var)) ) {
Expand Down Expand Up @@ -1578,6 +1579,7 @@ sub process_namelist_inline_logic {
setup_logic_glacier($opts, $nl_flags, $definition, $defaults, $nl, $envxml_ref);
setup_logic_dynamic_plant_nitrogen_alloc($opts, $nl_flags, $definition, $defaults, $nl, $physv);
setup_logic_luna($opts, $nl_flags, $definition, $defaults, $nl, $physv);
setup_logic_hillslope($opts, $nl_flags, $definition, $defaults, $nl);
setup_logic_o3_veg_stress_method($opts, $nl_flags, $definition, $defaults, $nl,$physv);
setup_logic_hydrstress($opts, $nl_flags, $definition, $defaults, $nl);
setup_logic_dynamic_roots($opts, $nl_flags, $definition, $defaults, $nl, $physv);
Expand Down Expand Up @@ -2042,7 +2044,7 @@ sub setup_logic_snicar_methods {
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'do_sno_oc' );

# Error checking in loop
my %supportedSettings = ( 'snicar_solarspec' => "'mid_latitude_winter'", 'snicar_dust_optics' => "'sahara'", 'snicar_numrad_snw' => '5', 'snicar_snobc_intmix' => '.false.', 'snicar_snodst_intmix' => '.false.', 'snicar_use_aerosol' => '.true.', 'do_sno_oc' => '.false.' );
my %supportedSettings = ( 'snicar_solarspec' => "'mid_latitude_winter'", 'snicar_dust_optics' => "'sahara'", 'snicar_numrad_snw' => '5', 'snicar_snodst_intmix' => '.false.', 'snicar_use_aerosol' => '.true.', 'do_sno_oc' => '.false.' );
keys %supportedSettings;
while ( my ($key, $val) = each %supportedSettings ) {
my $var = $nl->get_value($key);
Expand All @@ -2060,13 +2062,13 @@ sub setup_logic_snicar_methods {
$log->warning("$key1=$val1a and $val1b are supported; $var1 is EXPERIMENTAL, UNSUPPORTED, and UNTESTED!");
}

# snicar_snobc_intmix and snicar_snodst_intmix cannot both be true
# snicar_snobc_intmix and snicar_snodst_intmix cannot both be true, however, they can both be false
my $key1 = 'snicar_snobc_intmix';
my $key2 = 'snicar_snodst_intmix';
my $var1 = $nl->get_value($key1);
my $var2 = $nl->get_value($key2);
my $val1 = $supportedSettings{$key1}; # supported value for this option
if (($var1 eq $var2) && ($var1 ne $val1)) {
my $val2 = $supportedSettings{$key2}; # supported value for this option
if (($var1 eq $var2) && ($var2 ne $val2)) {
$log->warning("$key1 = $var1 and $key2 = $var2 do not work together!");
}
}
Expand Down Expand Up @@ -2712,6 +2714,8 @@ sub setup_logic_do_transient_pfts {
$cannot_be_true = "$var cannot be combined with use_cndv";
} elsif (&value_is_true($nl->get_value('use_fates'))) {
$cannot_be_true = "$var cannot be combined with use_fates";
} elsif (&value_is_true($nl->get_value('use_hillslope'))) {
$cannot_be_true = "$var cannot be combined with use_hillslope";
}

if ($cannot_be_true) {
Expand Down Expand Up @@ -2787,6 +2791,8 @@ sub setup_logic_do_transient_crops {
# do_transient_crops. However, this hasn't been tested, so to be safe,
# we are not allowing this combination for now.
$cannot_be_true = "$var has not been tested with FATES, so for now these two options cannot be combined";
} elsif (&value_is_true($nl->get_value('use_hillslope'))) {
$cannot_be_true = "$var cannot be combined with use_hillslope";
}

if ($cannot_be_true) {
Expand Down Expand Up @@ -2882,6 +2888,8 @@ sub setup_logic_do_transient_lakes {
if (&value_is_true($nl->get_value($var))) {
if (&value_is_true($nl->get_value('collapse_urban'))) {
$log->fatal_error("$var cannot be combined with collapse_urban");
} elsif (&value_is_true($nl->get_value('use_hillslope'))) {
$log->fatal_error("$var cannot be combined with use_hillslope");
}
if ($n_dom_pfts > 0 || $n_dom_landunits > 0 || $toosmall_soil > 0 || $toosmall_crop > 0 || $toosmall_glacier > 0 || $toosmall_lake > 0 || $toosmall_wetland > 0 || $toosmall_urban > 0) {
$log->fatal_error("$var cannot be combined with any of the of the following > 0: n_dom_pfts > 0, n_dom_landunit > 0, toosmall_soil > 0._r8, toosmall_crop > 0._r8, toosmall_glacier > 0._r8, toosmall_lake > 0._r8, toosmall_wetland > 0._r8, toosmall_urban > 0._r8");
Expand Down Expand Up @@ -2945,6 +2953,8 @@ sub setup_logic_do_transient_urban {
if (&value_is_true($nl->get_value($var))) {
if (&value_is_true($nl->get_value('collapse_urban'))) {
$log->fatal_error("$var cannot be combined with collapse_urban");
} elsif (&value_is_true($nl->get_value('use_hillslope'))) {
$log->fatal_error("$var cannot be combined with use_hillslope");
}
if ($n_dom_pfts > 0 || $n_dom_landunits > 0 || $toosmall_soil > 0 || $toosmall_crop > 0 || $toosmall_glacier > 0 || $toosmall_lake > 0 || $toosmall_wetland > 0 || $toosmall_urban > 0) {
$log->fatal_error("$var cannot be combined with any of the of the following > 0: n_dom_pfts > 0, n_dom_landunit > 0, toosmall_soil > 0._r8, toosmall_crop > 0._r8, toosmall_glacier > 0._r8, toosmall_lake > 0._r8, toosmall_wetland > 0._r8, toosmall_urban > 0._r8");
Expand Down Expand Up @@ -3274,12 +3284,8 @@ sub setup_logic_hydrology_switches {
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_subgrid_fluxes');
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'snow_cover_fraction_method');
my $subgrid = $nl->get_value('use_subgrid_fluxes' );
my $origflag = $nl->get_value('origflag' );
my $h2osfcflag = $nl->get_value('h2osfcflag' );
my $scf_method = $nl->get_value('snow_cover_fraction_method');
if ( $origflag == 1 && &value_is_true($subgrid) ) {
$log->fatal_error("if origflag is ON, use_subgrid_fluxes can NOT also be on!");
}
if ( $h2osfcflag == 1 && ! &value_is_true($subgrid) ) {
$log->fatal_error("if h2osfcflag is ON, use_subgrid_fluxes can NOT be off!");
}
Expand All @@ -3303,9 +3309,6 @@ sub setup_logic_hydrology_switches {
if ( defined($use_vic) && defined($lower) && (&value_is_true($use_vic)) && $lower != 3 && $lower != 4) {
$log->fatal_error( "If use_vichydro is on -- lower_boundary_condition can only be table or aquifer" );
}
if ( defined($origflag) && defined($use_vic) && (&value_is_true($use_vic)) && $origflag == 1 ) {
$log->fatal_error( "If use_vichydro is on -- origflag can NOT be equal to 1" );
}
if ( defined($h2osfcflag) && defined($lower) && $h2osfcflag == 0 && $lower != 4 ) {
$log->fatal_error( "If h2osfcflag is 0 lower_boundary_condition can only be aquifer" );
}
Expand Down Expand Up @@ -3487,6 +3490,28 @@ sub setup_logic_luna {

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

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

add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_hillslope' );
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'downscale_hillslope_meteorology' );
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'hillslope_head_gradient_method' );
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'hillslope_transmissivity_method' );
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'hillslope_pft_distribution_method' );
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'hillslope_soil_profile_method' );
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_hillslope_routing', 'use_hillslope'=>$nl_flags->{'use_hillslope'} );
my $use_hillslope = $nl->get_value('use_hillslope');
my $use_hillslope_routing = $nl->get_value('use_hillslope_routing');
if ( (! &value_is_true($use_hillslope)) && &value_is_true($use_hillslope_routing) ) {
$log->fatal_error("Cannot turn on use_hillslope_routing when use_hillslope is off\n" );
}
}

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

sub setup_logic_hydrstress {
#
# Plant hydraulic stress model
Expand Down Expand Up @@ -4265,7 +4290,6 @@ sub setup_logic_soil_resis {

add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'soil_resis_method' );
}
#-------------------------------------------------------------------------------

sub setup_logic_canopyfluxes {
#
Expand Down Expand Up @@ -4471,7 +4495,8 @@ sub setup_logic_fates {
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'fates_paramfile', 'phys'=>$nl_flags->{'phys'});
my @list = ( "fates_spitfire_mode", "use_fates_planthydro", "use_fates_ed_st3", "use_fates_ed_prescribed_phys",
"use_fates_inventory_init","use_fates_fixed_biogeog","use_fates_nocomp","fates_seeddisp_cadence",
"use_fates_logging","fates_parteh_mode", "use_fates_cohort_age_tracking","use_fates_tree_damage","use_fates_luh" );
"use_fates_logging","fates_parteh_mode", "use_fates_cohort_age_tracking","use_fates_tree_damage",
"use_fates_luh","fates_history_dimlevel" );
foreach my $var ( @list ) {
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, 'use_fates'=>$nl_flags->{'use_fates'},
'use_fates_sp'=>$nl_flags->{'use_fates_sp'} );
Expand Down Expand Up @@ -4641,6 +4666,7 @@ sub write_output_files {

# CLM component
my @groups;

@groups = qw(clm_inparm ndepdyn_nml popd_streams urbantv_streams light_streams
soil_moisture_streams lai_streams atm2lnd_inparm lnd2atm_inparm clm_canopyhydrology_inparm cnphenology
cropcal_streams
Expand All @@ -4650,7 +4676,7 @@ sub write_output_files {
soilhydrology_inparm luna friction_velocity mineral_nitrogen_dynamics
soilwater_movement_inparm rooting_profile_inparm
soil_resis_inparm bgc_shared canopyfluxes_inparm aerosol
clmu_inparm clm_soilstate_inparm clm_nitrogen clm_snowhydrology_inparm
clmu_inparm clm_soilstate_inparm clm_nitrogen clm_snowhydrology_inparm hillslope_hydrology_inparm hillslope_properties_inparm
cnprecision_inparm clm_glacier_behavior crop_inparm irrigation_inparm
surfacealbedo_inparm water_tracers_inparm tillage_inparm);

Expand Down
25 changes: 20 additions & 5 deletions bld/namelist_files/namelist_defaults_ctsm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,9 @@ attributes from the config_cache.xml file (with keys converted to upper-case).
<reset_snow_glc_ela>1.e9</reset_snow_glc_ela>

<snow_cover_fraction_method>SwensonLawrence2012</snow_cover_fraction_method>

<snow_thermal_cond_method>Jordan1991</snow_thermal_cond_method>
<snow_thermal_cond_method phys="clm5_1">Sturm1997</snow_thermal_cond_method>

<!-- Default glacier behavior is:
Mountain glaciers: single_at_atm_topo
Expand Down Expand Up @@ -492,9 +494,9 @@ attributes from the config_cache.xml file (with keys converted to upper-case).
<!-- The default filenames are given relative to the root directory
for the CLM2 data in the CESM distribution -->
<!-- Plant function types (relative to {csmdata}) -->
<paramfile phys="clm5_1" >lnd/clm2/paramdata/ctsm51_params.c240207b.nc</paramfile>
<paramfile phys="clm5_0" >lnd/clm2/paramdata/clm50_params.c240207b.nc</paramfile>
<paramfile phys="clm4_5" >lnd/clm2/paramdata/clm45_params.c240207b.nc</paramfile>
<paramfile phys="clm5_1" >lnd/clm2/paramdata/ctsm51_params.c240208.nc</paramfile>
<paramfile phys="clm5_0" >lnd/clm2/paramdata/clm50_params.c240208.nc</paramfile>
<paramfile phys="clm4_5" >lnd/clm2/paramdata/clm45_params.c240208.nc</paramfile>

<!-- ================================================================== -->
<!-- FATES default parameter file -->
Expand Down Expand Up @@ -619,6 +621,18 @@ attributes from the config_cache.xml file (with keys converted to upper-case).
<cnegcrit phys="clm4_5" use_cn=".true.">-6.d+2</cnegcrit>
<nnegcrit phys="clm4_5" use_cn=".true.">-6.d+1</nnegcrit>


<!-- Hillslope hydrology -->
<use_hillslope >.false.</use_hillslope>
<use_hillslope phys="clm4_5" >.false.</use_hillslope>
<use_hillslope phys="clm5_0" >.false.</use_hillslope>
<use_hillslope_routing >.false.</use_hillslope_routing>
<hillslope_head_gradient_method >Darcy</hillslope_head_gradient_method>
<hillslope_transmissivity_method >LayerSum</hillslope_transmissivity_method>
<hillslope_pft_distribution_method >Standard</hillslope_pft_distribution_method>
<hillslope_soil_profile_method >Uniform</hillslope_soil_profile_method>
<downscale_hillslope_meteorology >.true.</downscale_hillslope_meteorology>

<!-- Plant hydraulic stress -->
<use_hydrstress >.false.</use_hydrstress>
<use_hydrstress phys="clm5_0" use_fates=".false." configuration="clm">.true.</use_hydrstress>
Expand Down Expand Up @@ -1689,7 +1703,8 @@ use_crop=".true.">lnd/clm2/surfdata_map/ctsm5.1.dev052/landuse.timeseries_mpasa1
<snicar_solarspec >mid_latitude_winter</snicar_solarspec>
<snicar_dust_optics >sahara</snicar_dust_optics>
<snicar_snodst_intmix>.false.</snicar_snodst_intmix>
<snicar_snobc_intmix >.false.</snicar_snobc_intmix>
<snicar_snobc_intmix>.false.</snicar_snobc_intmix>
<snicar_snobc_intmix phys="clm5_1">.true.</snicar_snobc_intmix>
<snicar_use_aerosol >.true.</snicar_use_aerosol>
<do_sno_oc >.false.</do_sno_oc>

Expand Down Expand Up @@ -2889,7 +2904,7 @@ use_crop=".true.">lnd/clm2/surfdata_map/ctsm5.1.dev052/landuse.timeseries_mpasa1
<use_fates_luh use_fates=".true.">.false.</use_fates_luh>
<fates_parteh_mode use_fates=".true.">1</fates_parteh_mode>
<fates_seeddisp_cadence use_fates=".true.">0</fates_seeddisp_cadence>

<fates_history_dimlevel use_fates=".true.">2,2</fates_history_dimlevel>
<use_fates_nocomp use_fates=".true." use_fates_sp=".true.">.true.</use_fates_nocomp>
<use_fates_nocomp use_fates=".true." >.false.</use_fates_nocomp>
<use_fates_fixed_biogeog use_fates=".true." use_fates_sp=".true.">.true.</use_fates_fixed_biogeog>
Expand Down
54 changes: 48 additions & 6 deletions bld/namelist_files/namelist_definition_ctsm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,19 @@ Full pathname to the inventory initialization control file.
(Only relevant if FATES is on).
</entry>

<entry id="fates_history_dimlevel" type="integer(2)" category="physics"
group="clm_inparm" valid_values="0,1,2" >
Setting for what types of FATES history to be allocate and
calculated at the dynamics timestep (1st integer) and the
model timestep (2nd integer). This must be consistent with
hist_fincl*, ie output variables must not be listed if the
output level is not enabled.
0 = no fates history variables are calculated or allocated
1 = only time x space (3d) fates history variables allowed
2 = multiplexed dimensioned fates history is also allowed
(Only relevant if FATES is on)
</entry>

<!-- This may eventually migrate to the dynamic_subgrid group-->
<entry id="use_fates_luh" type="logical" category="physics"
group="clm_inparm" valid_values="" >
Expand All @@ -800,6 +813,41 @@ LUNA operates on C3 and non-crop vegetation (see vcmax_opt for how other veg is
LUNA: Leaf Utilization of Nitrogen for Assimilation
</entry>

<entry id="use_hillslope" type="logical" category="physics"
group="clm_inparm" valid_values="" value=".false.">
Toggle to turn on the hillslope model
</entry>

<entry id="downscale_hillslope_meteorology" type="logical" category="physics"
group="clm_inparm" valid_values="" value=".false.">
Toggle to turn on meteorological downscaling in hillslope model
</entry>

<entry id="use_hillslope_routing" type="logical" category="physics"
group="clm_inparm" valid_values="" value=".false.">
Toggle to turn on surface water routing in the hillslope hydrology model
</entry>

<entry id="hillslope_head_gradient_method" type="char*256" category="physics"
group="hillslope_hydrology_inparm" valid_values="Kinematic,Darcy">
Method for calculating hillslope saturated head gradient
</entry>

<entry id="hillslope_transmissivity_method" type="char*256" category="physics"
group="hillslope_hydrology_inparm" valid_values="LayerSum,Uniform">
Method for calculating transmissivity of hillslope columns
</entry>

<entry id="hillslope_pft_distribution_method" type="char*256" category="physics"
group="hillslope_properties_inparm" valid_values="Standard,FromFile,DominantPftUniform,DominantPftLowland,PftLowlandUpland">
Method for distributing pfts across hillslope columns
</entry>

<entry id="hillslope_soil_profile_method" type="char*256" category="physics"
group="hillslope_properties_inparm" valid_values="Uniform,FromFile,SetLowlandUpland,Linear">
Method for distributing soil thickness across hillslope columns
</entry>

<entry id="use_hydrstress" type="logical" category="physics"
group="clm_inparm" valid_values="" value=".false.">
Toggle to turn on the plant hydraulic stress model
Expand Down Expand Up @@ -2542,12 +2590,6 @@ If surface water is active or not
(deprecated -- will be removed)
</entry>

<entry id="origflag" type="integer" category="clm_physics"
group="clm_soilhydrology_inparm" valid_values="0,1" >
Use original CLM4 soil hydraulic properties
(deprecated -- will be removed)
</entry>

<!-- ======================================================================================== -->
<!-- namelist elements associated with the CH4 Model -->
<!-- ======================================================================================== -->
Expand Down
Loading

0 comments on commit dd87593

Please sign in to comment.