Add tripolar grid / bipolar Arctic fold section to MOM6 example#23
Open
hdrake wants to merge 7 commits into
Open
Add tripolar grid / bipolar Arctic fold section to MOM6 example#23hdrake wants to merge 7 commits into
hdrake wants to merge 7 commits into
Conversation
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>
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
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>
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>
This was referenced Jun 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Xonly, which is incorrect in the Arctic where the northernmost row folds onto itself (columni↔ columnN − i). The new section interprets the grid as two full-height faces (West/East, split at the fold pivot meridians) joined periodically inXand by the fold along their northern edge, using the newfoldconnection flag.It then verifies, on real MOM6 OM4p25 output, that:
X(exactly), andvmo = −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
foldelement inface_connections). The notebook cells run successfully against that branch.🤖 Generated with Claude Code