Template scripts and Jupyter notebooks for running ocean diagnostics on CESM MOM6 simulations, including climatologies, transports, MOC, T/S biases, and more on NCAR systems.
Diagnostics are built on mom6-tools. See the mom6-tools documentation for detailed guidance.
The workflow has two steps:
- Run diagnostic scripts (
make diags) — submits PBS jobs to Casper that process model output into NetCDF files. - Build HTML report (
make html) — runs Jupyter notebooks via papermill and builds a Jupyter Book website, then deploys it to the CGD web server.
Edit diag_config.yml to point to your case. Key fields:
Case:
CASEROOT: /path/to/your/case/
OCN_DIAG_ROOT: /path/to/output/ncfiles/
SNAME: "my_case_short_name"
Avg:
start_date: 'YYYY-01-01'
end_date: 'YYYY-01-01'
oce_cat: /glade/work/chengz/ocean_catalogs/reference-datasets.ymlNote that oce_cat must be an absolute path.
The Transports section lists ocean sections where volume transports are computed. Edit or extend this list as needed.
moc.sh requires large memory. To increase the memory requested, change the following lines in ~/.config/dask/ncar-jobqueue.yaml:
memory: '16GiB' # Total amount of memory per job
resource-spec: select=1:ncpus=1:mem=16GB
Set the CASE and COMPSET variables at the top of notebooks/run_notebooks.sh to match your simulation:
CASE="your.case.name"
COMPSET=BLT1850 # BLT1850 or GIAFAlso update the PBS account (#PBS -A) in all scripts/*.sh files and in notebooks/run_notebooks.sh if needed.
The scripts expect the mom6-tools conda environment:
conda activate mom6-toolsmake diagsThis runs run_scripts.sh, which submits the following PBS jobs to Casper:
| Script | Description |
|---|---|
climo_native.sh |
Climatology on native MOM6 grid |
climo_z.sh |
Climatology on z-level grid |
basin_reductions.sh |
Basin-mean reductions |
moc.sh |
Meridional overturning circulation (z) |
moc_sigma2.sh |
MOC in sigma-2 density coordinates |
pht.sh |
Poleward heat transport |
aaiw_pv.sh |
AAIW potential vorticity |
enso.sh |
ENSO indices |
transports.sh |
Volume transports through key sections |
surface.sh |
Surface fields |
equatorial.sh |
Equatorial diagnostics |
ts_levels.sh |
T/S at depth levels |
stats.sh |
Global ocean statistics |
drift_thetao.sh |
Temperature drift |
rms_thetao.sh |
Temperature RMS error |
drift_so.sh |
Salinity drift |
rms_so.sh |
Salinity RMS error |
tao.sh |
TAO mooring diagnostics |
After jobs complete, copy the output NetCDF files to your OCN_DIAG_ROOT:
# Reminder also printed by make diags:
cp -r ncfiles/ $OCN_DIAG_ROOTmake htmlThis submits notebooks/run_notebooks.sh to Casper, which:
- Generates the table of contents and intro page.
- Executes all notebooks with papermill.
- Builds a Jupyter Book from the notebooks.
- Deploys the HTML output to
tungsten.cgd.ucar.eduunder/project/diagnostics/external/<COMPSET>/<CASE>/ocn/.
| Notebook | Description |
|---|---|
ts_biases.ipynb |
Temperature and salinity biases |
moc.ipynb |
Meridional overturning circulation |
pht.ipynb |
Poleward heat transport |
mld.ipynb |
Mixed layer depth |
bld.ipynb |
Boundary layer depth |
transports.ipynb |
Volume transports |
equatorial.ipynb |
Equatorial sections |
ocean_stats.ipynb |
Global ocean statistics |
enso.ipynb |
ENSO |
aaiw_pv.ipynb |
AAIW potential vorticity |
ssh.ipynb |
Sea surface height |
make clean_notebooks # Clear all notebook outputs in place
make clean # Remove all generated files and restore notebooks from git- mom6-tools
- papermill
- jupyter-book
- oce-catalogs — reference ocean observational datasets
- PBS/Casper (NCAR HPC)