Solution (source code)

= Solution

The <isentropic potential vorticity> is <Ertel potential vorticity> expressed on constant <potential temperature> surfaces:
$$
\boxed{q=\frac{\boldsymbol\omega_a\cdot\nabla\theta}{\rho}=\frac{\zeta_\theta+f}{\sigma_\theta},\qquad\sigma_\theta=-\frac1g\frac{\partial p}{\partial\theta}>0.}
$$
Here $\zeta_\theta$ is the vertical curl of horizontal velocity differentiated on an isentropic surface, and $\sigma_\theta$ is mass per unit area per unit potential-temperature interval. For smooth inviscid adiabatic motion, \b[$Dq/Dt=0$]. Conserved anomalies are advected and deformed, explaining much balanced large-scale weather variability. Diagnosing velocity from PV additionally needs balance, stratification and boundary information. Strong latent/radiative heating, friction and irreversible mixing generate or modify PV, limiting a purely conservative explanation.<Fundamentals of Atmosphere-Ocean Dynamics by Michael Edgeworth McIntyre>[Potential-vorticity conservation, balance and Rossby-wave dynamics]{ref}