Skip to content

Commit 1634138

Browse files
authored
Merge pull request #625 from MPAS-Dev/develop
Merge develop to master for v1.2.5 release
2 parents b87d99b + df05a5f commit 1634138

63 files changed

Lines changed: 3082 additions & 442 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ All platforms:
3030

3131
MPAS-Analysis is available as an anaconda package via the `conda-forge` channel:
3232

33-
``` bash
33+
```
3434
conda config --add channels conda-forge
3535
conda create -n mpas-analysis mpas-analysis
3636
conda activate mpas-analysis
@@ -58,14 +58,15 @@ environment with the following packages:
5858
* shapely
5959
* cartopy
6060
* geometric\_features
61+
* gsw
6162

6263
These can be installed via the conda command:
63-
``` bash
64+
```
6465
conda config --add channels conda-forge
65-
conda create -n mpas-analysis numpy scipy matplotlib netCDF4 \
66-
xarray dask bottleneck basemap lxml nco>=4.8.1 pyproj pillow \
67-
cmocean progressbar2 requests setuptools shapely cartopy \
68-
geometric_features
66+
conda create -n mpas-analysis python=3.7 numpy scipy "matplotlib>=3.0.2" \
67+
netCDF4 "xarray>=0.10.0" dask bottleneck basemap lxml "nco>=4.8.1" pyproj \
68+
pillow cmocean progressbar2 requests setuptools shapely cartopy \
69+
geometric_features gsw
6970
conda activate mpas-analysis
7071
```
7172

@@ -78,13 +79,13 @@ Then, get the code from:
7879
If you installed the `mpas-analysis` package, download the data that is
7980
necessary to MPAS-Analysis by running:
8081

81-
``` bash
82+
```
8283
download_analysis_data -o /path/to/mpas_analysis/diagnostics
8384
```
8485

8586
If you are using the git repository, run:
8687

87-
``` bash
88+
```
8889
./download_analysis_data.py -o /path/to/mpas_analysis/diagnostics
8990
```
9091

@@ -121,13 +122,13 @@ should see a warning that the data are being downloaded.
121122
**Note**: If you are having issues downloading the shape files (e.g., a time out error or forbidden error), follow these steps:
122123

123124
1. Run the following in python on your local machine (i.e., one that has no trouble downloading these files):
124-
```python
125+
```
125126
import cartopy.io.shapereader as shpreader
126127
for name in ['ocean', 'coastline', 'land']:
127128
shpfilename = shpreader.natural_earth(resolution='110m',
128129
category='physical',
129130
name=name)
130-
reader = shpreader.Reader(shpfilename)
131+
shpreader.Reader(shpfilename)
131132
```
132133
2. On your local machine, run `python -c "import cartopy; print(cartopy.config['data_dir'])"`. This will print out the directory in which the natural earth shapefiles are being placed locally.
133134
3. Copy these files onto the remote machine you are working on. Include folders `shapefiles/natural_earth/physical/*` where `*` is the set of shapefiles that were downloaded.
@@ -140,12 +141,12 @@ for name in ['ocean', 'coastline', 'land']:
140141
If you installed the `mpas-analysis` package, list the available analysis tasks
141142
by running:
142143

143-
``` bash
144+
```
144145
mpas_analysis --list
145146
```
146147

147148
If using a git repository, run:
148-
``` bash
149+
```
149150
python -m mpas_analysis --list
150151
```
151152

@@ -228,13 +229,13 @@ To purge old analysis (delete the whole output directory) before running run
228229
the analysis, add the `--purge` flag. If you installed `mpas-analysis` as
229230
a package, run:
230231

231-
``` bash
232+
```
232233
mpas_analysis --purge <config.file>
233234
```
234235

235236
If you are running in the repo, use:
236237

237-
``` bash
238+
```
238239
python -m mpas_analysis --purge <config.file>
239240
```
240241

@@ -300,7 +301,7 @@ within the `mpas_analysis/shared` directory.
300301
`build_analysis_list`, see below.
301302

