Skip to content

Commit

Permalink
Merge tag 'ctsm5.1.dev048' into vert_res_in_mimics
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 were also changed to use terms consistent with
 the new names as well.
  • Loading branch information
slevis-lmwg committed Jul 11, 2021
2 parents e962b0e + 05c1eae commit cda5d14
Show file tree
Hide file tree
Showing 66 changed files with 5,204 additions and 3,669 deletions.
4 changes: 2 additions & 2 deletions Externals.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ required = True
local_path = cime
protocol = git
repo_url = https://github.com/ESMCI/cime
tag = cime5.8.47
tag = branch_tags/cime5.8.47_a01
required = True

[cmeps]
Expand All @@ -51,7 +51,7 @@ required = True
local_path = components/cdeps
protocol = git
repo_url = https://github.com/ESCOMP/CDEPS.git
tag = cdeps0.12.4
tag = cdeps0.12.11
externals = Externals_CDEPS.cfg
required = True

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.46.0_api.16.0.0
tag = sci.1.46.2_api.16.1.0
required = True

[PTCLM]
Expand Down
92 changes: 71 additions & 21 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 @@ -2920,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 @@ -3211,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 @@ -3237,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 @@ -3358,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 @@ -3394,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 @@ -3420,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 @@ -3577,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 @@ -4109,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
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
28 changes: 22 additions & 6 deletions bld/namelist_files/namelist_defaults_ctsm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case).
<!-- FATES default parameter file -->
<!-- ================================================================== -->

<fates_paramfile>lnd/clm2/paramdata/fates_params_api.15.1.0_12pft_c210505.nc </fates_paramfile>
<fates_paramfile>lnd/clm2/paramdata/fates_params_api.16.1.0_12pft_c210630.nc </fates_paramfile>

<!-- ======================================================================================== -->
<!-- clm 5.0 BGC nitrogen model -->
Expand Down Expand Up @@ -1470,6 +1470,9 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts
<stream_fldfilename_ndep phys="clm5_0" hgrid="0.9x1.25" use_cn=".true." ssp_rcp="hist" >lnd/clm2/ndepdata/fndep_clm_hist_b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.ensmean_1849-2015_monthly_0.9x1.25_c180926.nc</stream_fldfilename_ndep>
<stream_fldfilename_ndep phys="clm4_5" hgrid="0.9x1.25" use_cn=".true." ssp_rcp="hist" >lnd/clm2/ndepdata/fndep_clm_hist_b.e21.BWHIST.f09_g17.CMIP6-historical-WACCM.ensmean_1849-2015_monthly_0.9x1.25_c180926.nc</stream_fldfilename_ndep>

<stream_meshfile_ndep hgrid="1.9x2.5">share/meshes/fv1.9x2.5_141008_ESMFmesh_c20191001.nc</stream_meshfile_ndep>
<stream_meshfile_ndep hgrid="0.9x1.25">share/meshes/fv0.9x1.25_141008_polemod_ESMFmesh.nc</stream_meshfile_ndep>

<!-- Only the CMIP6 Tier I Nitogen deposition files are available -->
<stream_fldfilename_ndep phys="clm5_1" hgrid="0.9x1.25" use_cn=".true." ssp_rcp="SSP5-8.5"
>lnd/clm2/ndepdata/fndep_clm_f09_g17.CMIP6-SSP5-8.5-WACCM_1849-2101_monthly_c191007.nc</stream_fldfilename_ndep>
Expand Down Expand Up @@ -1539,6 +1542,7 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts
<model_year_align_lai >2001</model_year_align_lai>

<stream_fldfilename_lai hgrid="360x720cru" >lnd/clm2/lai_streams/MODISPFTLAI_0.5x0.5_c140711.nc</stream_fldfilename_lai>
<stream_meshfile_lai hgrid="360x720cru" >lnd/clm2/lai_streams/MODISPFTLAI_0.5x0_ESMFmesh_cdf5_090621.nc</stream_meshfile_lai>

<lai_mapalgo>bilinear</lai_mapalgo>

Expand Down Expand Up @@ -1575,7 +1579,9 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts
<stream_year_last_lightng >0001</stream_year_last_lightng>

<stream_fldfilename_lightng hgrid="94x192" >atm/datm7/NASA_LIS/clmforc.Li_2012_climo1995-2011.T62.lnfm_Total_c140423.nc</stream_fldfilename_lightng>
<stream_meshfile_lightng hgrid="94x192" >atm/datm7/NASA_LIS/clmforc.Li_2012_climo1995-2011.T62_ESMFmesh_cdf5_110621.nc</stream_meshfile_lightng>
<stream_fldfilename_lightng hgrid="360x720" >atm/datm7/NASA_LIS/clmforc.Li_2016_climo1995-2013.360x720.lnfm_Total_c160825.nc</stream_fldfilename_lightng>
<stream_meshfile_lightng hgrid="360x720" >atm/datm7/NASA_LIS/clmforc.Li_2016_climo1995-2013.360x720_ESMFmesh_cdf5_150621.nc</stream_meshfile_lightng>

