CoolFace
Apppublic

SaharBarak/terraform-vs-natural-earth

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes
App README

Climate Paradigm Challenge

Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference Visualizing Terraform vs. Natural Earth under identical CO₂

A controlled, transparent simulation that compares Natural Earth and Terraform Earth while holding atmospheric CO₂ constant. Built for clarity, reproducibility, and education.

Why this exists

Climate debates often mix multiple shifting variables. Here we hold CO₂ forcing identical and vary only surface/boundary properties (albedo, heat capacity, diffusion proxy, land–ocean fraction). This isolates how much the surface paradigm alone can change climate outcomes within a simple, testable model.

This is a tool for testing—not speculating. It complements, not replaces, complex GCMs.


Method (v1)

We implement a 1D diffusive Energy Balance Model (EBM):

$$ C(\phi)\,\frac{\partial T}{\partial t} = S(\phi)\,[1-\alpha(\phi, T)]

  • —\bigl(A + B\,T\bigr)
  • —D\,\nabla^{2}T
  • —\Delta F{\mathrm{CO2}} $$
  • —Shared forcing: same CO₂ concentration for both panels, with \( \Delta F{\mathrm{CO2}} = 5.35 \,\ln(C/C_0) \).
  • —Varying factors: surface albedo, effective heat capacity, diffusion coefficient \(D\) (transport proxy), optional coarse land–ocean reshaping.
  • —Grid: 1° latitude bands (−90..90). A 2D upgrade is planned.
  • —Outputs: equilibrium & transient temperature, diagnostics (global‑mean ΔT, gradients, ice‑line proxy).
Limitations: No explicit dynamics, clouds, moisture feedbacks, ENSO, or seasonal cycle (yet). See `docs/LIMITATIONS.md`.

Terraform presets (v1)

  • —Greened Deserts: lower albedo in subtropical desert belts (tunable fraction).
  • —Hydrated Inland Seas: raise inland effective heat capacity.
  • —Polar Mirror Belts: increase albedo over polar latitudes (configurable belts).
  • —Smoothed Orography: increase diffusion \(D\) as a transport proxy.
  • —Urban Albedo: increase mid‑lat albedo in populated belts.
  • —Natural Earth: baseline fields + ice–albedo feedback.

You can also paint albedo interactively on the Terraform panel.


Reproducibility

  • —Every run is a deterministic config. Share URLs or save YAML in /experiments.
  • —Versioned parameters (model=v1.0), with unit‑tested energy closure and equilibrium behavior.
  • —Clear separation of data, model, and view.

Quickstart (local)

Frontend

~~~bash cd frontend npm install npm run dev ~~~

Backend (Python 3.11)

~~~bash cd api pip install -r requirements.txt uvicorn api.main:app --reload --port 7860 ~~~

Run with Docker (recommended for Spaces and local parity)

~~~bash docker build -t climate-paradigm-challenge . docker run -p 7860:7860 climate-paradigm-challenge ~~~


API

Base URL defaults to http://localhost:7860.

POST /simulate

  • —Request body: see api/models.py (SimRequest).
  • —Response: latitude array(s), final fields, thinned time series, diagnostics.

GET /presets

  • —Response: list of available Terraform presets.

Tech stack

  • —Frontend: Vite + TypeScript, Three.js (twin globes), Zustand, lightweight charts.
  • —Backend: FastAPI, NumPy, Numba (optional), Pydantic v2.
  • —Deployment: Hugging Face Spaces (Docker).

Ethics & interpretation

This project is designed for transparency and awakening through evidence. Results are specific to an EBM framing; do not over‑generalize beyond the model’s scope. Use it to form better questions and design targeted, falsifiable experiments.


License

  • —Code: MIT — see `docs/LICENSE-CODE`.
  • —Docs & figures: CC‑BY 4.0 — see `docs/LICENSE-DOCS`.

Citation

See `docs/CITATION.cff`.


Contributing

Contributions are welcome via Issues and PRs. Please keep changes modular, add or update tests for model logic, and document any new parameters or presets.


Created by Sahar.