pvtend.GridProfile

class pvtend.GridProfile(name: str, nlat: int, nlon: int, lat_south: float, lat_north: float, dlat: float, dlon: float, lon_west: float, lat_half: float, lon_half: float, z_is_height: bool, inv_band_s: float = 10.5, inv_band_n: float = 85.5)[source]

Static description of an input grid + its PV-inversion geometry (config).

Bundles the regular lat-lon grid metadata, the event-patch half-widths, and the Wu QG piecewise-inversion latitude band. Scope (v2.13): this is metadata/config consumed by callers. The Wu inversion solver (pvtend.ppvi.solver.invert_piecewise()) is genuinely grid-agnostic (anisotropic-safe zhdr reorder + below-ground fill), and the spectral Helmholtz/derivatives (pvtend.sh_ops) are global. The higher-level TendencyComputer pipeline, however, is still ERA5-specific (it hard-codes the 10.5–85.5°N band and H=z/g), so f09 end-to-end use currently goes through the solver API directly — build the cubes + zhdr yourself and pass H=z when z_is_height (see the pv_inversion/wu_cesm closure test for a worked example). Two profiles are provided:

  • ERA5_1P5_NH — the default ERA5 1.5° Northern-Hemisphere grid (current behaviour; isotropic Δlat=Δlon=1.5°).

  • CESM_F09 — the CESM2-LENS2 f09 global grid (192×288, anisotropic Δlat≈0.942°, Δlon=1.25°). Helmholtz/derivatives run fully global; the Wu QG inversion runs on the mid-latitude band [inv_band_s, inv_band_n] (it is singular at the equator/poles, so a truly-global QG inversion is out of scope — the band covers all blocking, ~25–85°N).

Note: CESM z is geopotential height [m] (use H=z directly), whereas ERA5 z is geopotential [m²/s²] (H=z/g).

__init__(name: str, nlat: int, nlon: int, lat_south: float, lat_north: float, dlat: float, dlon: float, lon_west: float, lat_half: float, lon_half: float, z_is_height: bool, inv_band_s: float = 10.5, inv_band_n: float = 85.5) None

Methods

__init__(name, nlat, nlon, lat_south, ...[, ...])

Attributes

inv_band_n

inv_band_s

isotropic

True if Δlat≈Δlon (Wu zhdr ordering is then irrelevant).

name

nlat

nlon

lat_south

lat_north

dlat

dlon

lon_west

lat_half

lon_half

z_is_height