Skip to content

Commit c99048a

Browse files
authored
Merge pull request #165 from billsacks/versioned_docs_cesm21
Update documentation format to versioned documentation - for cesm2.1 Description of changes Similar to #164 but for cesm2.1-alphabranch. Also updates documentation source on cesm2.1-alphabranch to bring in changes that were made on master. Specific notes Contributors other than yourself, if any: none Fixes: none User interface changes?: No Testing performed (automated tests and/or manual tests): none
2 parents 825b0e2 + 0b230aa commit c99048a

File tree

9 files changed

+116
-39
lines changed

9 files changed

+116
-39
lines changed

doc/README

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,35 @@
1+
2+
This requires Sphinx v1.7 or greater, as well as some add-ons, which can
3+
be installed with:
4+
5+
pip install sphinx
6+
pip install sphinxcontrib-programoutput
7+
pip install git+https://github.com/esmci/sphinx_rtd_theme.git@version-dropdown-with-fixes
8+
9+
Check the sphinx version as follows:
10+
11+
>sphinx-build --version
12+
13+
The documentation source is stored with the CESM master code base. However,
14+
the built html files are stored separately in the orphan gh-pages branch
15+
and can be viewed from a browser at URL:
16+
17+
http://escomp.github.io/cesm
18+
19+
Details for working with the documentation are contained in the following
20+
wiki page:
21+
22+
https://github.com/ESMCI/cime/wiki/Working-with-Sphinx-and-reStructuredText
23+
24+
(The procedure is the same for the CESM documentation as for the CIME
25+
documentation.)
26+
127
Use the following commands to auto-build the html documentation from the main
228
cesm/doc directory:
329

4-
>make clean
5-
>make html
6-
7-
The build/html files should be copied to the appropriate release or
8-
development https://github.com/ESCOMP/cesm gh-pages orphan branch
9-
subdirectory and commited to that branch separately.
30+
make clean
31+
make html
1032

11-
Only the doc/source files are stored with the code on the master
12-
branch.
33+
To publish the docs to the orphan gh-pages branch, follow the steps in
34+
https://github.com/ESMCI/cime/wiki/Working-with-Sphinx-and-reStructuredText
35+
to ensure proper versioning of the documentation.

doc/source/_static/pop_ver.js

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
$(document).ready(function() {
2+
/* For a URL that looks like
3+
https://blah.github.io/versions/VERSIONFOO/html/bar/index.html, set cur_version_dir to
4+
'VERSIONFOO' (i.e., the portion of the path following 'versions').
5+
*/
6+
var proj_end = document.baseURI.indexOf("versions") + 9;
7+
var end = document.baseURI.indexOf("/", proj_end);
8+
var cur_version_dir = document.baseURI.substring(proj_end, end);
9+
var mylist = $("#version-list");
10+
mylist.empty();
11+
$.getJSON(version_json_loc, function(data) {
12+
if (data.hasOwnProperty(cur_version_dir)) {
13+
/* First add the current version so that it appears first in the drop-down
14+
menu and starts as the selected element of the menu. If you click on the
15+
current version, you should stay at the current page.
16+
17+
The conditional around this block should generally be true, but we check it
18+
just in case the current version is missing from the versions.json file for
19+
some reason.
20+
*/
21+
cur_version_name = data[cur_version_dir];
22+
mylist.append($("<option>", {value: document.baseURI, text: cur_version_name}));
23+
}
24+
// Now add the other versions
25+
$.each(data, function(version_dir, version_name) {
26+
if (version_dir != cur_version_dir) {
27+
/* If you click on a different version, you should go to the root of the
28+
documentation for that version. This assumes paths like
29+
https://blah.github.io/versions/VERSIONFOO/html/bar/index.html. So we
30+
need to go up two levels from the URL_ROOT (html) to then go back down
31+
into the appropriate version's html directory.
32+
*/
33+
mylist.append($("<option>", {value: DOCUMENTATION_OPTIONS.URL_ROOT + '../../' + version_dir + '/html', text: version_name}));
34+
}
35+
});
36+
});
37+
});

