Skip to content

Commit

Permalink
updated several files to ctsm5.3.011
Browse files Browse the repository at this point in the history
  • Loading branch information
mvertens committed Nov 13, 2024
1 parent dbab48c commit c685a27
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 23 deletions.
13 changes: 7 additions & 6 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,16 +1357,13 @@ 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 @@ -4153,6 +4150,10 @@ sub setup_logic_megan {
if ( defined($nl->get_value('megan_specifier')) ||
defined($nl->get_value('megan_factors_file')) ) {
check_megan_spec( $opts, $nl, $definition );
if ( &value_is_true( $nl_flags->{'use_fates'} ) ) {
$log->warning("MEGAN can NOT be on when FATES is also on.\n" .
" Use the '-no-megan' option when '-bgc fates' is activated");
}
}
}

Expand Down Expand Up @@ -4965,7 +4966,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
24 changes: 7 additions & 17 deletions cime_config/buildnml
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ def buildnml(case, caseroot, compname):
run_reftod = case.get_value("RUN_REFTOD")
start_tod = case.get_value("START_TOD")
glc_nec = case.get_value("GLC_NEC")
cism_use_antarctica = case.get_value("CISM_USE_ANTARCTICA")
dglc_use_antarctica = case.get_value("DGLC_USE_ANTARCTICA")
glc_use_antarctica = case.get_value("GLC_USE_ANTARCTICA")
mask = case.get_value("MASK_GRID")
driver = case.get_value("COMP_INTERFACE").lower()

Expand Down Expand Up @@ -247,29 +246,20 @@ def buildnml(case, caseroot, compname):
else:
nomeg = ""

glc_use_antarctica = cism_use_antarctica
if glc_use_antarctica is None:
glc_use_antarctica = dglc_use_antarctica
if glc_use_antarctica is None:
# This is the case for compsets without CISM or DGLC, where the
# CISM_USE_ANTARCTICA and DGLC_USE_ANTARCTICA xml variables are not defined
# This is the case for compsets with SGLC where the GLC_USE_ANTARCTICA xml
# variable isn't defined
glc_use_antarctica_flag = ""
elif isinstance(glc_use_antarctica, bool):
if glc_use_antarctica:
glc_use_antarctica_flag = "-glc_use_antarctica"
else:
glc_use_antarctica_flag = ""
else:
if cism_use_antarctia:
expect(
False,
"Unexpected value for CISM_USE_ANTARCTICA: {}".format(cism_use_antarctica),
)
else:
expect(
False,
"Unexpected value for DGLC_USE_ANTARCTICA: {}".format(dglc_use_antarctica),
)
expect(
False,
"Unexpected value for GLC_USE_ANTARCTICA: {}".format(glc_use_antarctica),
)

if clm_nml_use_case != "UNSET":
usecase = "-use_case %s" % clm_nml_use_case
Expand Down

0 comments on commit c685a27

Please sign in to comment.