Solution (source code)

= Solution

<Hydrostatic equilibrium> balances the vertical <pressure gradient> against weight, $dP/dz=-\rho g$. For a dry <ideal gas> parcel displaced slowly enough to maintain pressure balance but rapidly enough to exchange negligible <heat>, the first law gives
$$
c_p\,dT-\frac1\rho\,dP=0.
$$
Combining the two equations yields the <dry adiabatic lapse rate>
$$
\boxed{\Gamma_d=-\frac{dT}{dz}=\frac g{c_p}\simeq9.8\,\mathrm{K\,km^{-1}},}
$$
using $c_p\simeq1004\,\mathrm{J\,kg^{-1}\,K^{-1}}$. Here <temperature> in the thermodynamic differential is absolute, $g$ and $c_p$ are treated as constant, composition is fixed, and condensation is excluded. Hydrostatic balance alone does not force the atmosphere to be adiabatic; the parcel assumption supplies the extra relation.

Water condensation releases <latent heat>, reducing the cooling of a rising saturated parcel and giving a smaller <moist adiabatic lapse rate>. Radiation, mixing, large-scale motion and incomplete convective adjustment also shape the environmental lapse rate. Thus an observed $6$--$7\,\mathrm{K\,km^{-1}}$ need not equal the dry parcel value and is broadly consistent with a moist, radiatively influenced atmosphere.