Session 8 · Inside one day

Routing: reservoir and unit hydrograph

The soil and the aquifer decide how much water leaves the land each day. Routing decides when it passes the gauge. Water generated in the far corners of the Leaf River's 1924 km² needs days to travel down the channels, so a storm's runoff arrives spread out over the following week. This session covers the three steps that do this: the fast reservoir, the loss fraction and the unit hydrograph.

Time about 30 minutesNeeds Sessions 5–7
Watch this session first: a 6-minute narrated video with English subtitles. The page below goes further and lets you try each step yourself.

You will be able to

Where we are: the end of the chain, from the three runoff paths to the river flow at the gauge.

The fast reservoir

Overland flow from the soil step (Session 6) first enters a store, the fast reservoir, holding Fs mm. Each day it releases a fixed fraction qc of what it holds:

\[ F_s \leftarrow F_s + Q_{\text{ov}}, \qquad Q_r = \min(\mathit{qc},\, 1)\cdot F_s, \qquad F_s \leftarrow F_s - Q_r \]

This is the linear reservoir of Session 2. For the Leaf River qc = 0.659 per day: 66% of a day's overland flow leaves the same day, 22% the next day and 8% the day after. The minimum guards against releasing more than the store holds, which could only happen with a time step longer than a day.

Losses

The three outflows are added up and a fixed fraction lf is removed:

\[ r = \big(Q_r + Q_{\text{int}} + Q_b + Q_{sp}\big)\,(1 - \mathit{lf}) \]

\(r\) is the day's runoff, ready to be routed to the gauge. The loss represents water that leaves the catchment without passing the gauge, such as deep groundwater flowing under the river or water withdrawn for use. Like other parameters it is effective. It also absorbs systematic errors in the forcing, for example rainfall estimates that are slightly too high. For the Leaf River lf = 0.108: about 11% of runoff, 60 mm per year over 1989–1999, is removed.

The unit hydrograph

Suppose 10 mm of runoff is generated across the catchment on one day. Water produced next to the gauge passes it within hours; water from the headwaters takes days. The share of the day's runoff that passes the gauge 0, 1, 2, … days later is the catchment's unit hydrograph: the river's response to one unit of runoff. dCREST uses a gamma distribution for it, a curve that rises quickly and then decays slowly:

\[ w_i \;\propto\; \frac{1}{\Gamma(n)} \left[\frac{(i + \tfrac12)\,\Delta t}{k}\right]^{n-1} \exp\!\left[-\frac{(i + \tfrac12)\,\Delta t}{k}\right], \qquad i = 0, 1, \dots, 29, \qquad \sum_i w_i = 1 \]

\(w_i\): share of a day's runoff passing the gauge \(i\) days later. \(\Delta t\) = 24 h. Each day is represented by its midpoint, \(i + \tfrac12\). The weights are normalised to sum to exactly 1, so no water is lost or gained.

The shape is set by \(n\) = nshape: for the same time scale, larger values give a later and broader response (and a more symmetric one). The time scale \(k\) (hours) comes from the catchment's size, scaled by kmult:

\[ k_g = 0.35 \left(\frac{A}{1000\ \text{km}^2}\right)^{0.38} \times 24\ \text{h}, \qquad k = \max(\mathit{kmult}\cdot k_g,\; 1\ \text{h}) \]

\(k_g\) is a rule of thumb: larger catchments respond more slowly, roughly with area to the power 0.38. It makes kmult a dimensionless correction that can be compared between catchments of different sizes. For the Leaf River, \(A\) = 1924 km² gives \(k_g\) = 10.8 h. With kmult = 1.83, \(k\) = 19.7 h and, with \(n\) = 2.74, the weights are:

days after01234567
share \(w_i\)17.3%34.6%24.8%13.1%6.0%2.5%1.0%0.4%

So the peak of a storm's runoff passes the gauge the day after it is generated, and most has passed within four days.

