Skip to content

feat(geom): add n_peri_dim support to XYGeomSpec/XYGeomFactory for tripolar grids #4691

@tclune

Description

@tclune

Summary

Tripolar ocean grids are a special case of the XY geom: same file-based 2D curvilinear coordinates, same corner support, but with one periodic dimension and a bipole at the north.

Rather than introducing a separate TripolarGeomSpec/TripolarGeomFactory, support tripolar grids by adding a single integer field n_peri_dim to XYGeomSpec.

Design

XYGeomSpec — add integer field:

  • n_peri_dim = 0 (default — no periodic dimensions)

make_XYGeomSpec_from_hconfig — read optional hconfig key:

class: xy
grid_file_name: tripolar_grid.nc
n_peri_dim: 1

create_basic_grid — conditional on n_peri_dim:

  • 0ESMF_GridCreateNoPeriDim (current behavior)
  • 1ESMF_GridCreate1PeriDim with hardcoded poleKindFlag=[ESMF_POLEKIND_MONOPOLE, ESMF_POLEKIND_BIPOLE]

equal_to — include n_peri_dim in the comparison.

GridType metadata — remains 'XY' for all XY-family grids including tripolar. Users specify class: xy in hconfig; tripolar is a subcase, not a separate class.

Notes

  • The custom north-fold halo in the MAPL2 TripolarGridFactory may be a holdover — ESMF should handle scalar halos correctly for bipole grids natively. To be investigated before closing this issue.
  • n_peri_dim: 2 (doubly periodic) is reserved for future use cases; poleKindFlag can become configurable at that point.
  • No class: tripolar alias is needed; hconfig is new to MAPL3 so there are no legacy configs to support.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions