Skip to content

Commit

Permalink
Merge tag 'ctsm5.1.dev048' into neon_modify_dev
Browse files Browse the repository at this point in the history
 I used existing infrastructure to add descriptive strings to certain history
 fields that I had labeled by number in ESCOMP#1340. While doing this, I applied the
 change to a bunch of other history fields that needed it.

 Some variable names for pools was also changed to use terms consistent with the new
 names as well.
  • Loading branch information
ekluzek committed Jul 23, 2021
2 parents e503179 + 05c1eae commit 81288cc
Show file tree
Hide file tree
Showing 256 changed files with 10,115 additions and 8,095 deletions.
9 changes: 5 additions & 4 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 = cism2_1_78
tag = cismwrap_2_1_83
externals = Externals_CISM.cfg
required = True

Expand Down Expand Up @@ -37,21 +37,22 @@ required = True
local_path = cime
protocol = git
repo_url = https://github.com/ESMCI/cime
tag = branch_tags/cime5.8.42_a01
tag = branch_tags/cime5.8.47_a01
required = True

[cmeps]
local_path = cime/src/drivers/nuopc/
protocol = git
repo_url = https://github.com/ESCOMP/CMEPS.git
tag = v0.9.0
tag = cmeps0.13.2
required = True

[cdeps]
local_path = components/cdeps
protocol = git
repo_url = https://github.com/ESCOMP/CDEPS.git
tag = v0.6.0
tag = cdeps0.12.11
externals = Externals_CDEPS.cfg
required = True

[doc-builder]
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.45.0_api.15.0.0
tag = sci.1.46.2_api.16.1.0
required = True

