Skip to content

Commit

Permalink
Merge pull request #1502 from ekluzek/nuopc_default
Browse files Browse the repository at this point in the history
Make the NUOPC driver the default
  • Loading branch information
ekluzek authored Nov 19, 2021
2 parents 7a85024 + 5debfe0 commit c4c387b
Show file tree
Hide file tree
Showing 44 changed files with 604 additions and 562 deletions.
16 changes: 8 additions & 8 deletions Externals.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@ required = True
local_path = components/cism
protocol = git
repo_url = https://github.com/ESCOMP/CISM-wrapper
tag = cismwrap_2_1_87
tag = cismwrap_2_1_93
externals = Externals_CISM.cfg
required = True

[rtm]
local_path = components/rtm
protocol = git
repo_url = https://github.com/ESCOMP/RTM
tag = rtm1_0_77
tag = rtm1_0_78
required = True

[mosart]
local_path = components/mosart
protocol = git
repo_url = https://github.com/ESCOMP/MOSART
tag = mosart1_0_43
tag = mosart1_0_45
required = True

[mizuRoute]
Expand All @@ -37,33 +37,33 @@ required = True
local_path = cime
protocol = git
repo_url = https://github.com/ESMCI/cime
tag = cime6.0.4
tag = cime6.0.11
required = True

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

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

[cpl7]
tag = cpl7.0.3
tag = cpl7.0.5
protocol = git
repo_url = https://github.com/ESCOMP/CESM_CPL7andDataComps
local_path = components/cpl7
required = True

[share]
tag = share1.0.2
tag = share1.0.8
protocol = git
repo_url = https://github.com/ESCOMP/CESM_share
local_path = share
Expand Down
9 changes: 1 addition & 8 deletions Externals_CLM.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,7 @@
local_path = src/fates
protocol = git
repo_url = https://github.com/NGEET/fates
tag = sci.1.48.0_api.17.0.0
required = True

[PTCLM]
local_path = tools/site_and_regional/PTCLM
protocol = git
repo_url = https://github.com/ESCOMP/PTCLM
tag = PTCLM2_20210810
tag = sci.1.49.1_api.17.0.0
required = True

[externals_description]
Expand Down
42 changes: 25 additions & 17 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,24 @@ $CTSMROOT/README 06/08/2018

Community Terrestrial Systems Model (CTSM) science version 5.1 series -- source code, tools,
offline-build and test scripts. This gives you everything you need
to run CTSM with CESM with datm8 to provide CRU NCEP or GSWP3 forcing data in
to run CTSM with CESM with the CMEPS driver and CDEPS data models to provide CRU NCEP or GSWP3 forcing data in
place of a modeled atmosphere.

CMEPS is the Community Mediator for Earth Prediction Systems. And CDEPS is the
Community Data Models for Earth Prediction System. They are both NUOPC based models
used to drive the CESM (Community Earth System Model) of which CTSM is a component of.
NUOPC is the National Unified Operational Prediction Capability a standard way of building
coupled model systems. The NUOPC layer is based on the Earth System Modeling Framework (ESMF).

For lists of current bugs (issues) and current development see the CTSM GitHub page:

https://github.com/ESCOMP/ctsm
https://github.com/ESCOMP/CTSM

INFORMATION ON THE CMEPS DRIVER:

https://escomp.github.io/CMEPS

https://earthsystemmodeling.org/nuopc/

IMPORTANT NOTE ON CESM CHECKOUT VERSUS A CTSM CHECKOUT:

