Earth & Environmental Computing · Week 12 · Course session · 26 slides
Download HTML
Earth & Environmental Computing | Computational Methods for Earth & Environmental Science | 16-Week Course

Simple Environmental Modeling

A one-bucket model of an Iowa river will fail honestly. Diagnosing WHERE it fails is the science.

Water balance · Calibration · NSE · Validation · Equifinality
Week 12·Course session·Open Course Materials | Adapt for your classroom·Week 12 | Course session
Learning Objectives

By the end of this lecture, you will be able to...

  • Diagram a bucket water-balance model: inputs, states, parameters
  • Explain calibration as parameter search against observations
  • Interpret Nash-Sutcliffe efficiency, including negative values
  • Define equifinality and why a good fit is not proof
Contents

Today's Lecture

01The Bucket
03Where the Bucket Fails
02Calibration
Recap

Last Week in Sixty Seconds

  • A map between observations is a claim; LOO tests it
  • Nugget, sill, range: noise, budget, reach
  • Memorizing maps validate worst
  • Today: predict in TIME with physics, and hold out a year
01

The Bucket

Drawn before it is coded: inputs, states, parameters, and real units.

01 · The bucket

The Bucket, Drawn Before Coded

Flows

  • Precipitation in at the top
  • Evapotranspiration out
  • Quickflow spills from surplus
  • Baseflow leaks through the bottom

Two knobs

  • k_runoff: fraction of surplus to quickflow
  • k_baseflow: fraction of storage leaked per day
  • Every code line = an arrow on this drawing
01 · The bucket

Inputs, States, Parameters

Inputs

Time series the world provides: rain, potential evapotranspiration.

States

What the model remembers between days: storage in the bucket.

Parameters

Numbers we choose or fit: the two k values.

Keep these three straight and any environmental model becomes readable.

01 · The bucket

One Day of the Bucket

Python

available = storage + max(precip, 0)
actual_et = min(max(pet, 0), available)
surplus   = max(precip - actual_et, 0)
quickflow = k_runoff * surplus
storage   = max(available - actual_et - quickflow, 0)
baseflow  = k_baseflow * storage
flow      = quickflow + baseflow
  • Seven lines of mass accounting
  • Water is conserved: nothing appears, nothing vanishes
01 · The bucket

The Price of Admission: Real Units

runoff_mm_per_day = Q_m3s * 86.4 / area_km2

Q = discharge (m3/s), from the USGS record

area = 3,271 sq mi = about 8,470 km2 at Iowa City

86.4 = seconds per day / 1e6 * 1000

result: same unit as precipitation

  • Model and observations must speak mm/day before any comparison
Pause and think

?

pandas reads the station ID "05454500" and prints 5454500. What happened, and where will it bite?

Numeric parsing dropped the leading zero
Any string lookup on site_no fails: dtype={"site_no": str} at read time
02

Calibration

A search with a score, judged on a year the model has not seen.

02 · Calibration

Calibration Is a Search

  • No handbook lists your watershed's k values
  • Try parameter pairs, score each against observed flow
  • The lab's grid search: 320 model runs, fully transparent
  • Silent assumptions: observations trustworthy, structure adequate
02 · Calibration

Nash-Sutcliffe Efficiency

NSE = 1 - sum((obs - sim)^2) / sum((obs - mean(obs))^2)

NSE = 1: perfect match

NSE = 0: you tied the mean

NSE < 0: the mean beats your model

the rival is always: just predict the mean

  • Expect modest or negative validation NSE this week, and say so out loud
02 · Calibration

Calibrate on Year 1, Judge on Year 2

The split

  • Grid search sees days 1-365 only
  • The model then runs both years
  • NSE reported separately per year

Reading the pair

  • Validation below calibration: expected
  • Validation far below: memorized the year
  • Validation above: get suspicious, check the split
02 · Calibration

The Valley in the Calibration Surface

  • Many parameter pairs fit almost equally well
  • Different internal stories, same hydrograph
  • A good fit cannot certify the mechanism
  • Report ranges; validate on unseen data; prefer measurable parameters
Pause and think

?

Two parameter pairs sit in the same RMSE valley. Name two ways to choose between them, and one reason to refuse to choose.

Choose: independent field evidence, or validation-year performance
Refuse: report the range; the data cannot tell them apart
03

Where the Bucket Fails

What Iowa does that one bucket cannot, and how the states say so.

03 · Where the bucket fails

Where the Bucket Fails, and Why

01

Given

Two years of Iowa City rain, temperature-based PET, observed runoff in mm/day.

02

Solve

Calibrate year 1, validate year 2, average the residual by month.

03

Interpret

Late-winter and spring residuals point at snowmelt: the bucket has no snow store.

03 · Where the bucket fails

What Iowa Does That the Bucket Cannot

  • Stores precipitation as snow, releases it in spring
  • Freezes the ground: infiltration shuts off
  • Grows corn: water use peaks in July
  • One added snow store would fix the biggest miss
03 · Where the bucket fails

The PET Proxy, and Its Honesty Problem

PET = 0.12 * max(T_mean, 0) [mm/day]

T_mean = daily mean temperature (deg C)

0.12 = a crude coefficient, not a law

monotonic with temperature: the right shape

ignores radiation, humidity, wind, crops

  • One of the model's largest input uncertainties, and Friday's sensitivity practice: change 0.12 to 0.20 and watch the calibration shift
03 · Where the bucket fails

The Storage Series Is a Sanity Check

  • Fills in fall and winter, draws down through summer
  • If storage grows without bound, a leak term is broken
  • If it pins at zero all year, ET or runoff is eating everything
  • Plot the state, not just the output: models fail visibly there first
03 · This week's lab

Group Lab 6: Modeling and Calibration

Lab session

  • Real-unit conversion via drainage area
  • Calibrate year 1, NSE both years
  • Observed vs simulated figure

Studio session

  • Calibration-surface heatmap
  • Residual-by-month table
  • Limitation paragraph naming a missing process
Pitfalls

Where This Week Goes Wrong

  • Unit conversion off by area or by 1000
  • Negative NSE read as a personal failure instead of a finding
  • The leading-zero station ID trap
  • Never looking at WHICH months carry the residual
Bridge

Connection to Next Week

This weekNext weekBridge idea
A complete model-test cycleFinal project launchNow do the whole arc on a question your group chooses
Summary

Key Takeaways

  • Inputs, states, parameters: keep them straight
  • Calibration searches; validation judges
  • NSE = 0 means you tied the mean
  • Equifinality: fit is evidence, never proof
  • The residual calendar names the missing process
Discussion · Next week: the final project launch

?

If you could add ONE process to the bucket before rerunning, which buys the most realism per line of code? Defend your pick.