Skip to content

Commit

Permalink
Merge branch 'new_rawpftlai' into changelog_readme_update
Browse files Browse the repository at this point in the history
  • Loading branch information
ekluzek committed Sep 24, 2024
2 parents 7710514 + e761cd9 commit 5826608
Show file tree
Hide file tree
Showing 52 changed files with 357 additions and 3,350 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@ ctsm.input_data_list.previous
# mksurfdata unit tests
unit_test_build

# Tools executables
/tools/mkprocdata_map/mkprocdata_map

# run_neon output directories
/tools/site_and_regional/listing.csv
/tools/site_and_regional/????/
Expand Down
2 changes: 0 additions & 2 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,6 @@ cime_config/usermods_dirs -------- Directories of sets of user-modification subd

tools/mksurfdata_esmf --------- Directory to build program to create surface dataset
at any resolution.
tools/mkprocdata_map ---------- Process history data from unstructed grids to a gridded
format.
tools/mkmapgrids -------------- NCL script to create a SCRIP grid file for a regular lat/lon grid (deprecated)
tools/crop_calendars ---------- Tools to process and process and create crop calendar datasets for CTSM
tools/modify_input_files ------ Script to modify existing CTSM input datasets in standard ways
Expand Down
33 changes: 29 additions & 4 deletions bld/CLMBuildNamelist.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1665,6 +1665,7 @@ sub process_namelist_inline_logic {
setup_logic_demand($opts, $nl_flags, $definition, $defaults, $nl);
setup_logic_surface_dataset($opts, $nl_flags, $definition, $defaults, $nl, $envxml_ref);
setup_logic_dynamic_subgrid($opts, $nl_flags, $definition, $defaults, $nl);
setup_logic_exice($opts, $nl_flags, $definition, $defaults, $nl, $physv);
if ( remove_leading_and_trailing_quotes($nl_flags->{'clm_start_type'}) ne "branch" ) {
setup_logic_initial_conditions($opts, $nl_flags, $definition, $defaults, $nl, $physv);
}
Expand Down Expand Up @@ -1894,7 +1895,7 @@ sub process_namelist_inline_logic {
#################################
# namelist group: exice_streams #
#################################
setup_logic_exice($opts, $nl_flags, $definition, $defaults, $nl, $physv);
setup_logic_exice_streams($opts, $nl_flags, $definition, $defaults, $nl, $physv);

##########################################
# namelist group: clm_temperature_inparm #
Expand Down Expand Up @@ -2580,10 +2581,12 @@ sub setup_logic_initial_conditions {
#
# MUST BE AFTER: setup_logic_demand which is where flanduse_timeseries is set
# AFTER: setup_logic_irrigate which is where irrigate is set
# AFTER: setup_logic_exice which is where use_excess_ice is set
my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_;

my $var = "finidat";
my $finidat = $nl->get_value($var);
$nl_flags->{'excess_ice_on_finidat'} = "unknown";
if ( $nl_flags->{'clm_start_type'} =~ /cold/ ) {
if (defined $finidat ) {
$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" .
Expand Down Expand Up @@ -2632,7 +2635,7 @@ sub setup_logic_initial_conditions {
$settings{'sim_year'} = $st_year;
}
foreach my $item ( "mask", "maxpft", "irrigate", "glc_nec", "use_crop", "use_cn", "use_cndv",
"use_fates",
"use_fates", "use_excess_ice",
"lnd_tuning_mode",
) {
$settings{$item} = $nl_flags->{$item};
Expand All @@ -2653,6 +2656,7 @@ sub setup_logic_initial_conditions {
my $done = 2;
do {
$try++;
$nl_flags->{'excess_ice_on_finidat'} = $settings{'use_excess_ice'};
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, %settings );
# If couldn't find a matching finidat file, check if can turn on interpolation and try to find one again
$finidat = $nl->get_value($var);
Expand Down Expand Up @@ -4966,18 +4970,39 @@ sub setup_logic_cnmatrix {
#-------------------------------------------------------------------------------
sub setup_logic_exice {
#
# excess ice streams
# 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());
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) ) {
$nl_flags->{'use_excess_ice'} = ".true.";
} else {
$nl_flags->{'use_excess_ice'} = ".false.";
}
}

#-------------------------------------------------------------------------------
sub setup_logic_exice_streams {
#
# excess ice streams
# Run after initial conditions found as well as after setup_logic_exice
#
my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_;
my $use_exice = $nl_flags->{'use_excess_ice'};
my $excess_ice_on_finidat = $nl_flags->{'excess_ice_on_finidat'};
my $use_exice_streams = $nl->get_value( 'use_excess_ice_streams' );
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.';
# if excess ice is turned off
# If an finidat file was selected and use_excess_ice is on:
} elsif ( (not defined($use_exice_streams)) && value_is_true($use_exice) && (not value_is_true($excess_ice_on_finidat)) ) {
$nl->set_variable_value('exice_streams', 'use_excess_ice_streams' , '.true.');
$use_exice_streams = '.true.';
# if excess ice is turned off
} elsif ( (not defined($use_exice_streams)) && (not value_is_true($use_exice)) ) {
$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
Expand Down
Loading

0 comments on commit 5826608

Please sign in to comment.