[PTCLM]
Expand Down
114 changes: 71 additions & 43 deletions bld/CLMBuildNamelist.pm
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ REQUIRED OPTIONS
(default 2000)
-structure "structure" The overall structure being used [ standard | fast ]
OPTIONS
-driver "value" mct or nuopc
-bgc "value" Build CLM with BGC package [ sp | cn | bgc | fates ]
(default is sp).
CLM Biogeochemistry mode
Expand Down Expand Up @@ -242,7 +243,7 @@ sub process_commandline {
# Save the command line arguments to the script. NOTE: this must be
# before GetOptions() is called because items are removed from from
# the array!
$nl_flags->{'cmdline'} = "@ARGV";
$nl_flags->{'cmdline'} = "@ARGV\n";

my %opts = ( cimeroot => undef,
config => "config_cache.xml",
Expand All @@ -252,6 +253,7 @@ sub process_commandline {
co2_type => undef,
co2_ppmv => undef,
clm_demand => "null",
driver => "mct",
help => 0,
glc_nec => "default",
glc_use_antarctica => 0,
Expand Down Expand Up @@ -284,6 +286,7 @@ sub process_commandline {

GetOptions(
"cimeroot=s" => \$opts{'cimeroot'},
"driver=s" => \$opts{'driver'},
"clm_demand=s" => \$opts{'clm_demand'},
"co2_ppmv=f" => \$opts{'co2_ppmv'},
"co2_type=s" => \$opts{'co2_type'},
Expand Down Expand Up @@ -1645,11 +1648,6 @@ sub process_namelist_inline_logic {
#############################################
setup_logic_friction_vel($opts, $nl_flags, $definition, $defaults, $nl);

################################################
# namelist group: century_soilbgcdecompcascade #
################################################
setup_logic_century_soilbgcdecompcascade($opts, $nl_flags, $definition, $defaults, $nl);

#############################
# namelist group: cngeneral #
#############################
Expand Down Expand Up @@ -2925,15 +2923,13 @@ sub setup_logic_methane {
if ( &value_is_true($nl_flags->{'use_lch4'}) ) {
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'finundation_method',
'use_cn'=>$nl_flags->{'use_cn'}, 'use_fates'=>$nl_flags->{'use_fates'} );
#
# Get resolution to read streams file for
#
my $finundation_method = remove_leading_and_trailing_quotes($nl->get_value('finundation_method' ));
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'finundation_res',
'finundation_method'=>$finundation_method );
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldfilename_ch4finundated',
'finundation_method'=>$finundation_method,
'finundation_res'=>$nl->get_value('finundation_res') );
'finundation_method'=>$finundation_method);
if ($opts->{'driver'} eq "nuopc" ) {
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_meshfile_ch4finundated',
'finundation_method'=>$finundation_method);
}
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_aereoxid_prog',
'use_cn'=>$nl_flags->{'use_cn'}, 'use_fates'=>$nl_flags->{'use_fates'} );
#
Expand Down Expand Up @@ -3216,7 +3212,6 @@ sub setup_logic_nitrogen_deposition {
#
# Nitrogen deposition for bgc=CN
#

if ( $nl_flags->{'bgc_mode'} =~/cn|bgc/ ) {
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'ndepmapalgo', 'phys'=>$nl_flags->{'phys'},
'use_cn'=>$nl_flags->{'use_cn'}, 'hgrid'=>$nl_flags->{'res'},
Expand All @@ -3242,17 +3237,32 @@ sub setup_logic_nitrogen_deposition {
'use_cn'=>$nl_flags->{'use_cn'}, 'lnd_tuning_mode'=>$nl_flags->{'lnd_tuning_mode'},
'hgrid'=>"0.9x1.25", 'ssp_rcp'=>$nl_flags->{'ssp_rcp'}, 'nofail'=>1 );
if ( ! defined($nl->get_value('stream_fldfilename_ndep') ) ) {
# Also check at f19 resolution
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldfilename_ndep', 'phys'=>$nl_flags->{'phys'},
'use_cn'=>$nl_flags->{'use_cn'}, 'lnd_tuning_mode'=>$nl_flags->{'lnd_tuning_mode'},
'hgrid'=>"1.9x2.5", 'ssp_rcp'=>$nl_flags->{'ssp_rcp'}, 'nofail'=>1 );
# If not found report an error
if ( ! defined($nl->get_value('stream_fldfilename_ndep') ) ) {
$log->warning("Did NOT find the Nitrogen-deposition forcing file (stream_fldfilename_ndep) for this ssp_rcp\n" .
"One way to get around this is to point to a file for another existing ssp_rcp in your user_nl_clm file.\n" .
"If you are running with CAM and WACCM chemistry Nitrogen deposition will come through the coupler.\n" .
"This file won't be used, so it doesn't matter what it points to -- but it's required to point to something.\n" )
}
# Also check at f19 resolution
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldfilename_ndep', 'phys'=>$nl_flags->{'phys'},
'use_cn'=>$nl_flags->{'use_cn'}, 'lnd_tuning_mode'=>$nl_flags->{'lnd_tuning_mode'},
'hgrid'=>"1.9x2.5", 'ssp_rcp'=>$nl_flags->{'ssp_rcp'}, 'nofail'=>1 );
# If not found report an error
if ( ! defined($nl->get_value('stream_fldfilename_ndep') ) ) {
$log->warning("Did NOT find the Nitrogen-deposition forcing file (stream_fldfilename_ndep) for this ssp_rcp\n" .
"One way to get around this is to point to a file for another existing ssp_rcp in your user_nl_clm file.\n" .
"If you are running with CAM and WACCM chemistry Nitrogen deposition will come through the coupler.\n" .
"This file won't be used, so it doesn't matter what it points to -- but it's required to point to something.\n" )
}
}
if ($opts->{'driver'} eq "nuopc" ) {
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_meshfile_ndep', 'phys'=>$nl_flags->{'phys'},
'use_cn'=>$nl_flags->{'use_cn'}, 'lnd_tuning_mode'=>$nl_flags->{'lnd_tuning_mode'},
'hgrid'=>"0.9x1.25", 'ssp_rcp'=>$nl_flags->{'ssp_rcp'}, 'nofail'=>1 );
if ( ! defined($nl->get_value('stream_fldfilename_ndep') ) ) {
# Also check at f19 resolution
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_meshfile_ndep', 'phys'=>$nl_flags->{'phys'},
'use_cn'=>$nl_flags->{'use_cn'}, 'lnd_tuning_mode'=>$nl_flags->{'lnd_tuning_mode'},
'hgrid'=>"1.9x2.5", 'ssp_rcp'=>$nl_flags->{'ssp_rcp'}, 'nofail'=>1 );
# If not found report an error
if ( ! defined($nl->get_value('stream_meshfile_ndep') ) ) {
$log->warning("Did NOT find the Nitrogen-deposition meshfile file (stream_meshfilee_ndep) for this ssp_rcp. \n")
}
}
}
} else {
# If bgc is NOT CN/CNDV then make sure none of the ndep settings are set!
Expand Down Expand Up @@ -3363,6 +3373,29 @@ sub setup_logic_popd_streams {
}
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldfilename_popdens', 'phys'=>$nl_flags->{'phys'},
'cnfireson'=>$nl_flags->{'cnfireson'}, 'hgrid'=>"0.5x0.5", 'ssp_rcp'=>$nl_flags->{'ssp_rcp'} );
#
# TODO (mvertens, 2021-06-22) the following is needed for MCT since a use case enforces this - so for now stream_meshfile_popdens will be added to the mct
# stream namelist but simply not used
if ($opts->{'driver'} eq "nuopc" ) {
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_meshfile_popdens', 'hgrid'=>"0.5x0.5");
my $inputdata_rootdir = $nl_flags->{'inputdata_rootdir'};
my $default_value = $nl->get_value('stream_meshfile_popdens');
my $none_filename = $inputdata_rootdir . '/none';
my $none_filename = &quote_string($none_filename);
if ($default_value eq $none_filename) {
my $var = 'stream_meshfile_popdens';
my $group = $definition->get_group_name($var);
my $val = "none";
$val = &quote_string( $val );
$nl->set_variable_value($group, $var, $val);
}
} else {
my $var = 'stream_meshfile_popdens';
my $group = $definition->get_group_name($var);
my $val = "none";
$val = &quote_string( $val );
$nl->set_variable_value($group, $var, $val);
}
} else {
# If bgc is NOT CN/CNDV or fire_method==nofire then make sure none of the popdens settings are set
if ( defined($nl->get_value('stream_year_first_popdens')) ||
Expand Down Expand Up @@ -3399,6 +3432,10 @@ sub setup_logic_urbantv_streams {
}
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldfilename_urbantv', 'phys'=>$nl_flags->{'phys'},
'hgrid'=>"0.9x1.25" );
if ($opts->{'driver'} eq "nuopc" ) {
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_meshfile_urbantv', 'phys'=>$nl_flags->{'phys'},
'hgrid'=>"0.9x1.25" );
}
}

