Skip to content

Commit

Permalink
Merge tag 'ctsm1.0.dev038' into nlevurbgrnd
Browse files Browse the repository at this point in the history
My branch is based on ctsm1.0.dev035 and NWP support started with ctsm1.0.dev038

Support for NWP configuration, NLDAS grid and NLDAS datm forcing

This tag includes a set of changes that, together, provide support for
running an initial Numerical Weather Prediction version of CTSM over the
Continental U.S.

(1) NWP configuration: The changes in this configuration relative to the
    climate (CLM5) configuration mainly target decreasing runtime by
    removing features that are expensive and not as important for NWP
    time scales (days to months rather than many years) and space scales
    (high resolution):

    - Single dominant landunit; if vegetated, single dominant PFT

    - Only 5 soil layers, down to 3 m

    - Only 5 snow layers

    - Plant hydraulic stress off

    - Ball-Berry rather than Medlyn stomatal conductance method (this is
      a side-effect of turning plant hydraulic stress off, and is not
      itself a critical aspect of the NWP configuration)

    - Maximum of 3 iterations to compute canopy fluxes

    - MEGAN is off

    Note that the NWP compset triggers changes in two new xml variables:
    CLM_CONFIGURATION ('clm' vs. 'nwp'; this controls things of a more
    scientific nature, like whether plant hydraulic stress is on or
    off), and CLM_STRUCTURE ('standard' vs. 'fast'; this controls
    structural things like the maximum number of landunits per grid cell
    and the soil layer structure). Thus, you can create a case that is a
    hybrid between the CLM and NWP configurations by changing these two
    xml variables independently.

(2) NLDAS2 regional grid: 0.125 deg grid over the Continental U.S.

(3) Updated version of MOSART with support for the same NLDAS2 regional
    grid

(4) NLDAS2 data atmosphere forcing: over the same regional grid; forcing
    data are available from 1980 - 2018. (We have excluded 1979 because
    a small amount of data were missing for that year, and we didn't
    have a good way to handle those missing data.)

These changes can be used independently or all together. However, note
that you will get garbage if you try to use the new NLDAS2 datm forcing
for a run that extends beyond the boundaries of the NLDAS2 domain.

There are three new NWP compsets:
- I2000Ctsm50NwpSpGswpGs: GSWP3 datm forcing; meant for global runs or
  regional runs outside the NLDAS domain
- I2000Ctsm50NwpSpNldasGs: NLDAS2 datm forcing; meant for regional runs
  over the NLDAS domain or some portion of it
- I2000Ctsm50NwpSpNldasRsGs: Same as above, but with a stub runoff model
  in place of MOSART, for runs that aren't interested in having a runoff
  model and for which you want improved throughput

The alias for the new grid is: nldas2_rnldas2_mnldas2 (indicating that
we're using the nldas2 grid for land/atmosphere, runoff ('r') and the
ocean mask ('m').

- Resolves ESCOMP#451 (Add NWP physics option)
- Resolves ESCOMP#452 (Add an NWP compset)
  • Loading branch information
olyson committed Sep 18, 2019
2 parents 72cb106 + b1418ae commit 7965ce0
Show file tree
Hide file tree
Showing 30 changed files with 873 additions and 65 deletions.
4 changes: 2 additions & 2 deletions Externals.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ required = True
local_path = components/mosart
protocol = git
repo_url = https://github.com/ESCOMP/mosart
tag = release-cesm2.0.00
tag = nldas-grid.n01_mosart1_0_31
required = True

[cime]
local_path = cime
protocol = git
repo_url = https://github.com/ESMCI/cime
tag = ctsm/ctsm1.0/cime5.7.9/n01
tag = ctsm/ctsm1.0/cime5.7.9/n05
required = True

[externals_description]
Expand Down
22 changes: 18 additions & 4 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ test -------------- CLM Testing scripts for CLM offline tools.
tools ------------- CLM Offline tools to prepare input datasets and process output.
cime_config ------- Configuration files of cime for compsets and CLM settings
manage_externals -- Script to manage the external source directories
python ------------ Some python modules mostly for use by run_sys_tests (but could be used elsewhere)

Directory structure only for a CTSM checkout:

Expand Down Expand Up @@ -61,10 +62,17 @@ README.rst --------------- File that displays under the project in github
README_EXTERNALS.rst ----- Information on how to work with subversion externals for clm
CODE_OF_CONDUCT.md ------- Code of Conduct for how to work with each other on the CTSM project
Copyright ---------------- CESM Copyright file
doc/UpdateChangeLog.pl ------- Script to add documentation on a tag to the
doc/UpdateChangeLog.pl --- Script to add documentation on a tag to the
ChangeLog/ChangeSum files
doc/ChangeLog ---------------- Documents different CLM versions
doc/ChangeSum ---------------- Summary documentation of different CLM versions
doc/ChangeLog ------------ Documents different CLM versions
doc/ChangeSum ------------ Summary documentation of different CLM versions

doc/design --------------- Software Engineering and code design document files

Checklists for standard Software Engineering tasks

./doc/README.CHECKLIST.master_tags
./bld/namelist_files/README.CHECKLIST.interpolating_initial_conditions.md

Documentation of Namelist Items: (view the following in a web browser)

Expand All @@ -77,7 +85,13 @@ Important files in main directories (under $CTSMROOT):

Externals.cfg --------------- File for management of the main high level externals
Externals_CLM.cfg ----------- File for management of the CLM specific externals (i.e. FATES)

run_sys_tests --------------- Python script to send the standard CTSM testing off (submits
the create_test test suite for several different compilers on the
machines we do standard CTSM testing on).

parse_cime.cs.status -------- Script to parse test status files cs.status.* created by create_test
(can be used along with run_sys_tests)
doc/Quickstart.GUIDE -------- Quick guide to using cpl7 scripts.
doc/IMPORTANT_NOTES --------- Some important notes about this version of
clm, configuration modes and namelist items
Expand All @@ -87,7 +101,7 @@ doc/ChangeSum --------------- Summary one-line list of changes for each
model version.
doc/README ------------------ Documentation similar to this file
doc/UsersGuide -------------- CLM Users Guide
doc/CodeReference ----------- CLM Code Reference Guide
doc/IMPORTANT_NOTES --------- Some important notes on caveats for some configurations/namelist items

bld/README ------------------ Description of how to use the configure and
build-namelist scripts.
Expand Down
61 changes: 52 additions & 9 deletions bld/CLMBuildNamelist.pm
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ REQUIRED OPTIONS
-cimeroot "directory" Path to cime directory
-config "filepath" Read the given CLM configuration cache file.
Default: "config_cache.xml".
-configuration "cfg" The overall configuration being used [ clm | nwp ]
clm = Climate configuration
nwp = Numerical Weather Prediction configuration
-d "directory" Directory where output namelist file will be written
Default: current working directory.
-envxml_dir "directory" Directory name of env_*.xml case files to read in.
Expand All @@ -78,6 +81,7 @@ REQUIRED OPTIONS
(i.e. 1850, 2000, 1850-2000, 1850-2100)
"-sim_year list" to list valid simulation years
(default 2000)
-structure "structure" The overall structure being used [ standard | fast ]
OPTIONS
-bgc "value" Build CLM with BGC package [ sp | cn | bgc | fates ]
(default is sp).
Expand Down Expand Up @@ -240,6 +244,7 @@ sub process_commandline {

my %opts = ( cimeroot => undef,
config => "config_cache.xml",
configuration => undef,
csmdata => undef,
clm_usr_name => undef,
co2_type => undef,
Expand All @@ -254,6 +259,7 @@ sub process_commandline {
dir => "$cwd",
rcp => "default",
sim_year => "default",
structure => undef,
clm_accelerated_spinup=> "default",
chk_res => undef,
note => undef,
Expand All @@ -280,6 +286,7 @@ sub process_commandline {
"co2_ppmv=f" => \$opts{'co2_ppmv'},
"co2_type=s" => \$opts{'co2_type'},
"config=s" => \$opts{'config'},
"configuration=s" => \$opts{'configuration'},
"csmdata=s" => \$opts{'csmdata'},
"clm_usr_name=s" => \$opts{'clm_usr_name'},
"envxml_dir=s" => \$opts{'envxml_dir'},
Expand All @@ -306,6 +313,7 @@ sub process_commandline {
"rcp=s" => \$opts{'rcp'},
"s|silent" => \$opts{'silent'},
"sim_year=s" => \$opts{'sim_year'},
"structure=s" => \$opts{'structure'},
"output_reals=s" => \$opts{'output_reals_filename'},
"clm_accelerated_spinup=s" => \$opts{'clm_accelerated_spinup'},
"clm_start_type=s" => \$opts{'clm_start_type'},
Expand Down Expand Up @@ -621,6 +629,7 @@ sub process_namelist_commandline_options {
setup_cmdl_chk_res($opts, $defaults);
setup_cmdl_resolution($opts, $nl_flags, $definition, $defaults);
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);
setup_cmdl_fire_light_res($opts, $nl_flags, $definition, $defaults, $nl);
setup_cmdl_spinup($opts, $nl_flags, $definition, $defaults, $nl);
Expand Down Expand Up @@ -768,6 +777,31 @@ sub setup_cmdl_fates_mode {
}
}

#-------------------------------------------------------------------------------
sub setup_cmdl_configuration_and_structure {
# Error-check and set the 'configuration' and 'structure' namelist flags

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

my $val;

my $var = "configuration";
$val = $opts->{$var};
if (defined($val) && ($val eq "clm" || $val eq "nwp")) {
$nl_flags->{$var} = $val;
} else {
$log->fatal_error("$var has a value (".$val.") that is NOT valid. Valid values are: clm, nwp.");
}

$var = "structure";
$val = $opts->{$var};
if (defined($val) && ($val eq "standard" || $val eq "fast")) {
$nl_flags->{$var} = $val;
} else {
$log->fatal_error("$var has a value (".$val.") that is NOT valid. Valid values are: standard, fast.");
}
}

#-------------------------------------------------------------------------------
sub setup_cmdl_bgc {
# BGC - alias for group of biogeochemistry related use_XXX namelists
Expand Down Expand Up @@ -1936,9 +1970,12 @@ sub setup_logic_subgrid {

my $var = 'run_zero_weight_urban';
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var);
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'collapse_urban');
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'n_dom_landunits');
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'n_dom_pfts');
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'collapse_urban',
'structure'=>$nl_flags->{'structure'});
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'n_dom_landunits',
'structure'=>$nl_flags->{'structure'});
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'n_dom_pfts',
'structure'=>$nl_flags->{'structure'});
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'toosmall_soil');
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'toosmall_crop');
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'toosmall_glacier');
Expand Down Expand Up @@ -2052,7 +2089,8 @@ sub setup_logic_soilstate {
my ($opts, $nl_flags, $definition, $defaults, $nl) = @_;

add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'organic_frac_squared' );
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'soil_layerstruct' );
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'soil_layerstruct',
'structure'=>$nl_flags->{'structure'});
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_bedrock',
'use_fates'=>$nl_flags->{'use_fates'}, 'vichydro'=>$nl_flags->{'vichydro'} );
}
Expand Down Expand Up @@ -2893,7 +2931,7 @@ sub setup_logic_hydrstress {
my ($opts, $nl_flags, $definition, $defaults, $nl) = @_;

add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_hydrstress',
'use_fates'=>$nl_flags->{'use_fates'} );
'configuration'=>$nl_flags->{'configuration'}, 'use_fates'=>$nl_flags->{'use_fates'} );
$nl_flags->{'use_hydrstress'} = $nl->get_value('use_hydrstress');
if ( &value_is_true( $nl_flags->{'use_fates'} ) && &value_is_true( $nl_flags->{'use_hydrstress'} ) ) {
$log->fatal_error("Cannot turn use_hydrstress on when use_fates is on" );
Expand Down Expand Up @@ -3281,8 +3319,9 @@ sub setup_logic_megan {
my $var = "megan";

if ( $opts->{$var} eq "default" ) {
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl,
'megan', clm_accelerated_spinup=>$nl_flags->{'clm_accelerated_spinup'} );
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'megan',
'clm_accelerated_spinup'=>$nl_flags->{'clm_accelerated_spinup'},
'configuration'=>$nl_flags->{'configuration'} );
$nl_flags->{$var} = $nl->get_value($var);
} else {
$nl_flags->{$var} = $opts->{$var};
Expand Down Expand Up @@ -3432,6 +3471,8 @@ sub setup_logic_canopyfluxes {
my ($opts, $nl_flags, $definition, $defaults, $nl) = @_;

add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_undercanopy_stability' );
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'itmax_canopy_fluxes',
'structure'=>$nl_flags->{'structure'});
}

#-------------------------------------------------------------------------------
Expand All @@ -3453,8 +3494,10 @@ sub setup_logic_snowpack {
#
my ($opts, $nl_flags, $definition, $defaults, $nl) = @_;

add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'nlevsno');
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'h2osno_max');
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'nlevsno',
'structure'=>$nl_flags->{'structure'});
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'h2osno_max',
'structure'=>$nl_flags->{'structure'});
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'int_snow_max');
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'n_melt_glcmec');
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'wind_dependent_snow_density');
Expand Down
2 changes: 1 addition & 1 deletion 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", "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", "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" /);

space = " ";
badres = 0
Expand Down
Loading

0 comments on commit 7965ce0

Please sign in to comment.