Repository navigation
Support smoothing onto lat-lon and projection grids - #217
Merged
Merged
Conversation
ESMF_RegridWeightGen reads a SCRIP grid of rank 2 as logically rectangular, with neighboring cells sharing corners. Expanding the destination cells (expand_dist or expand_factor) moves each cell's corners independently, so ESMF could not arrange them and failed for lat-lon and projection destinations. expand_scrip() now writes an expanded grid of rank 2 as unstructured, which ESMF accepts. The mapping file then describes the destination as 1D, with the expanded corners and cell areas. A new Remapper.finalize_map() rewrites it with the shape, corners and (for conservative maps) cell areas of the true destination grid, so only the weights reflect the expansion and remap_numpy() and ncremap() give output on the destination grid. Cell areas are computed for corners joined by great circles, as ESMF computes them. This applies to every expanded destination, so expanded maps to MPAS meshes now also carry the true corners and areas rather than the expanded ones; their weights are unchanged. build_map() calls finalize_map() itself. Callers that run the command from prepare_map() must call it afterwards. Without expansion it does nothing. Fixes MPAS-Dev#210 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
Posted by Claude Code on @xylar's behalf TestingThe new tests in |
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.
Smoothing with
expand_distorexpand_factornow works for lat-lon and projection destinations, which ESMF rejected before. The expanded grid is given to the mapping tool as unstructured, and a new publicRemapper.finalize_map()then puts the true destination shape, corners and cell areas back in the mapping file, so only the weights carry the smoothing.build_map()callsfinalize_map()itself. Callers that run the command fromprepare_map(), such as Polaris'sMappingFileStep, need to call it afterwards.ncremap()output gets correct bounds and areas.Fixes #210
Checklist
docs/developer_guide/api.md) has any new or modified class, method and/or functions listedTestingcomment in the PR documents testing used to verify the changestests/Posted by Claude Code on @xylar's behalf