Expand All @@ -28,32 +40,28 @@ General directory structure ($CTSMROOT):
doc --------------- Documentation of CTSM.
bld --------------- Template, configure and build-namelist scripts for clm.
src --------------- CTSM Source code.
lilac ------------- Lightweight Infrastructure for Land-Atmosphere Coupling (for coupling to a host atmosphere model)
test -------------- CTSM Testing scripts for CTSM offline tools.
tools ------------- CTSM Offline tools to prepare input datasets and process output.
cime_config ------- Configuration files of cime for compsets and CTSM 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)
python ------------ Some python modules mostly for use by run_sys_tests (but could be used elsewhere l

Directory structure only for a CTSM checkout:

components -------- Other active sub-components needed for CTSM to run (river routing and land-ice models)
libraries --------- CESM libraries: MCT (Model Coupling Toolkit) and PIO
share ------------- CESM shared code

cime/scripts --------------- cesm/cime driver scripts

cime/src/drivers/mct/main ----------- CESM top level driver source code.
cime/src/drivers/mct/shr ------------ CESM top level driver shared code.
cime/src/components/data_comps/datm - CESM Data model version 8 source code.
cime/src/components/stub_comps/sice - CESM stub sea-ice model source code.
cime/src/components/stub_comps/socn - CESM stub ocean model source code.
cime/src/components/stub_comps/sglc - CESM stub glacier model source code.
cime/src/externals ------------------ CESM external utility codes
(Model Coupling Toolkit (MCT)
(Earth System Model Framework)
(timing -- code timing utility)
(pio -- Parallel Input/Output)
components/cmeps -------------------- CESM top level driver (for NUOPC driver [which is the default]) source code.
components/cdeps -------------------- CESM top level data model shared code (for NUOPC driver).
cime/src/externals ------------------ CESM external utility codes (genf90)
components/cism --------------------- CESM Community land Ice Sheet Model.
components/mosart ------------------- Model for Scale Adaptive River Transport
components/rtm ---------------------- CESM River Transport Model.
components/cpl7 --------------------- CESM top level driver for MCT driver (being deprecated)

Top level documentation ($CTSMROOT):

Expand Down Expand Up @@ -92,7 +100,7 @@ run_sys_tests --------------- Python script to send the standard CTSM testing of

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/Quickstart.GUIDE -------- Quick guide to using NUOPC scripts.
doc/IMPORTANT_NOTES --------- Some important notes about this version of
clm, configuration modes and namelist items
that are not validated or functional.
Expand Down Expand Up @@ -149,7 +157,7 @@ Source code directory structure:

src/biogeochem ---- Biogeochemisty
src/main ---------- Main control and high level code
src/cpl ----------- Land model high level MCT and ESMF drivers
src/cpl ----------- Land model high level caps for NUOPC driver (and MCT and LILAC)
src/biogeophys ---- Biogeophysics (Hydrology)
src/dyn_subgrid --- Dynamic land unit change
src/init_interp --- Online interpolation
Expand All @@ -161,7 +169,7 @@ src/unit_test_shr - Unit test shared modules for unit testing
src/unit_test_stubs Unit test stubs that replicate CTSM code simpler

=============================================================================================
QUICKSTART: using the CPL7 scripts
QUICKSTART: using the NUOPC driver scripts
=============================================================================================

cd $CIMEROOT/scripts
Expand Down
2 changes: 1 addition & 1 deletion README.CHECKLIST.new_case
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ General Checklist to always do:
- Make sure the LND_TUNING_MODE is correct
(./xmlquery LND_TUNING_MODE)
- For an "I compset" make sure you are running over the right forcing years
(usually ./xmlquery -p DATM_CLMNCEP_YR)
(usually ./xmlquery -p DATM_YR)
- First and align year for streams should be the start year of a historical simulation
(./xmlquery RUN_STARTDATE)
(grep stream_year_first CaseDocs/lnd_in; grep model_year_align CaseDocs/lnd_in)
Expand Down
56 changes: 56 additions & 0 deletions README.NUOPC_driver.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# $CTSMROOT/README.NUOPC_driver

CTSM now by default uses the NUOPC based CMEPS driver!


## What's new?

MESH Files:
Mesh files to describe grids are new in both the driver namelist and for example in any
streams files.
Full ESMF Library is used:
The full ESMF Library is used and required to be built in order to run the model.
Single Point cases:
Single point cases can now set their location using PTS_LAT and PTS_LON.

## What's removed?

Domain files are no longer used. And mapping for regriding is created on the fly
rather than using fixed mapping files in almost all cases. Runoff mapping files
still need to be generated offline.

## What files change?

rpointer.drv becomes rpointer.cpl
cpl.log.* files get's split into med.log.* and drv.log.*
user_datm.streams.txt.* file changes goes into the user_nl_datm_streams files
datm.streams.txt.* files are all in one file called datm.streams.xml

## What XML variables change in your case?

DATM_CLMNCEP_YR_* variables change to DATM_YR_*

## New obscure options:

ESMF_AWARE_THREADING --- ESMF is aware of threading (can have differing number of threads in components)
CREATE_ESMF_PET_FILES -- Create output log files from ESMF for each Processor (PET)
ESMF_VERBOSITY_LEVEL --- Verbosity level for ESMF logging
ESMF_PROFILING_LEVEL --- Verbosity level for ESMF profiling

nuopc.runseq is a text file that determines how the driver operates. You can change the operation
by having an updated copy in your case directory.


## What if I want to use the previous MCT driver?

The MCT driver will be available for sometime going forward, but
new development won't go into it, and it will eventually be removed.
But, if you have to...
Use the "--driver mct" command line option to create_newcase
You can set COMP_INTERFACE in a case as well, but it won't create it with everything needed
so we recommend setting up a case from scratch.


For more notes see:

https://docs.google.com/presentation/d/1yjiKSEV53JDAJbYxhpY2T9GTxlWFzQAn
24 changes: 19 additions & 5 deletions bld/CLMBuildNamelist.pm
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ sub process_commandline {
co2_type => undef,
co2_ppmv => undef,
clm_demand => "null",
driver => "mct",
driver => "nuopc",
help => 0,
glc_nec => "default",
glc_use_antarctica => 0,
Expand Down Expand Up @@ -1528,10 +1528,10 @@ sub process_namelist_inline_logic {
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_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);
}
setup_logic_dynamic_subgrid($opts, $nl_flags, $definition, $defaults, $nl);
setup_logic_spinup($opts, $nl_flags, $definition, $defaults, $nl);
setup_logic_supplemental_nitrogen($opts, $nl_flags, $definition, $defaults, $nl);
setup_logic_snowpack($opts, $nl_flags, $definition, $defaults, $nl);
Expand Down Expand Up @@ -2319,6 +2319,7 @@ sub setup_logic_initial_conditions {
my $fsurdat = $nl->get_value('fsurdat');
$fsurdat =~ s!(.*)/!!;
$settings{'fsurdat'} = $fsurdat;
$settings{'do_transient_pfts'} = $nl->get_value('do_transient_pfts');
#
# If not transient use sim_year, otherwise use date
#
Expand Down Expand Up @@ -4080,6 +4081,13 @@ sub setup_logic_misc {
#
my ($opts, $nl_flags, $definition, $defaults, $nl) = @_;

if ( $opts->{'driver'} ne "nuopc" ) {
my $var = "force_send_to_atm";
my $val = $nl->get_value($var);
if ( defined($val) ) {
$log->fatal_error( "$var can only be set for the nuopc driver" );
}
}
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'for_testing_run_ncdiopio_tests');
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'hist_master_list_file');
}
Expand Down Expand Up @@ -4121,6 +4129,9 @@ sub write_output_files {
if ( &value_is_true($nl_flags->{'use_lch4'}) ) {
push @groups, "ch4par_in";
}
if ( $opts->{'driver'} eq "nuopc" ) {
push @groups, "ctsm_nuopc_cap";
}
push @groups, "clm_humanindex_inparm";
push @groups, "cnmresp_inparm";
push @groups, "photosyns_inparm";
Expand Down Expand Up @@ -4355,8 +4366,9 @@ sub check_input_files {

if ($input_pathname_type eq 'abs') {
if ($inputdata_rootdir) {
#MV $pathname =~ s:$inputdata_rootdir::;
print OUTFILE "$var = $pathname\n";
if ( $pathname !~ /^\s*$/ ) { # If pathname isn't blank or null
print OUTFILE "$var = $pathname\n";
}
}
else {
if (-e $pathname) { # use -e rather than -f since the absolute pathname
Expand All @@ -4377,7 +4389,9 @@ sub check_input_files {
if ($inputdata_rootdir) {
$pathname = "$rootdir/$pathname";
#MV $pathname =~ s:$inputdata_rootdir::;
print OUTFILE "$var = $pathname\n";
if ( $pathname !~ /^\s*$/ ) { # If pathname isn't blank or null
print OUTFILE "$var = $pathname\n";
}
}
else {
if (-f "$rootdir/$pathname") {
Expand Down
5 changes: 3 additions & 2 deletions bld/namelist_files/createMapEntry.pl
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,13 @@

foreach my $foo ( @list ) {
next if ($foo =~ m/^\./); #~# skip anything in the directory with a leading or stand alone 'dot'
$foo =~ s/$grid/RES/; # Replace grid trying to match with RES (so underscores in the grid name don't mess up the matching)
my @tokens = split(/_/, $foo); #~# split foo name by the underscore
#~# write out lines for namelist_defaults_ctsm.xml nomask" files
my $from_mask = $tokens[2];
if ( $from_mask =~ /nomask/ ) {
if ( $tokens[5] eq "nomask" && $tokens[4] eq $grid ) {
print "<map frm_hgrid=\"$tokens[1]\" frm_lmask=\"$from_mask\" to_hgrid=\"$tokens[4]\" to_lmask=\"$tokens[5]\" \n";
if ( $tokens[5] eq "nomask" && $tokens[4] eq "RES" ) {
print "<map frm_hgrid=\"$tokens[1]\" frm_lmask=\"$from_mask\" to_hgrid=\"$grid\" to_lmask=\"$tokens[5]\" \n";
print ">$partialPath/$foo</map>\n";
}
}
Expand Down
Loading

0 comments on commit c4c387b

Please sign in to comment.