Skip to content

Commit

Permalink
Merge branch 'rosiealice_CTSM/megan_cherrypick_ctsm' into feature/meg…
Browse files Browse the repository at this point in the history
…an_cherrypick_ctsm_mvertens
  • Loading branch information
mvertens committed Nov 13, 2024
2 parents 494b326 + 5533548 commit 6508c01
Show file tree
Hide file tree
Showing 8 changed files with 792 additions and 540 deletions.
15 changes: 11 additions & 4 deletions bld/CLMBuildNamelist.pm
Original file line number Diff line number Diff line change
Expand Up @@ -978,7 +978,7 @@ sub setup_cmdl_bgc {
# Set soil matrix (which is needed later for spinup)
$var = "use_soil_matrixcn";
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var,
, 'use_fates'=>$nl_flags->{'use_fates'},
, 'use_fates'=>$nl_flags->{'use_fates'},
, 'soil_decomp_method'=>$nl_flags->{'soil_decomp_method'},
, 'phys'=>$nl_flags->{'phys'}, clm_accelerated_spinup=>$nl_flags->{'clm_accelerated_spinup'} );
if ( &value_is_true($nl->get_value($var)) ) {
Expand Down Expand Up @@ -1214,7 +1214,7 @@ sub setup_cmdl_spinup {
if ( &value_is_true($nl_flags->{'use_cn'}) ) {
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition,
$defaults, $nl, "spinup_state", clm_accelerated_spinup=>$nl_flags->{'clm_accelerated_spinup'},
use_cn=>$nl_flags->{'use_cn'}, use_fates=>$nl_flags->{'use_fates'},
use_cn=>$nl_flags->{'use_cn'}, use_fates=>$nl_flags->{'use_fates'},
use_soil_matrixcn=>$nl_flags->{"use_soil_matrixcn"} );
if ( $nl->get_value("spinup_state") ne 0 ) {
$nl_flags->{'bgc_spinup'} = "on";
Expand Down Expand Up @@ -1357,13 +1357,16 @@ sub setup_cmdl_run_type {
$nl->set_variable_value($group, $var, quote_string( $opts->{$var} ) );
}
}
print "\n";
print "DEBUG0: clm_start_type is $nl_flags->{'clm_start_type'}\n";
if ( ! defined $set ) {
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var,
'use_cndv'=>$nl_flags->{'use_cndv'}, 'use_fates'=>$nl_flags->{'use_fates'},
'sim_year'=>$st_year, 'sim_year_range'=>$nl_flags->{'sim_year_range'},
'bgc_spinup'=>$nl_flags->{'bgc_spinup'}, 'lnd_tuning_mode'=>$nl_flags->{'lnd_tuning_mode'} );
}
$nl_flags->{'clm_start_type'} = $nl->get_value($var);
print "DEBUG1: clm_start_type is $nl_flags->{'clm_start_type'}\n";
$nl_flags->{'st_year'} = $st_year;
}

