Snapshot / Computational Thinking Repo ↗

Carbon emissions and future warming

We can now close the loop between human choices and planetary temperature. Burning fossil fuel adds CO₂ to the air; that CO₂ forces the Energy Balance Model; the model warms. Chain those together and you get a projection: given an emissions path, how hot does it get, and when?

The dial below is the one that actually matters in the real world: how fast we keep emitting CO₂. Set it high and watch temperature climb steeply through the century; bring it toward zero and warming levels off. This is, in miniature, exactly the calculation behind climate projections — running live in WebAssembly.

begin
    using PlutoUI, WasmMakie
end

CO₂ added per year (ppm) = 25 ÷10

years into the future = 100

let
    # start from today (about 420 ppm, ~15 C) and march forward: each year add emissions to
    # CO2, recompute the greenhouse forcing, and Euler-step the temperature. All bonded
    # values are localized first; the loop body uses only locals.
    A = 214.6
    B = 1.77
    C = 51.0
    absorbed = 239.4
    emit = Float64(emiti) / 10.0
    co2 = 420.0
    T = 15.0

    Ts = Vector{Float64}(undef, nyears + 1)
    ts = Vector{Float64}(undef, nyears + 1)
    Ts[1] = T
    ts[1] = 0.0
    for y in 1:nyears
        co2 = co2 + emit
        forcing = 5.35 * log(co2 / 280.0)
        dT = (absorbed - (A + B * T) + forcing) / C
        T = T + dT
        Ts[y + 1] = T
        ts[y + 1] = Float64(y)
    end

    fig = Figure(size = (600, 350))
    ax = Axis(fig[1, 1])
    lines!(ax, [0.0, Float64(nyears)], [14.0, 14.0])    # pre-industrial baseline
    lines!(ax, [0.0, Float64(nyears)], [16.5, 16.5])    # the +2.5C "danger" line
    lines!(ax, ts, Ts)                                   # the projection
    fig
end
cw_stats = let
    # final CO2 + temperature in a SEPARATE bond-dependent cell so the markdown below
    # interpolates them live (values inside a markdown cell's own `let` bake to the
    # slider defaults).
    A = 214.6
    B = 1.77
    C = 51.0
    absorbed = 239.4
    emit = Float64(emiti) / 10.0
    co2 = 420.0
    T = 15.0
    for y in 1:nyears
        co2 = co2 + emit
        forcing = 5.35 * log(co2 / 280.0)
        dT = (absorbed - (A + B * T) + forcing) / C
        T = T + dT
    end
    (floor(co2), floor(T * 10.0) / 10.0, floor((T - 14.0) * 10.0) / 10.0)
end;

In 100 years: CO2 reaches about 670.0 ppm and the planet warms to about 16.3 C – that is 2.3 C above pre-industrial. Slide emissions toward 0 and the curve bends flat; keep them high and it sails past the 2 C and 3 C guardrails. The future temperature is, quite literally, a choice of slope.

What the projection does and doesn't say

This model gets the shape of the story right — emissions drive CO₂, CO₂ drives warming, and cutting emissions bends the curve — with arithmetic you can watch. Real projections add the ocean's slow uptake of heat and carbon, the feedbacks from the earlier lesson, and a spread of socio-economic scenarios, which is why they quote ranges.

But the core message survives every layer of sophistication: cumulative emissions set the warming, and the steepness of the curve is set by how fast we keep adding carbon. That is the number climate policy is really arguing about.

Appendix

The Energy Balance Model from this module, driven by a simple linear-emissions CO₂ path and stepped one year at a time with an inline logarithm for the forcing, drawn with WasmMakie — entirely in-browser WebAssembly. It mirrors the structure of the MIT climate-policy notebook.