doc/source/_templates/footer.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{% extends "!footer.html" %}
2+
{% block extrafooter %}
3+
{{ super() }}
4+
<script>var version_json_loc = "{{ pathto('../../versions.json', 1) }}";</script>
5+
{% endblock %}

doc/source/_templates/layout.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{% extends "!layout.html" %}
2+
3+
{% set script_files = script_files + ["_static/pop_ver.js"] %}

doc/source/cesm_configurations.rst

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ a science and technical perspective. CESM supports numerous
1212
<http://www.cesm.ucar.edu/models/cesm2/cesm/compsets.html>`_. In
1313
addition, each model component has input options to configure specific
1414
`model settings
15-
<http://www.cesm.ucar.edu/models/cesm2/component_xml/index.html>`_
15+
<http://www.cesm.ucar.edu/models/cesm2/settings/current>`_
1616
and `parameterizations
17-
<http://www.cesm.ucar.edu/models/cesm2/component_namelists/index.html>`_.
17+
<http://www.cesm.ucar.edu/models/cesm2/settings/current>`_.
1818

1919

2020
CESM2 Components
@@ -35,7 +35,7 @@ and an external system processing component
3535
- external system processing (esp)
3636

3737
In addition CESM2 is accompanied by a `driver/coupler (cpl7)
38-
<http://esmci.github.io/cime/driver_cpl/index.html>`_ that coordinates
38+
<http://esmci.github.io/cime/versions/master/html/driver_cpl/index.html>`_ that coordinates
3939
the time evolution of geophysical components and periodically permits
4040
the components to exchange data. Each component is represented in one
4141
of several modes: "active," "data," "dead," or "stub" that permits the
@@ -73,32 +73,32 @@ The CESM2 components can be summarized as follows:
7373
:widths: 12, 10, 10, 10, 60
7474

