Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Climate simulation, modeling tools, and climate data analysis methods
.claude/skills/brycewang-stanford-climate-modeling-guide/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-04 | ✗→✓ | ▲ Improved | 79% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 96% | 0% |
| case-16 | ✗→✓ | ▲ Improved | 119% | 0% |
| case-11 | ✓→✓ | = Same ✓ | 81% | 0% |
| case-12 | ✓→✓ | = Same ✓ | 80% | 0% |
A skill for working with climate models and climate data in research contexts. Covers accessing CMIP archives, processing NetCDF data, running idealized climate simulations, statistical downscaling, and analyzing climate projections with Python tools.
Climate data is stored in NetCDF (Network Common Data Form) files following CF (Climate and Forecast) conventions:
pythonimport xarray as xr import numpy as np # Open a CMIP6 temperature dataset ds = xr.open_dataset("tas_Amon_CESM2_ssp585_r1i1p1f1_gn_201501-210012.nc") print(ds) # Dimensions: (time: 1032, lat: 192, lon: 288) # Variables: tas (surface air temperature, K) # Attributes: CF-1.6 compliant, CMIP6 metadata # Basic inspection print(f"Variable: {ds.tas.long_name}") print(f"Units: {ds.tas.units}") print(f"Time range: {ds.time.values[0]} to {ds.time.values[-1]}") print(f"Spatial resolution: {np.diff(ds.lat.values[:2])[0]:.2f} deg")
The Coupled Model Intercomparison Project Phase 6 provides standardized multi-model climate projections:
python# Using intake-esm to search the CMIP6 catalog import intake # Open the Pangeo CMIP6 catalog (cloud-hosted on Google Cloud) url = "https://storage.googleapis.com/cmip6/pangeo-cmip6.json" col = intake.open_esm_datastore(url) # Search for monthly surface temperature under SSP5-8.5 query = col.search( experiment_id="ssp585", variable_id="tas", table_id="Amon", source_id=["CESM2", "GFDL-ESM4", "UKESM1-0-LL", "MPI-ESM1-2-HR"], member_id="r1i1p1f1", ) print(f"Found {len(query)} datasets from {query.nunique()['source_id']} models") # Load as xarray datasets (lazy, Zarr-backed) dsets = query.to_dataset_dict(zarr_kwargs={"consolidated": True})
pythondef compute_global_mean_anomaly(ds, baseline_start="1850-01-01", baseline_end="1900-12-31"): """ Compute area-weighted global mean temperature anomaly relative to a baseline period. """ # Area weighting by cosine of latitude weights = np.cos(np.deg2rad(ds.lat)) weights.name = "weights" # Weighted global mean time series global_mean = ds.tas.weighted(weights).mean(dim=["lat", "lon"]) # Compute baseline climatology baseline = global_mean.sel(time=slice(baseline_start, baseline_end)) climatology = baseline.groupby("time.month").mean("time") # Compute anomalies anomaly = global_mean.groupby("time.month") - climatology # Annual mean anomaly annual_anomaly = anomaly.resample(time="YE").mean() return annual_anomaly def multi_model_ensemble(datasets: dict, baseline_period: tuple): """ Compute multi-model ensemble mean and spread for temperature projections. datasets: dict of {model_name: xarray.Dataset} Returns ensemble mean and 5th/95th percentile bounds. """ anomalies = [] for name, ds in datasets.items(): anom = compute_global_mean_anomaly(ds, *baseline_period) anom = anom.assign_coords(model=name) anomalies.append(anom) ensemble = xr.concat(anomalies, dim="model") return { "mean": ensemble.mean(dim="model"), "p05": ensemble.quantile(0.05, dim="model"), "p95": ensemble.quantile(0.95, dim="model"), }
Standard indices used in climate research:
| Index | Full Name | Definition | |-------|-----------|-----------| | ENSO (Nino3.4) | El Nino Southern Oscillation | SST anomaly in 5S-5N, 170W-120W | | NAO | North Atlantic Oscillation | SLP difference Iceland - Azores | | PDO | Pacific Decadal Oscillation | Leading PC of North Pacific SST | | AMO | Atlantic Multidecadal Oscillation | Detrended North Atlantic SST | | IOD | Indian Ocean Dipole | SST difference western - eastern Indian Ocean |
pythondef compute_nino34(sst_dataset, baseline="1991-01-01/2020-12-31"): """Compute Nino 3.4 index from SST data.""" # Select Nino 3.4 region nino34_region = sst_dataset.tos.sel( lat=slice(-5, 5), lon=slice(190, 240) ) # Area-weighted mean weights = np.cos(np.deg2rad(nino34_region.lat)) nino34_ts = nino34_region.weighted(weights).mean(dim=["lat", "lon"]) # Remove monthly climatology clim = nino34_ts.sel(time=slice(*baseline.split("/"))).groupby("time.month").mean() nino34_index = nino34_ts.groupby("time.month") - clim # 5-month running mean for standard definition nino34_smoothed = nino34_index.rolling(time=5, center=True).mean() return nino34_smoothed
Global climate models (GCMs) typically have 50-200 km resolution, too coarse for impact studies. Statistical downscaling bridges this gap:
pythondef quantile_mapping(obs: np.ndarray, model_hist: np.ndarray, model_future: np.ndarray, n_quantiles: int = 100): """ Quantile mapping bias correction. Maps model quantiles to observed quantiles for bias correction. """ quantiles = np.linspace(0, 1, n_quantiles + 1) obs_q = np.quantile(obs, quantiles) hist_q = np.quantile(model_hist, quantiles) # For each future value, find its quantile in historical distribution # then map to corresponding observed quantile corrected = np.interp(model_future, hist_q, obs_q) return corrected
| Method | Type | Advantages | Limitations | |--------|------|-----------|-------------| | Quantile mapping | Statistical | Simple, preserves distribution | Assumes stationarity | | BCSD | Statistical | Preserves spatial patterns | Limited for extremes | | Delta method | Statistical | Very simple | Only shifts mean | | WRF (dynamical) | Physical | Physically consistent | Computationally expensive | | DeepSD (deep learning) | Hybrid | Learns complex patterns | Requires large training data |
pythondef energy_balance_model(S0=1361, albedo=0.30, emissivity=0.612): """ Zero-dimensional energy balance model. S0: solar constant (W/m2) albedo: planetary albedo emissivity: effective atmospheric emissivity Returns equilibrium surface temperature (K). """ sigma = 5.67e-8 # Stefan-Boltzmann constant # Absorbed solar radiation absorbed = S0 * (1 - albedo) / 4 # Surface temperature with greenhouse effect T_surface = (absorbed / (emissivity * sigma)) ** 0.25 return T_surface T_eq = energy_balance_model() print(f"Equilibrium surface temperature: {T_eq:.1f} K ({T_eq - 273.15:.1f} C)")
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-11 | pass→pass | 13,424 | 13,008 | -3% | 1 | 1 | 0% | 2,572 | 4,651 | +81% | 0 | 0 | — |
case-12 | pass→pass | 15,120 | 16,534 | +9% | 1 | 1 | 0% | 2,877 | 5,172 | +80% | 0 | 0 | — |
case-13 | pass→pass | 7,478 | 6,596 | -12% | 1 | 1 | 0% | 1,206 | 3,362 | +179% | 0 | 0 | — |
case-04 | fail→pass | 11,214 | 7,897 | -30% | 1 | 1 | 0% | 2,054 | 3,676 | +79% | 0 | 0 | — |
case-05 | fail→pass | 13,239 | 17,505 | +32% | 1 | 1 | 0% | 2,869 | 5,620 | +96% | 0 | 0 | — |
case-01 | fail→fail | 28,309 | 26,107 | -8% | 1 | 1 | 0% | 5,621 | 7,245 | +29% | 0 | 0 | — |
case-02 | fail→fail | 23,401 | 27,866 | +19% | 1 | 1 | 0% | 4,162 | 7,573 | +82% | 0 | 0 | — |
case-03 | pass→pass | 9,942 | 8,229 | -17% | 1 | 1 | 0% | 2,026 | 3,342 | +65% | 0 | 0 | — |
case-06 | fail→fail | 21,513 | 15,940 | -26% | 1 | 1 | 0% | 4,103 | 4,972 | +21% | 0 | 0 | — |
case-07 | pass→pass | 11,369 | 13,306 | +17% | 1 | 1 | 0% | 1,924 | 4,316 | +124% | 0 | 0 | — |
case-08 | pass→pass | 15,064 | 15,548 | +3% | 1 | 1 | 0% | 2,363 | 4,508 | +91% | 0 | 0 | — |
case-09 | fail→fail | 19,180 | 17,123 | -11% | 1 | 1 | 0% | 2,635 | 4,614 | +75% | 0 | 0 | — |
case-10 | fail→fail | 18,774 | 15,379 | -18% | 1 | 1 | 0% | 2,610 | 4,279 | +64% | 0 | 0 | — |
case-14 | pass→pass | 15,707 | 20,154 | +28% | 1 | 1 | 0% | 2,492 | 5,640 | +126% | 0 | 0 | — |
case-15 | pass→pass | 9,639 | 5,671 | -41% | 1 | 1 | 0% | 1,632 | 3,022 | +85% | 0 | 0 | — |
case-16 | fail→pass | 9,192 | 7,367 | -20% | 1 | 1 | 0% | 1,548 | 3,395 | +119% | 0 | 0 | — |
case-17 | pass→pass | 17,451 | 21,774 | +25% | 1 | 1 | 0% | 2,667 | 5,631 | +111% | 0 | 0 | — |
case-18 | pass→pass | 8,299 | 6,274 | -24% | 1 | 1 | 0% | 1,424 | 3,155 | +122% | 0 | 0 | — |
case-19 | pass→pass | 6,680 | 6,044 | -10% | 1 | 1 | 0% | 1,009 | 2,976 | +195% | 0 | 0 | — |
case-20 | fail→fail | 20,943 | 16,916 | -19% | 1 | 1 | 0% | 3,812 | 5,008 | +31% | 0 | 0 | — |
case-21 | fail→fail | 19,600 | 20,320 | +4% | 1 | 1 | 0% | 3,195 | 5,412 | +69% | 0 | 0 | — |
case-22 | fail→fail | 25,548 | 14,524 | -43% | 1 | 1 | 0% | 2,371 | 4,561 | +92% | 0 | 0 | — |
case-23 | fail→fail | 27,541 | 35,765 | +30% | 1 | 1 | 0% | 5,481 | 7,599 | +39% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted. The headline lift of +13 percentage points is the difference between those two pass rates over the 23 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.