Skip to content

Commit

Permalink
Merge pull request #883 from ekluzek/rel2master
Browse files Browse the repository at this point in the history
Bring changes on release-clm5.0 branch to master
  • Loading branch information
ekluzek committed May 2, 2020
2 parents 92057e3 + 48ec25c commit 8265b77
Show file tree
Hide file tree
Showing 125 changed files with 14,119 additions and 2,407 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ clm.input_data_list
clm.input_data_list.previous
*.stdout.txt.o*

# mksurfdata unit tests
unit_test_build

# Tools executables
/tools/mksurfdata_map/mksurfdata_map
/tools/mkprocdata_map/mkprocdata_map
Expand Down
8 changes: 4 additions & 4 deletions Externals_CLM.cfg
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[fates]
local_path = src/fates
protocol = git
repo_url = https://github.com/NCAR/fates-release
tag = fates_s1.8.1_a3.0.0_rev2
repo_url = https://github.com/NGEET/fates
tag = sci.1.30.0_api.8.0.0
required = True

[PTCLM]
local_path = tools/PTCLM
protocol = git
repo_url = https://github.com/ESCOMP/ptclm
tag = PTCLM2_180611
repo_url = https://github.com/ESCOMP/PTCLM
tag = PTCLM2_20200121
required = True

[externals_description]
Expand Down
4 changes: 4 additions & 0 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ tools/ncl_scripts ------------ Directory of NCL and perl scripts to do various
tasks. Most notably to plot perturbation error growth
testing and to extract regional information from
global datasets for single-point/regional simulations.
tools/contrib ----------------- Miscellansous useful scripts for pre and post processing
as well as case management of CTSM. These scripts are
contributed by users and may not be as well tested or
supported as other tools.


=============================================================================================
Expand Down
355 changes: 228 additions & 127 deletions bld/CLMBuildNamelist.pm

Large diffs are not rendered by default.

41 changes: 27 additions & 14 deletions bld/listDefaultNamelist.pl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#
# To then get the files from the CESM SVN repository:
#
# ../../cime/scripts/Tools/check_input_data -datalistdir . -export
# ../cime/scripts/Tools/check_input_data --data-list-dir . --download
#
#=======================================================================

Expand All @@ -44,13 +44,13 @@
#-----------------------------------------------------------------------------------------------
# Add $cfgdir to the list of paths that Perl searches for modules

my @dirs = ( "$cfgdir", "../../../cime/utils/perl5lib" );
my @dirs = ( "$cfgdir", "../cime/utils/perl5lib" );
unshift @INC, @dirs;

require queryDefaultXML;

# Defaults
my $cesmroot = abs_path( "$cfgdir/../../../");
my $cesmroot = abs_path( "$cfgdir/../");