7575
"atmosphere","atm","cam", "active","The `Community Atmosphere Model (CAM) <http://www.cesm.ucar.edu/models/cesm2/atmosphere/>`_ is a global atmospheric general circulation model developed from the NCAR CCM3."
76-
"atmosphere","atm","datm", "data", "The `data atmosphere <http://esmci.github.io/cime/data_models/data-atm.html>`_ component is a pure data component that reads in atmospheric forcing data"
76+
"atmosphere","atm","datm", "data", "The `data atmosphere <http://esmci.github.io/cime/versions/master/html/data_models/data-atm.html>`_ component is a pure data component that reads in atmospheric forcing data"
7777
"atmosphere","atm", "xatm", "dead", "Used only for testing the driver/coupler"
7878
"atmosphere","atm", "satm", "stub", "Used only to satisy the interface requirements"
7979
"land", "lnd", "clm", "active", "The `Community Land Model (CLM) <http://www.cesm.ucar.edu/models/cesm2/land/>`_ is the result of a collaborative project between scientists in the Terrestrial Sciences Section of the Climate and Global Dynamics Division (CGD) at NCAR and the CESM Land Model Working Group. Other principal working groups that also contribute to the CLM are Biogeochemistry, Paleoclimate, and Climate Change and Assessment."
80-
"land", "lnd", "dlnd", "data", "The `data land component <http://esmci.github.io/cime/data_models/data-lnd.html>`_ is a purely data-land component (reading in coupler history data for atm/land fluxes and land albedos produced by a previous run, or snow surface mass balance fields) or both."
80+
"land", "lnd", "dlnd", "data", "The `data land component <http://esmci.github.io/cime/versions/master/html/data_models/data-lnd.html>`_ is a purely data-land component (reading in coupler history data for atm/land fluxes and land albedos produced by a previous run, or snow surface mass balance fields) or both."
8181
"land", "lnd", "xlnd", "dead", "Used only for testing the driver/coupler"
8282
"land", "lnd", "slnd", "stub", "Used only to satisy the interface requirements"
8383
"river", "rof", "rtm", "active", "The `river transport model (RTM) <http://www.cesm.ucar.edu/models/cesm2/river/>`_ was previously part of CLM and was developed to route total runoff from the land surface model to either the active ocean or marginal seas which enables the hydrologic cycle to be closed (Branstetter 2001, Branstetter and Famiglietti 1999). This is needed to model ocean convection and circulation, which is affected by freshwater input."
8484
"river", "rof", "mosart", "active", "`MOdel for Scale Adaptive River Transport (MOSART) <http://www.cesm.ucar.edu/models/cesm2/river/>`_ , a new large-scale river routing model. MOSART improves the magnitude and timing of river flow simulations."
85-
"river", "rof", "drof", "data", "The `data runoff model <http://esmci.github.io/cime/data_models/data-river.html>`_ was previously part of the data land model and functions as a purely data-runoff model (reading in runoff data)."
85+
"river", "rof", "drof", "data", "The `data runoff model <http://esmci.github.io/cime/versions/master/html/data_models/data-river.html>`_ was previously part of the data land model and functions as a purely data-runoff model (reading in runoff data)."
8686
"river", "rof", "xrof", "dead", "Used only for testing the driver/coupler"
8787
"river", "rof", "srof", "stub", "Used only to satisy the interface requirements"
8888
"ocean", "ocn", "pop", "active", "The ocean model is an extension of the `Parallel Ocean Program (POP) <http://www.cesm.ucar.edu/models/cesm2/ocean/>`_ Version 2 from Los Alamos National Laboratory (LANL)."
89-
"ocean", "ocn", "docn", "data", "The `data ocean <http://esmci.github.io/cime/data_models/data-ocean.html>`_ component has two distinct modes of operation. It can run as a pure data model, reading ocean SSTs (normally climatological) from input datasets, interpolating in space and time, and then passing these to the coupler. Alternatively, docn can compute updated SSTs based on a slab ocean model where bottom ocean heat flux convergence and boundary layer depths are read in and used with the atmosphere/ocean and ice/ocean fluxes obtained from the coupler."
89+
"ocean", "ocn", "docn", "data", "The `data ocean <http://esmci.github.io/cime/versions/master/html/data_models/data-ocean.html>`_ component has two distinct modes of operation. It can run as a pure data model, reading ocean SSTs (normally climatological) from input datasets, interpolating in space and time, and then passing these to the coupler. Alternatively, docn can compute updated SSTs based on a slab ocean model where bottom ocean heat flux convergence and boundary layer depths are read in and used with the atmosphere/ocean and ice/ocean fluxes obtained from the coupler."
9090
"ocean", "ocn", "xocn", "dead"
9191
"ocean", "ocn", "socn", "stub"
9292
"sea-ice", "ice", "cice", "active", "The `sea-ice component (CICE) <http://www.cesm.ucar.edu/models/cesm2/sea-ice/>`_ is an extension of the Los Alamos National Laboratory (LANL) sea-ice model and was developed though collaboration within the CESM Polar Climate Working Group (PCWG). In CESM, CICE can run as a fully prognostic component or in prescribed mode where ice coverage (normally climatological) is read in."
93-
"sea-ice", "ice", "dice", "data", "The `data ice <http://esmci.github.io/cime/data_models/data-seaice.html>`_ component is a partially prognostic model. The model reads in ice coverage and receives atmospheric forcing from the coupler, and then it calculates the ice/atmosphere and ice/ocean fluxes. The data ice component acts very similarly to CICE running in prescribed mode."
93+
"sea-ice", "ice", "dice", "data", "The `data ice <http://esmci.github.io/cime/versions/master/html/data_models/data-seaice.html>`_ component is a partially prognostic model. The model reads in ice coverage and receives atmospheric forcing from the coupler, and then it calculates the ice/atmosphere and ice/ocean fluxes. The data ice component acts very similarly to CICE running in prescribed mode."
9494
"sea-ice", "ice", "xice", "dead", "Used only for testing the driver/coupler"
9595
"sea-ice", "ice", "sice", "stub"
9696
"land-ice", "glc", "cism", "active", The `CISM component <http://www.cesm.ucar.edu/models/cesm2/land-ice/>`_ is an extension of the Glimmer ice sheet model.
9797
"land-ice", "glc", "sglc", "stub", "Used only to satisy the interface requirements"
9898
"ocean-wave", "wav", "wav", "ww3","The `ww3 <http://www.cesm.ucar.edu/models/cesm2/wave/>`_ component adds prognostic ocean waves to the system"
9999
"ocean-wave", "wav", "xwav", "dead", "Used only for testing the driver/coupler"
100100
"ocean-wave", "wav", "swav", "stub", "Used only to satisy the interface requirements"
101-
"coupler", "cpl", "cpl", "active", "The `CESM coupler <http://esmci.github.io/cime/driver_cpl/index.html>`_ was built primarily through a collaboration of the NCAR CESM Software Engineering Group and the Argonne National Laboratory (ANL). The MCT coupling library provides much of the infrastructure."
101+
"coupler", "cpl", "cpl", "active", "The `CESM coupler <http://esmci.github.io/cime/versions/master/html/driver_cpl/index.html>`_ was built primarily through a collaboration of the NCAR CESM Software Engineering Group and the Argonne National Laboratory (ANL). The MCT coupling library provides much of the infrastructure."
102102

