Skip to content

Commit

Permalink
Merge pull request ESCOMP#2852 from slevis-lmwg/rm_refs_to_datm_vars
Browse files Browse the repository at this point in the history
Remove/replace refs to DATM_C*_YR_* variables
  • Loading branch information
slevis-lmwg authored Nov 6, 2024
2 parents f0566a6 + 16d83c1 commit 33607a0
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 55 deletions.
12 changes: 2 additions & 10 deletions cime_config/buildnml
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,8 @@ def buildnml(case, caseroot, compname):
clm_accelerated_spinup = case.get_value("CLM_ACCELERATED_SPINUP")
comp_interface = case.get_value("COMP_INTERFACE")
lilac_mode = case.get_value("LILAC_MODE")
if comp_interface == "nuopc":
yr_start = case.get_value("DATM_YR_START")
yr_end = case.get_value("DATM_YR_END")
else:
yr_start = case.get_value("DATM_CLMNCEP_YR_START")
yr_end = case.get_value("DATM_CLMNCEP_YR_END")

if yr_start != None and yr_start < 0:
yr_start = case.get_value("DATM_CPLHIST_YR_START")
yr_end = case.get_value("DATM_CPLHIST_YR_END")
yr_start = case.get_value("DATM_YR_START")
yr_end = case.get_value("DATM_YR_END")

# For LILAC
if yr_start == None or lilac_mode == "on":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,25 @@
Running with MOAR data
========================

.. warning::
These instructions are outdated and will not work. This page will be either updated or removed as part of the CTSM6/CLM3 release.

Because it takes so long to spinup the CN model (as we just saw previously), if you are doing fully coupled simulations with active atmosphere and ocean, you will want to do the spinup portion of this "offline". So instead of doing expensive fully coupled simulations for the spinup duration, you run CLM in a very cheap "I" compset using atmospheric forcing from a shorter fully coupled simulation (or a simulation run previously by someone else).

In this example we will use the ``I1850Clm50BgcSpinup compset`` to setup CLM to run with atmospheric forcing from a previous fully coupled simulation with data that is already stored on disk on Cheyenne. There are several simulations that have high frequency data for which we can do this. You can also do this on a machine other than Cheyenne, but would need to download the data from the Earth System Grid and change the datapath similar to Example :numref:`eg-sim-data-from-prev-sim`.

Example: Simulation with MOAR Data on cheyenne
Example: Simulation with MOAR Data on derecho
-------------------------------------------------------------
::

> cd cime/scripts
> ./create_newcase -case MOARforce1850 -res f19_g17_gl4 -compset I1850Clm50BgcSpinup
> cd MOARforce1850
# The following sets the casename to point to for atm forcing (you could also use an editor)
> ./xmlchange DATM_CPL_CASE=b40.1850.track1.1deg.006a
> ./xmlchange DATM_CPLHIST_CASE=b40.1850.track1.1deg.006a
# The following sets the align year and years to run over for atm forcing
# (you could also use an editor)
> ./xmlchange DATM_CPL_YR_ALIGN=1,DATM_CPL_YR_START=960,DATM_CPL_YR_END=1030
> ./xmlchange DATM_YR_ALIGN=1,DATM_YR_START=960,DATM_YR_END=1030
> ./case.setup
# Now build and run as normal
> ./case.build
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ For single point simulations, the global anomaly forcing files can be used, but

mapalgo = 'nn','nn','nn','nn','nn','nn','nn','nn','nn','nn','nn','nn','nn' (the number of 'nn' values will depend on the number of original streams plus the number of anomaly forcing streams)

