Skip to content

Commit

Permalink
Merge pull request #10 from ekluzek/new_surf_in_namelist_defaults
Browse files Browse the repository at this point in the history
Update surface datasets in namelist defaults
  • Loading branch information
ekluzek authored Sep 11, 2024
2 parents e5d96a0 + 10ffe8a commit 01476b6
Show file tree
Hide file tree
Showing 6 changed files with 166 additions and 105 deletions.
13 changes: 11 additions & 2 deletions bld/CLMBuildNamelist.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2506,8 +2506,9 @@ sub setup_logic_surface_dataset {
# consistent with it
# MUST BE AFTER: setup_logic_demand which is where flanduse_timeseries is set
#
my ($opts, $nl_flags, $definition, $defaults, $nl, $xmlvar_ref) = @_;
my ($opts_in, $nl_flags, $definition, $defaults, $nl, $xmlvar_ref) = @_;

my $opts = $opts_in;
$nl_flags->{'flanduse_timeseries'} = "null";
my $flanduse_timeseries = $nl->get_value('flanduse_timeseries');
if (defined($flanduse_timeseries)) {
Expand All @@ -2523,6 +2524,11 @@ sub setup_logic_surface_dataset {
if ($flanduse_timeseries ne "null" && &value_is_true($nl_flags->{'use_cndv'}) ) {
$log->fatal_error( "dynamic PFT's (setting flanduse_timeseries) are incompatible with dynamic vegetation (use_cndv=.true)." );
}
# Turn test option off for NEON until after XML is interpreted
my $test_files = $opts->{'test'};
if ( &value_is_true($nl_flags->{'neon'})) {
$opts->{'test'} = 0;
}
#
# Always get the crop version of the datasets now and let the code turn it into the form desired
# Provided this isn't with FATES on
Expand All @@ -2548,7 +2554,7 @@ sub setup_logic_surface_dataset {
'use_crop'=>$nl_flags->{'use_crop'} );
}
#
# Expand the XML variables for NEON cases so that NEONSITE will be used
# Expand the XML variables for NEON cases so that NEONSITE will be used and test for existence
#
if ( &value_is_true($nl_flags->{'neon'}) ) {
my $fsurdat = $nl->get_value($var);
Expand All @@ -2557,6 +2563,9 @@ sub setup_logic_surface_dataset {
my $group = $definition->get_group_name($var);
$nl->set_variable_value($group, $var, $newval);
$log->verbose_message( "This is a NEON site and the fsurdat file selected is: $newval" );
if ( $test_files and ($newval !~ /null|none/) and (! -f remove_leading_and_trailing_quotes($newval) ) ) {
$log->fatal_error("file not found: $var = $newval");
}
}
}
}
Expand Down
Loading

0 comments on commit 01476b6

Please sign in to comment.