302303
A new analysis task can be added with:
303-
```python
304+
```
304305
analyses.append(<component>.MyTask(config, myArg='argValue'))
305306
```
306307
This will add a new object of the `MyTask` class to a list of analysis tasks
@@ -314,10 +315,15 @@ to be generated and is set up properly.
314315
## Generating Documentation
315316

316317
To generate the `sphinx` documentation, run:
317-
```bash
318+
```
319+
conda config --add channels conda-forge
320+
conda remove -y --all -n mpas-analysis-docs
318321
conda env create -f docs/environment.yml
322+
conda install -y -n mpas-analysis-docs mock pillow sphinx sphinx_rtd_theme
319323
conda activate mpas-analysis-docs
320-
python setup.py install
324+
pip install .
325+
rm -rf build dist mpas_analysis.egg-info
321326
cd docs
327+
make clean
322328
make html
323329
```

ci/requirements.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ dependencies:
2121
- shapely
2222
- cartopy
2323
- geometric_features
24+
- gsw
Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
[runs]
2+
## options related to the run to be analyzed and control runs to be
3+
## compared against
4+
5+
# mainRunName is a name that identifies the simulation being analyzed.
6+
mainRunName = 20190711.testLuke.A_WCYCL1850S.ne30_oECv3.compy
7+
8+
# config file for a control run to which this run will be compared. The
9+
# analysis should have already been run to completion once with this config
10+
# file, so that the relevant MPAS climatologies already exist and have been
11+
# remapped to the comparison grid. Leave this option commented out if no
12+
# control run is desired.
13+
# controlRunConfigFile = /path/to/config/file
14+
15+
# config file for a main run on which the analysis was already run to
16+
# completion. The relevant MPAS climatologies already exist and have been
17+
# remapped to the comparison grid and time series have been extracted.
18+
# Leave this option commented out if the analysis for the main run should be
19+
# performed.
20+
mainRunConfigFile = config.GM_20190605_GMtest_Kappa3d_vary_c2_intel.compy
21+
22+
[execute]
23+
## options related to executing parallel tasks
24+
25+
# the number of parallel tasks (1 means tasks run in serial, the default)
26+
parallelTaskCount = 6
27+
28+
# the parallelism mode in ncclimo ("serial" or "bck")
29+
# Set this to "bck" (background parallelism) if running on a machine that can
30+
# handle 12 simultaneous processes, one for each monthly climatology.
31+
ncclimoParallelMode = bck
32+
33+
[diagnostics]
34+
## config options related to observations, mapping files and region files used
35+
## by MPAS-Analysis in diagnostics computations.
36+
37+
# The base path to the diagnostics directory. Typically, this will be a shared
38+
# directory on each E3SM supported machine (see the example config files for
39+
# its location). For other machines, this would be the directory pointed to
40+
# when running "download_analysis_data.py" to get the public observations,
41+
# mapping files and region files.
42+
baseDirectory = /compyfs/diagnostics
43+
44+
[input]
45+
## options related to reading in the results to be analyzed
46+
47+
# directory containing model results
48+
baseDirectory = /compyfs/wolf966/e3sm_scratch/20190711.testLuke.A_WCYCL1850S.ne30_oECv3.compy/run
49+
50+
# names of ocean and sea ice meshes (e.g. oEC60to30v3, oQU240v3, oRRS30to10v3, etc.)
51+
mpasMeshName = oEC60to30v3
52+
53+
# names of namelist and streams files, either a path relative to baseDirectory
54+
# or an absolute path.
55+
#oceanNamelistFileName = mpas-o_in
56+
#oceanStreamsFileName = streams.ocean
57+
#seaIceNamelistFileName = mpas-cice_in
58+
#seaIceStreamsFileName = streams.cice
59+
60+
[output]
61+
## options related to writing out plots, intermediate cached data sets, logs,
62+
## etc.
63+
64+
# directory where analysis should be written
65+
baseDirectory = /path/to/output/directory
66+
67+
# Anvil doesn't have direct access to a web portal, so output will need
68+
# to be copied elsewhere (e.g. NERSC web portal)
69+
htmlSubdirectory = html
70+
71+
# a list of analyses to generate. Valid names can be seen by running:
72+
# mpas_analysis --list
73+
# This command also lists tags for each analysis.
74+
# Shortcuts exist to generate (or not generate) several types of analysis.
75+
# These include:
76+
# 'all' -- all analyses will be run
77+
# 'all_<tag>' -- all analysis with a particular tag will be run
78+
# 'all_<component>' -- all analyses from a given component (either 'ocean'
79+
# or 'seaIce') will be run
80+
# 'only_<component>', 'only_<tag>' -- all analysis from this component or
81+
# with this tag will be run, and all
82+
# analysis for other components or
83+
# without the tag will be skipped
84+
# 'no_<task_name>' -- skip the given task
85+
# 'no_<component>', 'no_<tag>' -- in analogy to 'all_*', skip all analysis
86+
# tasks from the given compoonent or with
87+
# the given tag. Do
88+
# mpas_analysis --list
89+
# to list all task names and their tags
90+
# an equivalent syntax can be used on the command line to override this
91+
# option:
92+
# mpas_analysis config.analysis --generate \
93+
# all,no_ocean,all_timeSeries
94+
# All tasks with tag "landIceCavities" are disabled because this run did not
95+
# include land-ice cavities.
96+
generate = ['all', 'no_landIceCavities', 'no_eke', 'no_BGC', 'no_icebergs',
97+
'no_min', 'no_max']
98+
99+
[climatology]
100+
## options related to producing climatologies, typically to compare against
101+
## observations and previous runs
102+
103+
# the first year over which to average climatalogies
104+
startYear = 31
105+
# the last year over which to average climatalogies
106+
endYear = 40
107+
108+
[timeSeries]
109+
## options related to producing time series plots, often to compare against
110+
## observations and previous runs
111+
112+
# start and end years for timeseries analysis. Using out-of-bounds values
113+
# like start_year = 1 and end_year = 9999 will be clipped to the valid range
114+
# of years, and is a good way of insuring that all values are used.
115+
startYear = 1
116+
endYear = 40
117+
118+
[index]
119+
## options related to producing nino index.
120+
121+
# start and end years for the nino 3.4 analysis. Using out-of-bounds values
122+
# like start_year = 1 and end_year = 9999 will be clipped to the valid range
123+
# of years, and is a good way of insuring that all values are used.
124+
# For valid statistics, index times should include at least 30 years
125+
startYear = 1
126+
endYear = 9999
127+
128+
[streamfunctionMOC]
129+
## options related to plotting the streamfunction of the meridional overturning
130+
## circulation (MOC)
131+
132+
# Use postprocessing script to compute the MOC? You want this to be True
133+
# for low-resolution simulations that use GM to parameterize eddies, because
134+
# the online MOC analysis member currently does not include the bolus velocity
135+
# in its calculation, whereas the postprocessing script does.
136+
# NOTE: this is a temporary option that will be removed once the online
137+
# MOC takes into account the bolus velocity when GM is on.
138+
usePostprocessingScript = True
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/bin/bash -l
2+
# This software is open source software available under the BSD-3 license.
3+
#
4+
# Copyright (c) 2019 Triad National Security, LLC. All rights reserved.
5+
# Copyright (c) 2019 Lawrence Livermore National Security, LLC. All rights
6+
# reserved.
7+
# Copyright (c) 2019 UT-Battelle, LLC. All rights reserved.
8+
#
9+
# Additional copyright and license information can be found in the LICENSE file
10+
# distributed with this code, or at
11+
# https://raw.githubusercontent.com/MPAS-Dev/MPAS-Analysis/master/LICENSE
12+
13+
#SBATCH --nodes=1
14+
#SBATCH --time=1:00:00
15+
#SBATCH --account=e3sm
16+
#SBATCH --job-name=mpas_analysis
17+
#SBATCH --output=mpas_analysis.o%j
18+
#SBATCH --error=mpas_analysis.e%j
19+
20+
cd $SLURM_SUBMIT_DIR
21+
export OMP_NUM_THREADS=1
22+
23+
source /compyfs/software/e3sm-unified/load_latest_e3sm_unified.sh
24+
export HDF5_USE_FILE_LOCKING=FALSE
25+
26+
# MPAS/ACME job to be analyzed, including paths to simulation data and
27+
# observations. Change this name and path as needed
28+
run_config_file="config.run_name_here"
29+
30+
if [ ! -f $run_config_file ]; then
31+
echo "File $run_config_file not found!"
32+
exit 1
33+
fi
34+
35+
# if using the mpas_analysis conda package instead of the git repo, remove
36+
# "python -m"
37+
38+
srun -N 1 -n 1 python -m mpas_analysis $run_config_file
39+