The cycling of the present-day (base) climate is controlled through the DATM\_CLMNCEP\_YR\_START and DATM_CLMNCEP\_YR\_END variables in env\_run.xml.
The cycling of the present-day (base) climate is controlled through the DATM\_YR\_START and DATM\_YR\_END variables in env\_run.xml.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Example: Simulation Forced with Data from the Previous Simulation
> ./xmlchange DATM_CPLHIST_CASE="myB1850"
# The following sets the align year and years to run over for atm forcing
# (you could also use an editor)
> ./xmlchange DATM_CPLHIST_YR_ALIGN="1",DATM_CPLHIST_YR_START=1,DATM_CPLHIST_YR_END=20
> ./xmlchange DATM_YR_ALIGN="1",DATM_YR_START=1,DATM_YR_END=20
# Set the strm_datdir in the namelist_defaults_datm.xml
# file to the archival path of the case above in the form of: /glade/home/achive/$USER/$DATM_CPLHIST_CASE/cpl/hist
# NOTE: THIS WILL CHANGE THE PATH FOR ALL I1850Clm50BgcSpinup COMPSET CASES MADE AFTER THIS!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -510,13 +510,10 @@ For running "I" cases there are several other noteworthy configuration items tha
CCSM_BGC
DATM_MODE
DATM_PRESAERO
DATM_CLMNCEP_YR_ALIGN
DATM_CLMNCEP_YR_START
DATM_CLMNCEP_YR_END
DATM_CPL_CASE
DATM_CPL_YR_ALIGN
DATM_CPL_YR_START
DATM_CPL_YR_END
DATM_YR_ALIGN
DATM_YR_START
DATM_YR_END
DATM_CPLHIST_CASE

``CCSM_CO2_PPMV``
Sets the mixing ratio of CO2 in parts per million by volume for ALL CESM components to use. Note that most compsets already set this value to something reasonable. Also note that some compsets may tell the atmosphere model to override this value with either historic or ramped values. If the ``CCSM_BGC`` variable is set to something other than "none" the atmosphere model will determine CO2, and CLM will listen and use what the atmosphere sends it. On the CLM side the namelist item ``co2_type`` tells CLM to use the value sent from the atmosphere rather than a value set on it's own namelist.
Expand Down Expand Up @@ -569,36 +566,27 @@ For running "I" cases there are several other noteworthy configuration items tha

``pt1_pt1`` = read in single-point or regional datasets

DATM_CLMNCEP_YR_START
``DATM_CLMNCEP_YR_START`` sets the beginning year to cycle the atmospheric data over for ``CLM_QIAN`` or ``CLMCRUNCEP`` modes.
DATM_YR_START
``DATM_YR_START`` sets the beginning year to cycle the atmospheric data over for ``CLM_QIAN`` or ``CLMCRUNCEP`` or ``CPLHISTForcing`` modes.

DATM_CLMNCEP_YR_END
``DATM_CLMNCEP_YR_END`` sets the ending year to cycle the atmospheric data over for ``CLM_QIAN`` or ``CLMCRUNCEP`` modes.
DATM_YR_END
``DATM_YR_END`` sets the ending year to cycle the atmospheric data over for ``CLM_QIAN`` or ``CLMCRUNCEP`` or ``CPLHISTForcing`` modes.

DATM_CLMNCEP_YR_ALIGN
``DATM_CLMNCEP_YR_START`` and ``DATM_CLMNCEP_YR_END`` determine the range of years to cycle the atmospheric data over, and ``DATM_CLMNCEP_YR_ALIGN`` determines which year in that range of years the simulation will start with.
DATM_YR_ALIGN
``DATM_YR_START`` and ``DATM_YR_END`` determine the range of years to cycle the atmospheric data over, and ``DATM_YR_ALIGN`` determines which year in that range of years the simulation will start with.

DATM_CPL_CASE
``DATM_CPL_CASE`` sets the casename to use for the ``CPLHISTForcing`` mode.

DATM_CPL_YR_START
``DATM_CPL_YR_START`` sets the beginning year to cycle the atmospheric data over for the ``CPLHISTForcing`` mode.

DATM_CPL_YR_END
``DATM_CPL_YR_END`` sets the ending year to cycle the atmospheric data over for the ``CPLHISTForcing`` mode.

