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:
0 → ESMF_GridCreateNoPeriDim (current behavior)
1 → ESMF_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.
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 fieldn_peri_dimtoXYGeomSpec.Design
XYGeomSpec— add integer field:n_peri_dim = 0(default — no periodic dimensions)make_XYGeomSpec_from_hconfig— read optional hconfig key:create_basic_grid— conditional onn_peri_dim:0→ESMF_GridCreateNoPeriDim(current behavior)1→ESMF_GridCreate1PeriDimwith hardcodedpoleKindFlag=[ESMF_POLEKIND_MONOPOLE, ESMF_POLEKIND_BIPOLE]equal_to— includen_peri_dimin the comparison.GridTypemetadata — remains'XY'for all XY-family grids including tripolar. Users specifyclass: xyin hconfig; tripolar is a subcase, not a separate class.Notes
TripolarGridFactorymay 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;poleKindFlagcan become configurable at that point.class: tripolaralias is needed; hconfig is new to MAPL3 so there are no legacy configs to support.