Skip to content

Commit

Permalink
Save use_excice_streams to nl_flags so it doesn't have to be set to f…
Browse files Browse the repository at this point in the history
…alse when not needed
  • Loading branch information
ekluzek committed Jul 31, 2024
1 parent e3605ab commit 18df066
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions bld/CLMBuildNamelist.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4593,14 +4593,16 @@ sub setup_logic_exice {
$use_exice_streams = '.true.';
# if excess ice is turned off
} elsif ( (not defined($use_exice_streams)) && (not value_is_true($use_exice)) ) {
$nl->set_variable_value('exice_streams', 'use_excess_ice_streams' , '.false.');
$use_exice_streams = '.false.';
# Checking for cold clm_start_type and not finidat here since finidat can be not set set in branch/hybrid runs and
# These cases are handled in the restart routines in the model
} elsif ( defined($use_exice_streams) && (not value_is_true($use_exice_streams)) && value_is_true($use_exice) &&
( $nl_flags->{'clm_start_type'} eq "'cold'" || $nl_flags->{'clm_start_type'} eq "'arb_ic'" )) {
$log->fatal_error("use_excess_ice_streams can NOT be FALSE when use_excess_ice is TRUE on the cold start" );
}

# Put use_exice_streams into nl_flags so can be referenced later
$nl_flags->{'use_excice_streams'} = $use_exice_streams;
# If excess ice streams is on
if (defined($use_exice_streams) && value_is_true($use_exice_streams)) {
# Can only be true if excess ice is also on, otherwise fail
Expand Down Expand Up @@ -4652,7 +4654,7 @@ sub setup_logic_coldstart_temp {

my @list = ( "excess_ice_coldstart_temp", "excess_ice_coldstart_depth" );

# Only needs to be set if it's a coldstart
# Only needs to be set by the user if it's a coldstart
if ( ! string_is_undef_or_empty($finidat) ) {
foreach my $var ( @list ) {
my $val = $nl->get_value( $var );
Expand All @@ -4667,7 +4669,7 @@ sub setup_logic_coldstart_temp {
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'excess_ice_coldstart_depth',
'use_excess_ice'=>$use_exice);

my $use_exice_streams = $nl->get_value( 'use_excess_ice_streams' );
my $use_exice_streams = $nl_flags->{'use_excice_streams'};
my $exice_cs_temp = $nl->get_value( 'excess_ice_coldstart_temp' );
my $exice_cs_depth = $nl->get_value( 'excess_ice_coldstart_depth' );

Expand Down

0 comments on commit 18df066

Please sign in to comment.