Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdebolskiy committed Dec 11, 2023
2 parents 60d99ba + 50bfc43 commit 5667aad
Show file tree
Hide file tree
Showing 93 changed files with 4,021 additions and 1,153 deletions.
5 changes: 5 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,16 @@ b88e1cd1b28e3609684c79a2ec0e88f26cfc362b
b771971e3299c4fa56534b93421f7a2b9c7282fd
9de88bb57ea9855da408cbec1dc8acb9079eda47
8bc4688e52ea23ef688e283698f70a44388373eb
4ee49e3e516ca7dee5df378f65664f93a7db4415
0207bc98dd5c75cd69a0e788bc53e41093712f5c
e4d38681df23ccca0ae29581a45f8362574e0630
0a5a9e803b56ec1bbd6232eff1c99dbbeef25eb7
810cb346f05ac1aabfff931ab1a2b7b584add241
5933b0018f8e29413e30dda9b906370d147bad45
# Ran SystemTests and python/ctsm through black python formatter
5364ad66eaceb55dde2d3d598fe4ce37ac83a93c
8056ae649c1b37f5e10aaaac79005d6e3a8b2380
0bc3f00115d86d026a977918661c93779b3b19f9
540b256d1f3382f4619d7b0877c32d54ce5c40b6
8a168bb0895f4f2421608dd2589398e13a6663e6
6fccf682eaf718615407d9bacdd3903b8786a03d
12 changes: 6 additions & 6 deletions Externals.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ required = True
local_path = components/cism
protocol = git
repo_url = https://github.com/ESCOMP/CISM-wrapper
tag = cismwrap_2_1_95
tag = cismwrap_2_1_96
externals = Externals_CISM.cfg
required = True

Expand Down Expand Up @@ -44,26 +44,26 @@ required = True
local_path = cime
protocol = git
repo_url = https://github.com/ESMCI/cime
tag = cime6.0.125
tag = cime6.0.175
required = True

[cmeps]
tag = cmeps0.14.21
tag = cmeps0.14.43
protocol = git
repo_url = https://github.com/ESCOMP/CMEPS.git
local_path = components/cmeps
required = True

[cdeps]
tag = cdeps1.0.13
tag = cdeps1.0.24
protocol = git
repo_url = https://github.com/ESCOMP/CDEPS.git
local_path = components/cdeps
externals = Externals_CDEPS.cfg
required = True

[cpl7]
tag = cpl77.0.5
tag = cpl77.0.7
protocol = git
repo_url = https://github.com/ESCOMP/CESM_CPL7andDataComps
local_path = components/cpl7
Expand All @@ -84,7 +84,7 @@ local_path = libraries/mct
required = True

[parallelio]
tag = pio2_5_10
tag = pio2_6_2
protocol = git
repo_url = https://github.com/NCAR/ParallelIO
local_path = libraries/parallelio
Expand Down
2 changes: 1 addition & 1 deletion Externals_CLM.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
local_path = src/fates
protocol = git
repo_url = https://github.com/NGEET/fates
tag = sci.1.68.2_api.30.0.0
tag = sci.1.68.2_api.31.0.0
required = True