DATM_CPL_YR_ALIGN
``DATM_CPL_YR_START`` and ``DATM_CPL_YR_END`` determine the range of years to cycle the atmospheric data over, and ``DATM_CPL_YR_ALIGN`` determines which year in that range of years the simulation will start with.
DATM_CPLHIST_CASE
``DATM_CPLHIST_CASE`` sets the casename to use for the ``CPLHISTForcing`` mode.

-----------------------------
Downloading DATM Forcing Data
-----------------------------

In Chapter One of the `CESM User's Guide <link-to-CESM-UG>`_ there is a section on "Downloading input data". The normal process of setting up cases will use the "scripts/ccsm_utils/Tools/check_input_data" script to retrieve data from the CESM subversion inputdata repository. This is true for the standard `CLM_QIAN` forcing as well.

The `CLMCRUNCEP` data is uploaded into the subversion inputdata repository as well -- but as it is 1.1 Terabytes of data downloading it is problematic (*IT WILL TAKE SEVERAL DAYS TO DOWNLOAD THE ENTIRE DATASET USING SUBVERSION*). Because of its size you may also need to download it onto a separate disk space. We have done that on cheyenne for example where it resides in ``$ENV{CESMROOT}/lmwg`` while the rest of the input data resides in ``$ENV{CESMDATAROOT}/inputdata``. The data is also already available on: janus, franklin, and hopper. If you download the data, we recommend that you break your download into several chunks, by setting up a case and setting the year range for ``DATM_CPL_YR_START`` and ``DATM_CPL_YR_END`` in say 20 year sections over 1901 to 2010, and then use ``check_input_data`` to export the data.
The `CLMCRUNCEP` data is uploaded into the subversion inputdata repository as well -- but as it is 1.1 Terabytes of data downloading it is problematic (*IT WILL TAKE SEVERAL DAYS TO DOWNLOAD THE ENTIRE DATASET USING SUBVERSION*). Because of its size you may also need to download it onto a separate disk space. We have done that on derecho for example where it resides in ``$ENV{CESMROOT}/lmwg`` while the rest of the input data resides in ``$ENV{CESMDATAROOT}/inputdata``. The data is also already available on: janus, franklin, and hopper. If you download the data, we recommend that you break your download into several chunks, by setting up a case and setting the year range for ``DATM_YR_START`` and ``DATM_YR_END`` in say 20 year sections over 1901 to 2010, and then use ``check_input_data`` to export the data.

The ``CPLHISTForcing`` DATM forcing data is unique -- because it is large compared to the rest of the input data, and we only have a disk copy on cheyenne. The DATM assumes the path for the previous NCAR machine cheyenne of ``/glade/p/cesm/shared_outputdata/cases/ccsm4/$DATM_CPLHIST_CASE`` for the data. So you will need to change this path in order to run on any other machine. You can download the data itself from NCAR HPSS from ``/CCSM/csm/$DATM_CPLHIST_CASE``.
The ``CPLHISTForcing`` DATM forcing data is unique -- because it is large compared to the rest of the input data, and we only have a disk copy on derecho. The DATM assumes the path for derecho of ``/glade/p/cesm/shared_outputdata/cases/ccsm4/$DATM_CPLHIST_CASE`` for the data. So you will need to change this path in order to run on any other machine.