#-------------------------------------------------------------------------------
Expand All @@ -3425,6 +3462,10 @@ sub setup_logic_lightning_streams {
}
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldfilename_lightng',
'hgrid'=>$nl_flags->{'light_res'} );
if ($opts->{'driver'} eq "nuopc" ) {
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_meshfile_lightng',
'hgrid'=>$nl_flags->{'light_res'} );
}
} else {
# If bgc is NOT CN/CNDV then make sure none of the Lightng settings are set
if ( defined($nl->get_value('stream_year_first_lightng')) ||
Expand Down Expand Up @@ -3582,6 +3623,10 @@ sub setup_logic_lai_streams {
}
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldfilename_lai',
'hgrid'=>"360x720cru" );
if ($opts->{'driver'} eq "nuopc" ) {
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_meshfile_lai',
'hgrid'=>"360x720cru" );
}
}
} else {
# If bgc is CN/CNDV then make sure none of the LAI settings are set
Expand Down Expand Up @@ -3621,23 +3666,6 @@ sub setup_logic_soilwater_movement {
}
#-------------------------------------------------------------------------------

sub setup_logic_century_soilbgcdecompcascade {
#
my ($opts, $nl_flags, $definition, $defaults, $nl) = @_;

if ( (&value_is_true($nl->get_value('use_cn')) || &value_is_true($nl->get_value('use_fates'))) &&
&value_is_true($nl->get_value('use_century_decomp')) ) {
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'initial_Cstocks',
'use_cn' => $nl->get_value('use_cn'), 'use_fates' => $nl->get_value('use_fates'),
'use_century_decomp' => $nl->get_value('use_century_decomp') );
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'initial_Cstocks_depth',
'use_cn' => $nl->get_value('use_cn'), 'use_fates' => $nl->get_value('use_fates'),
'use_century_decomp' => $nl->get_value('use_century_decomp') );
}
}

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