103103

104104
CESM2 Component Sets
@@ -181,7 +181,7 @@ files to fill in information required for the target platform. This
181181
functionality is handy in accelerating the porting process and quickly
182182
getting a case running on a new platform. For more information on
183183
porting, see the `CIME porting guide
184-
<http://esmci.github.io/cime/users_guide/porting-cime.html>`_. The
184+
<http://esmci.github.io/cime/versions/master/html/users_guide/porting-cime.html>`_. The
185185
list of available machines are documented in `CESM supported machines
186186
<http://www.cesm.ucar.edu/models/cesm2/cesm/machines.html>`_.
187187
Running **query_config** with the ``--machines`` option will also show
@@ -204,7 +204,7 @@ These control runs should be scientifically reproducible on the
204204
original platform or other platforms. Bit-for-bit reproducibility
205205
cannot be guaranteed due to variations in compiler or system
206206
versions. Users should carry out their own `port validations
207-
<http://esmci.github.io/cime/users_guide/porting-cime.html#validating-your-port>`_
207+
<http://esmci.github.io/cime/versions/master/html/users_guide/porting-cime.html#validating-your-port>`_
208208
on any platform prior to doing scientific runs or scientific analysis
209209
and documentation.
210210

doc/source/conf.py

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
#
1919
import os
2020
import sys
21+
# Note that we need a specific version of sphinx_rtd_theme. This can be obtained with:
22+
# pip install git+https://github.com/esmci/sphinx_rtd_theme.git@version-dropdown-with-fixes
23+
import sphinx_rtd_theme
2124
sys.path.insert(0, os.path.abspath('../../manage_externals'))
2225

2326

@@ -53,17 +56,17 @@
5356

5457
# General information about the project.
5558
project = u'CESM'
56-
copyright = u'2018, U.S. National Science Foundation'
59+
copyright = u'2020, U.S. National Science Foundation'
5760
author = u'Staff of NSF/NCAR CESM Software Engineering Group'
5861

5962
# The version info for the project you're documenting, acts as replacement for
6063
# |version| and |release|, also used in various other places throughout the
6164
# built documents.
6265
#
6366
# The short X.Y version.
64-
version = u''
67+
version = u'CESM2.1'
6568
# The full version, including alpha/beta/rc tags.
66-
release = u''
69+
release = u'CESM2.1'
6770

6871
# The language for content autogenerated by Sphinx. Refer to documentation
6972
# for a list of supported languages.
@@ -89,18 +92,25 @@
8992
# The theme to use for HTML and HTML Help pages. See the documentation for
9093
# a list of builtin themes.
9194
#
92-
html_theme = 'classic'
95+
html_theme = 'sphinx_rtd_theme'
9396

