Discretization rules
Closed §4.2 AST lowerings for the seeded ESD rule files, with boundary handling delegated to the domain.
The seeded rule files. Each rule lowers a §4.2 PDE operator —
grad, div, laplacian, D, plus pointwise math — to a closed
expression in the §4.2 op vocabulary: arrayop, broadcast,
ifelse, +, -, *, /, ^, sqrt, and friends. There are no
scheme-specific kernels in any binding language, and applies_to.op
only matches §4.2 ops (canonical names like grad and div; never
off-spec selectors such as advect, reconstruct, flux, or
limit). Any ESS binding can evaluate a lowering by walking its AST.
Boundary handling
Boundary conditions live on the domain, not in the rule. The domain’s
boundary_conditions block (esm-spec §11.5) declares the BC type per
axis — periodic, dirichlet, neumann, zero_gradient, or
robin — and downstream BC rewrite rules (e.g.
periodic_bc) consume that list
and rewrite the lowered AST into concrete index expressions at the
boundary cells. The lowering itself contains no bc:* nodes; it is
the interior closed form, and the (grid_family, BC list) pair from
the domain drives the boundary rewrites.
Migration status
The catalog is mid-migration to this closed-AST authoring pattern.
These pages document a curated subset of ~16 rules; the full catalog
under discretizations/
holds roughly 57 rule JSON files (32 finite_difference/ — including the
boundary-condition rules — plus 24 finite_volume/ and 1 ic/). Of the
documented subset, most still describe the legacy stencil/coefficient
form (an explicit stencil block plus per-offset coefficients) and are
scheduled for rewrite to the closed-AST form. Their pages describe the
legacy form until the rule itself migrates.
centered_2nd_uniformis the canonical linear exemplar — a singlearrayopwhose body combinesindex,+,-,*, and/to express $(u_{i+1} - u_{i-1}) / (2,\Delta x)$.weno5_advectionwill be the canonical nonlinear exemplar once its rewrite lands (blocked on ESS work tracked underesm-4gw).
Per-page rendering
After migration, each rule page renders the closed lowering AST
diagrammatically — pattern-variable bindings on applies_to, then the
op tree of the replacement — rather than a coefficient diagram.
Pages for rules that have not yet migrated continue to describe the
legacy stencil/coefficient form; they update when their rule does.
Convergence plots (when present) report empirical order of accuracy on
a manufactured solution; rules whose Layer-B fixtures depend on
in-flight ESS harness extensions show a pending placeholder until
those fixtures land.
- advection_duo
finite_volume
unstructured
scheme
O(h) on a quasi-uniform icosahedral triangular mesh
Auto-generated catalog entry for the advection_duo rule (finite_volume, grid family unstructured). The discrete operator is pretty-printed directly from the rule's replacement AST.
- advection_mpas
finite_volume
unstructured
scheme
O(h) L-inf median on a quasi-uniform Voronoi mesh (centered edge interpolation; NOT L-inf-convergent at maximally-distorted cells — see convergence fixture skip_reason)
Auto-generated catalog entry for the advection_mpas rule (finite_volume, grid family unstructured). The discrete operator is pretty-printed directly from the rule's replacement AST.
- advection_mpas_velocity_first
finite_volume
unstructured
scheme
O(h) L-inf median on a quasi-uniform Voronoi mesh (see advection_mpas)
Auto-generated catalog entry for the advection_mpas_velocity_first rule (finite_volume, grid family unstructured). The discrete operator is pretty-printed directly from the rule's replacement AST.
- centered_2nd_deriv_nonuniform_vertical
finite_difference
vertical
scheme
O(dz_k^2)
Auto-generated catalog entry for the centered_2nd_deriv_nonuniform_vertical rule (finite_difference, grid family vertical). The discrete operator is pretty-printed directly from the rule's replacement AST.
- centered_2nd_deriv_uniform
finite_difference
cartesian
scheme
O(dx^2)
Auto-generated catalog entry for the centered_2nd_deriv_uniform rule (finite_difference, grid family cartesian). The discrete operator is pretty-printed directly from the rule's replacement AST.
- centered_2nd_deriv_uniform_vertical
finite_difference
vertical
scheme
O(dz^2)
Auto-generated catalog entry for the centered_2nd_deriv_uniform_vertical rule (finite_difference, grid family vertical). The discrete operator is pretty-printed directly from the rule's replacement AST.
- centered_2nd_nonuniform_cartesian
finite_difference
cartesian
scheme
O(dx^2)
Auto-generated catalog entry for the centered_2nd_nonuniform_cartesian rule (finite_difference, grid family cartesian). The discrete operator is pretty-printed directly from the rule's replacement AST.
- centered_2nd_nonuniform_vertical
finite_difference
vertical
scheme
O(dz_k^2)
Auto-generated catalog entry for the centered_2nd_nonuniform_vertical rule (finite_difference, grid family vertical). The discrete operator is pretty-printed directly from the rule's replacement AST.
- centered_2nd_uniform
finite_difference
cartesian
scheme
O(dx²)
Two-point centered second-order finite difference for ∂u/∂x on a uniform Cartesian axis, expressed as a closed §4.2 arrayop lowering.
- centered_2nd_uniform_latlon
finite_difference
latlon
scheme
O(h²)
Centered second-order finite difference on a regular lat-lon grid, with the standard cos λ metric on the longitudinal stencil.
- centered_2nd_uniform_vertical
finite_difference
vertical
scheme
O(h²)
Two-point centered second-order finite difference for ∂u/∂k on a uniformly-spaced vertical axis.
- centered_4th_deriv_uniform
finite_difference
cartesian
scheme
O(dx^4)
Auto-generated catalog entry for the centered_4th_deriv_uniform rule (finite_difference, grid family cartesian). The discrete operator is pretty-printed directly from the rule's replacement AST.
- centered_4th_uniform
finite_difference
cartesian
scheme
O(dx^4)
Auto-generated catalog entry for the centered_4th_uniform rule (finite_difference, grid family cartesian). The discrete operator is pretty-printed directly from the rule's replacement AST.
- centered_4th_uniform_latlon
finite_difference
latlon
scheme
O(h^4)
Auto-generated catalog entry for the centered_4th_uniform_latlon rule (finite_difference, grid family latlon). The discrete operator is pretty-printed directly from the rule's replacement AST.
- centered_4th_uniform_vertical
finite_difference
vertical
scheme
O(h^4)
Auto-generated catalog entry for the centered_4th_uniform_vertical rule (finite_difference, grid family vertical). The discrete operator is pretty-printed directly from the rule's replacement AST.
- centered_6th_deriv_uniform
finite_difference
cartesian
scheme
O(dx^6)
Auto-generated catalog entry for the centered_6th_deriv_uniform rule (finite_difference, grid family cartesian). The discrete operator is pretty-printed directly from the rule's replacement AST.
- centered_6th_uniform
finite_difference
cartesian
scheme
O(dx^6)
Auto-generated catalog entry for the centered_6th_uniform rule (finite_difference, grid family cartesian). The discrete operator is pretty-printed directly from the rule's replacement AST.
- centered_6th_uniform_latlon
finite_difference
latlon
scheme
O(h^6)
Auto-generated catalog entry for the centered_6th_uniform_latlon rule (finite_difference, grid family latlon). The discrete operator is pretty-printed directly from the rule's replacement AST.
- centered_6th_uniform_vertical
finite_difference
vertical
scheme
O(h^6)
Auto-generated catalog entry for the centered_6th_uniform_vertical rule (finite_difference, grid family vertical). The discrete operator is pretty-printed directly from the rule's replacement AST.
- centered_8th_deriv_uniform
finite_difference
cartesian
scheme
O(dx^8)
Auto-generated catalog entry for the centered_8th_deriv_uniform rule (finite_difference, grid family cartesian). The discrete operator is pretty-printed directly from the rule's replacement AST.
- centered_8th_uniform
finite_difference
cartesian
scheme
O(dx^8)
Auto-generated catalog entry for the centered_8th_uniform rule (finite_difference, grid family cartesian). The discrete operator is pretty-printed directly from the rule's replacement AST.
- centered_8th_uniform_latlon
finite_difference
latlon
scheme
O(h^8)
Auto-generated catalog entry for the centered_8th_uniform_latlon rule (finite_difference, grid family latlon). The discrete operator is pretty-printed directly from the rule's replacement AST.
- centered_8th_uniform_vertical
finite_difference
vertical
scheme
O(h^8)
Auto-generated catalog entry for the centered_8th_uniform_vertical rule (finite_difference, grid family vertical). The discrete operator is pretty-printed directly from the rule's replacement AST.
- covariant_fv_gradient_latlon_t1
finite_volume
latlon
scheme
O(h^2)
Auto-generated catalog entry for the covariant_fv_gradient_latlon_t1 rule (finite_volume, grid family latlon). The discrete operator is pretty-printed directly from the rule's replacement AST.
- covariant_fv_gradient_latlon_t2
finite_volume
latlon
scheme
O(h^2)
Auto-generated catalog entry for the covariant_fv_gradient_latlon_t2 rule (finite_volume, grid family latlon). The discrete operator is pretty-printed directly from the rule's replacement AST.
- covariant_fv_laplacian_latlon
finite_volume
latlon
scheme
O(h^2)
Auto-generated catalog entry for the covariant_fv_laplacian_latlon rule (finite_volume, grid family latlon). The discrete operator is pretty-printed directly from the rule's replacement AST.
- divergence_arakawa_c
finite_volume
arakawa
scheme
O(h²)
Two-point centered finite-volume divergence on a C-grid — F_x at face_x, F_y at face_y, divergence emitted at cell_center.
- divergence_duo
finite_volume
unstructured
scheme
O(h) on a quasi-uniform icosahedral triangular mesh
Auto-generated catalog entry for the divergence_duo rule (finite_volume, grid family unstructured). The discrete operator is pretty-printed directly from the rule's replacement AST.
- divergence_mpas
finite_volume
unstructured
scheme
O(h^2) on a quasi-uniform Voronoi mesh
Auto-generated catalog entry for the divergence_mpas rule (finite_volume, grid family unstructured). The discrete operator is pretty-printed directly from the rule's replacement AST.
- flux_1d_ppm
finite_volume
cartesian
scheme
O(h^3) interior; O(h) at active limiter constraints
PPM-based 1D flux-form transport face flux: 4th-order CW84 edge interpolation + Colella-Woodward (1984) §4 monotonicity limiter + Courant-fraction flux integral + ifelse upwind selection on the per-face Courant.
- flux_duo
finite_volume
unstructured
scheme
O(h) on a quasi-uniform icosahedral triangular mesh
Auto-generated catalog entry for the flux_duo rule (finite_volume, grid family unstructured). The discrete operator is pretty-printed directly from the rule's replacement AST.
- flux_limiter_minmod
limiter
cartesian
limiter
O(dx²) in smooth monotone regions; O(dx) at extrema
Minmod TVD flux limiter (Roe 1986) — the most diffusive of the symmetric second-order TVD limiters.
- flux_limiter_superbee
limiter
cartesian
limiter
O(dx²) in smooth monotone regions; compressive near discontinuities
Superbee TVD flux limiter (Roe 1986) — sits on the upper edge of the second-order TVD region.
- godunov_norm_1st_uniform_cartesian_2d
finite_difference
cartesian
scheme
O(dx)
Auto-generated catalog entry for the godunov_norm_1st_uniform_cartesian_2d rule (finite_difference, grid family cartesian). The discrete operator is pretty-printed directly from the rule's replacement AST.
- gradient_duo
finite_volume
unstructured
scheme
O(h) on a quasi-uniform icosahedral triangular mesh
Auto-generated catalog entry for the gradient_duo rule (finite_volume, grid family unstructured). The discrete operator is pretty-printed directly from the rule's replacement AST.
- gradient_mpas
finite_volume
unstructured
scheme
O(h^2) on a quasi-uniform Voronoi mesh
Auto-generated catalog entry for the gradient_mpas rule (finite_volume, grid family unstructured). The discrete operator is pretty-printed directly from the rule's replacement AST.
- laplacian_2nd_uniform_cartesian
finite_difference
cartesian
scheme
O(dx^2)
Auto-generated catalog entry for the laplacian_2nd_uniform_cartesian rule (finite_difference, grid family cartesian). The discrete operator is pretty-printed directly from the rule's replacement AST.
- lax_friedrichs_flux
finite_volume
cartesian
scheme
O(h)
Lax–Friedrichs first-order numerical flux for 1D linear advection on a uniform Cartesian axis. For face-staggered Courant c the LF flux reduces to first-order upwinding F_{i+1/2} = max(c,0)·q_i + min(c,0)·q_{i+1}, with upwind cell selection encoded directly in an abs op (no caller-side branching on sign(c)).
- midpoint_1d
integral
cartesian
scheme
O(h^2) midpoint/Euler quadrature of a full-domain 1-D integral on a uniform cartesian grid
Auto-generated catalog entry for the midpoint_1d rule (integral, grid family cartesian). The discrete operator is pretty-printed directly from the rule's replacement AST.
- mixed_deriv_2nd_nonuniform
finite_difference
cartesian
scheme
O(dx_i*dy_j)
Auto-generated catalog entry for the mixed_deriv_2nd_nonuniform rule (finite_difference, grid family cartesian). The discrete operator is pretty-printed directly from the rule's replacement AST.
- mixed_deriv_2nd_uniform
finite_difference
cartesian
scheme
O(dx^2)
Auto-generated catalog entry for the mixed_deriv_2nd_uniform rule (finite_difference, grid family cartesian). The discrete operator is pretty-printed directly from the rule's replacement AST.
- nn_diffusion_duo
finite_difference
unstructured
scheme
O(h^2) on a quasi-uniform triangular icosahedral mesh
Auto-generated catalog entry for the nn_diffusion_duo rule (finite_difference, grid family unstructured). The discrete operator is pretty-printed directly from the rule's replacement AST.
- nn_diffusion_mpas
finite_difference
mpas
scheme
O(h²) on quasi-uniform Voronoi
Nearest-neighbor diffusion on an MPAS Voronoi mesh, summed over edges_on_cell with dv_edge / (dc_edge · area_cell) coefficients.
- nonlinear_laplacian_nonuniform
finite_difference
cartesian
scheme
O(dx_i^2)
Auto-generated catalog entry for the nonlinear_laplacian_nonuniform rule (finite_difference, grid family cartesian). The discrete operator is pretty-printed directly from the rule's replacement AST.
- nonlinear_laplacian_uniform
finite_difference
cartesian
scheme
O(dx^2)
Auto-generated catalog entry for the nonlinear_laplacian_uniform rule (finite_difference, grid family cartesian). The discrete operator is pretty-printed directly from the rule's replacement AST.
- periodic_bc
finite_difference
cartesian
boundary_condition
exact (index rewrite)
Periodic boundary handling as a downstream index-rewrite rule: wraps an out-of-range stencil access index(u, i − offset) to index(u, mod(i − offset + Nx, Nx)) on axes declared periodic by the domain.
- ppm_reconstruction
finite_volume
cartesian
scheme
O(dx³)
Piecewise-parabolic method (Colella & Woodward 1984) — 4th-order edge values + a parabola per cell, no limiter.
- ppm_reconstruction_left_edge
finite_volume
cartesian
scheme
O(dx^4)
Auto-generated catalog entry for the ppm_reconstruction_left_edge rule (finite_volume, grid family cartesian). The discrete operator is pretty-printed directly from the rule's replacement AST.
- ppm_reconstruction_right_edge
finite_volume
cartesian
scheme
O(dx^4)
Auto-generated catalog entry for the ppm_reconstruction_right_edge rule (finite_volume, grid family cartesian). The discrete operator is pretty-printed directly from the rule's replacement AST.
- spherical_laplacian_nonuniform
finite_difference
cartesian
scheme
O(dr_i^2)
Auto-generated catalog entry for the spherical_laplacian_nonuniform rule (finite_difference, grid family cartesian). The discrete operator is pretty-printed directly from the rule's replacement AST.
- spherical_laplacian_uniform
finite_difference
cartesian
scheme
O(dr^2)
Auto-generated catalog entry for the spherical_laplacian_uniform rule (finite_difference, grid family cartesian). The discrete operator is pretty-printed directly from the rule's replacement AST.
- staggered_1st_uniform_cc_to_face
finite_difference
arakawa
scheme
O(h^2) (two-point centered difference at the half-offset face)
Auto-generated catalog entry for the staggered_1st_uniform_cc_to_face rule (finite_difference, grid family arakawa). The discrete operator is pretty-printed directly from the rule's replacement AST.
- staggered_1st_uniform_face_to_cc
finite_difference
arakawa
scheme
O(h^2) (two-point centered difference at the half-offset cell center)
Auto-generated catalog entry for the staggered_1st_uniform_face_to_cc rule (finite_difference, grid family arakawa). The discrete operator is pretty-printed directly from the rule's replacement AST.
- upwind_1st
finite_difference
cartesian
scheme
O(dx)
First-order upwind (backward) finite difference for ∂u/∂x on a uniform Cartesian axis.
- upwind_1st_latlon
finite_difference
latlon
scheme
O(h)
Auto-generated catalog entry for the upwind_1st_latlon rule (finite_difference, grid family latlon). The discrete operator is pretty-printed directly from the rule's replacement AST.
- upwind_1st_nonuniform
finite_difference
cartesian
scheme
O(dx_i)
Auto-generated catalog entry for the upwind_1st_nonuniform rule (finite_difference, grid family cartesian). The discrete operator is pretty-printed directly from the rule's replacement AST.
- upwind_1st_vertical
finite_difference
vertical
scheme
O(h)
Auto-generated catalog entry for the upwind_1st_vertical rule (finite_difference, grid family vertical). The discrete operator is pretty-printed directly from the rule's replacement AST.
- vertical_remap
finite_volume
vertical
scheme
O(dp^3) interior; O(dp) within two cells of the column top/bottom and at active CW84 limiter constraints
Conservative PPM vertical remap (Lin 2004) of a cell-averaged scalar from one set of vertical layer thicknesses to another: 4th-order CW84 edge interpolation + Colella–Woodward (1984) §4 monotonicity limiter + exact integration of the sub-grid parabola over the cumulative-pressure overlap. Documentation-only — deferred to a future ESS phase-hook RFC.
- weno5_advection
finite_volume
cartesian
scheme
O(dx⁵)
Jiang–Shu (1996) 5th-order WENO reconstruction expressed as a closed §4.2 arrayop+ifelse lowering — canonical nonlinear-scheme exemplar.
- weno5_advection_2d
finite_volume
cartesian
scheme
O(h⁵)
Dimension-by-dimension Jiang–Shu WENO5 reconstruction on a 2D structured uniform Cartesian grid.
- weno5_grad
finite_difference
cartesian
scheme
O(dx^5)
Auto-generated catalog entry for the weno5_grad rule (finite_difference, grid family cartesian). The discrete operator is pretty-printed directly from the rule's replacement AST.