Skip to content

Commit

Permalink
fix namelist logic
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdebolskiy committed Jun 4, 2024
1 parent 5001629 commit 9d6901b
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions bld/CLMBuildNamelist.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4588,14 +4588,20 @@ sub setup_logic_exice {
my ($opts, $nl_flags, $definition, $defaults, $nl) = @_;
my $use_exice = $nl->get_value( 'use_excess_ice' );
my $use_exice_streams = $nl->get_value( 'use_excess_ice_streams' );
# IF excess ice streams is on
if ( (not defined($use_exice_streams) && value_is_true($use_exice)) && ($nl_flags->{'clm_start_type'} == /cold/ || $nl_flags->{'clm_start_type'} == /arb_ic/ ) ) {
my $finidat = $nl->get_value('finidat');
# If coldstart and use_excess_ice is on:
if ( ( (not defined($use_exice_streams)) && value_is_true($use_exice) ) && string_is_undef_or_empty($finidat) ) {
$nl->set_variable_value('exice_streams', 'use_excess_ice_streams' , '.true.');
$use_exice_streams = '.true.'
$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.';
}
# 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
if (defined($use_exice) && not value_is_true($use_exice)) {
if ( defined($use_exice) && (not value_is_true($use_exice)) ) {
$log->fatal_error("use_excess_ice_streams can NOT be TRUE when use_excess_ice is FALSE" );
}
# Otherwise if ice streams are off
Expand Down

0 comments on commit 9d6901b

Please sign in to comment.