Why does the equator get two rainy seasons, why do storms build at 3 pm, and what happens to the river when the forest goes?
The science
Sun and ITCZ. Declination delta = 23.44 deg x sin(2 pi (d - 80)/365). The equator is overhead twice a year (equinoxes), so daily insolation has two maxima. The convergence zone follows the sun with a lag: phi_ITCZ = A sin(2 pi (d - 80 - lag)/365) with A = 12 deg and lag = 30 days over land (illustrative). Rain concentrates where the site is near the ITCZ: weight exp(-((phi - phi_ITCZ)/8 deg)^2).
Daily insolation. Q = S0/pi (d0/d)^2 (h0 sin phi sin delta + cos phi cos delta sin h0), S0 = 1361 W/m2; the page integrates the hourly flux numerically to compare.
Parcel model. Saturation vapour pressure (Bolton) e_s = 6.112 exp(17.67 T/(T + 243.5)) hPa; dew point from relative humidity; lifting condensation level from Bolton's formula (Espy rule 125 m per kelvin is the cross-check). Above it the parcel cools at the moist-adiabatic rate Gamma_m = g (1 + L r_s/(R T)) / (c_p + L^2 r_s eps/(R T^2)). CAPE = integral of g (T_p - T_e)/T_e dz up to the equilibrium level; environment lapse rate 6.2 K/km up to 13 km. Rain per day is 17 mm x min(1.6, CAPE/1500) x ITCZ weight, plus 2 mm/day x weight of stratiform rain, averaged over a five-member +-1.2 K temperature ensemble. These rain constants are tuned to give a rainforest-like total (about 1600 mm/yr) and are illustrative, not fitted to a station.
Water balance. A soil bucket of 400 mm (illustrative): dW/dt = P - ET - Q. Evapotranspiration is Priestley-Taylor, ET = alpha Delta/(Delta + gamma) Rn/lambda, alpha = 1.26 for forest and 0.8 for pasture, throttled when the bucket is below 55 %. Runoff is overflow plus a drainage term that grows when forest is removed. Forest loss also lowers boundary-layer humidity by the moisture-recycling slider (0.05 per unit of forest lost, illustrative), which lifts the condensation level and weakens CAPE.
Not modelled: ocean-atmosphere coupling, Walker circulation, MJO, orography, aerosols, real rainfall observations. Cloud and forest are stylised. This is a teaching model; for real data use station or satellite records. Models built with Blender (trees, basin, river, cloud puffs) and rendered with Three.js.