9497
# Theme options are theme-specific and customize the look and feel of a theme
9598
# further. For a list of options available for each theme, see the
9699
# documentation.
97100
#
98-
html_theme_options = {"stickysidebar": "true"}
101+
# The 'versions' option needs to have at least two versions to work, but it doesn't need
102+
# to have all versions: others will be added dynamically. Note that this maps from version
103+
# names to html links. The current version can link to the current location (i.e., do
104+
# nothing). For the other version, we just add a place-holder; its name and value are
105+
# unimportant because these versions will get replaced dynamically.
106+
html_theme_options = {}
107+
html_theme_options['versions'] = {version: ''}
108+
html_theme_options['versions']['[placeholder]'] = ''
99109

100110
# Add any paths that contain custom static files (such as style sheets) here,
101111
# relative to this directory. They are copied after the builtin static files,
102112
# so a file named "default.css" will overwrite the builtin "default.css".
103-
html_static_path = []
113+
html_static_path = ['_static']
104114

105115

106116
# -- Options for HTMLHelp output ------------------------------------------

doc/source/downloading_cesm.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ Downloading the code and scripts
88
--------------------------------
99

1010
Starting with CESM2, releases are available through a public GitHub
11-
repository, `http://github.com/ESCOMP/cesm <http://github.com/ESCOMP/cesm>`_.
11+
repository, `http://github.com/ESCOMP/CESM <http://github.com/ESCOMP/CESM>`_.
1212

1313
Access to the code requires both git and Subversion client software in
1414
place that is compatible with GitHub and our Subversion server
1515
software. You will need access to the command line clients, ``git``
1616
(v1.8 or greater) and ``svn`` (v1.8 or greater but less than v1.11).
1717
Currently, our Subversion server
1818
software is at version 1.8.17. For more information or to download
19-
open source tools, visit `Subversion <http://subversion.tigris.org/>`_
19+
open source tools, visit `Subversion <http://subversion.apache.org/>`_
2020
and `git downloads <https://git-scm.com/downloads>`_.
2121

2222
With valid git and svn clients installed on the machine where CESM will be
@@ -25,7 +25,7 @@ code:
2525

2626
.. code-block:: console
2727
28-
git clone -b release-cesm2.1.0 https://github.com/ESCOMP/cesm.git my_cesm_sandbox
28+
git clone -b release-cesm2.1.3 https://github.com/ESCOMP/CESM.git my_cesm_sandbox
2929
cd my_cesm_sandbox
3030
3131
To checkout a previous version of CESM, first view the available versions:
@@ -51,7 +51,7 @@ The **checkout_externals** script will read the configuration file called ``Exte
5151
will download all the external component models and CIME into /path/to/my_cesm_sandbox.
5252

5353
Details regarding the CESM checkout process are available in the CESM GitHub repo
54-
`README <http://github.com/ESCOMP/cesm/blob/master/README.rst>`_
54+
`README <http://github.com/ESCOMP/CESM/blob/master/README.rst>`_
5555
To see more details regarding the checkout_externals script from the command line, type:
5656

5757
.. code-block:: console

doc/source/introduction.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ into the Earth's past, present, and future climate states.
6666
CESM can be run on a number of different `hardware platforms
6767
<http://www.cesm.ucar.edu/models/cesm2/cesm/machines.html>`__, and
6868
has a relatively flexible design with respect to `processor layout
69-
<http://esmci.github.io/cime/users_guide/pes-threads.html>`__
69+
<http://esmci.github.io/cime/versions/master/html/users_guide/pes-threads.html>`__
7070
of components.
7171

7272
The CESM project is a cooperative effort among U.S. climate
@@ -113,7 +113,7 @@ installing and running CESM2.
113113

114114
- `pnetcdf 1.7.0 is required and 1.8.1 is optional but recommended <http://trac.mcs.anl.gov/projects/parallel-netcdf/>`_
115115

116-
- `Trilinos <http://trilinos.gov/>`_ may be required for certain configurations
116+
- `Trilinos <https://trilinos.github.io/>`_ may be required for certain configurations
117117

118118
- `LAPACK <http://www.netlib.org/lapack/>`_ and `BLAS <http://www.netlib.org/blas/>`_
119119

0 commit comments

Comments
 (0)