Skip to content

Commit cc926a5

Browse files
committed
Update the docs
1 parent 0dbed08 commit cc926a5

File tree

3 files changed

+90
-4
lines changed

3 files changed

+90
-4
lines changed

docs/source/parameters.rst

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ be overridden by parameters set in a ``[[subsection]``.
1212
Note that some parameters will be overriden by defaults if you define them too high up in the inheritance hierarchy.
1313

1414
See `this release's parameter defaults <https://github.com/E3SM-Project/zppy/blob/bfbba5f9c3794cd7e399e35f8153866b1c8f6910/zppy/defaults/default.ini>`_
15-
on GitHub for a complete list of parameters and their default values.
16-
You can also view the most up-to-date,
15+
on GitHub for a complete list of parameters and their default values.
16+
You can also view the most up-to-date,
1717
`unreleased parameter defaults <https://github.com/E3SM-Project/zppy/blob/main/zppy/templates/default.ini>`_.
1818

1919
Deprecated parameters
@@ -61,6 +61,33 @@ For the ``e3sm_diags`` task:
6161
* If ``reference_data_path`` (the path to the reference data) is undefined, assume it is the ``diagnostics_base_path`` from Mache plus ``/observations/Atm/climatology/``. (So, it is important to change this for model-vs-model runs).
6262

6363

64+
For the ``mpas_analysis`` task:
65+
66+
* ``reference_data_path`` and ``test_data_path`` are optional and are only used for model-vs-model comparisons.
67+
If provided, ``zppy`` uses them to locate the MPAS-Analysis config files from a *previous* MPAS-Analysis run and passes those through to MPAS-Analysis as ``controlRunConfigFile`` (reference) and ``mainRunConfigFile`` (test).
68+
69+
.. note::
70+
These parameter names are intentionally consistent with the terminology used by ``e3sm_diags`` for model-vs-model runs: in both cases, ``reference_data_path`` identifies the *reference simulation's zppy-generated outputs*.
71+
72+
The practical difference is what each downstream tool consumes:
73+
``e3sm_diags`` needs ``reference_data_path`` to be the specific directory containing the reference climatology files (typically under the reference run's ``post/.../clim`` tree), whereas ``mpas_analysis`` needs to find the reference MPAS-Analysis config file.
74+
For MPAS-Analysis, ``zppy`` can resolve that config file when ``reference_data_path`` points to the prior run's zppy output directory (the one containing ``post/``), the ``post/`` directory itself, or directly to an ``mpas_analysis_*.cfg`` file.
75+
76+
``reference_data_path`` is intended to point to the prior run's zppy output directory (the one containing ``post/``) but zppy will also find the MPAS-Analysis config file if ``reference_data_path`` points to the ``post/`` directory itself, the MPAS-Analysis directory (``analysis/mpas_analysis``), the ``cfg/`` directory, or directly to an ``mpas_analysis_*.cfg`` file.
77+
78+
79+
**MPAS-Analysis model-vs-model year ranges**
80+
81+
MPAS-Analysis comparisons are configured by year ranges, similar to other ``zppy`` tasks.
82+
For model-vs-model comparisons, ``zppy`` supports separate year ranges for the test and reference runs:
83+
84+
* ``ts_years``, ``climo_years``, ``enso_years`` define the test run year ranges.
85+
* ``ref_ts_years``, ``ref_climo_years``, ``ref_enso_years`` optionally override the reference run year ranges.
86+
87+
If a ``ref_*_years`` parameter is not provided, it defaults to the corresponding test year ranges.
88+
If a ``ref_*_years`` parameter contains a single range and multiple test ranges are requested, the single reference range is used for each test range.
89+
90+
6491
For the ``ilamb`` task:
6592

6693
* If ``ilamb_obs`` (the path to observation data for ``ilamb``) is undefined, assume it is the ``diagnostics_base_path`` from Mache plus ``/ilamb_data``.
@@ -76,7 +103,7 @@ There are many parameter-handling functions.
76103

77104
In ``utils.py``:
78105

79-
* ``get_value_from_parameter``: check if parameter is in the configuration dictionary. If not, if inference is turned on (the default), then just use the value of ``second_choice_parameter``. If inferenceis turned off, raise a ``ParameterNotProvidedError``. Use this function if the backup option
106+
* ``get_value_from_parameter``: check if parameter is in the configuration dictionary. If not, if inference is turned on (the default), then just use the value of ``second_choice_parameter``. If inferenceis turned off, raise a ``ParameterNotProvidedError``. Use this function if the backup option
80107
* ``set_value_of_parameter_if_undefined``: check if parameter is in the configuration dictionary. If not, if inferenceis turned on (the default), then just set the parameter's value to the ``backup_option``. If inferenceis turned off, raise a ``ParameterNotProvidedError``.
81108

82109
In ``e3sm_diags.py``:
@@ -85,6 +112,6 @@ In ``e3sm_diags.py``:
85112
* ``check_set_specific_parameter``: if any requested ``e3sm_diags`` sets require this parameter, make sure it is present. If not, raise a ``ParameterNotProvidedError``.
86113
* ``check_parameters_for_bash``: use ``check_set_specific_parameter`` to check the existence of parameters that aren't used until the bash script.
87114
* ``check_mvm_only_parameters_for_bash``: similar, but these are specifically parameters used for model-vs-model runs. Uses ``check_parameter_defined`` in addition to ``check_set_specific_parameter``.
88-
* ``check_and_define_parameters``: make sure all parameters are defined, using ``utils.py get_value_from_parameter``, ``utils.py set_value_of_parameter_if_undefined``, and ``check_mvm_only_parameters_for_bash``.
115+
* ``check_and_define_parameters``: make sure all parameters are defined, using ``utils.py get_value_from_parameter``, ``utils.py set_value_of_parameter_if_undefined``, and ``check_mvm_only_parameters_for_bash``.
89116

90117
``check_parameters_for_bash`` can be run immediately for each subtask because it has very few conditions. Other checks are included in ``check_and_define_parameters`` later on in the code.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
[default]
2+
input = <test simulation input>
3+
# Where the `post/` directory will be written
4+
output = <test simulation output>
5+
case = <test case name>
6+
www = <www>
7+
partition = <partition>
8+
9+
# MPAS-Analysis: model vs. model ("test" vs. "reference")
10+
[mpas_analysis]
11+
active = True
12+
walltime = "4:00:00"
13+
parallelTaskCount = 6
14+
mesh = "EC30to60E2r2"
15+
shortTermArchive = True
16+
17+
# Test run year ranges (these determine the identifier used for the generated
18+
# MPAS-Analysis cfg: mpas_analysis_ts_<ts>_climo_<climo>.cfg)
19+
ts_years = "1850-2014",
20+
climo_years = "1985-2014",
21+
enso_years = "1850-2014",
22+
23+
# Point at a *previous zppy run output directory* for the reference simulation.
24+
# zppy will locate the matching MPAS-Analysis cfg file under (typical):
25+
# <reference_data_path>/post/analysis/mpas_analysis/cfg/
26+
# You may also point at the `post/` directory, `analysis/mpas_analysis`, the `cfg/`
27+
# directory, or directly at an mpas_analysis_*.cfg file.
28+
reference_data_path = <reference zppy output directory>
29+
30+
# Optional: point at a previous zppy output directory for the test simulation,
31+
# if you want MPAS-Analysis to reuse a completed test run as well.
32+
# test_data_path = <test zppy output directory>
33+
34+
# Optional: override the reference year ranges (defaults to the test ranges).
35+
# If you provide a single range, it will be reused for each test range.
36+
# ref_ts_years = "451-500",
37+
# ref_climo_years = "451-500",
38+
# ref_enso_years = "451-500",

docs/source/tutorial.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,27 @@ This is another example of a configuration file, this time using a RRM simulatio
5858
:language: cfg
5959
:linenos:
6060

61+
62+
Example 3
63+
=========
64+
65+
MPAS-Analysis model vs. model
66+
-----------------------------
67+
68+
MPAS-Analysis supports "main vs. control" (model-vs-model) comparisons.
69+
In ``zppy``, this is configured in the ``[mpas_analysis]`` section using
70+
``reference_data_path`` (and optionally ``test_data_path``), consistent with the
71+
terminology used for ``e3sm_diags`` model-vs-model runs.
72+
73+
Unlike ``e3sm_diags`` (where ``run_type = "model_vs_model"`` and ``reference_data_path``
74+
points directly at reference climatology output), MPAS-Analysis comparisons are driven
75+
by MPAS-Analysis config files. For model-vs-model mode, ``zppy`` locates the matching
76+
config file(s) from prior MPAS-Analysis output and passes them to MPAS-Analysis.
77+
78+
.. literalinclude:: post.mpas_analysis_model_vs_model.cfg
79+
:language: cfg
80+
:linenos:
81+
6182
Debugging failures
6283
==================
6384

0 commit comments

Comments
 (0)