[externals_description]
Expand Down
71 changes: 54 additions & 17 deletions bld/CLMBuildNamelist.pm
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ sub process_namelist_user_input {
process_namelist_commandline_infile($opts, $definition, $nl, $envxml_ref);

# Apply the commandline options and make sure the user didn't change it above
process_namelist_commandline_options($opts, $nl_flags, $definition, $defaults, $nl, $physv);
process_namelist_commandline_options($opts, $nl_flags, $definition, $defaults, $nl, $envxml_ref, $physv);

# The last two process command line arguments for usr_name and use_case
# They require that process_namelist_commandline_options was called before this
Expand All @@ -634,10 +634,10 @@ sub process_namelist_commandline_options {
# Obtain default values for the following build-namelist input arguments
# : res, mask, ssp_rcp, sim_year, sim_year_range, and clm_accelerated_spinup.

my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_;
my ($opts, $nl_flags, $definition, $defaults, $nl, $envxml_ref, $physv) = @_;

setup_cmdl_chk_res($opts, $defaults);
setup_cmdl_resolution($opts, $nl_flags, $definition, $defaults);
setup_cmdl_resolution($opts, $nl_flags, $definition, $defaults, $envxml_ref);
setup_cmdl_mask($opts, $nl_flags, $definition, $defaults, $nl);
setup_cmdl_configuration_and_structure($opts, $nl_flags, $definition, $defaults, $nl);
setup_cmdl_bgc($opts, $nl_flags, $definition, $defaults, $nl);
Expand Down Expand Up @@ -668,7 +668,7 @@ sub setup_cmdl_chk_res {
}

sub setup_cmdl_resolution {
my ($opts, $nl_flags, $definition, $defaults) = @_;
my ($opts, $nl_flags, $definition, $defaults, $envxml_ref) = @_;

my $var = "res";
my $val;
Expand All @@ -686,16 +686,30 @@ sub setup_cmdl_resolution {
$val = &quote_string( $nl_flags->{'res'} );
if ( ! $definition->is_valid_value( $var, $val ) ) {
my @valid_values = $definition->get_valid_values( $var );
if ( ! defined($opts->{'clm_usr_name'}) || $nl_flags->{'res'} ne $opts->{'clm_usr_name'} ) {
if ( $nl_flags->{'res'} ne "CLM_USRDAT" ) {
$log->fatal_error("$var has a value ($val) that is NOT valid. Valid values are: @valid_values");
}
}
}
if ( $nl_flags->{'res'} eq "CLM_USRDAT" ) {
if ( ! defined($opts->{'clm_usr_name'}) ) {
$log->fatal_error("Resolution is CLM_USRDAT, but --clm_usr_name option is NOT set, and it is required for CLM_USRDAT resolutions");
}
}
#
# For NEON sites
if ($nl_flags->{'res'} =~ /NEON/) {
$nl_flags->{'neon'} = ".true."
} else {
$nl_flags->{'neon'} = ".false."
#
$nl_flags->{'neon'} = ".false.";
$nl_flags->{'neonsite'} = "";
if ( $nl_flags->{'res'} eq "CLM_USRDAT" ) {
if ( $opts->{'clm_usr_name'} eq "NEON" ) {
$nl_flags->{'neon'} = ".true.";
$nl_flags->{'neonsite'} = $envxml_ref->{'NEONSITE'};
$log->verbose_message( "This is a NEON site with NEONSITE = " . $nl_flags->{'neonsite'} );
}
}
if ( ! &value_is_true( $nl_flags->{'neon'} ) ) {
$log->verbose_message( "This is NOT a NEON site" );
}

}
Expand Down Expand Up @@ -1572,7 +1586,7 @@ sub process_namelist_inline_logic {
setup_logic_grainproduct($opts, $nl_flags, $definition, $defaults, $nl, $physv);
setup_logic_soilstate($opts, $nl_flags, $definition, $defaults, $nl);
setup_logic_demand($opts, $nl_flags, $definition, $defaults, $nl);
setup_logic_surface_dataset($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);
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 @@ -2031,6 +2045,13 @@ sub setup_logic_snicar_methods {
sub setup_logic_snow {
my ($opts, $nl_flags, $definition, $defaults, $nl) = @_;

add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'snow_thermal_cond_method' );

my $var = $nl->get_value('snow_thermal_cond_method');
if ( $var ne "'Jordan1991'" && $var ne "'Sturm1997'" ) {
$log->fatal_error("$var is incorrect entry for the namelist variable snow_thermal_cond_method; expected Jordan1991 or Sturm1997");
}

my $numrad_snw = $nl->get_value('snicar_numrad_snw');
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'fsnowoptics',
'snicar_numrad_snw' => $numrad_snw);
Expand Down Expand Up @@ -2290,6 +2311,7 @@ sub setup_logic_demand {
$settings{'use_lch4'} = $nl_flags->{'use_lch4'};
$settings{'use_nitrif_denitrif'} = $nl_flags->{'use_nitrif_denitrif'};
$settings{'use_crop'} = $nl_flags->{'use_crop'};
$settings{'neon'} = $nl_flags->{'neon'};

my $demand = $nl->get_value('clm_demand');
if (defined($demand)) {
Expand Down Expand Up @@ -2342,7 +2364,7 @@ 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) = @_;
my ($opts, $nl_flags, $definition, $defaults, $nl, $xmlvar_ref) = @_;

$nl_flags->{'flanduse_timeseries'} = "null";
my $flanduse_timeseries = $nl->get_value('flanduse_timeseries');
Expand All @@ -2367,26 +2389,42 @@ sub setup_logic_surface_dataset {
if ( ! &value_is_true($nl_flags->{'use_fates'}) ) {
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var,
'hgrid'=>$nl_flags->{'res'}, 'ssp_rcp'=>$nl_flags->{'ssp_rcp'},
'neon'=>$nl_flags->{'neon'}, 'neonsite'=>$nl_flags->{'neonsite'},
'sim_year'=>$nl_flags->{'sim_year'}, 'irrigate'=>".true.", 'use_vichydro'=>$nl_flags->{'use_vichydro'},
'use_crop'=>".true.", 'glc_nec'=>$nl_flags->{'glc_nec'}, 'nofail'=>1);
'use_crop'=>".true.", 'glc_nec'=>$nl_flags->{'glc_nec'}, 'use_fates'=>$nl_flags->{'use_fates'}, 'nofail'=>1);
}
# If didn't find the crop version check for the exact match
if ( ! defined($nl->get_value($var) ) ) {
my $fsurdat = $nl->get_value($var);
if ( ! defined($fsurdat) ) {
if ( ! &value_is_true($nl_flags->{'use_fates'}) ) {
$log->verbose_message( "Crop version of $var NOT found, searching for an exact match" );
}
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var,
'hgrid'=>$nl_flags->{'res'}, 'ssp_rcp'=>$nl_flags->{'ssp_rcp'}, 'use_vichydro'=>$nl_flags->{'use_vichydro'},
'sim_year'=>$nl_flags->{'sim_year'}, 'irrigate'=>$nl_flags->{'irrigate'},
'sim_year'=>$nl_flags->{'sim_year'}, 'irrigate'=>$nl_flags->{'irrigate'}, 'use_fates'=>$nl_flags->{'use_fates'},
'neon'=>$nl_flags->{'neon'}, 'neonsite'=>$nl_flags->{'neonsite'},
'use_crop'=>$nl_flags->{'use_crop'}, 'glc_nec'=>$nl_flags->{'glc_nec'}, 'nofail'=>1 );
if ( ! defined($nl->get_value($var) ) ) {
if ( ! defined($fsurdat) ) {
$log->verbose_message( "Exact match of $var NOT found, searching for version with irrigate true" );
}
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var,
'hgrid'=>$nl_flags->{'res'}, 'ssp_rcp'=>$nl_flags->{'ssp_rcp'}, 'use_vichydro'=>$nl_flags->{'use_vichydro'},
'sim_year'=>$nl_flags->{'sim_year'}, 'irrigate'=>".true.",
'sim_year'=>$nl_flags->{'sim_year'}, 'irrigate'=>".true.", 'use_fates'=>$nl_flags->{'use_fates'},
'neon'=>$nl_flags->{'neon'}, 'neonsite'=>$nl_flags->{'neonsite'},
'use_crop'=>$nl_flags->{'use_crop'}, 'glc_nec'=>$nl_flags->{'glc_nec'} );
}
#
# Expand the XML variables for NEON cases so that NEONSITE will be used
#
if ( &value_is_true($nl_flags->{'neon'}) ) {
my $fsurdat = $nl->get_value($var);
my $newval = SetupTools::expand_xml_var( $fsurdat, $xmlvar_ref );
if ( $newval ne $fsurdat ) {
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" );
}
}
}

#-------------------------------------------------------------------------------
Expand Down Expand Up @@ -4174,7 +4212,6 @@ sub setup_logic_snowpack {
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'snow_overburden_compaction_method');
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'lotmp_snowdensity_method');
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'upplim_destruct_metamorph');
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'fresh_snw_rds_max');
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'reset_snow');
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'reset_snow_glc');
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'reset_snow_glc_ela');
Expand Down
1 change: 1 addition & 0 deletions bld/env_run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ Sample env_run.xml file that allows build-namelist to be run for testing in this
-->
<entry id="DIN_LOC_ROOT" value="MYDINLOCROOT" />
<entry id="GLC_TWO_WAY_COUPLING" value="FALSE" />
<entry id="NEONSITE" value="" />

</config_definition>
2 changes: 1 addition & 1 deletion bld/namelist_files/createMapEntry.pl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
my $scriptName;
($scriptName = $0) =~ s!(.*)/!!; # get name of script
my $cwd = getcwd();
my $CSMDATA = "/glade/p/cesm/cseg/inputdata";
my $CSMDATA = "/glade/campaign/cesm/cesmdata/cseg/inputdata";

if ($#ARGV != 0 ) {
usage();
Expand Down
Loading

0 comments on commit 5667aad

Please sign in to comment.