Skip to content

Landice mesh_gen: switch conservative remap weight generation from ESMF to mbtempest#952

Draft
Copilot wants to merge 6 commits intomainfrom
copilot/fix-esmf-regridweightgen-conserve-bug
Draft

Landice mesh_gen: switch conservative remap weight generation from ESMF to mbtempest#952
Copilot wants to merge 6 commits intomainfrom
copilot/fix-esmf-regridweightgen-conserve-bug

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 20, 2026

Conservative remapping in landice mesh_gen can hang/segfault with ESMF_RegridWeightGen at high resolution. This change transitions that path to mbtempest (TempestRemap parallel flow) while keeping the existing interpolation workflow intact.

  • Core change (landice mesh_gen optional interpolation)

    • In compass/landice/mesh.py::interp_gridded2mali(), replaced conservative weight generation via ESMF_RegridWeightGen with:
      1. mbconvert (SCRIP → H5M),
      2. mbpart (parallel partitioning),
      3. mbtempest --type 5 --weights (conservative weights).
    • Preserved existing downstream remap call (interpolate_to_mpasli_grid) and weight-file contract (gridded_to_MPAS_weights.nc).
  • Operational cleanup

    • Removes intermediate .h5m files created during convert/partition to avoid workspace clutter.
  • Config/docs alignment for mesh_gen

    • Updated landice mesh_gen config comments and matching User/Developer Guide snippets so nProcs is described as controlling mbtempest (not ESMF_RegridWeightGen).
# old
srun -n ${nProcs} ESMF_RegridWeightGen --method conserve ...

# new flow
mbconvert -B source.scrip.nc source.scrip.h5m
mbpart ${nProcs} -z RCB source.scrip.h5m source.scrip.p${nProcs}.h5m
srun -n ${nProcs} mbtempest --type 5 \
  --load source.scrip.p${nProcs}.h5m \
  --load destination.scrip.p${nProcs}.h5m \
  --file gridded_to_MPAS_weights.nc --weights --gnomonic --boxeps 1e-9

Checklist

  • User's Guide has been updated
  • Developer's Guide has been updated
  • API documentation in the Developer's Guide (api.rst) has any new or modified class, method and/or functions listed
  • Documentation has been built locally and changes look as expected
  • Document (in a comment titled Testing in this PR) any testing that was used to verify the changes

Copilot AI linked an issue Apr 20, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Fix bug in conserve mapping with ESMF_RegridWeightGen Landice mesh_gen: switch conservative remap weight generation from ESMF to mbtempest Apr 20, 2026
Copilot AI requested a review from trhille April 20, 2026 16:08
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.

Conserve mapping with ESMF_RegridWeightGen

2 participants