docs/analysis_tasks.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Analysis Tasks
1515
tasks/climatologyMapBGC
1616
tasks/climatologyMapArgoTemperature
1717
tasks/climatologyMapArgoSalinity
18+
tasks/climatologyMapWoa
1819
tasks/climatologyMapSchmidtko
1920
tasks/climatologyMapAntarcticMelt
2021

@@ -31,6 +32,7 @@ Analysis Tasks
3132
tasks/soseTransects
3233
tasks/geojsonTransects
3334
tasks/oceanRegionalProfiles
35+
tasks/regionalTSDiagrams
3436

3537
tasks/climatologyMapSeaIceConcNH
3638
tasks/climatologyMapSeaIceThickNH

docs/api.rst

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ more details and examples, refer to the relevant chapters in the main part of
77
the documentation.
88

99
Top-level script: mpas_analysis
10-
===================================
10+
===============================
1111

1212
.. currentmodule:: mpas_analysis.__main__
1313

@@ -21,8 +21,17 @@ Top-level script: mpas_analysis
2121
update_generate
2222
run_analysis
2323
wait_for_task
24-
download_analysis_data
24+
25+
Downloading data
26+
================
27+
28+
.. currentmodule:: mpas_analysis.download_data
29+
30+
.. autosummary::
31+
:toctree: generated/
2532

