-
Notifications
You must be signed in to change notification settings - Fork 148
Tutorials
- Building MOM6: slides and video
- MOM6 equations: video
- Running and controlling MOM6: slides
- Time-stepping algorithms: video
- Parameterizations in MOM6: slides and video
- Analyzing MOM6 output: repo and video
- Create your own experiment: video
(see https://github.com/NCAR/MOM6-webinars for slides and https://www.cesm.ucar.edu/events/244/agenda for more info)
- A Primer on the Vertical Lagrangian Remap Method (Stephen Griffies): slides and video
- Using MOM6 (Alistair Adcroft): slides and video
- Current simulation with MOM6 in CESM (Gustavo Marques): slides and video
- Using MOM6 in CESM (Alper Altuntas): slides and video
- GFDL's OM4 (Alistair Adcroft): slides and video
- An Overview of MOM6 Algorithms (Robert Hallberg): slides and video
- A novel implementation of neutral diffusion (Andrew Shao): slides and video
- Analyzing MOM6 using a xarray/dask/zarr software stack (Raphael Dussin): slides and video
- A Comparison of Twin MOM6 and HYCOM Eddy-Resolving Global Ocean Simulations (Alan Wallcraft): slides and video
- Representing the mesoscale horizontal diffusion of tracers within the boundary layers of general vertical coordinate ocean models (Gustavo Marques): slides and video
- Verification and Validation of MOM6 (Marshall Ward): slides and video
- The Unified Forecast System (Jessica Meixner): slides and video
- Regional Ocean Modeling (Enrique Curchitser): slides and video
- Setting up regional MOM6 (Kate Hedstrom): slides and video
- Regional MOM6 for the Nordic Seas (Robert Helber): slides and video
- Simpler models within the CESM (Isla Simpson): slides and video
- CESM MOM6 Aqua and Ridge (Xiaoning Wu): slides and video
- Ocean Basin Geometry and Climate: a MOM6 Application (Sarah Ragen): slides and video
- Coupled Data Assimilation (Dan Amrhein): slides and video
- MOM6 Data Assimilation Interfaces (Matthew Harrison): slides and video
- SOCA (Sea Ice Ocean Coupled Data Assimilation) (Travis Sluka): slides and video
- Newton-Krylov Methods for Tracer Spinup (Keith Lindsay): slides and video
- Adding Ocean Tracers to MOM6 (Andrew Shao): slides and video
- Adding the MARBL Biogeochemistry Model to MOM6 (Michael Levy): slides and video
- MOM6 Capability Overview, Time Stepping, and ALE
- Horizontal parameterizations
- Vertical parameterizations
The following jupyter notebooks (formerly IPython) illustrate some analysis of MOM6 output with explanation. You can peruse the notebooks on GitHub by navigating through MOM6-examples.
You can also run the notebooks interactively yourself. You will need jupyter installed (we recommend using conda to obtain and manage python):
cd MOM6-examples/
jupyter notebook
And then open the URL posted in the output (if it doesn't open automatically).
The directories corresponding to individual examples follow a common pattern of contents. Examples that have no binary input data typically look like:
tree MOM6-examples/ocean_only/benchmark/
MOM6-examples/ocean_only/benchmark/
|-- diag_table
|-- input.nml
|-- MOM_input
|-- MOM_memory.h
|-- MOM_override
|-- MOM_parameter_doc.all
|-- MOM_parameter_doc.layout
`-- MOM_parameter_doc.short
Of the above, only some files are read by the model while the rest are written. We record them in order version control the experiment as a whole, and to regression test the code.
Input file | i/o | Contents |
---|---|---|
input.nml | IN | Has the necessary fortran namelists for executing MOM6 and controlling non-MOM6 components of the code. This includes the list of MOM-style parameter files to read, usually "MOM_input" and "MOM_override". |
MOM_input | IN | Contains all the necessary run-time parameters that define this experiment. |
MOM_override | IN | Is usually blank except in cases where there are several variants on an example (e.g. with different coordinates). |
diag_table | IN | List of diagnostics, used by FMS's diagnostic manager. |
MOM_parameter_doc.all | OUT | Records all the run-time parameters that are not associated with the parallelization. |
MOM_parameter_doc.short | OUT | Records all the non-default run-time parameters that are not associated with the parallelization. |
MOM_parameter_doc.layout | OUT | Records all the run-time parameters that are associated with the parallelization. These parameters are computational and do not affect the numerical solution. |
available_diags | OUT | a list of available diagnostics. |
ocean.stats.* | OUT | are ascii files with a few key statistics/metrics used for bitwise regression testing by the core-MOM6 team. These files are version controlled in a separate "regressions" repository that is platform specific. |
When you run the models you will so other files appear:
- *.nc - Most diagnostics will be in netcdf files named in
diag_table
. There are a few others that are written to files such as "ocean_geometry.nc", "timestats.nc", "MOM_IC.nc", which are controlled by MOM6 rather than through the diagnostics manager. - ocean.stats, CPU_stats, - a few key statistics/metrics.
- logfile.* -
- RESTART/* - restart files. The model will fail with an error if the RESTART directory does not exist.
- fort.*, exitcode, _read_error.nml - are written by FMS code and can usually be ignored.
As outlined in Getting started obtain an interactive shell on batch nodes:
msub -I -lsize=32,walltime=01:00:00
To run the benchmark test, cd
to the benchmark directory and launch the executable:
cd ocean_only/benchmark/
mkdir -p RESTART
aprun -n 8 ../../build/intel/ocean_only/repro/MOM6
The benchmark test case is an example of a regional ocean model with two (hypothetical) ocean basins connected via a channel. The idealized shape of the basins (i.e., ocean mask), topography and grids are generated at run-time so there is no need for input grid files. The initial conditions are also set at runtime.
The grid resolution is set at NIGLOBAL x NJGLOBAL = 360x180 (1/4 degree for the region in this test case). If desired, this can be changed via an input file (MOM_override) in the working directory. For example, to make the model 4 times bigger one could do this in the workdir:
cd ocean_only/benchmark/
cat << EOF > MOM_override
#override NIGLOBAL = 720
#override NJGLOBAL = 360
EOF
The default total run time of this test is 2 days. This can be changed by adding the following lines to input.nml in the working directory:
cd ocean_only/benchmark/
cat << EOF >> input.nml
&ocean_solo_nml
months = 0
days = 20 /
EOF
Restarts
The model will write the model state to the RESTART directory at the end of the run. To restart the model, copy the files from the RESTART directory to the INPUT directory. You also need to edit the input.nml file so that:
input_filename = 'n'
becomes
input_filename = 'r'
Almost all the analysis examples above use python. Here's some steps to setup a working python environment that should work for the examples above:
- Find the appropriate bash script installer for your system from https://docs.conda.io/en/latest/miniconda.html#linux-installers and copy the URL
- Download the installer with wget, e.g.
wget https://repo.anaconda.com/miniconda/Miniconda3-py39_4.12.0-Linux-x86_64.sh
where the second argument is the URL from step 1. - Run the installer script with
bash Miniconda3-py39_4.12.0-Linux-x86_64.sh
, where the second argument is the name of the actual script you downloaded. - Answer the questions. We recommended saying "Y" to updating your .bashrc.
- Create a python environment using
conda create -n mom6py jupyter xarray matplotlib numpy netcdf4
- Activate the new environment
conda activate mom6py
- Launch a jupyter notebook with
jupyter notebook
and click the URL that appears in the terminal.