Solution (source code)

= Solution

A <foehn wind> is relatively warm, dry downslope air on a mountain's lee side. In the classical condensation pathway, ascending windward air expands and cools at the <dry adiabatic lapse rate> until the <lifting condensation level>. Condensation then releases <latent heat>, reducing the cooling rate to the <moist adiabatic lapse rate>. <Atmospheric precipitation> removes condensate, and the descending parcel warms by compression at approximately the dry rate. Its <relative humidity> falls.

For equal starting and finishing heights, complete condensate removal and a constant moist lapse rate above condensation height $z_c$, the <precipitation-driven foehn warming> is
$$
\boxed{T_{\rm lee}-T_{\rm windward}\simeq(\Gamma_d-\Gamma_m)(H-z_c)>0.}
$$
Here $H>z_c$ is the parcel's maximum height and $\Gamma_d>\Gamma_m$. The warming is adiabatic compression during descent, not heating by friction. Without condensation or a difference in source air, a reversible dry parcel returning to its original height would regain its original temperature.

Precipitation is not essential to every foehn event. <Isentropic foehn drawdown> can bring air of higher <potential temperature> from aloft down the lee slope; turbulent mixing and extra solar heating beneath clear skies can also contribute. The sketch shows the classical rainout pathway rather than asserting a unique mechanism.<Foehn effect by Met Office>[How does the foehn effect work? Condensation/rainout, drawdown, mixing and radiative warming]{ref}

\Image[/past-exam-of-the-atmospheric-physics-course-of-the-university-of-cambridge/2013/paper-1-ap2013-foehn-cross-section.png]
{title=Classical foehn pathway: moist ascent and condensate loss followed by dry compressional warming on the lee side}
{source=paper-1-ap2013-foehn-cross-section.py}