Skip to content

Commit

Permalink
Merge remote-tracking branch 'escomp/b4b-dev' into lilac_remove_mct
Browse files Browse the repository at this point in the history
  • Loading branch information
ekluzek committed Mar 18, 2024
2 parents 80568e2 + ebdb103 commit fa513f3
Show file tree
Hide file tree
Showing 148 changed files with 5,524 additions and 1,260 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
42 changes: 33 additions & 9 deletions bld/CLMBuildNamelist.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1577,6 +1577,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 @@ -2706,6 +2707,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 @@ -2781,6 +2784,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 @@ -2876,6 +2881,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 @@ -2939,6 +2946,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 @@ -3268,12 +3277,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 @@ -3297,9 +3302,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 @@ -3481,6 +3483,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 @@ -4209,7 +4233,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 @@ -4585,6 +4608,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 @@ -4594,7 +4618,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
18 changes: 15 additions & 3 deletions bld/namelist_files/namelist_defaults_ctsm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -484,9 +484,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.c240105.nc</paramfile>
<paramfile phys="clm5_0" >lnd/clm2/paramdata/clm50_params.c240105.nc</paramfile>
<paramfile phys="clm4_5" >lnd/clm2/paramdata/clm45_params.c240105.nc</paramfile>
<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>

<!-- ================================================================== -->
<!-- FATES default parameter file -->
Expand Down Expand Up @@ -611,6 +611,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
41 changes: 35 additions & 6 deletions bld/namelist_files/namelist_definition_ctsm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -800,6 +800,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 @@ -2499,12 +2534,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 fa513f3

Please sign in to comment.