Mass of a thin hydrostatic atmosphere (source code)

= Mass of a thin hydrostatic atmosphere

The column mass between pressures $P_0$ and $P_{\rm top}$ is $(P_0-P_{\rm top})/g$. A thin atmosphere over a spherical planet therefore has
$$
M_{\rm atm}\simeq\frac{4\pi R_p^2(P_0-P_{\rm top})}{g}
\simeq\frac{4\pi R_p^4P_0}{GM_p}
$$
when its top pressure is negligible.