Provides analysis for the MPAS components of ACME
Analysis for simulations produced with Model for Prediction Across Scales
(MPAS) components and the Energy Exascale Earth System Model (E3SM), which
used those components.

| All platforms: |
| Name | Downloads | Version | Platforms |
|---|---|---|---|
https://mpas-dev.github.io/MPAS-Analysis/develop/
MPAS-Analysis is available as an anaconda package via the conda-forge channel:
conda config --add channels conda-forgeconda create -n mpas-analysis mpas-analysisconda activate mpas-analysis
To use the latest version for developers, get the code from:
https://github.com/MPAS-Dev/MPAS-Analysis
Then, you will need to set up a conda environment from the MPAS-Analysis repo.
This environment will include the required dependencies for the development
branch from dev-spec.txt and will install the mpas_analysis package into
the conda environment in a way that points directly to the local branch (so
changes you make to the code directly affect mpas_analysis in the conda
environment):
conda config --add channels conda-forgeconda config --set channel_priority strictconda create -y -n mpas_analysis_dev --file dev-spec.txtconda activate mpas_analysis_devpython -m pip install --no-deps --no-build-isolation -e .
If you are developing another conda package at the same time (this is common
for MPAS-Tools or geometric_features), you should first comment out the other
package in dev-spec.txt. Then, you can install both packages in the same
development environment, e.g.:
conda create -y -n mpas_analysis_dev --file tools/MPAS-Tools/conda_package/dev-spec.txt \--file analysis/MPAS-Analysis/dev-spec.txtconda activate mpas_analysis_devcd tools/MPAS-Tools/conda_packagepython -m pip install --no-deps --no-build-isolation -e .cd ../../../analysis/MPAS-Analysispython -m pip install --no-deps --no-build-isolation -e .
Obviously, the paths to the repos may be different in your local clones. With
the mpas_analysis_dev environment as defined above, you can make changes to bothmpas_tools and mpas-analysis packages in their respective branches, and
these changes will be reflected when refer to the packages or call their
respective entry points (command-line tools).
If you installed the mpas-analysis package, download the data that is
necessary to MPAS-Analysis by running:
download_analysis_data -o /path/to/mpas_analysis/diagnostics
where /path/to/mpas_analysis/diagnostics is the main folder that will contain
two subdirectories:
mpas_analysis, which includes mapping and region mask files forobservations, which includes the pre-processed observations listed in theOnce you have downloaded the analysis data, you will point to its location
(your equivalent of path/to/mpas_analysis/diagnostics above) in the config
option baseDirectory in the [diagnostics] section.
If you installed the mpas-analysis package, list the available analysis tasks
by running:
mpas_analysis --list
This lists all tasks and their tags. These can be used in the generate
command-line option or config option. See mpas_analysis/default.cfg
for more details.
myrun.cfg), copy example.cfg,configs directory (if using ampas_analysis/default.cfg (in a git repo) or directlympas-analysis package, run:mpas_analysis myrun.cfg. This will read the configurationmpas_analysis/default.cfg and then replace thatmyrun.cfgIf you want to run a subset of the analysis, you can either set thegenerate option under [output] in your config file or use the--generate flag on the command line. See the comments inmpas_analysis/default.cfg for more details on this option.
Requirements for custom config files:
baseDirectory under [output] to the foldermpas_analysis/default.cfg.mpas_analysis/default.cfg directly.mpaso.hist.am.timeSeriesStatsMonthly.*.nc (Note: since OHCmpaso.hist.am.timeSeriesStatsMonthly.*.nc[timeSeries]/startYear and[timeSeries]/endYear are. This is especially important to know if[input]/runSubdirectory, [input]/oceanHistorySubdirectory and[input]/seaIceHistorySubdirectory to the appropriate run and archive[timeSeries]/startYear and[timeSeries]/endYear to include only data that have been short-termmpaso.hist.am.meridionalHeatTransport.0001-03-01.nc (or anyhist.am.meridionalHeatTransport file)mpaso.rst.0002-01-01_00000.nc (or any other mpas-o restart file)streams.oceanmpaso_inmpasseaice.hist.am.timeSeriesStatsMonthly.*.ncmpasseaice.rst.0002-01-01_00000.nc (or any other mpas-seaice restartstreams.seaicempassi_inNote: for older runs, mpas-seaice files will be named:
mpascice.hist.am.timeSeriesStatsMonthly.*.ncmpascice.rst.0002-01-01_00000.ncstreams.cicempas-cice_inmpaso_in will be named:mpas-o_inTo purge old analysis (delete the whole output directory) before running run
the analysis, add the --purge flag. If you installed mpas-analysis as
a package, run:
mpas_analysis --purge <config.file>
All of the subdirectories listed in output will be deleted along with the
climatology subdirectories in oceanObservations and seaIceObservations.
It is a good policy to use the purge flag for most changes to the config file,
for example, updating the start and/or end years of climatologies (and
sometimes time series), changing the resolution of a comparison grid, renaming
the run, changing the seasons over which climatologies are computed for a given
task, updating the code to the latest version.
Cases where it is reasonable not to purge would be, for example, changing
options that only affect plotting (color map, ticks, ranges, font sizes, etc.),
rerunning with a different set of tasks specified by the generate option
(though this will often cause climatologies to be re-computed with new
variables and may not save time compared with purging), generating only the
final website with --html_only, and re-running after the simulation has
progressed to extend time series (however, not recommended for changing the
bounds on climatologies, see above).
If you are running from a git repo:
configs/<machine_name> to the root directory (or another directoryconfigs/job_script.default.bash, ismpas-analysis conda package, download the job script and/orIf a job script for your machine is not available, try modifying the default
job script in configs/job_script.default.bash or one of the job scripts for
another machine to fit your needs.
There are three main ways to either customize the plots that MPAS-Analysis
already makes or creating new ones:
mpas_analysis/default.cfg for available[baseDirectory]/clim/mpas/avg/unmasked_[mpasMeshName]: MPAS-Ocean[baseDirectory]/clim/mpas/avg/remapped: remapped climatologies[baseDirectory]/clim/obs: observational climatologies.[baseDirectory]/clim/mpas/avg/mocStreamfunction_years[startYear]-[endYear].nc.[baseDirectory]/clim/mpas/avg/meridionalHeatTransport_years[startYear]-[endYear].nc.[baseDirectory]/timeseries: various time series data.Analysis tasks can be found in a directory corresponding to each component,
e.g., mpas_analysis/ocean for MPAS-Ocean. Shared functionality is contained
within the mpas_analysis/shared directory.
copying mpas_analysis/analysis_task_template.py toocean, sea_ice, etc.) and modifying it asmpas_analysis/shared/analysis_task.py for additional guidance.mpas_analysis/shared/analysis_task.pympas_analysis/default.cfg (and possibly any machine-specificconfigs/<machine>)mpas_analysis/<component>/__init__.pympas_analysis/__main__.py underbuild_analysis_list, see below.A new analysis task can be added with:
analyses.append(<component>.MyTask(config, myArg='argValue'))
This will add a new object of the MyTask class to a list of analysis tasks
created in build_analysis_list. Later on in run_analysis, it will first
go through the list to make sure each task needs to be generated
(by calling check_generate, which is defined in AnalysisTask), then,
will call setup_and_check on each task (to make sure the appropriate AM is
on and files are present), and will finally call run on each task that is
to be generated and is set up properly.
Create a development environment as described above in “Installation for
developers”. Then run:
To generate the sphinx documentation, run:
cd docsDOCS_VERSION=test make clean versioned-html
The results can be viewed in your web browser by opening:
_build/html/index.html