sub setup_logic_cnvegcarbonstate {
# MUST be AFTER: setup_logic_dynamic_plant_nitrogen_alloc as depends on mm_nuptake_opt which is set there
my ($opts, $nl_flags, $definition, $defaults, $nl) = @_;
Expand Down Expand Up @@ -4131,7 +4159,7 @@ sub add_default {
} else {
if ($is_input_pathname eq 'abs') {
$val = set_abs_filepath($val, $inputdata_rootdir);
if ( $test_files and ($val !~ /null/) and (! -f "$val") ) {
if ( $test_files and ($val !~ /null|none/) and (! -f "$val") ) {
$log->fatal_error("file not found: $var = $val");
}
}
Expand Down
4 changes: 2 additions & 2 deletions bld/namelist_files/checkmapfiles.ncl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
;

print( "Check that datm mapping files are consistent" );
resolutions = (/ "128x256", "64x128", "48x96", "32x64", "8x16", "94x192", "0.23x0.31", "0.47x0.63", "0.9x1.25", "1.9x2.5", "2.5x3.33", "4x5", "10x15", "0.125nldas2", "5x5_amazon", "1x1_camdenNJ", "1x1_vancouverCAN", "1x1_mexicocityMEX", "1x1_asphaltjungleNJ", "1x1_brazil", "1x1_urbanc_alpha", "1x1_numaIA", "1x1_smallvilleIA", "ne4np4", "ne16np4", "ne30np4", "ne60np4", "ne120np4", "ne240np4" /);
resolutions = (/ "128x256", "64x128", "48x96", "94x192", "0.23x0.31", "0.47x0.63", "0.9x1.25", "1.9x2.5", "2.5x3.33", "4x5", "10x15", "0.125nldas2", "5x5_amazon", "1x1_camdenNJ", "1x1_vancouverCAN", "1x1_mexicocityMEX", "1x1_asphaltjungleNJ", "1x1_brazil", "1x1_urbanc_alpha", "1x1_numaIA", "1x1_smallvilleIA", "ne4np4", "ne16np4", "ne30np4", "ne60np4", "ne120np4", "ne240np4" /);

space = " ";
badres = 0
Expand Down Expand Up @@ -82,7 +82,7 @@ begin
print( "query string="+querynml )


mapgrids = (/"0.5x0.5_MODIS", "0.5x0.5_AVHRR", "0.5x0.5_MODIS", "5x5min_nomask", "5x5min_IGBP-GSDP", "5x5min_ISRIC-WISE", "10x10min_nomask", "3x3min_MODIS", "3x3min_LandScan2004", "3x3min_GLOBE-Gardner", "3x3min_GLOBE-Gardner-mergeGIS", "0.9x1.25_GRDC", "360x720cru_cruncep", "1km-merge-10min_HYDRO1K-merge-nomask"/);
mapgrids = (/"0.5x0.5_nomask", "0.25x0.25_nomask", "0.125x0.125_nomask", "3x3min_nomask", "5x5min_nomask", "10x10min_nomask", "0.9x1.25_nomask", "1km-merge-10min_HYDRO1K-merge-nomask"/);
do i = 0, dimsizes(resolutions)-1
res = resolutions(i);
print( "Go through maps for Resolution: "+res );
Expand Down
8 changes: 4 additions & 4 deletions bld/namelist_files/createMkSrfEntry.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import os, sys

Expand Down Expand Up @@ -41,9 +41,9 @@ def parse_cmdline_args( self ):

def printentry( self, year ):
"Print a single entry"
print '<mksrf_fvegtyp hgrid="0.25x0.25" ssp_rcp="%s" sim_year="%d" crop="on"' % (self.ssp_rcp, year)
print '>lnd/clm2/rawdata/%s/mksrf_landuse_%s_%s.c%s.nc' % (self.subdir, self.desc, year, self.cdate)
print '</mksrf_fvegtyp>\n'
print( '<mksrf_fvegtyp hgrid="0.25x0.25" ssp_rcp="%s" sim_year="%d" crop="on"' % (self.ssp_rcp, year) )
print( '>lnd/clm2/rawdata/%s/mksrf_landuse_%s_%s.c%s.nc' % (self.subdir, self.desc, year, self.cdate) )
print( '</mksrf_fvegtyp>\n' )

entry = mksrfDataEntry_prog()
entry.parse_cmdline_args()
Expand Down
Loading

0 comments on commit 81288cc

Please sign in to comment.