--------------------------------------
Customizing via the build script files
Expand Down
2 changes: 1 addition & 1 deletion src/main/clm_varctl.F90
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ module clm_varctl
logical, public :: spinup_matrixcn = .false. !.false. ! true => use acc spinup
logical, public :: hist_wrt_matrixcn_diag = .false.!.false. ! true => use acc spinup
! SASU
integer, public :: nyr_forcing = 10 ! length of forcing years for the spin up. eg. if DATM_CLMNCEP_YR_START=1901;DATM_CLMNCEP_YR_END=1920, then nyr_forcing = 20
integer, public :: nyr_forcing = 10 ! length of forcing years for the spin up. eg. if DATM_YR_START=1901;DATM_YR_END=1920, then nyr_forcing = 20
integer, public :: nyr_SASU = 1 ! length of each semi-analytic solution. eg. nyr_SASU=5, analytic solutions will be calculated every five years.
! nyr_SASU=1: the fastest SASU, but inaccurate; nyr_SASU=nyr_forcing(eg. 20): the lowest SASU but accurate
integer, public :: iloop_avg = -999 ! The restart file will be based on the average of all analytic solutions within the iloop_avg^th loop.
Expand Down
12 changes: 6 additions & 6 deletions tools/contrib/run_clm_historical
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ cp original_user_nl_clm user_nl_clm
./xmlchange STOP_N=21
./xmlchange CONTINUE_RUN=FALSE
./xmlchange RESUBMIT=0
./xmlchange DATM_CLMNCEP_YR_ALIGN=1901
./xmlchange DATM_CLMNCEP_YR_START=1901
./xmlchange DATM_CLMNCEP_YR_END=1920
./xmlchange DATM_YR_ALIGN=1901
./xmlchange DATM_YR_START=1901
./xmlchange DATM_YR_END=1920

# need to use user_nl_datm files to get years right
cp user_nl_datm1901-1920 user_nl_datm
Expand Down Expand Up @@ -203,9 +203,9 @@ gzip $DDIR$CASENAME*.bin
# we have to resubmit the job 3 times.
./xmlchange STOP_OPTION=nyears
./xmlchange STOP_N=22
./xmlchange DATM_CLMNCEP_YR_ALIGN=1901
./xmlchange DATM_CLMNCEP_YR_START=1901
./xmlchange DATM_CLMNCEP_YR_END=2014
./xmlchange DATM_YR_ALIGN=1901
./xmlchange DATM_YR_START=1901
./xmlchange DATM_YR_END=2014
./xmlchange CONTINUE_RUN=TRUE
./xmlchange RESUBMIT=3

Expand Down
14 changes: 7 additions & 7 deletions tools/contrib/run_clmtowers
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,9 @@ foreach mysite ( $sites )
./xmlchange --id STOP_OPTION --val nyears
./xmlchange --id STOP_N --val $numyears
./xmlchange --id RUN_STARTDATE --val $startyear[$cnt]-01-01
./xmlchange --id DATM_CLMNCEP_YR_ALIGN --val $startyear[$cnt]
./xmlchange --id DATM_CLMNCEP_YR_START --val $startyear[$cnt]
./xmlchange --id DATM_CLMNCEP_YR_END --val $endyear[$cnt]
./xmlchange --id DATM_YR_ALIGN --val $startyear[$cnt]
./xmlchange --id DATM_YR_START --val $startyear[$cnt]
./xmlchange --id DATM_YR_END --val $endyear[$cnt]
./xmlchange --id CALENDAR --val GREGORIAN
if ($BGC == ON) then
./xmlchange --id CLM_BLDNML_OPTS --val "-mask navy -bgc bgc -crop"
Expand All @@ -240,9 +240,9 @@ foreach mysite ( $sites )
else
./xmlchange --id RUN_STARTDATE --val $startyear[$cnt]-01-01
endif
./xmlchange --id DATM_CLMNCEP_YR_ALIGN --val $alignyear
./xmlchange --id DATM_CLMNCEP_YR_START --val $startyears
./xmlchange --id DATM_CLMNCEP_YR_END --val $endyears
./xmlchange --id DATM_YR_ALIGN --val $alignyear
./xmlchange --id DATM_YR_START --val $startyears
./xmlchange --id DATM_YR_END --val $endyears
if ($alignyear == 1) then
./xmlchange --id CALENDAR --val NO_LEAP
endif
Expand All @@ -263,7 +263,7 @@ foreach mysite ( $sites )
./preview_namelists
# Have to force this for some reason
if ($SPINUP_P1 == FALSE) then
./xmlchange --id DATM_CLMNCEP_YR_END --val $endyear[$cnt]
./xmlchange --id DATM_YR_END --val $endyear[$cnt]
./preview_namelists
endif
if ( $status != 0 )then
Expand Down

0 comments on commit 33607a0

Please sign in to comment.