# The namelist defaults file contains default values for all required namelist variables.
my @nl_defaults_files = ( "$cfgdir/namelist_files/namelist_defaults_overall.xml",
Expand Down Expand Up @@ -84,11 +84,25 @@ sub usage {
to then read the resulting clm.input_data_list file and retreive the files
../../cime/scripts/Tools/check_input_data -datalistdir . -export
../cime/scripts/Tools/check_input_data --data-list-dir . --download
EOF
}

sub make_config_cache {
# Write a config_cache.xml file to read in
my ($phys, $config_cachefile) = @_;
my $fh = IO::File->new($config_cachefile, '>') or die "can't open file: $config_cachefile";
print $fh <<EOF;
<?xml version="1.0"?>
<config_definition>
<commandline></commandline>
<entry id="phys" value="$phys" list="" valid_values="clm4_5,clm5_0">Specifies clm physics</entry>
</config_definition>
EOF
$fh->close();
}

#-----------------------------------------------------------------------------------------------

sub GetListofNeededFiles {
Expand Down Expand Up @@ -191,14 +205,12 @@ sub GetListofNeededFiles {
"$cfgdir/namelist_files/namelist_definition_ctsm.xml"
);
$inputopts{'nldef_files'} = \@nl_definition_files;
$inputopts{'empty_cfg_file'} = "$cfgdir/config_files/config_definition_ctsm.xml";
$inputopts{'empty_cfg_file'} = "config_cache.xml";

my $definition = Build::NamelistDefinition->new( $nl_definition_files[0] );
foreach my $nl_defin_file ( @nl_definition_files ) {
$definition->add( "$nl_defin_file" );
}
my $cfg = Build::Config->new( $inputopts{'empty_cfg_file'} );

# Resolutions...
my @resolutions;
if ( $opts{'res'} eq "all" ) {
Expand All @@ -208,6 +220,7 @@ sub GetListofNeededFiles {
}

# Input options
&make_config_cache( "clm5_0", $inputopts{'empty_cfg_file'} );
push @nl_defaults_files, "$cfgdir/namelist_files/namelist_defaults_ctsm.xml";
if ( defined($opts{'usrdat'}) ) {
push @nl_defaults_files, "$cfgdir/namelist_files/namelist_defaults_usr_files.xml";
Expand Down Expand Up @@ -248,14 +261,14 @@ sub GetListofNeededFiles {
# Loop over all possible simulation year: 1890, 2000, 2100 etc.
#
$settings{'sim_year_range'} = "constant";
my @rcps = $definition->get_valid_values( "rcp", 'noquotes'=>1 );
$settings{'rcp'} = $rcps[0];
my @ssp_rcps = $definition->get_valid_values( "ssp_rcp", 'noquotes'=>1 );
$settings{'ssp_rcp'} = $ssp_rcps[0];
YEAR: foreach my $sim_year ( $definition->get_valid_values( "sim_year", 'noquotes'=>1 ) ) {
print "sim_year = $sim_year\n" if $printing;
$settings{'sim_year'} = $sim_year;
if ( $sim_year ne 1850 && $sim_year ne 2000 && $sim_year > 1800 ) { next YEAR; }

my @bgcsettings = $cfg->get_valid_values( "bgc" );
my @bgcsettings = $definition->get_valid_values( "bgc_mode", 'noquotes'=>1 );
print "bgc=@bgcsettings\n" if $printing;
#
# Loop over all possible BGC settings
Expand Down Expand Up @@ -298,11 +311,11 @@ sub GetListofNeededFiles {
$settings{'sim_year'} = $1;
}
#
# Loop over all possible rcp's
# Loop over all possible ssp_rcp's
#
print "sim_year_range=$sim_year_range rcp=@rcps\n" if $printing;
foreach my $rcp ( @rcps ) {
$settings{'rcp'} = $rcp;
print "sim_year_range=$sim_year_range ssp_rcp=@ssp_rcps\n" if $printing;
foreach my $ssp_rcp ( @ssp_rcps ) {
$settings{'ssp_rcp'} = $ssp_rcp;
&GetListofNeededFiles( \%inputopts, \%settings, \%files );
if ( $printTimes >= 1 ) {
$inputopts{'printing'} = 0;
Expand Down
12 changes: 6 additions & 6 deletions bld/namelist_files/createMkSrfEntry.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
class mksrfDataEntry_prog:

# Class data
year_start = 2016
year_end = 2100
ssp_rcp = "SSP5-8.5"
subdir = "pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2016-2100.c171005"
cdate = 171005
desc = "SSP5RCP85_clm5"
year_start = 850
year_end = 1849
ssp_rcp = "hist"
subdir = "pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1849.c171012"
cdate = 171012
desc = "histclm50_LUH2"

def parse_cmdline_args( self ):
"Parse the command line arguments for create data entry list"
Expand Down
2 changes: 1 addition & 1 deletion bld/namelist_files/namelist_defaults.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<li>Site specific point name (sitespf_pt)</li>
<li>Crop model (crop)</li>
<li>Data model forcing source (forcing)</li>
<li>Representative concentration pathway for future scenarios (rcp)</li>
<li>Representative concentration pathway for future scenarios (SSP-rcp)</li>
<li>New good wood harvest (newwoodharv)</li>
<li>CN Spin-up mode (spinup)</li>
<li>Type of file (type)</li>
Expand Down
Loading

0 comments on commit 8265b77

Please sign in to comment.