Expand Down Expand Up @@ -2588,7 +2591,11 @@ sub setup_logic_initial_conditions {
my $finidat = $nl->get_value($var);
$nl_flags->{'excess_ice_on_finidat'} = "unknown";
if ( $nl_flags->{'clm_start_type'} =~ /cold/ ) {
if (defined $finidat ) {
# start of hack
# THIS is a temporary hack to enable fates to use finidat values for startup runs
my $is_fates = $nl_flags->{'use_fates'};
if (defined $finidat && not $is_fates) {
# end of hack
$log->warning("setting $var (either explicitly in your user_nl_clm or by doing a hybrid or branch RUN_TYPE)\n is incomptable with using a cold start" .
" (by setting CLM_FORCE_COLDSTART=on)." );
$log->warning("Overridding input $var file with one specifying that this is a cold start from arbitrary initial conditions." );
Expand Down Expand Up @@ -4969,7 +4976,7 @@ sub setup_logic_exice {
# excess ice streams, must be set before initial conditions
#
my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_;
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_excess_ice', 'phys'=>$physv->as_string());
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_excess_ice', 'phys'=>$physv->as_string());
my $use_exice = $nl->get_value( 'use_excess_ice' );
# Put use_exice into nl_flags so can be referenced later
if ( value_is_true($use_exice) ) {
Expand Down
7 changes: 4 additions & 3 deletions bld/namelist_files/namelist_defaults_ctsm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,8 @@ attributes from the config_cache.xml file (with keys converted to upper-case).
<!-- FATES default parameter file -->
<!-- ================================================================== -->

<fates_paramfile>lnd/clm2/paramdata/fates_params_api.36.0.0_12pft_c240517.nc</fates_paramfile>
<!-- <fates_paramfile>lnd/clm2/paramdata/fates_params_api.36.1.0_14pft_c241003.nc</fates_paramfile> -->
<fates_paramfile>lnd/clm2/paramdata/fates_params_api.36.1.0_14pft_c241003_megan.nc</fates_paramfile>

<!-- ================================================================== -->
<!-- Default surface roughness parameterization -->
Expand Down Expand Up @@ -2040,10 +2041,10 @@ lnd/clm2/surfdata_esmf/NEON/ctsm5.3.0/surfdata_1x1_NEON_TOOL_hist_2000_78pfts_c2
<!-- As of 2024/02/02 the Grids Support spreadsheet includes no 16-pft landuse files. -->
<flanduse_timeseries hgrid="4x5" sim_year_range="1850-2000"
>lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_4x5_SSP2-4.5_1850-2100_78pfts_c240908.nc</flanduse_timeseries>
<flanduse_timeseries hgrid="10x15" sim_year_range="1850-2000"
<flanduse_timeseries hgrid="10x15" sim_year_range="1850-2000"
>lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_10x15_SSP2-4.5_1850-2100_78pfts_c240908.nc</flanduse_timeseries>

<flanduse_timeseries hgrid="360x720cru" sim_year_range="1850-2000"
<flanduse_timeseries hgrid="360x720cru" sim_year_range="1850-2000"
>lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_360x720cru_SSP2-4.5_1850-2100_78pfts_c240908.nc</flanduse_timeseries>

<flanduse_timeseries hgrid="1x1_brazil" sim_year_range="1850-2000"
Expand Down
21 changes: 11 additions & 10 deletions cime_config/config_component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<desc lnd="CLM45[%SP][%SP-VIC][%BGC][%BGC-CROP][%FATES][%BGCDV][%BGCDV-CROP]" >clm4.5:</desc>
<desc lnd="CLM50[%SP][%SP-VIC][%SP-NOANTHRO][%BGC-NOANTHRO][%BGC][%BGC-CROP][%FATES][%BGCDV][%BGCDV-CROP][%BGC-CROP-CMIP6DECK][%BGC-CROP-CMIP6WACCMDECK][%NWP-SP][%NWP-BGC-CROP]">clm5.0:</desc>
<desc lnd="CLM51[%SP][%SP-NOANTHRO][%BGC-NOANTHRO][%BGC][%BGC-CROP][%FATES][%FATES-SP][%FATES-NOCOMP][%NWP-SP][%NWP-BGC-CROP]">clm5.1:</desc>
<desc lnd="CLM60[%SP][%SP-NOANTHRO][%BGC-NOANTHRO][%BGC][%BGC-CROP][%FATES][%FATES-SP][%NWP-SP][%NWP-BGC-CROP]">clm6.0:</desc>
<desc lnd="CLM60[%SP][%SP-NOANTHRO][%BGC-NOANTHRO][%BGC][%BGC-CROP][%FATES][%FATES-SP][%FATES-NOCOMP][%NWP-SP][%NWP-BGC-CROP]">clm6.0:</desc>
<desc option="SP" >Satellite phenology:</desc>

<desc option="SP-VIC" >Satellite phenology with VIC hydrology:</desc>
Expand Down Expand Up @@ -256,8 +256,8 @@
<value compset="_CLM[^_]*%SP" >-bgc sp</value>
<value compset="_CLM[^_]*BGC" >-bgc bgc</value>
<value compset="_CLM[^_]*BGC-CROP" >-bgc bgc -crop</value>
<value compset="_CLM[^_]*FATES" >-bgc fates -no-megan</value>
<value compset="_CLM[^_]*FATES-SP" >-bgc fates -no-megan</value>
<value compset="_CLM[^_]*FATES" >-bgc fates</value>
<value compset="_CLM[^_]*FATES-SP" >-bgc fates</value>
<value compset="_CLM[^_]*FATES-NOCOMP">-bgc fates</value>

<!-- Options specific for CLM4.5 -->
Expand Down Expand Up @@ -333,7 +333,7 @@
to create_newcase. The default value is UNSET.
For NEON cases, this can be set to either NEON or NEON.PRISM, the latter of which would
use PRISM precipitation instead of the default NEON precipitation. NEON cases then also
use the variable NEONSITE to specify the exact site. PLUMBER cases use the variable
use the variable NEONSITE to specify the exact site. PLUMBER cases use the variable
PLUMBER2SITE to specify the exact site.</desc>
</entry>

Expand Down Expand Up @@ -367,12 +367,13 @@
<valid_values></valid_values>
<default_value></default_value>
<values match="last">
<value compset="_CLM60%[^_]*FATES-SP[%_]" >$COMP_ROOT_DIR_LND/cime_config/usermods_dirs/fates_sp</value>
<value compset="_CLM51%[^_]*FATES-SP[%_]" >$COMP_ROOT_DIR_LND/cime_config/usermods_dirs/fates_sp</value>
<value compset="_CLM50%[^_]*CMIP6DECK[%_]" >$COMP_ROOT_DIR_LND/cime_config/usermods_dirs/cmip6_deck</value>
<value compset="_CLM51%[^_]*FATES-SP[%_]" >$COMP_ROOT_DIR_LND/cime_config/usermods_dirs/fates_sp</value>
<value compset="_CLM51%[^_]*FATES-NOCOMP[%_]" >$COMP_ROOT_DIR_LND/cime_config/usermods_dirs/fates_nocomp</value>
<value grid="l%1.9x2.5" compset="_CLM50%[^_]*CMIP6DECK[%_]" >$COMP_ROOT_DIR_LND/cime_config/usermods_dirs/cmip6_nociso_deck</value>
<value compset="_CLM60%[^_]*FATES-SP[%_]" >$COMP_ROOT_DIR_LND/cime_config/usermods_dirs/fates_sp</value>
<value compset="_CLM60%[^_]*FATES-NOCOMP[%_]">$COMP_ROOT_DIR_LND/cime_config/usermods_dirs/fates_nocomp</value>
<value compset="_CLM51%[^_]*FATES-SP[%_]" >$COMP_ROOT_DIR_LND/cime_config/usermods_dirs/fates_sp</value>
<value compset="_CLM50%[^_]*CMIP6DECK[%_]" >$COMP_ROOT_DIR_LND/cime_config/usermods_dirs/cmip6_deck</value>
<value compset="_CLM51%[^_]*FATES-SP[%_]" >$COMP_ROOT_DIR_LND/cime_config/usermods_dirs/fates_sp</value>
<value compset="_CLM51%[^_]*FATES-NOCOMP[%_]">$COMP_ROOT_DIR_LND/cime_config/usermods_dirs/fates_nocomp</value>
<value grid="l%1.9x2.5" compset="_CLM50%[^_]*CMIP6DECK[%_]" >$COMP_ROOT_DIR_LND/cime_config/usermods_dirs/cmip6_nociso_deck</value>
<value compset="_CLM50%[^_]*CMIP6WACCMDECK[%_]">$COMP_ROOT_DIR_LND/cime_config/usermods_dirs/cmip6_waccm_deck</value>
<value grid="l%1.9x2.5" compset="_CLM50%[^_]*CMIP6WACCMDECK[%_]">$COMP_ROOT_DIR_LND/cime_config/usermods_dirs/cmip6_waccm_nociso_deck</value>
</values>
Expand Down
Loading

0 comments on commit 6508c01

Please sign in to comment.