diff --git a/datm/cime_config/config_component.xml b/datm/cime_config/config_component.xml
index 9ff459f5..de8840a0 100644
--- a/datm/cime_config/config_component.xml
+++ b/datm/cime_config/config_component.xml
@@ -49,18 +49,18 @@
CLMCRUNCEPv7, CLMGSWP3v1, CLMNLDAS2 and 1PT are modes using observational data for forcing prognostic land components.
WARNING for CLMNLDAS2: This is a regional forcing dataset over the U.S. (25-53N, 235-293E). Garbage data will be produced for runs extending beyond this regional domain.
- CORE2_NYF
- CORE2_IAF
- CORE_IAF_JRA
- CORE_IAF_JRA_1p4_2018
- CLM_QIAN
- CLM_QIAN_WISO
- CLMCRUNCEPv7
- CLMGSWP3v1
- CLMNLDAS2
- 1PT
- CPLHIST
- ERA5
+ CORE2_NYF
+ CORE2_IAF
+ CORE_IAF_JRA
+ CORE_IAF_JRA_1p4_2018
+ CLM_QIAN
+ CLM_QIAN_WISO
+ CLMCRUNCEPv7
+ CLMGSWP3v1
+ CLMNLDAS2
+ 1PT
+ ERA5
+ CPLHIST
diff --git a/doc/source/datm.rst b/doc/source/datm.rst
index e606bb14..ff067209 100644
--- a/doc/source/datm.rst
+++ b/doc/source/datm.rst
@@ -5,13 +5,13 @@ Data Atmosphere (DATM)
DATM is normally used to provide observational forcing data (or
forcing data produced by a previous run using active components) to
-drive prognostic components. The various ways of running DATM is
+drive prognostic components. The various ways of running DATM is
referred to as its mode.
-In the case of CESM, the active model components would be: CTSM,
-POP2, MOM6, POP2, CICE5-6, WW3 and MOSART. As examples, CORE2_NYF
-(CORE2 normal year forcing) is the DATM mode used in driving
-POP2 and MOM6. On the other hand CLM_QIAN, CLMCRUNCEP, CLMGSWP3
+In the case of CESM, the active model components would be: CTSM,
+POP2, MOM6, POP2, CICE5-6, WW3 and MOSART. As examples, CORE2_NYF
+(CORE2 normal year forcing) is the DATM mode used in driving
+POP2 and MOM6. On the other hand CLM_QIAN, CLMCRUNCEP, CLMGSWP3
and CLM1PT are DATM modes using observational data for forcing CTSM.
.. _datm-datamodes:
@@ -36,7 +36,7 @@ CLMNCEP (``datm_datamode_clmncep_mod.F90``)
infrastructure and data models to do active-land-only simulations.
CORE2_NYF (``datm_datamode_core2_mod.F90``)
- - Coordinated Ocean-ice Reference Experiments (CORE) Version 2
+ - Coordinated Ocean-ice Reference Experiments (CORE) Version 2
Normalst_aquap[1-10]Year Forcing.
CORE2_IAF (``datm_datamode_core2_mod.F90``)
@@ -60,16 +60,16 @@ ERA5 (``datm_datamode_era5_mod.F90``)
.. note::
Due to the high temporal and spatial resoultion of ERA5 dataset, only 2019
- data is staged on NCAR's Cheyenne platform under
+ data is staged on NCAR's Cheyenne platform under
`$CESMDATAROOT/inputdata/atm/datm7/ERA5`
.. note::
- In addition to the exiting DATM data modes, the `CDEPS fork `_
- used by `NOAA's UFS Weather Model `_
- also includes additional data modes such as CFSR, GEFS and GFS. These data modes are not
+ In addition to the exiting DATM data modes, the `CDEPS fork `_
+ used by `NOAA's UFS Weather Model `_
+ also includes additional data modes such as CFSR, GEFS and GFS. These data modes are not
merged with the NCAR's authoritative repository yet but it is tested under UFS Weather
model.
-
+
.. _datm-cime-vars:
---------------------------------------
@@ -77,25 +77,26 @@ Configuring DATM from CIME
---------------------------------------
If CDEPS is coupled to the CIME-CCS then the CIME ``$CASEROOT`` xml
-variable ``DATM_MODE`` sets the collection of streams that
-are associated with DATM and also sets the datm namelist variable
-``datamode`` in the file ``datm_in``. The following are the supported
-DATM ``datamode`` values, as defined in the file
-``namelist_definition_datm.xml``.
+variable ``DATM_MODE`` will be generated based on the compset
+specification ``DATM%{DATM_MODE}``. ``DATM_MODE`` will in term be
+used in the ``namelist_definition_datm.xml`` file to determine the
+collection of streams that are associated with DATM and also sets the
+datm namelist variable ``datamode`` in the file ``datm_in``.
-The following table describes the valid values of ``DATM_MODE``
+The following list describes the valid values of ``DATM_MODE``
(defined in the ``config_component.xml`` file for DATM), and how they
relate to the associated input streams and the ``datamode`` namelist
-variable. CIME will generate a value of ``DATM_MODE`` based on the
-compset.
+variable.
-CORE2_NYF
+DATM%CORE2_NYF,
- CORE2 normal year forcing (CESM C ang G compsets)
+ - datm_mode: CORE2_NYF
- streams: CORE2_NYF.GISS,CORE2_NYF.GXGXS,CORE2_NYF.NCEP
- datamode: CORE2_NYF
-CORE2_IAF
+DATM%CORE2_IAF,
- CORE2 interannual year forcing (CESM C ang G compsets)
+ - datm_mode: CORE2_IAF
- streams: CORE2_IAF.GCGCS.PREC,CORE2_IAF.GISS.LWDN,
CORE2_IAF.GISS.SWDN,CORE2_IAF.GISS.SWUP,
CORE2_IAF.NCEP.DN10,CORE2_IAF.NCEP.Q_10,
@@ -103,45 +104,97 @@ CORE2_IAF
CORE2_IAF.NCEP.V_10,CORE2_IAF.CORE2.ArcFactor
- datamode: CORE2_IAF
-CORE_IAF_JRA
+DATM%CORE_IAF_JRA
- JRA-55 intra-annual year forcing (CESM C ang G compsets)
- streams: CORE_IAF_JRA.PREC,CORE_IAF_JRA.LWDN,CORE_IAF_JRA.SWDN,
CORE_IAF_JRA.Q_10,CORE_IAF_JRA.SLP\_,CORE_IAF_JRA.T_10,CORE_IAF_JRA.U_10,
CORE_IAF_JRA.V_10,CORE_IAF_JRA.CORE2.ArcFactor
- datamode: CORE_IAF_JRA
-CLM_QIAN_WISO
+DATM%CLM_QIAN_WISO
- QIAN atm input data with water isotopes (CESM I compsets)
+ - datm_mode: CLMNCEP
- streams: CLM_QIAN_WISO.Solar,CLM_QIAN_WISO.Precip,CLM_QIAN_WISO.TPQW
- datamode: CLMNCEP
-CLM_QIAN
+DATM%CLM_QIAN
- QIAN atm input data (CESM I compsets)
+ - datm_mode: CLMNCEP
- streams: CLM_QIAN.Solar,CLM_QIAN.Precip,CLM_QIAN.TPQW
- datamode: CLMNCEP
-CLMCRUNCEPv7
+DATM%CLMCRUNCEPv7
- CRUNCEP atm input data (CESM I compsets)
+ - datm_mode: CLMNCEP
- streams: CLMCRUNCEP.Solar,CLMCRUNCEP.Precip,CLMCRUNCEP.TPQW
- datamode: CLMNCEP
-CLMGSWP3
+DATM%CLMGSWP3
- GSWP3 atm input data (I compsets)
+ - datm_mode: CLMNCEP
- streams: CLMGSWP3.Solar,CLMGSWP3.Precip,CLMGSWP3.TPQW
- datamode: CLMNCEP
-CLM1PT
+DATM%CLM1PT
- single point tower site atm input data
+ - datm_mode: CLMNCEP
- streams: CLM1PT.$ATM_GRID
- datamode: CLMNCEP
-ERA5
+DATM%ERA5
- ERA5 atm input data (not used any compset)
+ - datm_mode: ERA5
- streams: ERA5_HOURLY
- datamode: ERA5
-CPLHIST
+DATM%CPLHIST
- user generated forcing data from using coupler history files
used to spinup relevant prognostic components (for CESM this is CLM, POP and CISM)
+ - datm_mode:CPLHIST
- streams: CPLHISTForcing.Solar,CPLHISTForcing.nonSolarFlux,
- datamode: CPLHIST
+
+In addition, the following DATM specific CIME-CCS xml variables will appear in ``$CASEROOT/env_run.xml``:
+
+DATM_PRESAERO
+ - DATM prescribed aerosol forcing mode
+
+DATM_TOPO
+ - DATM surface topography forcing (only needed for compsets with active land)
+
+DATM_CO2_TSERIES
+ - Full pathname for domain file for datm when DATM_MODE is
+ CPLHIST, NOTE: if this is set to 'null' (the default), then
+ domain information is read in from the first coupler history
+ file in the target stream and it is assumed that the first
+ coupler stream file that is pointed to contains the domain
+ information for that stream.
+
+DATM_CPLHIST_CASE
+ - Case name used to determine stream filenames when DATM_MODE is CPLHIST
+
+DATM_YR_START
+ - Starting year to loop data over
+
+DATM_YR_END
+ - Ending year to loop data over
+
+DATM_YR_ALIGN
+ - Simulation year corresponding to DATM_YR_START. A common usage
+ is to set this to RUN_STARTDATE. With this setting, the forcing
+ in the first year of the run will be the forcing of year
+ DATM_YR_START. Another use case is to align the calendar
+ of transient forcing with the model calendar. For example,
+ setting DATM_YR_ALIGN=DATM_YR_START will lead to
+ the forcing calendar being the same as the model calendar. The
+ forcing for a given model year would be the forcing of the same
+ year. This would be appropriate in transient runs where the
+ model calendar is setup to span the same year range as the
+ forcing data.
+
+DATM_SKIP_RESTART_READ
+ - If set to true, than datm restarts will not be read on a continuation run.
+ This capability is used, for example, in CTSM spinup runs.
+
+
+
diff --git a/doc/source/dice.rst b/doc/source/dice.rst
index 2793edee..ebd5084b 100644
--- a/doc/source/dice.rst
+++ b/doc/source/dice.rst
@@ -4,7 +4,7 @@ Data Ice (DICE)
===============
DICE is normally used to provide observational forcing data to
-drive prognostic components. The various ways of running DICE is
+drive prognostic components. The various ways of running DICE is
referred to as its mode.
.. _dice-datamodes:
@@ -34,24 +34,27 @@ Configuring DICE from CIME
---------------------------------------
If CDEPS is coupled to the CIME-CCS then the CIME ``$CASEROOT`` xml
-variable ``DICE_MODE`` sets the collection of streams that
-are associated with DICE and also sets the dice namelist variable
-``datamode`` in the file ``dice_in``. The following are the supported
-DICE ``datamode`` values, as defined in the file
-``namelist_definition_dice.xml``.
+variable ``DICE_MODE`` will be generated based on the compset
+specification ``DICE%{DICE_MODE}``. ``DICE_MODE`` will in term be
+used in the ``namelist_definition_dice.xml`` file to determine the
+collection of streams that are associated with DICE and also sets the
+dice namelist variable ``datamode`` in the file ``dice_in``.
-The following table describes the valid values of ``DICE_MODE``
+The following list describes the valid values of ``DICE_MODE``
(defined in the ``config_component.xml`` file for DICE), and how they
relate to the associated input streams and the ``datamode`` namelist
-variable. CIME will generate a value of ``DICE_MODE`` based on the
-compset.
+variable.
-ssmi
+DICE%SSMI
- Reads data from file
+ - dice_mode: ssmi
- streams: ssmi_nyf
- - datamode: ssmi
+ - datamode: ssmi
-ssmi_iaf
- - Reads data from file
+DICE%IAF
+ - Reads data from file
+ - dice_mode: ssmi_iaf
- streams: ssmi_iaf
- - datamode: ssmi_iaf
+ - datamode: ssmi_iaf
+
+There are currently no DICE other specific xml variables in ``$CASEROOT/env_run.xml``.
diff --git a/doc/source/dlnd.rst b/doc/source/dlnd.rst
index 7a34983f..679cf58f 100644
--- a/doc/source/dlnd.rst
+++ b/doc/source/dlnd.rst
@@ -4,7 +4,7 @@ Data Land (DLND)
================
DLND is normally used to provide forcing data produced by a previous run
-using active components to drive prognostic components. Currently, there
+using active components to drive prognostic components. Currently, there
is one way of running DLND is referred to as its mode.
.. _dlnd-datamodes:
@@ -21,7 +21,7 @@ with a DLND source file that carries out these operations and these are
listed in parentheses next to the mode name.
copyall (``lnd_comp_nuopc.F90``)
- - This mode assumes that the data file has following variables:
+ - This mode assumes that the data file has following variables:
1. Surface temperature (`Sl_tsrf_elev`) in each elevation class
2. Surface topography (`Sl_topo_elev`) in each elevation class
3. SMB flux (`Flgl_qice_elev`) in each elevation class
@@ -29,30 +29,58 @@ copyall (``lnd_comp_nuopc.F90``)
.. _dlnd-cime-vars:
---------------------------------------
-Configuring DLND from CIME
+Configuring DLND using the CIME-CCS
---------------------------------------
If CDEPS is coupled to the CIME-CCS then the CIME ``$CASEROOT`` xml
-variable ``DLND_MODE`` sets the collection of streams that
-are associated with DLND and also sets the dlnd namelist variable
-``datamode`` in the file ``dlnd_in``. The following are the supported
-DLND ``datamode`` values, as defined in the file
-``namelist_definition_dlnd.xml``.
+variable ``DLND_MODE`` will be generated based on the compset
+specification ``DLND%{DLND_MODE}``. ``DLND_MODE`` will in term be
+used in the ``namelist_definition_dlnd.xml`` file to determine the
+collection of streams that are associated with DLND and also sets the
+dlnd namelist variable ``datamode`` in the file ``dlnd_in``.
-The following table describes the valid values of ``DLND_MODE``
+The following list describes the valid values of ``DLND_MODE``
(defined in the ``config_component.xml`` file for DLND), and how they
relate to the associated input streams and the ``datamode`` namelist
-variable. CIME will generate a value of ``DLND_MODE`` based on the
-compset.
+variable.
-LCPL
+DLND%LCPL
- Non-snow coupling mode. Land forcing data (produced by CLM) from a previous
- model run is read in from a coupler history file.
+ model run is read in from a coupler history file.
+ - dlnd_mode: SCPL
- streams: lnd.cplhist
- datamode: copyall
-SCPL
+DLND%SCPL
- Snow coupling mode. Glacier coupling data (produced by CISM) from a previous
model run is read in from a coupler history file.
+ - dlnd_mode: LCPL
- streams: sno.cplhist
- datamode: copyall
+
+In addition, the following DLND specific CIME-CCS xml variables will appear in ``$CASEROOT/env_run.xml``:
+
+DLND_CPLHIST_DIR
+ - directory for coupler history data mode
+
+DLND_CPLHIST_CASE
+ - case name for coupler history data mode
+
+DLND_CPLHIST_YR_START
+ - starting year to loop data over
+
+DLND_CPLHIST_YR_ALIGN
+ - Simulation year corresponding to DLND_CPLHIST_YR_START (only used
+ when DLND_MODE is CPLHIST or GLC_CPLHIST). A common usage is to
+ set this to RUN_STARTDATE. With this setting, the forcing in the
+ first year of the run will be the forcing of year
+ DLND_CPLHIST_YR_START. Another use case is to align the calendar
+ of transient forcing with the model calendar. For example, setting
+ DLND_CPLHIST_YR_ALIGN=DLND_CPLHIST_YR_START will lead to the
+ forcing calendar being the same as the model calendar. The forcing
+ for a given model year would be the forcing of the same year. This
+ would be appropriate in transient runs where the model calendar is
+ setup to span the same year range as the forcing data.
+
+DLND_SKIP_RESTART_READ
+ - If set to true, than dlnd restarts will not be read on a continuation run.
diff --git a/doc/source/docn.rst b/doc/source/docn.rst
index 80f7765c..d10852a6 100644
--- a/doc/source/docn.rst
+++ b/doc/source/docn.rst
@@ -5,7 +5,7 @@ Data Ocean (DOCN)
DOCN is normally used to provide observational forcing data (or
forcing data produced by a previous run using active components) to
-drive prognostic components. The various ways of running DOCN is
+drive prognostic components. The various ways of running DOCN is
referred to as its mode.
.. _docn-datamodes:
@@ -22,8 +22,8 @@ with a DOCN source file that carries out these operations and these are
listed in parentheses next to the mode name.
sstdata and sst_aquap_file (``docn_datamode_copyall_mod.F90``)
- - `sstdata` and `sst_aquap_file` modes assume that the only field in the
- input stream is SST. It also assumes the SST is in Celsius and must be
+ - `sstdata` and `sst_aquap_file` modes assume that the only field in the
+ input stream is SST. It also assumes the SST is in Celsius and must be
converted to Kelvin. All other fields are set to zero.
.. note::
@@ -40,7 +40,7 @@ iaf (``docn_datamode_iaf_mod.F90``)
sst_aquap_analytic, sst_aquap_constant and sst_aquap[1-10] (``docn_datamode_aquaplanet_mod.F90``)
- This mode creates analytic sea surface temperature. In case of using
`sst_aquap[1-10]` data mode, an additional information (`sst_option`)
- is extracted from the data mode to change the behaviour of the
+ is extracted from the data mode to change the behaviour of the
data mode such as the method of calculation of sea surface temperature.
som and som_aquap (``docn_datamode_som_mod.F90``)
@@ -56,61 +56,142 @@ som and som_aquap (``docn_datamode_som_mod.F90``)
appropriate and is provided for testing and development purposes only.
Users must create scientifically appropriate data for their particular
application. A tool is available to derive valid SOM forcing.
-
+
The only difference between `som` and `som_aquap` is that `som_aquap`
limits sea surface temperature based on calculated value of freezing
temperature.
+cplhist (``docn_datamode_cplhist_mod.F90``)
+
.. _docn-cime-vars:
---------------------------------------
-Configuring DOCN from CIME
+Configuring DOCN using CIME-CCS
---------------------------------------
If CDEPS is coupled to the CIME-CCS then the CIME ``$CASEROOT`` xml
-variable ``DOCN_MODE`` sets the collection of streams that
-are associated with DOCN and also sets the docn namelist variable
-``datamode`` in the file ``docn_in``. The following are the supported
-DOCN ``datamode`` values, as defined in the file
-``namelist_definition_docn.xml``.
+variable ``DOCN_MODE`` will be generated based on the compset
+specification ``DOCN%{DOCN_MODE}``. ``DOCN_MODE`` will in term be
+used in the ``namelist_definition_docn.xml`` file to determine the
+collection of streams that are associated with DOCN and also sets the
+docn namelist variable ``datamode`` in the file ``docn_in``.
-The following table describes the valid values of ``DOCN_MODE``
+The following list describes the valid values of ``DOCN_MODE``
(defined in the ``config_component.xml`` file for DOCN), and how they
relate to the associated input streams and the ``datamode`` namelist
-variable. CIME will generate a value of ``DOCN_MODE`` based on the
-compset.
+variable.
-prescribed
+DOCN%DOM
- SST data provided by a file
- - streams: prescribed
+ - docn_mode: prescribed
+ - streams: prescribed
- datamode: sstdata
-interannual
+DOCN%IAF
- SST data provided by a file
+ - docn_mode: interannual
- streams: interannual
- datamode: iaf
-som
+DOCN%SOM
- Slab Ocean Model is used to calculate sea surface temperature.
+ - docn_mode: som
- streams: som
- datamode: som
-som_aquap
+DOCN%SOMAQP
- Slab Ocean Model is used to calculate sea surface temperature.
- - streams: som_aquap
+ - docn_mode: som_aquap
+ - streams: N/A
- datamode: som_aquap
-sst_aquap[1-10]
+DOCN%AQP[1-10]
- Lattitude varying analytical sea surface data
+ - docn_mode: sst_aquap[1-10]
- streams: N/A
- datamode: sst_aquap[1-10]
-sst_aquap_file
+DOCN%AQPFILE
- SST data provided by a file
+ - docn_mode: sst_aquap_file
- streams: aquapfile
- datamode: sst_aquapfile
-sst_aquap_constant
+DOCN%AQPCONST
- Constant sea surface data from aquaplanet
+ - docn_mode: sst_aquap_constant
- streams: N/A
- datamode: sst_aquap_constant
+
+
+In addition, the following list outlines the DOCN specific CIME-CCS xml variables that appear in ``$CASEROOT/env_run.xml``:
+
+SSTICE_DATA_FILENAME
+ - Prescribed SST and ice coverage data file name.
+ Sets SST and ice coverage data file name.
+ This is only used when DOCN%DOM or DOCN%IAF is present in the compset.
+ (used by both DOCN and CICE running in prescribed mode)
+
+SSTICE_MESH_FILENAME
+ - Prescribed SST and ice coverage mesh file name.
+ Sets SST and ice coverage grid file name for prescribed runs.
+ This is only used when DOCN%DOM or DOCN%IAF is present in the compset.
+ (used by both DOCN and CICE running in prescribed mode)
+
+SSTICE_YR_START
+ - Starting year to loop data over
+ (only used by both DOCN runing in prescribed mode and CICE running in prescribed mode)
+
+SSTICE_YR_END
+ - Ending year to loop data over
+ (only used by both DOCN runing in prescribed mode and CICE running in prescribed mode)
+
+SSTICE_YR_ALIGN
+ - The model year that corresponds to SSTICE_YEAR_START on the data file.
+ Prescribed SST and ice coverage data will be aligned so that the first year of
+ data corresponds to SSTICE_YEAR_ALIGN in the model. For instance, if the first
+ year of prescribed data is the same as the first year of the model run, this
+ should be set to the year given in RUN_STARTDATE.
+ If SSTICE_YEAR_ALIGN is later than the model's starting year, or if the model is
+ run after the prescribed data ends (as determined by SSTICE_YEAR_END), the
+ default behavior is to assume that the data from SSTICE_YEAR_START to
+ SSTICE_YEAR_END cyclically repeats. This behavior is controlled by the
+ "taxmode" stream option; see the data model documentation for more details.
+ (only used by both DOCN runing in prescribed mode and CICE running in prescribed mode)
+
+DOCN_AQPCONST_VALUE
+ - Sets globally constant SST value and is only used when DOCN%AQPCONST is present in the compset.
+
+DOCN_SOMAQP_DATAFILE
+ - Sets the SOM aquaplanet file and is only used when DOCN%AQPFILE is present in the compset.
+
+DOCN_CPLHIST_YR_START
+ - Starting year to loop data over
+ Only used if DOCN_MODE=cplhist.
+
+DOCN_CPLHIST_YR_END
+ - Ending year to loop data over
+ Only used if DOCN_MODE=cplhist.
+
+DOCN_CPLHIST_YR_ALIGN
+ - Simulation year corresponding to DOCN_CPLHIST_YR_START. A common usage
+ is to set this to RUN_STARTDATE. With this setting, the forcing
+ in the first year of the run will be the forcing of year
+ DOCN_CPLHIST_YR_START. Another use case is to align the calendar
+ of transient forcing with the model calendar. For example,
+ setting DOCN_CPLHIST_YR_ALIGN=DOCN_CPLHIST_YR_START will lead to
+ the forcing calendar being the same as the model calendar. The
+ forcing for a given model year would be the forcing of the same
+ year. This would be appropriate in transient runs where the
+ model calendar is setup to span the same year range as the forcing data.
+ Only used if DOCN_MODE=cplhist.
+
+DOCN_IMPORT_FIELDS
+ - A column delimited set of import fields that are advertised by DOCN but never used.
+ In some cases it is needed for DOCN to advertise import fields even though it never will actually use them.
+ This is needed in order for the mediator to add fields that would
+ be sent to the ocean from the atmosphere, ice and runoff if the
+ ocean were prognostic.
+ If the value of DOCN_IMPORT_FIELDS is 'none' then no import fields are advertised
+ by DOCN. If the DOCN_IMPORT_FIELDS is set to 'Faxa_bcph:Faxa_dstdry:Faxa_dstwet:So_duu10n:Si_ifrac' then
+ these fields will be written to the mediator history file(s).
diff --git a/doc/source/drof.rst b/doc/source/drof.rst
index 9457d445..abcda2f4 100644
--- a/doc/source/drof.rst
+++ b/doc/source/drof.rst
@@ -32,84 +32,124 @@ Configuring DROF from CIME
---------------------------------------
If CDEPS is coupled to the CIME-CCS then the CIME ``$CASEROOT`` xml
-variable ``DROF_MODE`` sets the collection of streams that
-are associated with DROF and also sets the DROF namelist variable
-``datamode`` in the file ``drof_in``. The following are the supported
-DROF ``datamode`` values, as defined in the file
-``namelist_definition_drof.xml``.
+variable ``DROF_MODE`` will be generated based on the compset
+specification ``DROF%{DROF_MODE}``. ``DROF_MODE`` will in term be
+used in the ``namelist_definition_drof.xml`` file to determine the
+collection of streams that are associated with DROF and also sets the
+drof namelist variable ``datamode`` in the file ``drof_in``.
-The following table describes the valid values of ``DROF_MODE``
+The following list describes the valid values of ``DROF_MODE``
(defined in the ``config_component.xml`` file for DROF), and how they
relate to the associated input streams and the ``datamode`` namelist
-variable. CIME will generate a value of ``DROF_MODE`` based on the
-compset.
+variable.
-CPLHIST
+DROF%CPLHIST
- Reads data from coupler history file
+ - drof_mode: CPLHIST
- streams: rof.cplhist
- datamode: copyall
-DIATREN_ANN_RX1
+DROF%DIATREN_ANN_RX1
- Annual Average data from Dai_Trenberth Continental Freshwater Discharge
+ - drof_mode: DIATREN_ANN_RX1
- streams: rof.diatren_ann_rx1
- datamode: copyall
-DIATREN_ANN_AIS00_RX1
+DROF%DIATREN_ANN_AIS00_RX1
- Annual Average data from Dai_Trenberth Continental Freshwater Discharge
+ - drof_mode: DIATREN_ANN_AIS00_RX1
- streams: rof.diatren_ann_ais00_rx1
- datamode: copyall
-DIATREN_ANN_AIS45_RX1
+DROF%DIATREN_ANN_AIS45_RX1
- Annual Average data from Dai_Trenberth Continental Freshwater Discharge
+ - drof_mode: DIATREN_ANN_AIS45_RX1
- streams: rof.diatren_ann_ais45_rx1
- datamode: copyall
-DIATREN_ANN_AIS55_RX1
+DROF%DIATREN_ANN_AIS55_RX1
- Annual Average data from Dai_Trenberth Continental Freshwater Discharge
+ - drof_mode: DIATREN_ANN_AIS55_RX1
- streams: rof.diatren_ann_ais55_rx1
- datamode: copyall
-DIATREN_IAF_AIS00_RX1
+DROF%DIATREN_IAF_RX1
- Monthly data from Dai_Trenberth Continental Freshwater Discharge
- - streams: rof.diatren_iaf_ais00_rx1
+ - drof_mode: DIATREN_IAF_RX1
+ - streams: rof.diatren_iaf_rx1
- datamode: copyall
-DIATREN_IAF_RX1
+DROF%DIATREN_IAF_AIS00_RX1
- Monthly data from Dai_Trenberth Continental Freshwater Discharge
- - streams: rof.diatren_iaf_rx1
+ - drof_mode: DIATREN_IAF_AIS00_RX1
+ - streams: rof.diatren_iaf_ais00_rx1
- datamode: copyall
-DIATREN_IAF_AIS45_RX1
+DROF%DIATREN_IAF_AIS45_RX1
- Monthly data from Dai_Trenberth Continental Freshwater Discharge
+ - drof_mode: DIATREN_IAF_AIS45_RX1
- streams: rof.diatren_iaf_ais45_rx1
- datamode: copyall
-DIATREN_IAF_AIS55_RX1
+DROF%DIATREN_IAF_AIS55_RX1
- Monthly data from Dai_Trenberth Continental Freshwater Discharge
+ - drof_mode: DIATREN_IAF_AIS55_RX1
- streams: rof.diatren_iaf_ais55_rx1
- datamode: copyall
-IAF_JRA_1p4_2018
- - JRA-55 based river runoff data (2018)
- - streams: rof.iaf_jra_1p4_2018
- - datamode: copyall
-
-IAF_JRA
+DROF%IAF_JRA
- JRA-55 based river runoff data
+ - drof_mode: IAF_JRA
- streams: rof.iaf_jra
- datamode: copyall
-RYF8485_JRA
- - JRA55 v1.3 1984 May - 1985 Apr RAF
+DROF%IAF_JRA_1p4_2018
+ - JRA-55 based river runoff data (2018)
+ - drof_mode: IAF_JRA_1p4_2018
+ - streams: rof.iaf_jra_1p4_2018
+ - datamode: copyall
+
+DROF%RYF8485_JRA
+ - JRA55 v1.3 data from 1984 May - 1985 Apr RAF
+ - drof_mode: RYF8485_JRA
- streams: rof.ryf8485_jra
- datamode: copyall
-RYF9091_JRA
- - JRA55 v1.3 1990 May - 1991 Apr RAF
+DROF%RYF9091_JRA
+ - JRA55 v1.3 data from 1990 May - 1991 Apr RAF
+ - drof_mode: RYF9091_JRA
- streams: rof.ryf9091_jra
- datamode: copyall
-RYF0304_JRA
- - JRA55 v1.3 2003 May - 2004 Apr RAF
+DROF%RYF0304_JRA
+ - JRA55 v1.3 data form 2003 May - 2004 Apr RAF
+ - drof_mode: RYF0304_JRA
- streams: rof.ryf0304_jra
- datamode: copyall
+
+In addition, the following DATM specific CIME-CCS xml variables will appear in ``$CASEROOT/env_run.xml``:
+
+DROF_CPLHIST_CASE
+ - Case name used to determine stream filenames when DROF_MODE is CPLHIST
+
+DROF_CPLHIST_YR_START
+ - starting year to loop data over (only used when DROF_MODE is CPLHIST)
+
+DROF_CPLHIST_YR_END
+ - ending year to loop data over (only used when DROF_MODE is CPLHIST)
+
+DROF_CPLHIST_YR_ALIGN
+ - Simulation year corresponding to DROF_CPLHIST_YR_START (only used
+ when DROF_MODE is CPLHIST). A common usage is to set this to
+ RUN_STARTDATE. With this setting, the forcing in the first year of
+ the run will be the forcing of year DROF_CPLHIST_YR_START. Another
+ use case is to align the calendar of transient forcing with the
+ model calendar. For example, setting
+ DROF_CPLHIST_YR_ALIGN=DROF_CPLHIST_YR_START will lead to the
+ forcing calendar being the same as the model calendar. The forcing
+ for a given model year would be the forcing of the same year. This
+ would be appropriate in transient runs where the model calendar is
+ setup to span the same year range as the forcing data.
+
+DROF_SKIP_RESTART_READ
+ - If set to true, than drof restarts will not be read on a continuation run
diff --git a/doc/source/dwav.rst b/doc/source/dwav.rst
index 551c4443..94bb9f30 100644
--- a/doc/source/dwav.rst
+++ b/doc/source/dwav.rst
@@ -39,23 +39,29 @@ copyall (``wav_comp_nuopc.F90``)
.. _dwav-cime-vars:
---------------------------------------
-Configuring DWAV from CIME
+Configuring DWAV using the CIME-CCS
---------------------------------------
If CDEPS is coupled to the CIME-CCS then the CIME ``$CASEROOT`` xml
-variable ``DWAV_MODE`` sets the collection of streams that
-are associated with DWAV and also sets the DWAV namelist variable
-``datamode`` in the file ``dwav_in``. The following are the supported
-DROF ``datamode`` values, as defined in the file
-``namelist_definition_dwav.xml``.
+variable ``DWAV_MODE`` will be generated based on the compset
+specification ``DWAV%{DWAV_MODE}``. ``DWAV_MODE`` will in term be
+used in the ``namelist_definition_dwav.xml`` file to determine the
+collection of streams that are associated with DWAV and also sets the
+dwav namelist variable ``datamode`` in the file ``dwav_in``.
-The following table describes the valid values of ``DWAV_MODE``
+The following list describes the valid values of ``DWAV_MODE``
(defined in the ``config_component.xml`` file for DWAV), and how they
relate to the associated input streams and the ``datamode`` namelist
-variable. CIME will generate a value of ``DWAV_MODE`` based on the
-compset.
+variable.
-CLIMO
+DWAV%CLIMO
- Reads data from wave climatology file
+ - dwav_mode: CLIMO
- streams: climo
- datamode: copyall
+
+In addition, the following DICE specific CIME-CCS xml variables will appear in ``$CASEROOT/env_run.xml``:
+
+DWAV_SKIP_RESTART_READ
+ - If set to true, than dice restarts will not be read on a continuation run.
+
diff --git a/docn/CMakeLists.txt b/docn/CMakeLists.txt
index e74ed375..b8a2b44e 100644
--- a/docn/CMakeLists.txt
+++ b/docn/CMakeLists.txt
@@ -1,9 +1,11 @@
project(docn Fortran)
set(SRCFILES ocn_comp_nuopc.F90
- docn_datamode_copyall_mod.F90
- docn_datamode_som_mod.F90
- docn_datamode_aquaplanet_mod.F90
- docn_datamode_iaf_mod.F90)
+ docn_datamode_copyall_mod.F90
+ docn_datamode_som_mod.F90
+ docn_datamode_aquaplanet_mod.F90
+ docn_datamode_iaf_mod.F90
+ docn_datamode_cplhist_mod.F90
+ docn_import_data_mod.F90)
foreach(FILE ${SRCFILES})
if(EXISTS "${CASEROOT}/SourceMods/src.docn/${FILE}")
diff --git a/docn/cime_config/config_component.xml b/docn/cime_config/config_component.xml
index 2bcd256b..a06201aa 100644
--- a/docn/cime_config/config_component.xml
+++ b/docn/cime_config/config_component.xml
@@ -13,7 +13,7 @@
This file may have ocn desc entries.
-->
- DOCN
+ DOCN
prescribed ocean mode
slab ocean mode
aquaplanet slab ocean mode
@@ -31,6 +31,7 @@
analytic aquaplanet sst - option 10
file input aquaplanet sst
globally constant SST for idealized experiments, such as RCE
+ mediator history output for ocean fields imported to mediator
@@ -44,7 +45,7 @@
char
- prescribed,sst_aquap1,sst_aquap2,sst_aquap3,sst_aquap4,sst_aquap5,sst_aquap6,sst_aquap7,sst_aquap8,sst_aquap9,sst_aquap10,sst_aquapfile,som,som_aquap,sst_aquap_constant,interannual,null
+ prescribed,sst_aquap1,sst_aquap2,sst_aquap3,sst_aquap4,sst_aquap5,sst_aquap6,sst_aquap7,sst_aquap8,sst_aquap9,sst_aquap10,sst_aquapfile,som,som_aquap,sst_aquap_constant,interannual,cplhist
prescribed
prescribed
@@ -63,6 +64,7 @@
sst_aquap10
sst_aquapfile
sst_aquap_constant
+ cplhist
run_component_docn
env_run.xml
@@ -249,6 +251,45 @@
This is only used when DOCN_MODE=prescribed.
+
+ integer
+
+ 1
+ run_component_docn
+ env_run.xml
+
+ Simulation year corresponding to DOCN_CPLHIST_YR_START. A common usage
+ is to set this to RUN_STARTDATE. With this setting, the forcing
+ in the first year of the run will be the forcing of year
+ DOCN_CPLHIST_YR_START. Another use case is to align the calendar
+ of transient forcing with the model calendar. For example,
+ setting DOCN_CPLHIST_YR_ALIGN=DOCN_CPLHIST_YR_START will lead to
+ the forcing calendar being the same as the model calendar. The
+ forcing for a given model year would be the forcing of the same
+ year. This would be appropriate in transient runs where the
+ model calendar is setup to span the same year range as the
+ forcing data.
+
+
+
+
+ integer
+
+ 1
+ run_component_docn
+ env_run.xml
+ starting year to loop data over
+
+
+
+ integer
+
+ 1
+ run_component_docn
+ env_run.xml
+ ending year to loop data over
+
+
logical
TRUE,FALSE
@@ -259,6 +300,14 @@
+
+ char
+ none
+ run_component_docn
+ env_run.xml
+ none or colon deliminted string of import fields that DOCN will advertise
+
+
=========================================
DOCN naming conventions
diff --git a/docn/cime_config/namelist_definition_docn.xml b/docn/cime_config/namelist_definition_docn.xml
index 9020ac17..a44ae344 100644
--- a/docn/cime_config/namelist_definition_docn.xml
+++ b/docn/cime_config/namelist_definition_docn.xml
@@ -11,15 +11,15 @@
streams
streams_file
- List of streams that docn supports.
- The following are supported: prescribed, aquapfile, som, som_aquqp, interannual, and blank.
- The streamslist
+ List of streams for a given docn_mode value. Each docn_mode can
+ have zero or more streams that are associated with it.
prescribed
interannual
som_aquap
som
+ cplhist
aquapfile
''
''
@@ -39,9 +39,9 @@
char
docn
docn_nml
- sstdata,sst_aquap1,sst_aquap2,sst_aquap3,sst_aquap4,sst_aquap5,sst_aquap6,sst_aquap7,sst_aquap8,sst_aquap9,sst_aquap10,sst_aquapfile,sst_aquap_constant,som,som_aquap,iaf
+ sstdata,sst_aquap1,sst_aquap2,sst_aquap3,sst_aquap4,sst_aquap5,sst_aquap6,sst_aquap7,sst_aquap8,sst_aquap9,sst_aquap10,sst_aquapfile,sst_aquap_constant,som,som_aquap,iaf,cplhist
- General method that operates on the data.
+ General method that operates on the data for a given docn_mode.
==> dataMode = "sstdata"
sstdata mode assumes the only field in the input stream is SST.
It also assumes the SST is in Celsius and must be converted to Kelvin.
@@ -72,21 +72,21 @@
application. A tool is available to derive valid SOM forcing.
(1) map the xml variable DOCN_MODE => config variable docn_mode => namelist variable datamode
- compset="_DOCN%DOM_" => docn_mode=prescribed => datamode=prescribed
- compset="_DOCN%IAF_" => docn_mode=interannual => datamode=interannual
- compset="_DOCN%SOM_" => docn_mode=som => datamode=som
- compset="_DOCN%SOMAQP_" => docn_mode=som_aquap => datamode=som_aquap
- compset="_DOCN%AQP1_" => docn_mode=sst_aquap1 => datamode=sst_aquap1
- compset="_DOCN%AQP2_" => docn_mode=sst_aquap2 => datamode=sst_aquap2
- compset="_DOCN%AQP3_" => docn_mode=sst_aquap3 => datamode=sst_aquap3
- compset="_DOCN%AQP4_" => docn_mode=sst_aquap4 => datamode=sst_aquap4
- compset="_DOCN%AQP5_" => docn_mode=sst_aquap5 => datamode=sst_aquap5
- compset="_DOCN%AQP6_" => docn_mode=sst_aquap6 => datamode=sst_aquap6
- compset="_DOCN%AQP7_" => docn_mode=sst_aquap7 => datamode=sst_aquap7
- compset="_DOCN%AQP8_" => docn_mode=sst_aquap8 => datamode=sst_aquap8
- compset="_DOCN%AQP9_" => docn_mode=sst_aquap9 => datamode=sst_aquap9
- compset="_DOCN%AQP10_" => docn_mode=sst_aquap10 => datamode=sst_aquap10
- compset="_DOCN%AQPFILE_" => docn_mode=sst_aquapfile => datamode=sst_aquap_file
+ compset="_DOCN%DOM_" => docn_mode=prescribed => datamode=prescribed
+ compset="_DOCN%IAF_" => docn_mode=interannual => datamode=interannual
+ compset="_DOCN%SOM_" => docn_mode=som => datamode=som
+ compset="_DOCN%SOMAQP_" => docn_mode=som_aquap => datamode=som_aquap
+ compset="_DOCN%AQP1_" => docn_mode=sst_aquap1 => datamode=sst_aquap1
+ compset="_DOCN%AQP2_" => docn_mode=sst_aquap2 => datamode=sst_aquap2
+ compset="_DOCN%AQP3_" => docn_mode=sst_aquap3 => datamode=sst_aquap3
+ compset="_DOCN%AQP4_" => docn_mode=sst_aquap4 => datamode=sst_aquap4
+ compset="_DOCN%AQP5_" => docn_mode=sst_aquap5 => datamode=sst_aquap5
+ compset="_DOCN%AQP6_" => docn_mode=sst_aquap6 => datamode=sst_aquap6
+ compset="_DOCN%AQP7_" => docn_mode=sst_aquap7 => datamode=sst_aquap7
+ compset="_DOCN%AQP8_" => docn_mode=sst_aquap8 => datamode=sst_aquap8
+ compset="_DOCN%AQP9_" => docn_mode=sst_aquap9 => datamode=sst_aquap9
+ compset="_DOCN%AQP10_" => docn_mode=sst_aquap10 => datamode=sst_aquap10
+ compset="_DOCN%AQPFILE_" => docn_mode=sst_aquapfile => datamode=sst_aquap_file
compset="_DOCN%AQPCONST_" => docn_mode=sst_aquap_constant => datamode=sst_aquap_constant
@@ -106,10 +106,11 @@
sst_aquap10
sst_aquap_file
sst_aquap_constant
+ cplhist
-
+
char
streams
abs
@@ -119,11 +120,11 @@
$OCN_DOMAIN_MESH
- null
+ null
-
+
char
streams
abs
@@ -134,7 +135,7 @@
$MASK_MESH
$ATM_DOMAIN_MESH
- null
+ null
@@ -147,7 +148,7 @@
$OCN_NX
- 1
+ 1
@@ -160,7 +161,7 @@
$OCN_NY
- 1
+ 1
@@ -203,4 +204,16 @@
+
+ char
+ docn
+ docn_nml
+
+ Colon delimited set of fields to advertise as import data
+
+
+ $DOCN_IMPORT_FIELDS
+
+
+
diff --git a/docn/cime_config/stream_definition_docn.xml b/docn/cime_config/stream_definition_docn.xml
index 4fb67ede..0dd4baf5 100644
--- a/docn/cime_config/stream_definition_docn.xml
+++ b/docn/cime_config/stream_definition_docn.xml
@@ -4,7 +4,7 @@
-
+
$SSTICE_MESH_FILENAME
@@ -35,7 +35,7 @@
single
-
+
$DIN_LOC_ROOT/atm/cam/sst/sst_HadOIBl_bc_1x1_clim_c101029_ESMFmesh_120520.nc
@@ -66,7 +66,7 @@
single
-
+
$DIN_LOC_ROOT/ocn/docn7/SOM/pop_frc.1x1d.SCRIP.030620_ESMFmesh.nc
@@ -104,7 +104,7 @@
single
-
+
$DIN_LOC_ROOT/share/meshes/fv1.9x2.5_141008_ESMFmesh.nc
$DIN_LOC_ROOT/share/meshes/fv0.9x1.25_141008_polemod_ESMFmesh.nc
@@ -144,7 +144,7 @@
single
-
+
%DIN_LOC_ROOT/share/meshes/fv0.9x1.25_141008_polemod_ESMFmesh.nc
@@ -175,4 +175,37 @@
single
+
+
+ $OCN_DOMAIN_MESH
+
+
+ UNSET
+
+
+ ocnImp_So_bldepth So_bldepth
+ ocnImp_So_t So_t
+ ocnImp_So_u So_u
+ ocnImp_So_v So_v
+
+ null
+
+ bilinear
+
+ null
+ $DOCN_CPLHIST_YR_ALIGN
+ $DOCN_CPLHIST_YR_START
+ $DOCN_CPLHIST_YR_END
+ 0
+
+ nearest
+
+
+ extend
+
+
+ 1.e30
+
+ single
+
diff --git a/docn/docn_datamode_cplhist_mod.F90 b/docn/docn_datamode_cplhist_mod.F90
new file mode 100644
index 00000000..3ff9e65c
--- /dev/null
+++ b/docn/docn_datamode_cplhist_mod.F90
@@ -0,0 +1,160 @@
+module docn_datamode_cplhist_mod
+
+ use ESMF , only : ESMF_State, ESMF_LOGMSG_INFO, ESMF_LogWrite, ESMF_SUCCESS
+ use NUOPC , only : NUOPC_Advertise
+ use shr_kind_mod , only : r8=>shr_kind_r8, i8=>shr_kind_i8, cl=>shr_kind_cl, cs=>shr_kind_cs
+ use shr_const_mod , only : shr_const_TkFrz, shr_const_pi, shr_const_ocn_ref_sal
+ use shr_sys_mod , only : shr_sys_abort
+ use dshr_methods_mod , only : dshr_state_getfldptr, dshr_fldbun_getfldptr, chkerr
+ use dshr_fldlist_mod , only : fldlist_type, dshr_fldlist_add
+ use dshr_mod , only : dshr_restart_read, dshr_restart_write
+ use dshr_strdata_mod , only : shr_strdata_type
+
+ implicit none
+ private ! except
+
+ public :: docn_datamode_cplhist_advertise
+ public :: docn_datamode_cplhist_init_pointers
+ public :: docn_datamode_cplhist_advance
+ public :: docn_datamode_cplhist_restart_read
+ public :: docn_datamode_cplhist_restart_write
+
+ ! export fields
+ real(r8), pointer :: So_omask(:) => null() ! real ocean fraction sent to mediator
+ real(r8), pointer :: So_t(:) => null()
+ real(r8), pointer :: So_u(:) => null()
+ real(r8), pointer :: So_v(:) => null()
+ real(r8), pointer :: So_bldepth(:) => null()
+
+ real(r8) , parameter :: tkfrz = shr_const_tkfrz ! freezing point, fresh water (kelvin)
+ real(r8) , parameter :: ocnsalt = shr_const_ocn_ref_sal ! ocean reference salinity
+
+ character(*) , parameter :: nullstr = 'null'
+ character(*) , parameter :: rpfile = 'rpointer.ocn'
+ character(*) , parameter :: u_FILE_u = &
+ __FILE__
+
+!===============================================================================
+contains
+!===============================================================================
+
+ subroutine docn_datamode_cplhist_advertise(exportState, fldsexport, flds_scalar_name, rc)
+
+ ! input/output variables
+ type(esmf_State) , intent(inout) :: exportState
+ type(fldlist_type) , pointer :: fldsexport
+ character(len=*) , intent(in) :: flds_scalar_name
+ integer , intent(out) :: rc
+
+ ! local variables
+ type(fldlist_type), pointer :: fldList
+ !-------------------------------------------------------------------------------
+
+ rc = ESMF_SUCCESS
+
+ ! Advertise export fields
+ call dshr_fldList_add(fldsExport, trim(flds_scalar_name))
+ call dshr_fldList_add(fldsExport, 'So_omask' )
+ call dshr_fldList_add(fldsExport, 'So_t' )
+ call dshr_fldList_add(fldsExport, 'So_u' )
+ call dshr_fldList_add(fldsExport, 'So_v' )
+ call dshr_fldList_add(fldsExport, 'So_bldepth' )
+
+ fldlist => fldsExport ! the head of the linked list
+ do while (associated(fldlist))
+ call NUOPC_Advertise(exportState, standardName=fldlist%stdname, rc=rc)
+ if (ChkErr(rc,__LINE__,u_FILE_u)) return
+ call ESMF_LogWrite('(docn_comp_advertise): Fr_ocn'//trim(fldList%stdname), ESMF_LOGMSG_INFO)
+ fldList => fldList%next
+ enddo
+
+ end subroutine docn_datamode_cplhist_advertise
+
+ !===============================================================================
+ subroutine docn_datamode_cplhist_init_pointers(exportState, ocn_fraction, rc)
+
+ ! input/output variables
+ type(ESMF_State) , intent(inout) :: exportState
+ real(r8) , intent(in) :: ocn_fraction(:)
+ integer , intent(out) :: rc
+
+ ! local variables
+ character(len=*), parameter :: subname='(docn_init_pointers): '
+ !-------------------------------------------------------------------------------
+
+ rc = ESMF_SUCCESS
+
+ ! initialize pointers to export fields
+ call dshr_state_getfldptr(exportState, 'So_omask' , fldptr1=So_omask , rc=rc)
+ if (chkerr(rc,__LINE__,u_FILE_u)) return
+ call dshr_state_getfldptr(exportState, 'So_t' , fldptr1=So_t , rc=rc)
+ if (chkerr(rc,__LINE__,u_FILE_u)) return
+ call dshr_state_getfldptr(exportState, 'So_u' , fldptr1=So_u , allowNullReturn=.true., rc=rc)
+ if (chkerr(rc,__LINE__,u_FILE_u)) return
+ call dshr_state_getfldptr(exportState, 'So_v' , fldptr1=So_v , allowNullReturn=.true., rc=rc)
+ if (chkerr(rc,__LINE__,u_FILE_u)) return
+ call dshr_state_getfldptr(exportState, 'So_bldepth', fldptr1=So_bldepth, allowNullReturn=.true., rc=rc)
+ if (chkerr(rc,__LINE__,u_FILE_u)) return
+
+ So_u(:) = 0.0_r8
+ So_v(:) = 0.0_r8
+ So_t(:) = TkFrz
+ So_bldepth(:) = 0.0_r8
+
+ ! Set export state ocean fraction (So_omask)
+ So_omask(:) = ocn_fraction(:)
+
+ end subroutine docn_datamode_cplhist_init_pointers
+
+ !===============================================================================
+ subroutine docn_datamode_cplhist_advance(rc)
+
+ ! input/output variables
+ integer, intent(out) :: rc
+
+ ! local variables
+ character(len=*), parameter :: subname='(docn_datamode_cplhist_advance): '
+ !-------------------------------------------------------------------------------
+
+ rc = ESMF_SUCCESS
+
+ So_t(:) = So_t(:) + TkFrz
+
+ end subroutine docn_datamode_cplhist_advance
+
+ !===============================================================================
+ subroutine docn_datamode_cplhist_restart_write(case_name, inst_suffix, ymd, tod, &
+ logunit, my_task, sdat)
+
+ ! input/output variables
+ character(len=*) , intent(in) :: case_name
+ character(len=*) , intent(in) :: inst_suffix
+ integer , intent(in) :: ymd ! model date
+ integer , intent(in) :: tod ! model sec into model date
+ integer , intent(in) :: logunit
+ integer , intent(in) :: my_task
+ type(shr_strdata_type) , intent(inout) :: sdat
+ !-------------------------------------------------------------------------------
+
+ call dshr_restart_write(rpfile, case_name, 'docn', inst_suffix, ymd, tod, &
+ logunit, my_task, sdat)
+
+ end subroutine docn_datamode_cplhist_restart_write
+
+ !===============================================================================
+ subroutine docn_datamode_cplhist_restart_read(rest_filem, inst_suffix, logunit, my_task, mpicom, sdat)
+
+ ! input/output arguments
+ character(len=*) , intent(inout) :: rest_filem
+ character(len=*) , intent(in) :: inst_suffix
+ integer , intent(in) :: logunit
+ integer , intent(in) :: my_task
+ integer , intent(in) :: mpicom
+ type(shr_strdata_type) , intent(inout) :: sdat
+ !-------------------------------------------------------------------------------
+
+ call dshr_restart_read(rest_filem, rpfile, inst_suffix, nullstr, logunit, my_task, mpicom, sdat)
+
+ end subroutine docn_datamode_cplhist_restart_read
+
+end module docn_datamode_cplhist_mod
diff --git a/docn/docn_import_data_mod.F90 b/docn/docn_import_data_mod.F90
new file mode 100644
index 00000000..13273625
--- /dev/null
+++ b/docn/docn_import_data_mod.F90
@@ -0,0 +1,135 @@
+module docn_import_data_mod
+
+ use ESMF , only : ESMF_State, ESMF_LOGMSG_INFO, ESMF_LogWrite, ESMF_SUCCESS
+ use ESMF , only : ESMF_LOGMSG_ERROR, ESMF_FAILURE
+ use NUOPC , only : NUOPC_Advertise
+ use shr_kind_mod , only : r8=>shr_kind_r8, i8=>shr_kind_i8, cl=>shr_kind_cl, cs=>shr_kind_cs
+ use dshr_fldlist_mod , only : fldlist_type, dshr_fldlist_add
+ use dshr_methods_mod , only : chkerr
+
+ implicit none
+ private ! except
+
+ public :: docn_import_data_advertise
+
+ private :: docn_get_import_fields
+
+ character(*) , parameter :: u_FILE_u = &
+ __FILE__
+
+ !===============================================================================
+contains
+ !===============================================================================
+
+ subroutine docn_import_data_advertise(importState, fldsimport, flds_scalar_name, import_data_fields, rc)
+
+ ! input/output variables
+ type(esmf_State) , intent(inout) :: importState
+ type(fldlist_type) , pointer :: fldsimport
+ character(len=*) , intent(in) :: flds_scalar_name
+ character(len=*) , intent(in) :: import_data_fields
+ integer , intent(out) :: rc
+
+ ! local variables
+ type(fldlist_type), pointer :: fldList
+ character(CL), allocatable :: fieldnamelist(:)
+ integer :: n
+ !-------------------------------------------------------------------------------
+
+ ! Translate the colon deliminted string (import_data_fields) into a character array (fieldnamelist)
+ ! Note that the following call allocates the memory for fieldnamelist
+ call docn_get_import_fields(import_data_fields, fieldnamelist, rc)
+
+ ! Advertise import fields from datm, dice and med_aofluxes if appropriate
+ call dshr_fldList_add(fldsImport, trim(flds_scalar_name))
+ do n = 1,size(fieldnamelist)
+ if (trim(fieldnamelist(n)) == 'Faxa_bcph' .or. trim(fieldnamelist(n)) == 'Faxa_ocph') then
+ call dshr_fldList_add(fldsImport, trim(fieldnamelist(n)), ungridded_lbound=1, ungridded_ubound=3)
+ else if (trim(fieldnamelist(n)) == 'Faxa_dstwet' .or. trim(fieldnamelist(n)) == 'Faxa_dstdry') then
+ call dshr_fldList_add(fldsImport, trim(fieldnamelist(n)), ungridded_lbound=1, ungridded_ubound=4)
+ else
+ call dshr_fldList_add(fldsImport, trim(fieldnamelist(n)))
+ end if
+ end do
+
+ ! Deallocate memory from fieldnamelist
+ deallocate(fieldnamelist) ! this was allocated in docn_get_import_fields
+
+ fldlist => fldsImport ! the head of the linked list
+ do while (associated(fldlist))
+ call NUOPC_Advertise(importState, standardName=fldlist%stdname, rc=rc)
+ if (ChkErr(rc,__LINE__,u_FILE_u)) return
+ call ESMF_LogWrite('(docn_comp_advertise): To_ocn'//trim(fldList%stdname), ESMF_LOGMSG_INFO)
+ fldList => fldList%next
+ enddo
+
+ end subroutine docn_import_data_advertise
+
+
+ !===============================================================================
+ subroutine docn_get_import_fields(str, flds, rc)
+
+ ! input/output variables
+ character(len=*) , intent(in) :: str ! colon deliminted string to search
+ character(len=*) , allocatable , intent(out) :: flds(:) ! memory will be allocate for flds
+ integer , intent(out) :: rc
+ ! local variables
+ integer :: i,k,n ! generic indecies
+ integer :: nflds ! allocatable size of flds
+ integer :: count ! counts occurances of char
+ integer :: i0,i1 ! name = list(i0:i1)
+ integer :: nChar ! temporary
+ logical :: valid ! check if str is valid
+ !---------------------------------------
+
+ rc = ESMF_SUCCESS
+
+ ! check that this is a str is a valid colon dlimited list
+ valid = .true.
+ nChar = len_trim(str)
+ if (nChar < 1) then ! list is an empty string
+ valid = .false.
+ else if (str(1:1) == ':') then ! first char is delimiter
+ valid = .false.
+ else if (str(nChar:nChar) == ':') then ! last char is delimiter
+ valid = .false.
+ else if (index(trim(str)," ") > 0) then ! white-space in a field name
+ valid = .false.
+ end if
+ if (.not. valid) then
+ call ESMF_LogWrite("ERROR: invalid list = "//trim(str), ESMF_LOGMSG_ERROR)
+ rc = ESMF_FAILURE
+ return
+ end if
+ ! get number of fields in a colon delimited string list
+ nflds = 0
+ if (len_trim(str) > 0) then
+ count = 0
+ do n = 1, len_trim(str)
+ if (str(n:n) == ':') count = count + 1
+ end do
+ nflds = count + 1
+ endif
+ ! allocate memory for flds)
+ allocate(flds(nflds))
+ do k = 1,nflds
+ ! start with whole list
+ i0 = 1
+ i1 = len_trim(str)
+ ! remove field names before kth field
+ do n = 2,k
+ i = index(str(i0:i1),':')
+ i0 = i0 + i
+ end do
+ ! remove field names after kth field
+ if (k < nFlds) then
+ i = index(str(i0:i1),':')
+ i1 = i0 + i - 2
+ end if
+ ! set flds(k)
+ flds(k) = str(i0:i1)//" "
+ end do
+
+ end subroutine docn_get_import_fields
+
+end module docn_import_data_mod
diff --git a/docn/ocn_comp_nuopc.F90 b/docn/ocn_comp_nuopc.F90
index b32cce24..d885b248 100644
--- a/docn/ocn_comp_nuopc.F90
+++ b/docn/ocn_comp_nuopc.F90
@@ -53,6 +53,12 @@ module cdeps_docn_comp
use docn_datamode_aquaplanet_mod , only : docn_datamode_aquaplanet_advertise
use docn_datamode_aquaplanet_mod , only : docn_datamode_aquaplanet_init_pointers
use docn_datamode_aquaplanet_mod , only : docn_datamode_aquaplanet_advance
+ use docn_datamode_cplhist_mod , only : docn_datamode_cplhist_advertise
+ use docn_datamode_cplhist_mod , only : docn_datamode_cplhist_init_pointers
+ use docn_datamode_cplhist_mod , only : docn_datamode_cplhist_advance
+ use docn_datamode_cplhist_mod , only : docn_datamode_cplhist_restart_read
+ use docn_datamode_cplhist_mod , only : docn_datamode_cplhist_restart_write
+ use docn_import_data_mod , only : docn_import_data_advertise
implicit none
private ! except
@@ -182,6 +188,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
integer :: inst_index ! number of current instance (ie. 1)
integer :: nu ! unit number
integer :: ierr ! error code
+ character(len=CL) :: import_data_fields ! colon deliminted strings of input data fields
integer :: bcasttmp(3)
real(r8) :: rtmp(1)
type(ESMF_VM) :: vm
@@ -194,7 +201,8 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
namelist / docn_nml / datamode, &
model_meshfile, model_maskfile, &
- restfilm, nx_global, ny_global, sst_constant_value, skip_restart_read
+ restfilm, nx_global, ny_global, sst_constant_value, skip_restart_read, &
+ import_data_fields
rc = ESMF_SUCCESS
@@ -223,15 +231,17 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
end if
! write namelist input to standard out
- write(logunit,F00)' case_name = ',trim(case_name)
- write(logunit,F00)' datamode = ',trim(datamode)
- write(logunit,F00)' model_meshfile = ',trim(model_meshfile)
- write(logunit,F00)' model_maskfile = ',trim(model_maskfile)
- write(logunit,F01)' nx_global = ',nx_global
- write(logunit,F01)' ny_global = ',ny_global
- write(logunit,F00)' restfilm = ',trim(restfilm)
+ write(logunit,F00)' case_name = ',trim(case_name)
+ write(logunit,F00)' datamode = ',trim(datamode)
+ write(logunit,F00)' model_meshfile = ',trim(model_meshfile)
+ write(logunit,F00)' model_maskfile = ',trim(model_maskfile)
+ write(logunit,F01)' nx_global = ',nx_global
+ write(logunit,F01)' ny_global = ',ny_global
+ write(logunit,F00)' restfilm = ',trim(restfilm)
write(logunit,F02)' skip_restart_read = ',skip_restart_read
+ write(logunit,F00)' import_data_fields = ',trim(import_data_fields)
write(logunit,*) ' sst_constant_value = ',sst_constant_value
+
bcasttmp = 0
bcasttmp(1) = nx_global
bcasttmp(2) = ny_global
@@ -251,6 +261,8 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
call ESMF_VMBroadcast(vm, restfilm, CL, main_task, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
+ call ESMF_VMBroadcast(vm, import_data_fields, CL, main_task, rc=rc)
+ if (ChkErr(rc,__LINE__,u_FILE_u)) return
call ESMF_VMBroadcast(vm, bcasttmp, 3, main_task, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
@@ -263,7 +275,6 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
skip_restart_read = (bcasttmp(3) == 1)
sst_constant_value = rtmp(1)
-
! Special logic for prescribed aquaplanet
if (datamode(1:9) == 'sst_aquap' .and. trim(datamode) /= 'sst_aquap_constant') then
! First determine the prescribed aquaplanet option
@@ -282,6 +293,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
trim(datamode) == 'sst_aquap_file' .or. & ! read stream, no import data
trim(datamode) == 'som' .or. & ! read stream, needs import data
trim(datamode) == 'som_aquap' .or. & ! read stream, needs import data
+ trim(datamode) == 'cplhist' .or. & ! read stream, needs import data
trim(datamode) == 'sst_aquap_analytic' .or. & ! analytic, no streams, import or export data
trim(datamode) == 'sst_aquap_constant' ) then ! analytic, no streams, import or export data
! success do nothing
@@ -303,6 +315,14 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc)
else if (trim(datamode) == 'iaf') then
call docn_datamode_iaf_advertise(importState, exportState, fldsImport, fldsExport, flds_scalar_name, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
+ else if (trim(datamode) == 'cplhist') then
+ call docn_datamode_cplhist_advertise(exportState, fldsExport, flds_scalar_name, rc)
+ if (ChkErr(rc,__LINE__,u_FILE_u)) return
+ end if
+
+ if (trim(import_data_fields) /= 'none') then
+ call docn_import_data_advertise(importState, fldsImport, flds_scalar_name, import_data_fields, rc)
+ if (ChkErr(rc,__LINE__,u_FILE_u)) return
end if
end subroutine InitializeAdvertise
@@ -522,6 +542,9 @@ subroutine docn_comp_run(importState, exportState, clock, target_ymd, target_tod
case('sst_aquap_analytic', 'sst_aquap_constant')
call docn_datamode_aquaplanet_init_pointers(exportState, model_frac, rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
+ case('cplhist')
+ call docn_datamode_cplhist_init_pointers(exportState, model_frac, rc)
+ if (ChkErr(rc,__LINE__,u_FILE_u)) return
end select
! Read restart if needed
@@ -576,6 +599,9 @@ subroutine docn_comp_run(importState, exportState, clock, target_ymd, target_tod
case('sst_aquap_constant')
call docn_datamode_aquaplanet_advance(exportState, model_mesh, sst_constant_value=sst_constant_value, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
+ case('cplhist')
+ call docn_datamode_cplhist_advance(rc=rc)
+ if (ChkErr(rc,__LINE__,u_FILE_u)) return
end select
! Write restarts if needed (no restarts for aquaplanet analytic or aquaplanet input file)
@@ -590,6 +616,9 @@ subroutine docn_comp_run(importState, exportState, clock, target_ymd, target_tod
case('som','som_aquap')
call docn_datamode_som_restart_write(case_name, inst_suffix, target_ymd, target_tod, &
logunit, my_task, sdat)
+ case('cplhist')
+ call docn_datamode_cplhist_restart_write(case_name, inst_suffix, target_ymd, target_tod, &
+ logunit, my_task, sdat)
end select
end if
diff --git a/drof/cime_config/namelist_definition_drof.xml b/drof/cime_config/namelist_definition_drof.xml
index 846139e1..88a3493b 100644
--- a/drof/cime_config/namelist_definition_drof.xml
+++ b/drof/cime_config/namelist_definition_drof.xml
@@ -10,17 +10,17 @@
streams_file
List of streams used for the given drof_mode.
- rof.cplhist
+ rof.cplhist
rof.diatren_ann_rx1
rof.diatren_ann_ais00_rx1
rof.diatren_ann_ais45_rx1
rof.diatren_ann_ais55_rx1
- rof.diatren_iaf_ais00_rx1
rof.diatren_iaf_rx1
+ rof.diatren_iaf_ais00_rx1
rof.diatren_iaf_ais45_rx1
rof.diatren_iaf_ais55_rx1
- rof.iaf_jra_1p4_2018
rof.iaf_jra
+ rof.iaf_jra_1p4_2018
rof.ryf8485_jra
rof.ryf9091_jra
rof.ryf0304_jra
diff --git a/streams/dshr_strdata_mod.F90 b/streams/dshr_strdata_mod.F90
index 9e7083e0..ce39cc7c 100644
--- a/streams/dshr_strdata_mod.F90
+++ b/streams/dshr_strdata_mod.F90
@@ -1009,11 +1009,11 @@ subroutine shr_strdata_advance(sdat, ymd, tod, logunit, istr, timers, rc)
if ((sdat%pstrm(ns)%dtmax/sdat%pstrm(ns)%dtmin) > sdat%stream(ns)%dtlimit) then
if (sdat%mainproc) then
- write(sdat%stream(1)%logunit,*) trim(subname),' ERROR: for stream ',ns
- write(sdat%stream(1)%logunit,*) trim(subname),' ERROR: dday = ',dday
- write(sdat%stream(1)%logunit,*) trim(subName),' ERROR: dtime, dtmax, dtmin, dtlimit = ',&
+ write(sdat%stream(1)%logunit,'(a,i8)') trim(subname),' ERROR: for stream ',ns
+ write(sdat%stream(1)%logunit,'(a,i8)') trim(subname),' ERROR: dday = ',dday
+ write(sdat%stream(1)%logunit,'(a,4(f15.5,2x))') trim(subName),' ERROR: dtime, dtmax, dtmin, dtlimit = ',&
dtime, sdat%pstrm(ns)%dtmax, sdat%pstrm(ns)%dtmin, sdat%stream(ns)%dtlimit
- write(sdat%stream(1)%logunit,*) trim(subName),' ERROR: ymdLB, todLB, ymdUB, todUB = ', &
+ write(sdat%stream(1)%logunit,'(a,4(i10,2x))') trim(subName),' ERROR: ymdLB, todLB, ymdUB, todUB = ', &
sdat%pstrm(ns)%ymdLB, sdat%pstrm(ns)%todLB, sdat%pstrm(ns)%ymdUB, sdat%pstrm(ns)%todUB
end if
write(6,*) trim(subname),' ERROR: for stream ',ns, ' and calendar ',trim(calendar)