Skip to content

Add support for Omega split mesh and vertical coordinate datasets#736

Open
xylar wants to merge 5 commits into
masterfrom
split-horiz-mesh-vert-coord-init-state
Open

Add support for Omega split mesh and vertical coordinate datasets#736
xylar wants to merge 5 commits into
masterfrom
split-horiz-mesh-vert-coord-init-state

Conversation

@xylar

@xylar xylar commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

Adding support for Omega

Omega is the next-generation ocean model being developed alongside MPAS-Ocean. A key difference is how Omega organizes its data: instead of bundling the horizontal mesh, the vertical coordinate, and the model state all into a single file (as MPAS-Ocean has historically done), Omega keeps these as separate datasets. This PR updates the ocean tools in MPAS-Tools to work with that split layout, so the same analysis and visualization tools can be used for both MPAS-Ocean and Omega output.

What changed for users

  • A new, optional vertical-coordinate dataset. The barotropic streamfunction tools (compute_barotropic_streamfunction, compute_vertically_integrated_velocity) and the transect plotting tool (plot_feature_transects) now accept an optional ds_vert_coord argument for the vertical coordinate variables (minLevelCell, maxLevelCell, bottomDepth). If you don't provide it, it defaults to your mesh dataset, so existing MPAS-Ocean workflows keep working unchanged.

  • A new command-line option. The plot_feature_transects command gains a --vert_coord option to point at a separate vertical-coordinate file.

Backwards-incompatible changes (why this is version 2.0.0)

  • Layer thickness now comes from the data file, not the mesh file. Layer thickness changes over time, so it is part of the model state, not the static mesh. Tools that previously read layerThickness from a mesh dataset now read it from the data (state) dataset. In the common case where your mesh and data are the same file, nothing changes. If you relied on passing a separate mesh file that carried layerThickness, that variable now needs to be in your data file. This also affects add_zmid, which now reads layerThickness from its input file rather than the coordinate file.

  • The 1D depth coordinate is no longer supported for Omega. add_depth (and the underlying compute_depth) build an approximate 1D depth coordinate from refBottomDepth, which only makes sense for a z-level/z-star vertical coordinate. Omega uses general vertical coordinates and does not provide refBottomDepth, so these tools now raise a clear error explaining the situation and pointing you to the 3D zMid coordinate (add_zmid) instead. MPAS-Ocean z-star runs are unaffected.

Testing

A pre-release, 2.0.0rc1, has been tagged for downstream testing. Existing depth unit tests were updated to match the new layer-thickness behavior, and a new test confirms the clear error when refBottomDepth is missing.

🤖 Generated with Claude Code

Fixes #735

xylar and others added 5 commits June 26, 2026 12:36
ruff-format was added late in development and not all files were
updated. Reformat depth.py, barotropic.py and plot.py to satisfy the
ruff-format, flynt and import-sorting hooks, and add an explicit
strict=True to the existing zip() calls flagged by ruff (B905), so the
subsequent Omega changes land on a pre-commit-clean base.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Omega stores the vertical coordinate variables (minLevelCell,
maxLevelCell and bottomDepth) in a dataset separate from the horizontal
mesh. Add an optional ds_vert_coord argument (the same as ds_mesh by
default) to compute_vertically_integrated_velocity,
compute_barotropic_streamfunction and plot_feature_transects, and a
corresponding --vert_coord option to the plot_feature_transects command,
so these variables can be read from a separate dataset.

layerThickness is a dynamic field, so it is now always read from the
dynamic dataset rather than the mesh, and add_zmid reads it from its
input file rather than the coordinate file. This is not backwards
compatible.

add_depth and compute_depth rely on the 1D refBottomDepth, which Omega
and other general vertical coordinates do not provide. They now raise a
clear error when refBottomDepth is missing and are documented as not
supported for Omega, pointing users to the 3D zMid coordinate instead.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
add_zmid now reads layerThickness from the input file, so include it
there in test_add_zmid. Add a test that add_depth raises a clear error
when refBottomDepth is missing, as is the case for Omega.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add a warning to the "Adding a Depth Coordinate" docs that add_depth and
compute_depth rely on refBottomDepth and so assume a z-level/z-star
vertical coordinate, which Omega does not provide. Point users to the 3D
zMid coordinate instead.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Bump the major version to reflect the non-backwards-compatible Omega
changes: layerThickness must now come from the dynamic dataset rather
than the mesh, and the refBottomDepth-based 1D depth coordinate is no
longer supported for Omega.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@xylar

xylar commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator Author

I will try to test this in Polaris soon, maybe over the weekend if I have some time to kill.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Updates needed after separation of horiz mesh and vertical coord datasets for Omega

1 participant