33+
download_analysis_data
34+
download_natural_earth_110m
2635

2736
Analysis tasks
2837
==============

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@
7676
# built documents.
7777
#
7878
# The short X.Y version.
79-
version = u'1.2.4'
79+
version = u'1.2.5'
8080
# The full version, including alpha/beta/rc tags.
81-
release = u'1.2.4'
81+
release = u'1.2.5'
8282

8383
# The language for content autogenerated by Sphinx. Refer to documentation
8484
# for a list of supported languages.

docs/config/diagnostics.rst

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,19 @@ interpolate MPAS data and observations to common reference grids::
1818
# mapping files and region files.
1919
baseDirectory = /path/to/diagnostics
2020

21+
# A second directory where custom diagonstics data such as mapping files and
22+
# regions masks for unsupported grids can be found. The structure of
23+
# subdirectories in this directory must be the same as baseDirectory
24+
customDirectory = none
25+
2126
# Directory for mapping files (if they have been generated already). If mapping
2227
# files needed by the analysis are not found here, they will be generated and
23-
# placed in the output mappingSubdirectory
28+
# placed in the output mappingSubdirectory. The user can supply an absolute
29+
# path here to point to a path that is not within the baseDirectory above.
2430
mappingSubdirectory = mpas_analysis/maps
2531

26-
# Directory for region mask files
32+
# Directory for region mask files. The user can supply an absolute path here to
33+
# point to a path that is not within the baseDirectory above.
2734
regionMaskSubdirectory = mpas_analysis/region_masks
2835

2936
Diagnostics Directories
@@ -35,6 +42,10 @@ this data has already been downloaded to a shared location (see example config
3542
files in the subdirectories of the ``configs`` directory in the MPAS-Analysis
3643
repository).
3744

45+
The ``customDirectory``, if it is not ``none`` is another directory where
46+
observations, mapping files and region masks may be stored. This is useful for
47+
runs on non-standard grids or for testing out new observations.
48+
3849
The remaining options point to the subdirectories for mapping files (see
3950
below) and region masks (see :ref:`config_colormaps`), respectively.
4051
Typically, there is no reason to change ``mappingSubdirectory`` or

0 commit comments

Comments
 (0)