Earth
Earth's energy budget
Follow every watt of sunlight through a column of air standing on a slice of the Earth in a dark observatory hall. A lamp-sun pours in 340 W/m²; a cloud deck and the ground send 30 % back to space, the air absorbs a third of the rest, and thirty grey layers pass the infrared up and down. Start the column frozen at 170 K or hot at 360 K and watch both settle on the same radiative-convective equilibrium near 288 K: the critical lapse rate up to a tropopause near 9 km, 350 W/m² of back radiation, 123 W/m² carried up by convection, 237 W/m² leaving the top. Switch off convection and the ground climbs to 332 K; strip the air away and it falls to Te; one opaque layer gives 2^(1/4) Te. Double CO2 for 3.7 W/m² of forcing and 1.2 K of warming, 2.8 K if water vapour follows; turn forest into desert or ocean and watch the surface settle in weeks or years.

What happens
Thirty layers of equal mass (33.3 hPa each) over a surface slab: forest (albedo 0.14, 8 MJ/m²/K), a 50 m ocean mixed layer (0.06, 204 MJ/m²/K) or desert sand (0.38, 3 MJ/m²/K). Sunlight S/4 = 340 W/m² is absorbed on the way down by a grey shortwave depth of 0.18 spread evenly by mass and an ozone depth of 0.02 near the top; a cloud deck at 700 hPa reflects 32 % of what reaches it, the ground its albedo, and both reflected beams are absorbed again on the way up. Infrared travels in two bands, each two-stream for isothermal layers with the diffusivity D = 1.66: U(i+1) = t·U(i) + (1 − t)·f·σT⁴ with t = exp(−D·Δτ), and the same downward. The main band carries 75 % of σT⁴ with τ = 8·(p/ps)⁴ for water vapour plus 0.6·(p/ps) for CO2, which grows by 0.105 per doubling; the window carries 25 % and sees a tenth of the vapour. Every 6 hours each layer and the ground take forward-Euler steps of c·dT/dt = absorbed − emitted, so the column gains exactly (absorbed sunlight − outgoing infrared)·Δt. Then convective adjustment: with π = (p/ps)^(R·Γ/g) the profile T = θ·π has the critical lapse rate Γ = 6.5 K/km, and pooling θ with weights w·π, the ground included, wherever it falls with height sets each unstable stretch to Γ at its own enthalpy. Closed forms: without air Ts = Te = ((1 − α)·S/4σ)^(1/4); one opaque layer Ts = 2^(1/4)·Te; grey radiative equilibrium Ts⁴ = Te⁴·(1 + Σ tanh(D·Δτ/2)), the Eddington–Milne 1 + D·τ*/2 for thin layers. With the feedback on, the vapour depth grows 5 % per kelvin of the ground, at most eightfold.
Try this
Start cold or warm and watch both columns settle on the same equilibrium; follow the ribbons and read the top and surface balances; switch convection off and see the ground overheat; double CO2 and read the forcing, then the warming; turn on the water-vapour feedback; swap the forest for desert or ocean and time how fast the surface follows; try one opaque layer and no atmosphere against their closed forms.
The model and its limits
A one-dimensional global-mean column: grey radiation in two bands instead of a spectral calculation, a fixed cloud deck, a prescribed critical lapse rate instead of resolved convection, no seasons, days or latitudes, no ice and no ocean below the mixed layer. The CO2 slider adds a fixed grey depth per doubling tuned to about 3.7 W/m² of adjusted forcing - a coefficient, not a concentration. The water-vapour feedback is a simple exponential, capped so that there is no runaway greenhouse; the thin grey stratosphere relaxes far more slowly than the real one. Numbers belong to this idealized column.
Equations used in the module
Equations U(i+1) = t·U(i) + (1 − t)·f·σT⁴, D(i) = t·D(i+1) + (1 − t)·f·σT⁴, t = exp(−1.66·Δτ) c_p·(Δp/g)·dT/dt = SW_abs + ΔU + ΔD, C_s·dTs/dt = SW_s + D(0) − σTs⁴ − F_conv T = θ·(p/ps)^(R·Γ/g), θ pooled where it falls with height: Σ w·T conserved Te = ((1 − α)·S/4σ)^(1/4), Ts⁴ = Te⁴·(1 + Σ tanh(D·Δτ/2)) → Te⁴·(1 + D·τ*/2)