A floor that once broke calibration

\(k\) has a floor: it cannot be shorter than 1 hour. An earlier version set the floor at half a day. Because \(\mathit{kmult}\cdot k_g\) is shorter than 12 hours in most CAMELS catchments, the floor was active almost everywhere, and kmult had no effect at all on the result: the model could not be calibrated in that parameter, yet nothing in the scores showed it. The gradients exposed it (Session 12), and v1.0 lowered the floor to 1 hour.

River flow is a convolution

Each day's runoff is spread over the following days by the same weights, and the river flow on any day is the sum of the shares arriving from all earlier days:

\[ Q_t \;=\; \sum_{i=0}^{29} w_i\, r_{t-i} \]

This operation is called a convolution. Step through it below on the days around the 27 August 1992 storm.

Try itConvolution, one day at a time

Faint blue bars: daily runoff \(r\) from the model. Each coloured band is one day's runoff spread over the following days by the weights \(w_i\); grey at the bottom is runoff from days before the window that is still arriving. The dark line is their sum, the routed flow \(Q\), and the dots are the observed flow.

Shape the response

Try itUnit-hydrograph shape and the February 1990 flood
Weights \(w_i\) (share of a day's runoff arriving \(i\) days later)
The flood of February 1990, routed with these weights

Only the routing changes here; the runoff \(r\) is the same. A shorter time scale sharpens the peak and moves it earlier; a larger nshape delays it. The runoff entering the routing, \(r\), peaked at about 68 mm on 16 February, one day before the observed peak. Routing that sharply would put the model's peak a day early; the calibrated weights put it on the right day, but lower. Calibration has to balance the timing and the height of every flood in the record, not only this one.

In the code: src/dcrest/routing/uh.py and model.py
def gamma_uh(nshape, kscale_h, *, nstep=30, dt_hours=24.0, kmin_h=None, eps=1e-6):
    n = torch.clamp(nshape, min=0.5, max=12.0)
    kmin = dt_hours * 0.5 if kmin_h is None else kmin_h       # the old floor was dt / 2
    k = torch.clamp(kscale_h, min=kmin)
    t = (torch.arange(nstep, dtype=n.dtype, device=n.device) + 0.5) * dt_hours
    tt = t[:, None] / k[None, :]
    logw = (n[None, :] - 1.0) * torch.log(tt + eps) - tt - torch.lgamma(n[None, :])
    w = torch.exp(logw)
    return w / torch.clamp(w.sum(0, keepdim=True), min=eps)

# model.py, after the daily loop has produced runoff for every day:
weights = gamma_uh(params["nshape"], lag * params["kmult"], nstep=cfg.uh_nstep,
                   dt_hours=cfg.dt_hours, kmin_h=cfg.uh_kmin_h)
discharge = convolve_uh(runoff, weights)

Routing comes after the daily loop, because it does not feed back into any store. The whole runoff series is convolved in one pass, which on a GPU is a single grouped convolution over all catchments. The weights are computed in log space for numerical safety.

In Python

Check your understanding

The fast reservoir holds 4 mm, receives 6 mm of overland flow, and qc = 0.5. What is released and what remains?

It first holds 10 mm, releases \(0.5 \times 10 = 5\) mm, and keeps 5 mm.

Runoff is 10 mm today and zero on all other days. With the Leaf River's weights, what is the river flow tomorrow?

\(10 \times w_1 \approx 10 \times 0.346 \approx 3.5\) mm/day.

Why does a larger catchment get a larger time scale \(k_g\)?

Water has further to travel to the outlet, so the response is slower and more spread out. The rule \(k_g \propto A^{0.38}\) captures this on average.

Can the unit hydrograph create or destroy water?

No. The weights sum to 1, so every millimetre of runoff eventually passes the gauge; routing only changes when. (Water still "in transit" at the end of a simulation has not yet arrived.)

What to remember