Downslope distance between two networks#
A mapped stream network and a simulated one rarely coincide. This page defines how far apart they are, measured along the paths the water takes, and the criterion built on that distance, the method of Abhervé et al. [2023]. It answers one question. Given a model that makes a network of streams and a map that draws another, how long is the walk downslope from one to the other, in each direction, and at which value of the calibrated ratio do the two walks balance?
How a model makes streams in plain words is on How the model makes streams. The keys of a calibration on a network are in [calibration.outputs].
Note
Scope. The page covers the distances, the criterion, what it identifies, and how the mapped network is drawn on the mesh. The simulated network itself, from the release flux to the flowing cells, is on Where the water table reaches the surface. The search that moves a parameter until the criterion reaches zero is described only where it shapes the criterion.
Notation of this page
Every cell \(n\) has a center \(x_n\) and an area \(a_n\). A distance is a length in meters along cell-to-cell links, center to center. Sets of cells are written with capital letters.
Symbol |
Meaning |
Unit |
Set by |
|---|---|---|---|
\(B\) |
saturated thickness, \(B(h) = \min\bigl(\max(h - z_\mathrm{bot}, 0), H\bigr)\) |
m |
state, not a field |
\(\bar B\) |
saturated thickness averaged by area over the catchment ( |
m |
derived |
\(K\) |
horizontal hydraulic conductivity, the same along \(x\) and \(y\) |
m/s |
|
\(T\) |
transmissivity, \(T = K\,B\) |
m²/s |
derived |
\(\bar N\) |
recharge averaged over the catchment and a period of time ( |
m/s |
derived |
\(n, m\) |
cell indices; \(\mathcal{N}(n)\) is the set of cells that share a face with \(n\) |
the grid, The mesh |
|
\(a_n\) |
plan area of cell \(n\) |
m² |
the grid |
\(\epsilon\) |
rise per step of the priority flood inside a filled depression |
m |
1 mm, a constant of the code |
\(r(n)\) |
receiver of cell \(n\), the one cell it drains to; \(-1\) when it has none |
derived |
|
\(\mathcal{N}_D(n)\) |
neighbours a cell may drain to: the cells sharing a node on a quad mesh, a face on any other |
|
|
\(C_n\) |
drain conductance of cell \(n\) |
m²/s |
|
\(b_d\) |
thickness of the drain bed in the derived conductance |
m |
|
\(z^d_n\) |
drain elevation of cell \(n\) |
m |
derived |
\(q^\mathrm{rel}_n\) |
water the aquifer releases to the surface in cell \(n\) ( |
m³/s |
derived |
\(\tau_\mathrm{s}\) |
share of the mean basin recharge, over its own area, a cell must release to count as a source |
||
\(\Sigma\) |
the sources: cells that release more than their threshold |
derived |
|
\(\mathcal{S}\) |
the simulated network: the downstream closure of \(\Sigma\) |
derived |
|
\(D\) |
the descent of the model top |
built with every MODFLOW grid |
|
\(D_{so}\) |
mean downslope distance from the simulated network to the mapped one ( |
m |
derived |
\(D_{os}\) |
mean downslope distance from the mapped network to the simulated one ( |
m |
derived |
\(J_{signed}\) |
\(D_{so} - D_{os}\), the residual a root search drives to zero ( |
m |
derived |
\(J\) |
\(\lvert D_{so} - D_{os}\rvert\), the cost of the |
m |
|
\(D_{optim}\) |
\((D_{so} + D_{os}) / 2\), a diagnostic ( |
m |
derived |
\(h_{obs}\) |
cell size where the mapped network lies, the median distance between neighbouring cell centres over the mapped cells ( |
m |
derived |
\(r_{optim}\) |
\(D_{optim} / h_{obs}\), the validity indicator ( |
derived |
|
\(V\) |
the length \(D_{optim}\) must stay under for the result to be valid ( |
m |
|
\(L_{cap}\) |
longest descent to the outlet inside the catchment; the value a cell whose descent never meets its target takes ( |
m |
derived |
\(\alpha_o\) |
share of the mapped network in its own downslope closure, inside the catchment ( |
warning level: |
|
\(K/\bar N\) |
conductivity over mean recharge ( |
derived |
|
\(T/\bar N\) |
\(K\,\bar B / \bar N\), transmissivity over recharge ( |
m |
derived |
\(\mathcal{O}\) |
the mapped network, drawn on the cells |
||
\(d_T(n)\) |
downslope distance from cell \(n\) to the set \(T\) |
m |
derived |
\(\ell(n)\) |
distance from the centre of \(n\) to the centre of its receiver |
m |
derived |
\(A_d(n)\) |
area drained through cell \(n\), the cell included |
m² |
derived |
\(o\) |
outlet cell that closes the catchment |
derived from the pour point |
|
\(\Omega_o\) |
the catchment scored: the cells whose descent reaches \(o\) |
derived |
|
\(\mathcal{E}\) |
water bodies: lake cells and other cells whose surface water is an input |
derived |
|
\(\mu(n)\) |
weight of a cell in a mean: 1, or its area |
1 or m² |
|
\(f_{so}, f_{os}\) |
share of a support whose descent never meets its target ( |
reported per trial, bounds nothing |
|
\(\sigma_o\) |
positional accuracy of the mapped network |
m |
|
\(r_s\) |
largest distance between a stream head and the cell it lands on |
m |
|
\(A_{d,\min}\) |
drained area a cell needs before a head may land on it |
km² |
The graph the distances follow#
A distance follows a flow path, and a flow path exists only where the depressions are resolved. The code floods the model top on the mesh with the priority flood of Routing on the mesh: the descent D, (41), seeded on the border of the active domain, and reads the receivers \(r(n)\) of (43) on the flooded copy. The edge length \(\ell(n)\) is the distance from the center of \(n\) to the center of \(r(n)\).
The flood is seeded on the whole border, where water leaves the model, not on the outlet alone: sealing one outlet would fill a valley of the buffer up to a col of the divide. The criterion does not read the descent \(D\) the build stores (The graph of the stream criterion). The map is never burned into the surface: an observation never enters the routing surface or the model top.
1. The downslope distance to a set#
For a target set \(T\), the distance from a cell to \(T\) is the length of its descent down to the first cell of \(T\):
With one receiver per cell, exactly one descending path leaves a cell, so there is no shortest path to search for. The distance is not a Euclidean nearest distance: a source fifty meters from a stream but across a divide is far away downslope. And it is not symmetric: \(d_{\mathcal{O}}\) on the simulated cells and \(d_{\mathcal{S}}\) on the mapped cells differ, which is what lets one cost weigh an excess of simulated stream against a missing one. An empty target gives \(+\infty\) everywhere and does not raise: an empty simulated network is the legitimate end of a search interval.
Fig. 65 Two networks on an 8 by 8 grid of 10 m cells, with the receivers of the
flooded top. Left: from each simulated cell down to the map, the two hillside
cells walk 42 m. Right: from each mapped cell down to the simulated network,
the three upper cells walk 10, 20 and 30 m. The two means differ, and so do
the cells that carry them. Every number is a call of
downslope_distance_to_mask.#
In the code: downslope_distance_to_mask.
2. The outlet, the catchment and the saturation length#
The outlet \(o\) closes the catchment, usually at the gauging station. With
\(A_d(n) = a_n + \sum_{m : r(m) = n} A_d(m)\) the area drained through \(n\), the
outlet is the most drained cell within two neighbor rings of the cell nearest
to the pour point the catchment was delineated from (two cells is the
SnapPourPoints distance of the paper, read on the mesh). Without a pour point,
the most drained cell of the delineated polygon closes the catchment, and without
the polygon the largest basin of the mesh does, with a warning.
The catchment scored, and the longest descent in it, are read on the same graph:
The delineated polygon builds the domain and places the outlet; it is not the
support. Their symmetric difference over the area of the polygon, the outline the
mesh followed when it followed one, is published as catchment_mismatch. The same
gap to the basin of D the build kept, the cells the budget zone sums, is published
as basin_mismatch. A wrong outlet closes the basin of D on the same wrong branch,
so only the first one shows it. Above
max_catchment_mismatch,
5 per cent by default, the search is refused before its first solve. On the Nançon
the gap is 0.2 per cent on the default grid of 27 004 cells, 4.2, 3.0, 2.1 and 4.2 per
cent on grids of 45, 60, 80 and 120 cells a side, and 0.2 per cent on a Voronoi mesh of
100 m that follows the smoothed outline. It passes 5 per cent on the grid of 30 cells a
side (9.4), on a Voronoi mesh of 400 m (6.6) and on a Voronoi mesh of 200 m (11.2),
where the outlet closes on another branch. \(L_{cap}\) is
static: it is the value an unreachable cell takes in the means
(5. The two mean distances).
In the code: resolve_outlet.
3. The two networks on the cells#
The simulated network \(\mathcal{S}\) is the downstream closure of the sources \(\Sigma\), the cells whose release flux exceeds a share of their own recharge, (50). The release flux is the union of (49), the same union for the criterion and for the stored field. A steady phase reads one state of the run.
The mapped network \(\mathcal{O}\) is a set of lines, drawn on the cells by
one of three rules chosen by
drawn_by.
It is first cut to the delineated catchment
(clip_to_catchment),
with the shape data.hydrography clips what it loads to, so a file and that
section draw the same map, and so does a figure redrawn from the run.
Heads keeps only where the map says a stream starts, and lets the receiver graph draw the rest: the path a ditch gave a mapped line is something a model on a DEM cannot reproduce, and drawn cell by cell it would count as error.
The lines are merged between junctions and free ends. A free end on the outline the map was cut along was made by the cut: the stream goes on beyond it, so it is no head. It is counted as
n_cut_ends.A free end is a head when the largest drained area within the radius \(r_s\) of it does not exceed the same quantity at the other end of its reach. The drained area decides, never the direction the line was drawn in.
A head lands on the nearest active cell within \(r_s\) that drains at least \(A_{d,\min}\), or is lost.
From each landing cell, the trace follows the receivers until the descent ends or meets a traced cell.
The foot of each dam of a lake with a declared spillway is a forced head: the stream under a reservoir has no free end. Only the MODFLOW 6 build stores the dam feet.
The traced map is connected to the outlet by construction.
Fig. 67 The heads rule on a toy valley of 25 m cells, from one call of
trace_from_heads. The two upstream free ends drain less than the
confluence and are kept; the downstream end drains more and is not a head.
The drawn map follows the descent of the model, not the line.#
Crossing, the default, draws the map as the data gives it. It keeps a cell when a mapped line crosses the segment joining the
centers of two cells that share an edge: on a structured grid, the cell medians,
which is what the WhiteboxTools tool VectorLinesToRaster of the paper tests.
The map is one cell wide, like the simulated network. A reach that crosses no
segment marks the cell holding its midpoint instead, and the count is published
per trial as n_observed_features_fallback. This is the rule for a map that is
not a tree: canals, braids, polders, karst.
Touch keeps every cell a line touches, corners included. Each diagonal step of the map then gains the two cells that share the corner, so a model that reproduces the map exactly is pulled towards a smaller K. It is kept to replay a session recorded before 2026-09.
In the code: trace_from_heads.
4. The supports and the targets#
The means are taken over the catchment, without the water bodies \(\mathcal{E}\):
\(\mathcal{S}\) is closed downslope, \(\mathcal{O}\) is taken as drawn: closing the map would build observation out of the DEM.
The target of \(D_{so}\) is \(T_{so} = \mathcal{O} \cup \mathcal{E} \cup \{o\}\). The outlet is added because mapped lines may stop short of it.
The target of \(D_{os}\) is \(T_{os} = \mathcal{S}\).
Water bodies stay in the graph and leave both supports: a lake cell in a support would add one zero per cell and move the root with the size of the lake.
The supports split the cells into three classes, published per trial:
n_valid (\(\mathcal{S}^\ast \cap \mathcal{O}\), simulated where the map has a
stream), n_excess (\(\mathcal{S}^\ast \setminus \mathcal{O}\), simulated where it
has none) and n_missing (\(\mathcal{O}^\ast \setminus \mathcal{S}\), mapped where
the model makes none).
The graph is not cut to \(\Omega_o\), the supports are: on a buffered domain many cells drain out of the basin and never meet the map.
5. The two mean distances#
Write \(\hat d_T(n)\) for the distance in which an unreachable cell takes the value \(L_{cap}\). An unreachable cell is never dropped and never counted as infinite: \(+\infty\) would make the mean infinite, and dropping it would move the support with the parameter. With \(\mu(n)\) the weight of a cell,
With \(\mu = 1\), each cell has one vote, as in the paper; with \(\mu = a_n\) the
mean is weighted by area, which matters on a mesh refined along the streams.
Both pairs are reported at every trial, and
weighting selects the one the
criterion reads.
\(D_{so}\) large means a simulated network spilling far from the mapped one, an excess. \(D_{os}\) large means a simulated network that never grew to the mapped one, a deficit. At a balanced point most distances are zero, so the means are carried by a few cells: they are tail statistics.
The unreachable shares \(f_{so}\) and \(f_{os}\) are reported on both sides, and neither
refuses a trial. \(f_{so}\) is zero by construction: the target of \(D_{so}\)
holds the outlet, and every cell of the catchment reaches the outlet. The target of \(f_{os}\)
is the simulated network the calibration moves: at a high conductivity it retracts
into the talwegs, and mapped cells legitimately have nothing left to descend into.
frac_outlet_terminated is the share of the simulated support whose descent meets
the target only at the sealed outlet. It says how much of \(D_{so}\) rests on that one
cell, and a network in excess legitimately gives a large share, so it bounds nothing.
In the code: mean_downslope_distance.
6. The criterion#
The criterion is equations 1 to 4 of Abhervé et al. [2023]:
When the simulated network is empty, \(D_{so}\) has no support, and the residual is set to \(J_{signed} = -L_{cap}\): the negative value a root search needs at the end of its interval where nothing seeps.
The cost is \(J\), and its zero is a crossing. The two curves \(D_{so}\) and \(D_{os}\), drawn against the calibrated parameter, cross, and the crossing is the answer. \(D_{optim}\) is large at both ends of a sweep, so it has an interior minimum, and minimizing it is a tempting substitute. It is a different estimator: nothing places its minimum at the crossing.
Fig. 69 \(D_{so}\) and \(D_{os}\) against \(K/\bar N\) on a toy catchment of 60 by 60 cells of 20 m. No solver runs: a cell is a source when the recharge it drains exceeds what a 30 m saturated thickness carries down its slope, \(\bar N A_d > K B s\,w\), and the map holds the cells draining more than 0.03 km². Every distance is a call of the code. The curves are steps, because the masks are discrete. The minimum of \(D_{optim}\) (dotted) is not at the crossing.#
The two estimators are needed and are not interchangeable. Inside one model
structure, \(J\) finds the parameter, and \(D_{optim}\) cannot separate two points
that both balance. Between structures already balanced at \(J = 0\), only
\(D_{optim}\) separates them. The code names them apart in
metric: distance_gap is the cost
\(J\) and carries the signed residual; distance_mean is \(D_{optim}\), a
diagnostic. With two maps, each bound is this same pair evaluated once, and the
cost is the sum of the weighted gaps. A run with a permanent map beside the full
one, in one state, scores the state against the permanent map; the full map is
scored at the same state as a validation and never enters the cost.
In the code: seepage_distance_cost.
7. When a result is valid#
The length scale. \(h_{obs}\) is the median distance between the centers of cells that share an edge, over the mapped cells of \(\Omega_o\): the cell size on a regular grid, the size of the fine cells on a mesh refined along the streams. It is static, since the map does not move with \(K\).
The bound. The paper reads \(r_{optim} \leq 2\): two cells, one of which budgets for the error of the map. The code writes it as a length:
With no declared accuracy, \(V = 2 h_{obs}\), the bound of the paper. A declared
accuracy \(\sigma_o\) above \(h_{obs}\) widens \(V\) and leaves \(r_{optim}\) comparable
with the paper. A declared
validity_length replaces the
computation. The bound is read on the trial the search returns, and qualifies the
value without replacing it: a violation logs a warning, or is refused after the
session is saved when
on_invalid is
"error". Each trial publishes r_optim and r_optim_valid.
The map against the surface. Wherever the mapped lines do not sit in the talwegs of the model top, the distances measure a disagreement between two datasets rather than hydrogeology. The code publishes the share of the downstream closure of the map that the map itself holds, inside the catchment:
as alpha_obs_closure_catchment. A value below
alpha_warning_threshold
logs a warning, once per process.
What the criterion identifies#
Take a steady water-table aquifer with drains at the surface whose conductance is derived from \(K\), (44). Per unit area, the balance of a cell is
with \(B\) the saturated thickness ((24)) and \(z^d\) the drain elevation, the cell top by default. Dividing by \(K\) gives
which depends on \(N/K\) and on the geometry alone. When \(K\) is scaled by one factor everywhere and \(N\) keeps its shape, the head field, and so the seepage mask, the release flux and the criterion, depend only on \(K/\bar N\). What the criterion calibrates is that ratio, not \(K\). A \(K\) read from it inherits the recharge series entirely: report \(K/\bar N\) and name the recharge beside it.
When the search moves the homogeneous conductivity alone, the report publishes
the ratio with what it rests on: k_over_r (\(K/\bar N\)), k_optim_m_s,
R_mean_m_s (\(\bar N\)), d_sat_m (the saturated thickness averaged over the
catchment, \(\bar B\)), and t_over_r_m (\(T/\bar N = K \bar B / \bar N\), a length).
For any other search they are not published.
This is why a search that moves \(K\) is refused when a conductance does not follow \(K\) (see the limits).
How a search reaches the zero#
The masks are discrete, so \(J_{signed}\) steps over zero instead of reaching it. On a real catchment \(|J|\) never drops below three meters while the root is bracketed to a factor 1.0015. The zero is a plateau whose width sets how precisely the parameter is known. A bisection therefore stops on the width of its bracket, on a logarithmic transform, never on the size of the residual. A search that stops on \(|J| < \epsilon\) may never stop at all.
Monotonicity is not proven, since the direction of variation was established on three points. A coarse sweep runs first, checks it instead of assuming it and sees every crossing. Its solves are the same ones that draw the diagnostic curves. A bracket with no sign change is reported, never closed: returning the better end would be a minimized mean distance in disguise, which is the drift this criterion exists to correct. The search raises and prints both residuals. The options are on Calibration methods and metrics.
Two roots#
A network output scored on two bounds (\(n_{bounds} = 2\), a transient extent
table and a minimal map) publishes one residual per bound, J_signed_minimal and
J_signed_maximal, and no J_signed. The search sweeps once, keeps one bracket
per bound on the same trials, and halves each until its width reaches the
tolerance. The value it returns is the weighted geometric mean of the two roots
with the weights the output publishes. This value is solved once more, so every
number published beside it comes from a real solve. The two roots and their
spread \(\Delta = \log_{10}(K^*_\mathrm{max} / K^*_\mathrm{min})\) are published
in roots_record. A bound weighted zero is not searched, because its root would
move nothing and a missing sign change on it would refuse a search that does not
depend on it.
Points asked together#
An engine that asks for \(n\) points at once gets \(n\). The sweep is fixed in advance, so it is handed out \(n\) points at a time. A bracket is cut by \(n\) points into \(n + 1\) equal parts in the log variable, all solved together, and the part whose ends change sign is kept. A round that needs fewer points to reach the tolerance places only those. With two roots the \(n\) points of a round are shared between the two brackets, one each first, then one at a time to the bracket that would stay widest, and a bracket both bounds share is cut once. One point per ask is the binary search, trial for trial.
When one round leaves several parts that change sign, the residual is not monotone there. The part kept is the one binary bisection keeps. Its halvings are followed through the points evaluated, as far as each midpoint is one of them, which is all the way when \(n + 1\) is a power of two. Past the last midpoint evaluated, the lowest crossing left is kept, the rule the sweep applies to crossings of one width.
The budget before the first solve#
The budget is known before the first solve, from root_search_budget. Let \(d\) be
the declared interval in decades, \(t = \log_{10}(1 + \mathrm{rel\_tol})\), \(S\) the
sweep points (two when sweep_points is zero), \(s = d / (S - 1)\) the sweep step,
\(h(w) = \lceil \log_2 (w / t) \rceil\) the halvings of a bracket \(w\) decades wide
and \(E\) the bracket_expand. Then
one root inside the declared bounds costs \(N_\mathrm{nominal} = S + h(s)\),
one root found after \(e\) expansions costs \(S + 2e + h(1)\), since each expansion solves two new ends and leaves a bracket one decade wide,
two roots inside the bounds cost \(S + 2 h(s) + 1\), the last one being the solve at the combined value,
two roots of which one needed \(e\) expansions cost \(S + 2e + h(1) + \max(h(s), h(1)) + 1\),
\(N_\mathrm{worst}\) is the largest of these, reached at \(e = E\) whenever the sweep step is at most a decade.
On the Nançon, \([10^{-7}, 10^{-3}]\) m/s, seven sweep points and one per cent, one
root costs 15 evaluations inside the bounds and 17, 19, 21 and 23 after one to
four expansions. Two roots cost 24 inside the bounds and 26 to 32 after
expansions. max_trials = "auto" budgets the worst case, and a declared budget
below the nominal case is refused before the first solve. When a budget still
runs out, the search publishes the halvings its brackets still need
(evaluations_remaining), and the engine grants exactly those, once.
With \(n\) points per ask, \(h(w)\) becomes the number of evaluations that close the bracket \(n\) cuts at a time, and the two brackets of a two-root search are closed together. With \(n = 1\) the counts above hold. There are more evaluations and far fewer rounds. On the Nançon with four points, one root costs 20 evaluations in 6 rounds instead of 15 in 15, and two roots cost 26 in 8 instead of 24 in 24.
The interval around the root#
The interval reported beside the root is read on the cost curve. The trials give one cost per point of the search variable, the first solved cost when a point was asked twice, and none on a point that did not solve. From the root the cost is followed on each side to its first crossing of the margin, by a straight line between two points, so no solve is added. A point with no cost stops the walk, since a line drawn to it would claim a crossing no solve showed.
Assumptions#
Water leaves a cell by one receiver (single flow direction).
The model top, flooded on the mesh graph, is the surface water follows.
Distances are lengths along links between cell centers, not straight lines.
The mapped network is independent of the DEM. It is never burned into the surface.
The release flux is the whole of what leaves the aquifer for the surface.
For the reading of \(K/\bar N\): the state is steady, the drain conductance follows \(K\), and \(K\) is scaled by one factor while \(N\) keeps its shape.
The threshold \(\tau_\mathrm{s}\) and the mean recharge \(\bar N\) are frozen over a search.
Limits#
What the code refuses:
a search whose scored catchment differs from the delineated outline by more than its bound, before the first solve: an outlet on another branch, or a mesh too coarse for the catchment;
a mapped network that lands on no active cell, or on no cell of the catchment. The message names the CRS as the first suspect;
a heads rule that draws no stream: no free end on an active cell, every free end draining more than the other end of its reach, or every head lost;
a release record in the budget that no declared package reads, which would report its water as dry land;
a search that moves a conductivity while a drain has a fixed conductance, or while SFR or LAK is active: those conductances do not follow \(K\), so (61) does not hold. A search driving another parameter gets a warning instead;
a bisection on more than one parameter, or on a parameter without a logarithmic transform.
What the code does not represent:
Monotonicity. The criterion does not prove that \(J_{signed}\) varies one way with the parameter. It checks it on a sweep.
\(r_{optim}\) is not a quality indicator. It measures agreement with the map, and it moves with the grid: refining a mesh lowers \(h_{obs}\) and raises \(r_{optim}\) at constant agreement. Two verdicts are comparable when their validity lengths are.
Tail statistics. Reading \(r_{optim} \leq 2\) as “the typical gap is under two cells” is wrong when the median distance is zero.
The surface is not repaired.
dem_correc_typeconditions the DEM before the catchment is delineated (fill, the tool of the paper, orbreach[Lindsay, 2016], orcapped_breach). A DEM declaredstate = "conditioned"on its source is treated asprovided: HydroModPy skips the conditioning and still computes the D8 directions and the accumulation. The criterion always floods the model top on the mesh; a breached raster reaches it only through the domain and the outlet.The recharge of the steady stage. The protocol averages it over the window the run loads, three years in example 04, where the paper reads a normal of sixty years, 1960 to 2019. It is a declared departure, and \(K\) is only readable with the \(\bar N\) and the window printed beside it. Write a long
steady_windowwhen the forcing covers one. A window across 31 July 2015 reads a break of the SIM2 product: the summer drainage over example 04 no longer falls under 0.3 mm/day after it (The daily soil reservoir).The visible flow. In one state the simulated network is the closure of the sources, whatever it carries. A visible flow exists in a transient run only, in the two-bound mode and in the persistence figures, which apply
calibration.outputs.<name>.model.extent.visible_flow(How the model makes streams), so such a figure and a one-state score do not read the same network.The two-bound mode is outside the protocol. The protocol scores its network output at its steady stage, and an extent table is refused on a steady search. Its transient stage scores the hydrograph alone. A two-bound search is written by hand.
Intermittent reaches. A complete map mixes the reaches that flow all year with those that flow part of it. A one-state output scores it against one state, so an intermittent reach counts as if it flowed in that state. Only
calibration.outputs.<name>.map.permanentand the two-bound mode separate the two, and only when the source says which reach is permanent. The code does not know when an intermittent reach flows.The resolution of the DEM. The model top and the descent \(D\) come from the DEM, so the simulated network cannot sit closer to a talweg than the DEM places it. A mesh finer than the DEM does not place it better. Under the heads rule the map is drawn on the same descent and shares that error. Under
crossingortouchit is drawn where the lines are, so a talweg the DEM shifts leaves a distance that no parameter closes.Tracing error and snapping. The cost reads the mapped lines as exact.
calibration.outputs.<name>.map.position_accuracyenters the validity length only. Under the heads rule a head lands up tocalibration.outputs.<name>.map.heads.radiusfrom its point, on a cell that drains at leastcalibration.outputs.<name>.map.heads.min_drained_area. A head that lands in the next talweg, or is lost, changes the drawn map, and no part of that uncertainty is carried into the score.Domain of validity. The method was built for unconfined aquifers in a temperate humid climate, with gentle gradients and a strong groundwater-stream connection. Outside that, the criterion still computes, and it means less.
Measured#
A twin with six heads. A comb basin of 5600 cells of 20 m makes a network one cell wide at \(K/\bar N = 600\), and that network, written as a map of six lines, is the truth. The protocol finds \(K\) again to 0.45 per cent on MODFLOW-NWT, MODFLOW 6 and a Voronoi mesh, with \(J = 0\), inside a band of 3 per cent that the width of the zero plateau and the stop of the search set. A map drawn at another \(K\) gives that \(K\). A wrong map moves the answer, and the last two rows below are what a balanced \(J\) does not show:
The map |
\(K\) off by |
\(D_{optim}\) |
\(r_{optim}\) valid |
|---|---|---|---|
The truth |
0.45 % |
0 m |
yes |
One head missing |
6.5 % |
2.2 m |
yes |
All valley heads three cells low |
8.6 % |
0.3 m |
yes |
All valley heads five cells south, three valleys shorter and two longer |
2.4 % |
6.0 m |
yes |
200 m off, five of six heads lost |
a factor of 9.6 |
0 m |
yes |
The bound of two cells passes every row, so it does not check a map. Read
\(D_{optim}\) against zero on a twin, and n_heads_lost on any run: a lost head logs a
warning, because the reach under it leaves the map and \(K\) reads higher. A map that
wanders a cell off its talwegs below its heads gives the same \(K\) to the last bit
under the heads rule, and \(K\) 11.6 per cent low under the crossing rule.
On the Nançon. The default grid of 27 004 cells, protocol 1.3, recharge over 2000 to 2002, with the 29 heads the cut map holds, none lost (31 under D4), is below. One root over four decades of \(K\) in each case.
Case |
\(K\) (m/s) |
|
NSE |
\(J\) (m) |
\(D_{optim}\) (m) |
Mapped cells |
\(K\) where \(\lvert J \rvert\) is under one cell |
|---|---|---|---|---|---|---|---|
Heads, D8 |
1.01e-4 |
0.0253 |
0.9580 |
-1.46 |
105.0 |
471 |
7.82e-5 to 1.09e-4 |
Crossing, D8 |
1.06e-4 |
0.0253 |
0.9576 |
2.63 |
112.2 |
496 |
7.65e-5 to 1.26e-4 |
Heads, D4 |
8.82e-5 |
0.0253 |
0.9588 |
2.89 |
98.0 |
659 |
8.11e-5 to 1.13e-4 |
The two rules agree on \(K\). The 5.5 per cent between them is about the size of the tie under heads, where trials from 1.01e-4 to 1.06e-4 m/s read the same \(J\). Heads misses 99 cells and adds 167 where crossing misses 195 and adds 232, and its root is no sharper: \(\lvert J \rvert\) stays under a tenth of a cell over about 6 per cent of \(K\) under both rules.
D4 moves \(K\) by 12.4 per cent, far more than the tie. Its root sits just above a step of the curve, where \(J\) falls by 62 m over 0.2 per cent of \(K\), and \(D_{optim}\) is not comparable, because the walk differs. It draws 40 per cent more cells, and its catchment leaves the outline by 1.1 per cent against 0.2. On a twin whose valleys run along the grid diagonal it leaves the outline by 17 per cent, which the bound refuses, and with the bound lifted it lands 4.5 per cent off against 2.4 per cent for D8. On valleys along the grid axes the two are equal.
The hydrograph does not decide. NSE moves by 1.2e-3 over these three values of \(K\),
and Sy stays within the 5 per cent the search stops on.
The visible flow. In the two-bound mode, \(K\) depends on the flow a reach must carry to count as a stream. On the Nançon with the BD Topage maps, the mean of the two roots is 1.73e-5, 1.29e-5 and 7.80e-6 m/s at 0.5, 1 and 2 L/s, a factor of 2.2. Most of it comes from the root on the complete map, 4.97e-6, 2.95e-6 and 1.32e-6 m/s, because \(\lvert J \rvert\) stays under one cell over half a decade of \(K\) or more there. The root on the permanent map moves less, 6.01e-5, 5.61e-5 and 4.61e-5 m/s, but its \(D_{optim}\) is over 260 m, past the bound of 150 m. The two roots lie 1.1 to 1.5 decades apart, so their mean meets neither map. Quote each root with its visible flow.
K and Sy on two maps. A twin whose two maps come from a run at a known \(K\) and Sy finds \(K\) to a few per cent. It does not find Sy. Over a factor of 16 in Sy, \(\lvert J \rvert\) stays under one cell on both maps at the true \(K\), and two of three search methods return a Sy near 80 per cent high. Where the two maps are nearly the same, \(K\) lands 32 per cent high and Sy 70 per cent low at a cost of zero. On the Nançon only the permanent root follows Sy, with a slope of 0.61 in log-log. The two roots meet at \(K\) = 9.1e-6 m/s and Sy = 0.0040, which is below the usual range. There NSE falls from 0.96 to 0.77 and the NSE on log discharge from 0.98 to 0.43. So the route is allowed, and it is not recommended. A minimiser on one parameter is refused, because the same trials give 1e-7 m/s, the search bound, where the root search gives 1.29e-5.
The step of D4. The 12.4 per cent of D4 comes from one cell. It lies on a hillslope at 170 m, and it dries between \(K\) = 8.697e-5 and 8.715e-5 m/s. With it go 37 cells of stream under D4 and 27 under D8, all absent from the map. Under D4 this takes \(J_{signed}\) from +65 to +3.0 m, within 3 m of zero, and the root falls just above it. D8 loses the same cell at the same \(K\), and \(J_{signed}\) stays positive, from 83 to 34 m. A solver closure a hundred times tighter gives the same \(J\), so the step belongs to the model and not to the solver. Under D4, \(K\) is set by that one cell, and its narrow band is apparent precision.
Comparing structures. Two structures compare only at an equal balance, so a plain bisection closes the root of \(J\) at each one and gives its \(D_{optim}\). On the Nançon, thicknesses of 10 to 90 m give \(D_{optim}\) of 142, 168, 107, 112 and 123 m, each in 24 solves at a width of 8, except 10 m, whose root lies above the search bound of \(K\) and costs 27. Between 17.3 and 90 m, \(K \cdot \bar B\) stays within 13 per cent, as the ratio \(T/\bar N\) predicts. One step of \(J\) moves \(D_{optim}\) by 30 m at 17.3 m, so a smaller gap between two structures says nothing. Scoring \(D_{optim}\) without the balance finds 105 m at \(J\) = +24 m, with a network 21 per cent longer than the map.
Triangles. The twin has no triangle column. With XT3D and Newton, MODFLOW 6 keeps cycling by 2 to 5 cm on one border triangle, whatever the under-relaxation. Without Newton it closes, and the side triangles then seep beside the talweg. The network is wider than one cell, so no map of lines can equal it. The Voronoi column, whose cells follow the talwegs, passes.
Parameters of this page#
The keys of a calibration on a network are in [calibration.outputs].
Checked by#
The tests that import the code of this page. The box is generated: a new test appears here on the next build.
23 test files import hydromodpy.catchment.drainage.distance, hydromodpy.catchment.drainage.filling, hydromodpy.catchment.stream_network.geometry, hydromodpy.catchment.stream_network.heads, hydromodpy.catchment.stream_network.network, hydromodpy.catchment.stream_network.cost, hydromodpy.calibration.criteria.hydrographic_network_distance. Their names say what they check.
unit: 21
- Config. calibration
- Criteria series. calibration
- Metrics solver extract. calibration
- Observations network geometry. calibration
- Optim cost margin. calibration
- Optim objective. calibration
- Descent. catchment/drainage
- Distance. catchment/drainage
- Downslope whitebox golden. catchment/drainage
- Filling. catchment/drainage
- Graph. catchment/drainage
- Routing. catchment/drainage
- Cost. catchment/stream_network
- Geometry. catchment/stream_network
- Heads. catchment/stream_network
- Network. catchment/stream_network
- Metric table. core/scoring
- Recharge rates. model/forcing
- Comparison. results/stream
- Redraw comparison. results/stream
- Run extent. results/stream
In the code#
What |
Where |
|---|---|
The flood on the mesh graph |
|
The receivers and the distance to a set |
|
The outlet, the catchment, \(h_{obs}\), \(V\), the supports |
|
The heads rule |
|
The crossing rule |
|
The means and the criterion |
|
The two estimators |
|
The root search |
|
See also#
[calibration.outputs]: the keys of a calibration on the network, the two-bound mode of a transient run included.
Where the water table reaches the surface: the sources, the closure and the diagnostics against a map.
How the model makes streams: how the model makes streams, in plain words.
Bibliography: the full list of references.