centered_2nd_uniform_latlon

Family
finite_difference
Grid family
latlon
Kind
scheme
Accuracy
O(h²)
Applies to
grad(u), dim=k (k ∈ {lon, lat})
Rule file
discretizations/finite_difference/centered_2nd_uniform_latlon.json
Tags
#finite-difference #lat-lon #spherical #metric

Stencil

centered_2nd_uniform_latlon stencils for the lon and lat axes
Two-point centered stencil applied independently on the lon and lat axes; the lon coefficients carry the cos λ spherical metric factor.

Coefficients

selector kindaxisoffsetcoeff
latlonlon−1−1 / (2 R cos λ dλ)
latlonlon+1+1 / (2 R cos λ dλ)
latlonlat−1−1 / (2 R dφ)
latlonlat+1+1 / (2 R dφ)

R is sphere radius, λ is latitude, and are constant grid spacings. The lat-lon accessor surfaces cos_lat as a per-row metric quantity bound at evaluation time.

Discrete operator

Let u_{i,j} denote the cell-centered value at longitude index i and latitude index j, with constant grid spacings Δλ, Δφ and per-row metric cos φ_j. The two axes apply independently:

$$ \left.\frac{1}{R\cos\varphi}\,\frac{\partial u}{\partial\lambda}\right|_{i,j} \;\approx\; \frac{u_{i+1,j} - u_{i-1,j}}{2\,R\,\cos\varphi_j\,\Delta\lambda}, \qquad \left.\frac{1}{R}\,\frac{\partial u}{\partial\varphi}\right|_{i,j} \;\approx\; \frac{u_{i,j+1} - u_{i,j-1}}{2\,R\,\Delta\varphi}. $$

A Taylor expansion about each cell center gives the leading truncation errors

$$ \frac{(\Delta\lambda)^2}{6}\, \frac{1}{R\cos\varphi_j}\,\frac{\partial^3 u}{\partial\lambda^3}, \qquad \frac{(\Delta\varphi)^2}{6}\, \frac{1}{R}\,\frac{\partial^3 u}{\partial\varphi^3}, $$

so each axis is O(h²) in its own grid spacing. Latitude rows adjacent to the poles are excluded from the support — the ±1 lat offset would step past the grid — and the lon axis is periodic in i.

Convergence

Empirical convergence — slope ≈ −2 on log-log
L error of the lat-axis stencil applied to the lon-independent Y2,0 spherical harmonic on the unit sphere, sampled at cell centers with n ∈ {16, 32, 64, 128} and dropping the polar rows from the measurement. The empirical slope tracks the expected −2 reference line.

The Layer-B walker drives this rule through ESS’s verify_mms_convergence with the registered Y2,0 spherical-harmonic manufactured solution on the unit sphere (lon-independent, so the lon stencil is exact and the test isolates the lat-axis 2nd-order accuracy). The fixture sweeps n ∈ {16, 32, 64, 128} with nlon = 2 n, nlat = n and asserts an observed L minimum order ≥ 1.9 over interior cells (poles excluded by the lat stencil’s reach). Inputs/expected live under fixtures/convergence/.