Skip to content

Add global_ocean test cases for MALI-based ICs on existing E3SM meshes - #1016

Draft
xylar wants to merge 6 commits into
MPAS-Dev:mainfrom
xylar:ocean/sorrmr4-ic-from-mali
Draft

xylar wants to merge 6 commits into
MPAS-Dev:mainfrom
xylar:ocean/sorrmr4-ic-from-mali

Conversation

@xylar

@xylar xylar commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

This PR adds global_ocean test cases that build initial conditions from MALI AIS topography on two existing E3SM meshes, SOwISC12to30E3r4 and oQU240wLI. They are for testing ice-shelf melt coupling in E3SM-Project/E3SM#8887. landIceMask is kept from each existing initial condition so E3SM's coupling files stay valid, and the land-ice fields match what the coupler delivers.

For reviewers:

The PR also fixes two bugs in MALI topography remapping. It switches compass to the PCD's gravity, because the mpas_tools constants are out of date (MPAS-Dev/MPAS-Tools#781).

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
  • Document (in a comment titled Testing in this PR) any testing that was used to verify the changes

Posted by Claude Code on @xylar's behalf. The testing, analysis and wording above are AI-authored; please check them accordingly.

xylar and others added 6 commits November 19, 2026 07:49
`'Frac' in var` tested the DataArray's values rather than its name, so
remapped MALI fractions were never limited to 1.

`xr.Dataset(ds_bedmachine)` raises a TypeError with recent xarray, which
no longer accepts a Dataset as data_vars.  Use a copy instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add two config options to [remap_mali_topography]:

* `map_filename`: a precomputed MALI-to-MPAS-Ocean mapping file (e.g.
  E3SM's glc-to-ocn coupler map) to use instead of computing one with
  mbtempest.
* `normalize_land_ice_fractions`: set landIceFracObserved and
  landIceFloatingFracObserved to the floating fraction divided by the
  remapped MALI ocean fraction (below sea level and not grounded), as
  E3SM's coupler delivers them with GLC2OCN_SHELF_MASK=ungrounded.

Also match MALI's cellMask and the coupler's masks at ties: ice exactly
at flotation is floating (draft >= bed) and the ocean mask includes
bed == sea level.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
These test cases build a new initial condition from MALI AIS 4-to-20-km
topography on exactly the culled SOwISC12to30E3r4 mesh used in E3SM, so
E3SM's mapping, domain and partition files for that mesh stay valid.

`Mesh` takes a new `existing_mesh` argument.  When it is set:

* `ExistingMeshStep` replaces the base mesh, extracting the horizontal
  mesh from the existing initial condition given by
  [existing_mesh]/mesh_filename.
* `ExistingCulledMeshStep` replaces the cull step.  It masks and "culls"
  the topography as `CullMeshStep` does but culls no cells.  The flood
  fill that removes land ice not connected to the ice sheet can't start
  at the South Pole on a culled mesh, so it uses the connected components
  of the land-ice region that contain land ice in the existing file.
* landIceMask and landIceFloatingMask are copied unchanged from the
  existing file, since E3SM coupling files depend on them.

The SOwISC12to30E3r4 config uses E3SM's glc-to-ocn coupler map and
normalized land-ice fractions, so landIcePressure and the land-ice
fractions match what the coupler delivers with
GLC2OCN_SHELF_MASK=ungrounded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On an existing mesh, landIceMask is fixed, so removing land ice from the
topography no longer affects the mask.  It only makes the initial
condition disagree with what E3SM's coupler delivers.  On oQU240wLI, the
critical-passage mask and the seeded flood fill zeroed landIcePressure in
9 cells where the coupler delivers up to 6e5 Pa.

`ExistingCulledMeshStep` now writes its outputs directly instead of going
through `_cull_topo()`: the remapped topography with the existing masks,
and an identity map from the culled to the base mesh (the existing mesh
is both), which remap_ice_shelf_melt needs.  The seeded flood fill is no
longer needed and is removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
These build an initial condition from E3SM's default MALI initial
condition for the ais8to30 grid on exactly the oQU240wLI mesh, for a
low-resolution E3SM test of importing ice-sheet geometry into the ocean
(TL319_oQU240wLI_ais8to30).  As on SOwISC12to30E3r4, the land-ice masks
come from the existing initial condition, and E3SM's glc-to-ocn coupler
map is used.  The vertical grid is the existing 60layerPHC grid.

`mali_filename` in [remap_mali_topography] may now be an absolute path
instead of a file in the mali_topo database.  The new ais_8to30km.cfg uses
this for the MALI file in E3SM's inputdata on Chrysalis.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
E3SM's shared constants now come from the Physical Constants
Dictionary (PCD), and MPAS-Ocean, MALI and E3SM's coupler all use its
gravity (9.80665 m s-2), but the constants in mpas_tools are out of
date (MPAS-Dev/MPAS-Tools#781).  Ice-shelf pressures computed by compass
with the old value (9.80616) are 5e-5 lower than those the coupler
delivers.

compass.constants copies the mpas_tools constants with the PCD's
gravity, and compass uses it everywhere instead of
mpas_tools.cime.constants.  The other constants, including the Earth
radius, are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@xylar xylar changed the title Add global_ocean test cases for a MALI-based IC on the existing SORRMr4 mesh Add global_ocean test cases for MALI-based ICs on existing E3SM meshes Nov 20, 2026
@xylar xylar self-assigned this Nov 20, 2026
@xylar xylar added the ocean label Nov 20, 2026
@xylar

xylar commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator Author

Testing

I ran the mesh, init, dynamic_adjustment and files_for_e3sm (ocean_initial_condition and seaice_initial_condition) test cases for both existing meshes on Chrysalis with gnu and Open-MPI. MPAS-Ocean was built from E3SM-Project/E3SM#9208. The mesh_filename in each cfg was overridden with a copy of the existing initial condition converted to the PCD radius. The work directory is:

/lcrc/group/e3sm/ac.xylar/compass_2.1/chrysalis/pcd_ic_from_mali

All steps passed except remap_ice_shelf_melt on SORRMr4, which runs out of memory and was skipped. Compared with the coupler's ungrounded remap of the same MALI file:

Mesh landIcePressure max diff Fractions max diff Cells with p > 0 (IC / coupler) landIceMask changed
SOwISC12to30E3r4 4.7e-6 Pa 4.5e-13 12,591 / 12,591 0 cells
oQU240wLI 6.5e-9 Pa 1.4e-15 73 / 73 0 cells

I didn't run the pr suite or compare against a baseline.


Posted by Claude Code on @xylar's behalf.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant