pvtend.helmholtz.solve_poisson_spherical_fft

pvtend.helmholtz.solve_poisson_spherical_fft(rhs: ndarray, lat: ndarray, dy: float, dlon_rad: float, R_earth: float = 6371000.0, bc_type: str = 'dirichlet', bc_south: ndarray | None = None, bc_north: ndarray | None = None) ndarray[source]

Solve the spherical Poisson equation — periodic in λ, configurable φ BCs.

Solves the full spherical Laplacian on a lat-lon grid:

(1/(a²cos²φ)) ∂²χ/∂λ² + (1/a²cosφ) ∂/∂φ(cosφ ∂χ/∂φ) = f

Uses the conservative (divergence) form for the meridional operator — following xinvert (MiniUFO). Multiply through by a²cosφ:

(1/cosφ) ∂²χ/∂λ² + ∂/∂φ(cosφ ∂χ/∂φ) = f · a² · cosφ

Two boundary condition types in φ:

  • "dirichlet" (legacy): χ = 0 at both φ boundaries. Solves interior rows only (nlat−2 unknowns).

  • "neumann" (default, Li et al. 2006): ∂χ/∂φ = g at boundaries. bc_south and bc_north are the prescribed ∂χ/∂φ values (1-D, shape (nlon,)). Solves the full nlat system with the boundary rows replaced by one-sided FD conditions. This minimises the harmonic residual in bounded domains.

Parameters:
  • rhs – Right-hand side of ∇²χ = rhs, shape (nlat, nlon).

  • lat – Latitude in degrees, shape (nlat,).

  • dy – Meridional grid spacing a·Δφ [m].

  • dlon_rad – Longitudinal grid spacing Δλ in radians.

  • R_earth – Earth radius [m].

  • bc_type"dirichlet" or "neumann" (default).

  • bc_south – ∂χ/∂φ at the south boundary, shape (nlon,). Required when bc_type is "neumann".

  • bc_north – ∂χ/∂φ at the north boundary, shape (nlon,). Required when bc_type is "neumann".

Returns:

Solution χ, shape (nlat, nlon).

References

Li Z, Chao Y, McWilliams JC (2006) MWR 134, 3384–3394. Lynch P (1989) MWR 117, 1492–1500.