Solution (source code)

= Solution

For <dry atmospheric Ertel potential vorticity>, use <absolute vorticity> $\boldsymbol\omega_a=\nabla\times\mathbf u+2\boldsymbol\Omega$ and <potential temperature> $\theta=T(p_0/p)^{R_d/c_p}$:
$$
\boxed{q_E=\frac{\boldsymbol\omega_a\cdot\nabla\theta}{\rho},\qquad
\frac{Dq_E}{Dt}=0.}
$$
The conservation statement is <Ertel's theorem> for smooth, inviscid, adiabatic flow with conservative body forces and a thermodynamic equation of state $p=p(\rho,\theta)$. Stretching of $\boldsymbol\omega_a/\rho$ cancels deformation of $\nabla\theta$ in their material derivative; the remaining baroclinic triple product vanishes because $\nabla p$ lies in the span of $\nabla\rho,\nabla\theta$. The atmospheric form includes $1/\rho$; the commonly used <Boussinesq approximation> version has a different normalization.

In a predominantly vertical stratification, $q_E\simeq(f+\zeta)\,\partial_z\theta/\rho$. Thus rotation and stratification jointly label air masses. Material conservation explains how parcels deform and stretch while preserving a useful scalar, supports <Rossby waves>, and helps diagnose sharp fronts, jets and stratospheric intrusions.

Under an appropriate balance model, <potential-vorticity inversion> recovers associated wind and temperature fields from a PV distribution together with stratification and boundary data. \b[PV alone does not specify every component of an arbitrary atmospheric flow.] <Potential-vorticity generation by heating and friction> limits conservative parcel reasoning near strong heating, surface stress or mixing.<Fundamentals of Atmosphere-Ocean Dynamics by Michael Edgeworth McIntyre>[PartII§12, equationII.17, physical PDF pp.150–152: dry atmospheric PV and qualified invertibility]{ref}