Replace XESMF with ConservativeRegridding#160
Open
simone-silvestri wants to merge 18 commits intomainfrom
Open
Replace XESMF with ConservativeRegridding#160simone-silvestri wants to merge 18 commits intomainfrom
simone-silvestri wants to merge 18 commits intomainfrom
Conversation
Remove XESMF entirely and use ConservativeRegridding for regridding between SpeedyWeather and Oceananigans grids. ConservativeRegridding is now a direct dependency rather than an extension. The SpeedyWeather extension now implements treeify for RingGrids, building GeoInterface polygons from cell vertices. This enables the default OctahedralGaussianGrid instead of requiring FullClenshawGrid. Note: treeify for SpeedyWeather grids needs testing to confirm it works end-to-end with the conservative regridding pipeline. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Member
Author
|
Still need to verify some things, so I ll make this into a draft |
RingGrids.get_gridcell_polygons returns vertices in clockwise order (E, S, W, N). Reverse to CCW (E, N, W, S) so that GO.area on the Spherical manifold returns positive areas. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Build a proper ExplicitPolygonGrid + TopDownQuadtreeCursor for SpeedyWeather grids instead of using FlatNoTree (brute force). - Full grids: clean (nlon, nlat) ExplicitPolygonGrid, linear indices match RingGrid flat indices directly. - Reduced grids: (nlon_max, nlat) matrix with degenerate padding for shorter rings, ReorderedTopDownQuadtreeCursor maps 2D indices to RingGrid flat indices, ghost cells beyond npoints have zero area. The regrid! overloads handle the size mismatch for reduced grids by zero-padding into temp arrays. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Reduced grids now use one sub-tree per latitude ring combined via MultiTreeWrapper. Each ring is an ExplicitPolygonGrid(nlon_ring, 1) with IndexOffsetQuadtreeCursor mapping to flat RingGrid indices. This gives ncells = npoints exactly — no ghost cells, no size mismatch, so regrid! stays clean with no padding logic. The dual DFS prunes entire latitude rings via SphericalCap extents, and within each ring prunes by longitude via the quadtree. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Extensions can only use packages listed in the parent Project.toml. These are already in the dependency tree via ConservativeRegridding. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Oceananigans uses radius=6.371e6, SpeedyWeather uses 6.3710088e6. Pass the exchange_grid's manifold explicitly to Regridder to avoid the "manifolds must be the same" error. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
simone-silvestri
commented
May 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
ConservativeRegridding.Regridderandregrid!instead ofXESMF.Regriddertranspose(regridder)for the reverse direction instead of constructing a separate regridderTODO
🤖 Generated with Claude Code