<lightngmapalgo >bilinear</lightngmapalgo>

Expand Down Expand Up @@ -1672,6 +1678,8 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts
<stream_fldfilename_popdens hgrid="0.5x0.5" use_fates=".true." ssp_rcp="SSP5-3.4" >lnd/clm2/firedata/clmforc.Li_2018_SSP5_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc
</stream_fldfilename_popdens>

<stream_meshfile_popdens hgrid="0.5x0.5">lnd/clm2/firedata/clmforc.Li_2017_HYDEv3.2_CMIP6_hdm_0.5x0_ESMFmesh_cdf5_100621.nc</stream_meshfile_popdens>

<popdensmapalgo use_cn=".true." >bilinear</popdensmapalgo>

<popdensmapalgo use_cn=".true." hgrid="1x1_brazil" >nn</popdensmapalgo>
Expand Down Expand Up @@ -1725,12 +1733,18 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts

<stream_fldfilename_urbantv phys="clm5_1" hgrid="0.9x1.25"
>lnd/clm2/urbandata/CLM50_tbuildmax_Oleson_2016_0.9x1.25_simyr1849-2106_c160923.nc</stream_fldfilename_urbantv>
<stream_meshfile_urbantv phys="clm5_1" hgrid="0.9x1.25"
>lnd/clm2/urbandata/CLM50_tbuildmax_Oleson_2016_0.9x1_ESMFmesh_cdf5_100621.nc</stream_meshfile_urbantv>

<stream_fldfilename_urbantv phys="clm5_0" hgrid="0.9x1.25"
>lnd/clm2/urbandata/CLM50_tbuildmax_Oleson_2016_0.9x1.25_simyr1849-2106_c160923.nc</stream_fldfilename_urbantv>
<stream_meshfile_urbantv phys="clm5_0" hgrid="0.9x1.25"
>lnd/clm2/urbandata/CLM50_tbuildmax_Oleson_2016_0.9x1_ESMFmesh_cdf5_100621.nc</stream_meshfile_urbantv>

<stream_fldfilename_urbantv phys="clm4_5" hgrid="0.9x1.25"
>lnd/clm2/urbandata/CLM45_tbuildmax_Oleson_2016_0.9x1.25_simyr1849-2106_c160923.nc</stream_fldfilename_urbantv>
<stream_meshfile_urbantv phys="clm4_5" hgrid="0.9x1.25"
>lnd/clm2/urbandata/CLM50_tbuildmax_Oleson_2016_0.9x1_ESMFmesh_cdf5_100621.nc</stream_meshfile_urbantv>

<urbantvmapalgo >nn</urbantvmapalgo>

Expand Down Expand Up @@ -2541,14 +2555,16 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts
<use_aereoxid_prog use_cn=".true." >.true.</use_aereoxid_prog>
<use_aereoxid_prog use_fates=".true.">.true.</use_aereoxid_prog>

<finundation_res finundation_method="TWS_inversion">1.9x2.5</finundation_res>
<finundation_res finundation_method="ZWT_inversion">1.9x2.5</finundation_res>

<stream_fldfilename_ch4finundated finundation_method="TWS_inversion" hgrid="1.9x2.5"
<stream_fldfilename_ch4finundated finundation_method="TWS_inversion"
>lnd/clm2/paramdata/finundated_inversiondata_0.9x1.25_c170706.nc</stream_fldfilename_ch4finundated>
<stream_fldfilename_ch4finundated finundation_method="ZWT_inversion" hgrid="1.9x2.5"
<stream_fldfilename_ch4finundated finundation_method="ZWT_inversion"
>lnd/clm2/paramdata/finundated_inversiondata_0.9x1.25_c170706.nc</stream_fldfilename_ch4finundated>

<stream_meshfile_ch4finundated finundation_method="TWS_inversion"
>lnd/clm2/paramdata/finundated_inversiondata_0.9x1_ESMFmesh_cdf5_130621.nc</stream_meshfile_ch4finundated>
<stream_meshfile_ch4finundated finundation_method="ZWT_inversion"
>lnd/clm2/paramdata/finundated_inversiondata_0.9x1_ESMFmesh_cdf5_130621.nc</stream_meshfile_ch4finundated>

<!-- ========================================= -->
<!-- Defaults for different BGC modes -->
<!-- ========================================= -->
Expand Down
Loading

0 comments on commit cda5d14

Please sign in to comment.