Skip to content

Add tripolar grid / bipolar Arctic fold section to MOM6 example#23

Open
hdrake wants to merge 7 commits into
xgcm:masterfrom
hdrake:mom6-tripolar-fold
Open

Add tripolar grid / bipolar Arctic fold section to MOM6 example#23
hdrake wants to merge 7 commits into
xgcm:masterfrom
hdrake:mom6-tripolar-fold

Conversation

@hdrake

@hdrake hdrake commented May 31, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds a section to the MOM6 example demonstrating how to represent the MOM6 tripolar grid and its bipolar Arctic fold with xgcm's face_connections.

The grid is treated as periodic in X only, which is incorrect in the Arctic where the northernmost row folds onto itself (column i ↔ column N − i). The new section interprets the grid as two full-height faces (West/East, split at the fold pivot meridians) joined periodically in X and by the fold along their northern edge, using the new fold connection flag.

It then verifies, on real MOM6 OM4p25 output, that:

  • the fold halo equals the partner face's top row mirrored in X (exactly), and
  • velocity components reverse sign across the fold, visible in MOM6's own seam transport (vmo = −vmo[::-1]).

It also notes that the original GFDL thredds data server is offline and points to the Zenodo archive used by the new section.

Dependency

Requires the bipolar-fold feature added in xgcm/xgcm#707 (the fold element in face_connections). The notebook cells run successfully against that branch.

🤖 Generated with Claude Code

Adds a self-contained section demonstrating how to represent the MOM6
tripolar grid's bipolar Arctic fold with xgcm's face_connections (using
the new `fold` connection flag in xgcm). The grid is split into two
full-height faces joined periodically in X and by the fold along their
northern edge, and the section verifies the fold halo against the
geometric neighbour and shows the velocity sign convention via MOM6's
seam transport.

Also notes that the original GFDL thredds data server is offline and
points to the Zenodo archive used by the new section.

Requires the bipolar-fold feature from xgcm/xgcm#707.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@hdrake hdrake marked this pull request as draft May 31, 2026 15:51
hdrake and others added 4 commits May 31, 2026 09:53
Replace the dead GFDL thredds download with the full-resolution MOM6
example output archived on Zenodo (record 15420739), and recast the
notebook around the variables that archive actually provides:

- Load the vertically-integrated mass-budget file directly from Zenodo;
  drop the now-redundant separate ocean_grid_sym download (geolon_c /
  geolat_c are already included).
- Build the grid for the symmetric-memory layout (xq/yq are the `outer`
  position).
- Recast the vorticity demo as the curl of the vertically-integrated mass
  transport (umo, vmo), which lands on the cell corners.
- Point the bipolar-fold section at the same dataset (no second download).

Requires the bipolar-fold feature from xgcm/xgcm#707.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Pass autoparse_metadata=False to the main Grid constructor (the CM4X data
has no COMODO c_grid_axis_shift attributes), and commit the executed
notebook with outputs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ison

Address review feedback: replace the curl of raw mass transport with the
barotropic (depth-integrated) relative vorticity -- divide the transports
by cell widths (umo/dyCu, vmo/dxCv) to get vertically-integrated velocity,
then take the curl on the cell corners. Convert the dataset to
non-symmetric mode (center/right staggering) for clarity.

Add a North Polar Stereographic side-by-side of Arctic vorticity computed
the naive X-periodic way vs the tripolar fold-aware way (dV/dx is periodic
and shared; dU/dy crosses the seam and is computed on the fold grid with
the velocity sign-flip), plus a difference panel showing the two agree
everywhere except along the bipolar fold seam.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Register dxCv/dyCu as the X/Y distance metrics and divide the transports
by rho0, so grid.derivative yields the depth-integrated relative vorticity
in physical units (m/s) rather than a raw finite difference. Apply the same
in the Arctic naive-vs-fold comparison (Y metric split onto the two faces).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@hdrake hdrake marked this pull request as ready for review May 31, 2026 23:26
hdrake and others added 2 commits May 31, 2026 16:35
tripolar_faces now operates on the entire Dataset (slicing xh and xq
together), so every field lands on the two faces in one call. Build one
fold-aware Grid from the faced dataset and reuse it for both the scalar
fold check and the vorticity comparison, instead of splitting each
variable separately and building two grids.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant