pvtend.solve_chi_from_omega

pvtend.solve_chi_from_omega(omega: ndarray, lat: ndarray, lon: ndarray, plevs_pa: ndarray, method: str = 'spectral') tuple[ndarray, ndarray, ndarray][source]

Solve ∇²χ = -∂ω/∂p at each level.

Computes the velocity potential of the divergent wind associated with omega by solving a Poisson equation on each pressure level.

By default (method="spectral") the solve uses spherical harmonics via pvtend.sh_ops.invert_laplacian_sh(), which is pole-closed and supports auto NH→global parity mirroring (scalar parity for χ). Pass method="fd" to fall back to the legacy conservative-form spherical-FFT Poisson solver.

Parameters:
  • omega – Vertical velocity component [Pa/s], shape (nlev, nlat, nlon).

  • lat – Latitude [degrees], ascending, shape (nlat,).

  • lon – Longitude [degrees], shape (nlon,).

  • plevs_pa – Pressure levels [Pa], ascending, shape (nlev,).

  • method"spectral" (default) or "fd".

Returns:

Tuple of (chi, u_div, v_div), each with shape (nlev, nlat, nlon).

Raises:

ValueError – If omega is not 3-D.