Spaces:
Running
Running
Download session-06.html from hydros-ou/dcrest-course: direct link, hf CLI and curl.
- Browser
- Download file 18.5 kB
-
https://huggingface.co/spaces/hydros-ou/dcrest-course/resolve/main/session-06.html
- Command line
-
hf download hf://spaces/hydros-ou/dcrest-course/session-06.html
-
curl -L -o session-06.html https://huggingface.co/spaces/hydros-ou/dcrest-course/resolve/main/session-06.html
18.5 kB
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <title>Session 6 · Soil II: interflow and dry days — dCREST, step by step</title> | |
| <meta name="description" content="How dCREST splits runoff into interflow and overland flow, and where evaporation comes from on days without enough rain: the soil first, then the aquifer."> | |
| <link rel="preconnect" href="https://fonts.googleapis.com"> | |
| <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> | |
| <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600&family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,600;1,6..72,400&family=Source+Sans+3:wght@400;600;700&display=swap"> | |
| <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.min.css"> | |
| <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/uplot@1.6.31/dist/uPlot.min.css"> | |
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/codemirror.min.css"> | |
| <link rel="stylesheet" href="assets/course.css"> | |
| <script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.min.js"></script> | |
| <script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/contrib/auto-render.min.js"></script> | |
| <script defer src="https://cdn.jsdelivr.net/npm/uplot@1.6.31/dist/uPlot.iife.min.js"></script> | |
| <script defer src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/codemirror.min.js"></script> | |
| <script defer src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.16/mode/python/python.min.js"></script> | |
| <script defer src="assets/dcrest.js"></script> | |
| <script defer src="assets/course.js"></script> | |
| </head> | |
| <body> | |
| <main> | |
| <div class="kicker">Session 6 · Inside one day</div> | |
| <h1>Soil II: interflow and dry days</h1> | |
| <p class="lede">Session 5 produced runoff \(R\) on wet days. This session finishes the soil step. On wet days, \(R\) is divided between two paths to the river. On dry days, which at the Leaf River are most days, the soil and the groundwater have to supply the evaporative demand that the canopy could not.</p> | |
| <div class="meta"><span><b>Time</b> about 30 minutes</span><span><b>Needs</b> Session 5</span></div> | |
| <figure class="video"><video controls preload="none" playsinline poster="video/s06.jpg"><source src="video/s06.mp4" type="video/mp4"></video> | |
| <figcaption>Watch this session first: a 6-minute narrated video with English subtitles. The page below goes further and lets you try each step yourself.</figcaption></figure> | |
| <div class="goals"><h4>You will be able to</h4><ul> | |
| <li>compute the interflow capacity τ and split runoff into interflow and overland flow;</li> | |
| <li>explain how the parameter <var data-v="fc">fc</var> changes the timing of the model's floods;</li> | |
| <li>compute soil and aquifer evaporation on a dry day by hand;</li> | |
| <li>explain why evaporation slows down as the catchment dries.</li> | |
| </ul></div> | |
| <figure class="wide"><div class="plate"><svg id="map" role="img" aria-label="Model diagram with the soil store highlighted"></svg></div> | |
| <figcaption>Where we are: the rest of the soil step sends runoff along two paths and, on dry days, draws evaporation from the soil and the aquifer.</figcaption></figure> | |
| <h2>Two paths for runoff</h2> | |
| <p>Runoff can reach a stream over the ground surface (<strong>overland flow</strong>) or by moving sideways through the upper, more permeable layer of soil (<strong>interflow</strong>). How much the soil can carry sideways in a day depends on how permeable it is and how wet it is. dCREST expresses this as a daily <strong>interflow capacity</strong>:</p> | |
| <div class="eq">\[ \tau \;=\; \frac{\mathit{SM}_c + \mathit{SM}'}{2\,\mathit{wm}} \cdot \mathit{fc} \cdot 24\ \text{h} \]</div> | |
| <p class="eqnote">\(\mathit{SM}_c\): soil water before the storm; \(\mathit{SM}'\): after infiltration; their mean divided by <var>wm</var> is the soil's average wetness over the day, between 0 and 1. <var data-v="fc">fc</var>: interflow rate in mm per hour.</p> | |
| <p>Runoff up to the capacity goes to interflow; anything beyond it, plus the impervious runoff \(P_i\) from Session 5, becomes overland flow:</p> | |
| <div class="eq">\[ Q_{\text{int}} = \min(R, \tau) + X, \qquad Q_{\text{ov}} = R - \min(R, \tau) + P_i \]</div> | |
| <p>\(X = \max(\mathit{SM} - \mathit{wm}, 0)\) is any soil water above capacity; it joins the interflow. In practice the soil never exceeds its capacity in dCREST, so \(X\) is a safeguard and stays at zero.</p> | |
| <div class="callout idea"><span class="label">What the two paths mean in dCREST</span> | |
| <p>The names suggest that overland flow is fast and interflow slow. In dCREST the timing is set by what happens next (Session 8): <strong>overland flow</strong> passes through the fast reservoir, which releases a fraction <var data-v="qc">qc</var> of its water each day, while <strong>interflow</strong> goes straight to the routing step. Changing <var>fc</var> therefore changes how much runoff is delayed by the reservoir.</p> | |
| </div> | |
| <h3>At the Leaf River</h3> | |
| <p>Calibration gave the Leaf River a very small interflow rate, <var>fc</var> = 0.0185 mm/h. Even with a fully wet soil, \(\tau\) is at most \(0.0185 \times 24 = 0.44\) mm/day. On the storm of 27 August 1992, \(R\) was 29.5 mm and \(\tau\) only 0.26 mm. So 0.26 mm went to interflow and 29.3 mm to overland flow. Over 1989–1999 interflow carries only 3% of the model's runoff, overland flow through the fast reservoir 72%, and groundwater the rest. For this river, calibration effectively closed the interflow path and routed storm runoff through the fast reservoir.</p> | |
| <div class="widget wide" id="fcw"> | |
| <div class="whead"><span class="wtag">Try it</span><span class="wtitle">Open the interflow path</span></div> | |
| <div class="controls" id="fc_ctl"></div> | |
| <div class="stats" id="fc_stats"></div> | |
| <div class="chart" id="fc_chart"></div> | |
| <p class="note">The whole model is rerun from 1986 with your <var>fc</var>; the chart shows the winter of 1990–1991 (simulated in blue, observed as a dark line). With a large <var>fc</var> most runoff skips the fast reservoir and the peaks become sharper (and very slightly earlier). Watch the test score: is the calibrated value the best?</p> | |
| </div> | |
| <h2>Dry days: where evaporation comes from</h2> | |
| <p>On a dry day all the water reaching the ground evaporates at once, and the soil must supply the remaining demand. A wet soil gives up water easily; a dry soil holds on to it more tightly, and plants close their pores. dCREST captures this by letting the soil supply the demand in proportion to how full it is:</p> | |
| <div class="eq">\[ E_s \;=\; \min\!\Big( (D - E_c - L)\cdot\frac{\mathit{SM}_c}{\mathit{wm}},\;\; \mathit{SM}_c \Big) \]</div> | |
| <p>Whatever the soil could not supply, \(U = D - E_c - L - E_s\), is partly met by the <strong>aquifer</strong>, again in proportion to how full it is:</p> | |
| <div class="eq">\[ E_g \;=\; \min\!\Big( U\cdot\frac{G}{\mathit{hmaxaq}},\;\; G \Big) \]</div> | |
| <p>This represents water that deep roots or vegetation along streams can reach from groundwater, and moisture rising from the water table. The demand left after that goes unmet: the catchment simply evaporates less than the atmosphere could take.</p> | |
| <h3>A hot, dry August day</h3> | |
| <p>On 15 August 1993 there was no rain, the canopy was empty, and the demand was \(D = 0.955 \times 5.05 = 4.82\) mm.</p> | |
| <div class="tablewrap"><table> | |
| <thead><tr><th>Step</th><th>Calculation</th><th class="n">mm</th></tr></thead> | |
| <tbody> | |
| <tr><td>soil wetness</td><td>\(\mathit{SM}_c / \mathit{wm} = 162.3 / 235.2\)</td><td class="n">0.690</td></tr> | |
| <tr><td>soil evaporation \(E_s\)</td><td>\(4.82 \times 0.690\)</td><td class="n">3.33</td></tr> | |
| <tr><td>unmet demand \(U\)</td><td>\(4.82 - 3.33\)</td><td class="n">1.49</td></tr> | |
| <tr><td>aquifer fullness</td><td>\(G / \mathit{hmaxaq} = 95.7 / 106.9\)</td><td class="n">0.895</td></tr> | |
| <tr><td>aquifer evaporation \(E_g\)</td><td>\(1.49 \times 0.895\)</td><td class="n">1.34</td></tr> | |
| <tr><td>total evaporation</td><td>\(E_c + L + E_s + E_g\)</td><td class="n">4.66</td></tr> | |
| </tbody></table></div> | |
| <p class="eqnote">The numbers shown are rounded; each result is computed from the unrounded values, so redoing a row by hand can differ in the last digit.</p> | |
| <p>The catchment evaporated 4.66 of the 4.82 mm demanded. That same day the model's river flow was 0.347 mm/day against 0.349 observed, all of it from groundwater (Session 7).</p> | |
| <div class="widget" id="dry"> | |
| <div class="whead"><span class="wtag">Try it</span><span class="wtitle">A dry day, by hand</span></div> | |
| <div class="controls" id="dry_ctl"></div> | |
| <svg id="dry_svg" style="max-width:640px" viewBox="0 0 620 170" role="img" aria-label="Bar showing how the day's demand is met by soil and aquifer evaporation"></svg> | |
| <p class="note">The bar is the day's demand left after the canopy (with no rain). As the soil and the aquifer dry out, less of the demand is met: the catchment evaporates less than the atmosphere could take.</p> | |
| </div> | |
| <h2>A summer of drying</h2> | |
| <p>Put the dry days together and the catchment slowly dries through summer: the soil and the aquifer both decline, and with them the evaporation they can supply. The chart shows summer 1993 from the full model.</p> | |
| <div class="widget wide" id="sum"> | |
| <div class="whead"><span class="wtag">Data</span><span class="wtitle">Summer 1993, from the model</span></div> | |
| <div class="chart" id="sum_chart1"></div> | |
| <div class="chart" id="sum_chart2"></div> | |
| <p class="note">Top: soil water <var>SM</var> and aquifer storage <var>G</var> (mm). Bottom: evaporation from the canopy, soil and aquifer (mm/day) and rain. After each rain the canopy takes over; between rains the soil and aquifer supply less and less.</p> | |
| </div> | |
| <div class="callout code"><span class="label">In the code: src/dcrest/kernels/soil.py (shortened)</span> | |
| <pre><code># wet branch: split the runoff | |
| temX = (SM_c + Wo_w) / WM / 2.0 * (FC * dt_hours) # tau | |
| inter_w = torch.minimum(R_w, temX) + interflowExcess_w | |
| over_w = R_w - torch.minimum(R_w, temX) + precipImperv | |
| # dry branch: soil evaporation, then aquifer-supported evaporation | |
| ExcessET = (adjPET - precip) * wetness # wetness = SM_cd / WM with the default options | |
| ExcessET_act = torch.minimum(ExcessET, SM_cd) # E_s | |
| Wo_d = SM_cd - ExcessET_act | |
| unmet = torch.clamp(adjPET - precip - ExcessET_act, min=0.0) # U | |
| resET_d = torch.minimum(unmet * gw / HMAX, gw) # E_g | |
| wet = precip > adjPET | |
| over = torch.where(wet, over_w, torch.zeros_like(SM0)) | |
| inter = torch.where(wet, inter_w, interflowExcess_d) | |
| gw = gw - torch.where(wet, torch.zeros_like(SM0), resET_d)</code></pre> | |
| <p>Both branches are computed for every catchment, and <code>torch.where</code> picks the one that applies. Here <code>precip</code> is the water reaching the soil (\(L\) in the equations) and <code>adjPET</code> the demand left after the canopy.</p> | |
| </div> | |
| <h2>In Python</h2> | |
| <p>A dry spell, day by day: start from the model's soil and aquifer at the beginning of 15 August 1993 and give the catchment 40 days of August demand and no rain.</p> | |
| <div class="pycell" data-title="Forty dry days"> | |
| <textarea> | |
| from dcrest_course import * | |
| case = load_case() | |
| p = case.params | |
| SM, G = 162.3, 95.7 # the model's state at the start of 15 August 1993 (mm) | |
| demand = 4.8 # mm/day, after the canopy (which is empty) | |
| rows = [] | |
| for day in range(1, 41): | |
| Es = min(demand * SM / p["wm"], SM) # soil supplies in proportion to wetness | |
| U = max(demand - Es, 0.0) | |
| Eg = min(U * G / p["hmaxaq"], G) # aquifer supplies part of the rest | |
| SM, G = SM - Es, G - Eg | |
| SM, G, Ds, spill, Qb = aquifer_step(SM, G, p) # drainage and baseflow, as in Session 7 | |
| rows.append(dict(day=day, Es=Es, Eg=Eg, ET=Es + Eg, SM=SM, G=G, baseflow=Qb)) | |
| table(rows[::5], ["day", "Es", "Eg", "ET", "SM", "G", "baseflow"], fmt="{:9.3f}") | |
| plot(np.arange(1, 41), [r["Es"] for r in rows], [r["Eg"] for r in rows], [r["baseflow"] for r in rows], | |
| labels=["soil evaporation", "aquifer evaporation", "baseflow"], title="A dry spell (mm/day)", xlabel="day") | |
| </textarea> | |
| </div> | |
| <h2>Check your understanding</h2> | |
| <div class="quiz"> | |
| <details><summary>With <var>fc</var> = 2 mm/h and an average wetness of 0.5, what is the interflow capacity? If the day's runoff is 30 mm, how is it split?</summary><div class="ans"><p>\(\tau = 0.5 \times 2 \times 24 = 24\) mm/day. Interflow \(\min(30, 24) = 24\) mm, overland flow 6 mm (plus any impervious runoff).</p></div></details> | |
| <details><summary>In dCREST, which runoff path reaches the river faster, and why?</summary><div class="ans"><p>Interflow: it goes straight to the routing step, while overland flow first passes the fast reservoir, which releases only a fraction <var>qc</var> of its water per day.</p></div></details> | |
| <details><summary>On a dry day the soil is 30% full and the demand is 5 mm. How much does the soil evaporate?</summary><div class="ans"><p>\(5 \times 0.3 = 1.5\) mm (less than the soil water, so the minimum does not apply). The unmet 3.5 mm is then partly supplied by the aquifer.</p></div></details> | |
| <details><summary>Why does total evaporation fall during a long dry spell even if the atmosphere's demand stays the same?</summary><div class="ans"><p>Soil and aquifer evaporation are proportional to how full they are. As they drain, they supply less each day, so a growing part of the demand goes unmet.</p></div></details> | |
| </div> | |
| <div class="remember"><h4>What to remember</h4><ul> | |
| <li>Runoff up to \(\tau = \text{wetness} \times \mathit{fc} \times 24\) h becomes interflow; the rest is overland flow.</li> | |
| <li>In dCREST, overland flow is delayed by the fast reservoir and interflow is not.</li> | |
| <li>On dry days the soil supplies the remaining demand (after the canopy and the day's rain) times its wetness; the aquifer supplies part of the rest in proportion to its fullness.</li> | |
| <li>Evaporation therefore slows as the catchment dries: a built-in drought feedback.</li> | |
| </ul></div> | |
| </main> | |
| <script> | |
| window.pageInit = async function () { | |
| Course.modelDiagram(document.getElementById("map"), { highlight: "soil" }); | |
| const c = await Course.data(), css = Course.css; | |
| // ---- fc widget | |
| const st = { fc: c.params.fc }; | |
| let u = null; | |
| function drawFc() { | |
| const p = Object.assign({}, c.params, { fc: st.fc }); | |
| const run = c.protocolRun("test", p, true), R = run.rec; | |
| let qi = 0, qr = 0, qb = 0; | |
| for (let i = 0; i < run.Q.length; i++) if (run.scored[i]) { qi += R.Qint[i]; qr += R.Qr[i]; qb += R.Qb[i] + R.spill[i]; } | |
| const tot = qi + qr + qb; | |
| document.getElementById("fc_stats").innerHTML = [["interflow share of runoff", (100 * qi / tot).toFixed(0) + "%"], ["through the fast reservoir", (100 * qr / tot).toFixed(0) + "%"], | |
| ["groundwater", (100 * qb / tot).toFixed(0) + "%"], ["test NSE (1989–1999)", run.nse.toFixed(3)]] | |
| .map(([k, v]) => `<span class="s"><span class="k">${k}</span><span class="v2">${v}</span></span>`).join(""); | |
| const a = c.idx("1990-11-01") - run.i0, b = c.idx("1991-05-31") - run.i0 + 1; | |
| const t = run.time.subarray(a, b), d = [t, run.obs.subarray(a, b), run.Q.subarray(a, b)]; | |
| if (u) { u.setData(d); return; } | |
| u = Course.tsChart(document.getElementById("fc_chart"), { time: t, height: 260, ylabel: "flow (mm/day)", | |
| series: [{ label: "observed", values: d[1], color: css("--obs") }, { label: "model", values: d[2], color: css("--sim"), width: 1.8 }] }); | |
| } | |
| Course.slider(document.getElementById("fc_ctl"), { label: "interflow rate fc", min: 0.001, max: c.bounds.fc[1], value: st.fc, log: true, fmt: (v) => v.toFixed(v < 0.1 ? 4 : 2) + " mm/h" }, (v) => { st.fc = v; drawFc(); }); | |
| drawFc(); | |
| // ---- dry-day calculator | |
| const d = { dem: 4.821, sm: 0.6901, g: 0.8951 }; | |
| const svg = document.getElementById("dry_svg"); | |
| function drawDry() { | |
| const Es = d.dem * d.sm, U = d.dem - Es, Eg = U * d.g, miss = U - Eg; | |
| const W = 560, x0 = 30, sc = W / Math.max(d.dem, 0.01); | |
| const seg = (x, w, col, lab, val) => w > 0.5 ? `<rect x="${x}" y="40" width="${w}" height="46" fill="${col}"/>` + (w > 60 ? `<text x="${x + w / 2}" y="68" text-anchor="middle" font-size="13" style="fill:#fff" font-weight="700">${val.toFixed(2)}</text>` : "") + | |
| `<text x="${x + w / 2}" y="${lab.y}" text-anchor="middle" font-size="12.5">${lab.t}</text>` : ""; | |
| svg.innerHTML = `<text x="${x0}" y="24" font-size="13.5">demand after the canopy: ${d.dem.toFixed(2)} mm</text>` + | |
| seg(x0, Es * sc, css("--soil"), { t: "soil Es", y: 108 }, Es) + seg(x0 + Es * sc, Eg * sc, css("--aquifer"), { t: "aquifer Eg", y: 108 }, Eg) + | |
| seg(x0 + (Es + Eg) * sc, miss * sc, css("--rule"), { t: "not met", y: 108 }, miss) + | |
| `<text x="${x0}" y="146" font-size="13">evaporated ${(Es + Eg).toFixed(2)} mm (${(100 * (Es + Eg) / d.dem).toFixed(0)}% of the demand)</text>`; | |
| } | |
| const dc = document.getElementById("dry_ctl"); | |
| Course.slider(dc, { label: "demand after canopy", min: 0.5, max: 7, step: 0.05, value: d.dem, fmt: (v) => v.toFixed(2) + " mm" }, (v) => { d.dem = v; drawDry(); }); | |
| Course.slider(dc, { label: "soil wetness SM / wm", min: 0, max: 1, step: 0.01, value: d.sm, fmt: (v) => (100 * v).toFixed(0) + "%" }, (v) => { d.sm = v; drawDry(); }); | |
| Course.slider(dc, { label: "aquifer fullness G / hmaxaq", min: 0, max: 1, step: 0.01, value: d.g, fmt: (v) => (100 * v).toFixed(0) + "%" }, (v) => { d.g = v; drawDry(); }); | |
| drawDry(); | |
| // ---- summer 1993 | |
| const run = c.protocolRun("test", null, true), R = run.rec; | |
| const a = c.idx("1993-06-01") - run.i0, b = c.idx("1993-10-15") - run.i0 + 1, t = run.time.subarray(a, b); | |
| const sl = (k) => R[k].subarray(a, b); | |
| Course.tsChart(document.getElementById("sum_chart1"), { time: t, height: 220, ylabel: "storage (mm)", | |
| series: [{ label: "soil water SM", values: sl("SM"), color: css("--soil"), width: 2 }, { label: "aquifer G", values: sl("G"), color: css("--aquifer"), width: 2 }] }); | |
| Course.tsChart(document.getElementById("sum_chart2"), { time: t, height: 220, ylabel: "mm/day", | |
| series: [{ label: "rain", values: sl("P"), color: "rgba(61,143,203,0.45)", bars: true }, { label: "canopy Ec", values: sl("Ec"), color: css("--canopy"), width: 1.6 }, | |
| { label: "soil Es", values: sl("Es"), color: css("--soil"), width: 1.6 }, { label: "aquifer Eg", values: sl("Eg"), color: css("--aquifer"), width: 1.6 }] }); | |
| }; | |
| </script> | |
| </body> | |
| </html> | |