Monday, July 13, 2026

If not Richards, what else ?

Two soils with the same water content θ are not in the same hydraulic state. The pore-occupancy g(r) — the fraction of pores of radius r that are water-filled — distinguishes them, while θ, being an integral of g, cannot. The navy step is the reference equilibrium geq = H(r* − r): water fills the small pores first. Everything else on the plot is a state that Richards' equation is blind to.


In May I posted the talk I gave at EGU 2026 in Vienna, and promised the two papers “in a couple of weeks after EGU.” It took a little longer than that — it always does — but the first one is now public:

The Statistical Physics of Unsaturated Soil Water: kinetic theory and non-commutative pore-water dynamics
R. Rigon, arXiv:2607.09416 [cond-mat.stat-mech], 22 pages, 9 figures, 2 appendices.

It is going to be submitted to Physical Review E. The companion paper — the Chapman–Enskog derivation that recovers Richards' equation as a hydrodynamic limit — follows shortly, and I will post it here when it lands.

The argument in one sentence

Unchanged from the talk, and worth repeating because everything else is a consequence of it:

Richards' equation is not wrong; it is the equilibrium limit of a deeper kinetic theory — in the same sense that Navier–Stokes is the hydrodynamic limit of Boltzmann's equation for a gas.

Mario Putti asked me, twenty years ago, “if not Richards, what else?” This is my attempt at an answer, and it arrives only after many years spent trying to solve Richards' equation properly — first with GEOtop, later with WHETGEO. You have to take an equation seriously for a long time before you earn the right to say what it is missing.

What the theory actually says

The state variable is not θ. It is the pore-occupancy g(r, x, t): the fraction of pores of radius r that are water-filled at position x and time t. Water content is recovered as a moment of it, θ[g] = φ ∫ g(r) f(r) dr — which is precisely the point: θ is an integral of g, so it throws information away. Two soils with the same θ, one wetted by rain (which fills pores by areal exposure, favouring the large ones) and one drained to the same θ (which empties the large ones first), are in genuinely different hydraulic states. They will conduct water differently, and they will respond to the next rainfall differently. Richards' equation cannot see the difference. That is the figure above, and that is the whole motivation.

The theory is built by passing through three scales, and I think this is the part hydrologists will find easiest to trust, because each step is ordinary physics:

  • Microscale. A single water transfer between two pores is set by a Hagen–Poiseuille rate and driven by the difference of pore chemical potentials Φ(r, r′) — capillary and gravitational here, but open to adsorptive, osmotic, or thermal refinement without touching the structure of the theory.
  • Mesoscale. Averaging over a representative volume gives a master equation — a gain–loss (Boltzmann-type) kinetic equation whose terms relax the occupancy toward its equilibrium, with a connectivity kernel C(r, r′) that encodes which pores can actually talk to which.
  • Macroscale. A Chapman–Enskog reduction gives back Richards' equation in the quasi-static limit Da → 0.

Everything the theory needs as input is a geometric property of the pore network — measurable from micro-CT. Nothing is calibrated against macroscopic hydrological data. I want to be blunt about how unusual that is, and how exposed it leaves me: the theory makes parameter-free predictions, and parameter-free predictions can be wrong in public.

Four things that fall out, which I did not put in

This is the part I care about. These were not assumptions; they are consequences.

1. Matric potential and hydraulic conductivity exist only in the limit. ψ and K are not primitive quantities of the theory. They emerge at Da → 0, and K is derived from the connectivity kernel rather than postulated. Below the percolation threshold, K vanishes — not as a fitting choice, but because the water phase stops spanning the medium. Field capacity gets a geometric meaning: θFC ≈ θc.

2. Hysteresis is geometry, not memory. It is the holonomy of a forcing bundle — a geometric phase, arising from the non-commutativity [W, D] ≠ 0 of the wetting and drying operators. Wetting fills by areal exposure; drying empties by capillary ordering; the two operations do not commute, so a closed loop in the forcing does not return you to where you started. Independent-domain and Preisach models posit bistable pores and reproduce the loop. Here the loop is derived, and it comes with a falsifiable prediction: the loop area scales as H ∼ I² with the forcing intensity. Domain models are rate-independent and predict no such thing. That is a clean experimental discriminant, and I would very much like someone to go and measure it.

3. Preferential flow is not a separate process. It is what the same equation does when Da > 1. The molecular-chaos (Stosszahlansatz) closure that underlies the kinetic equation fails exactly when pore occupancies become correlated near the percolation threshold — and that correlated, channelized regime is fingering and preferential flow. So the Richards / preferential-flow dichotomy dissolves into a continuous, Da-controlled crossover. We do not need two domains and a phenomenological exchange term; we need one equation and an honest look at its Damköhler number.

4. Out of the quasi-static limit, g(r) is irreducible. No single scalar — not θ, not ψ — is a complete description. And, as I discovered while revising the manuscript (a lesson in the value of being asked a hard question at the right moment): this is true even at equilibrium. With gravity present in a finite volume, the equilibrium occupancy is not the sharp step H(r* − r) at all; it is a smeared step, because a large pore low in the profile can stay filled while a smaller pore higher up has already drained. Each pore holds water within its own Jurin rise. The retention curve — the last place where the classical scalar picture was supposed to be exact — is not exact either.

Where this connects

The framework absorbs rather than replaces. Capillary-bundle models are its diagonal limit; critical-path models are its spectral limit; Hassanizadeh–Gray is a thermodynamically consistent extension, here resolved pore-class by pore-class; phase-field methods are gradient flow on a free energy, here with explicit network connectivity; dual-permeability models are the Da > 1 regime, without the phenomenology. The same machinery, with capillary pressure replaced by freezing-point depression, is the freezing-soil problem I have worked on with Niccolò Tubini and John Mohd Wani.

This is not a parallel universe to Richards. It contains it.

What I am not claiming

I would rather say this myself than have it said to me. The paper is a construction, not a rigorous reduction from molecular dynamics: the closures are posited on physical grounds and judged by their consequences. The full kinetic equation has not yet been solved on a real soil — the numerics live in the companion paper and in the supplementary demonstrations. And the single most obvious next step is also the hardest and the most interesting one:

directly observing g(r).

Micro-CT can see it. Nobody, as far as I know, has yet used it to test a kinetic theory of soil water. If you work with imaging of pore-scale water and this sounds like a collaboration, write to me.

Materials

  • Paper: arXiv:2607.09416
  • The EGU 2026 talk (slides, storyboard, and the notebooks behind the figures): the May post — still the gentlest way in, if the paper looks forbidding.
  • Code: will be added on GitHub; the OpenPNM notebooks that generate the supporting figures are already in the OSF repository linked from the talk.

Comments, objections, and counterexamples are all welcome — especially the counterexamples. A theory that cannot be attacked is not saying anything.

Sunday, July 5, 2026

Extended PETRI Net examples from the MARRMoT models collection

Five years ago, when we wrote that any lumped-parameter hydrological model can be represented as an Extended Petri Net, the statement had the flavor of a theorem asserted with a couple of worked examples. Now it has the flavor of a proof by exhaustion. The presentation below, prepared with Marialaura Bancheri and Anna De Nardi, contains the EPN translation of all forty-six conceptual models of the MARRMoT collection (Knoben et al., 2019), from the single-bucket Collie River Basin 1 up to SACRAMENTO, PRMS and CLASSIC. Anna carried out the bulk of this work as her graduation exercise, completing the task I had assigned to my class back in 2021, and I think the result deserves to be seen in its entirety.

The presentation can be found by clicking on the above image. 

I will not explain here what an EPN is: the definitive references remain Bancheri, Serafin and Rigon (2019), which introduces the formalism and its exact correspondence with the ordinary differential equations of the water budget, and Rigon and Bancheri (2021), which shows how the same topology carries, almost for free, the travel time, response time and tracer dynamics. A gentler entry point, with slides and a video tutorial, is this older post, and the conceptual background on the equivalences among the various hydrological dynamical systems is discussed here.

What the collection adds is something the papers could not give: the experience of seeing forty-six models side by side under a single graphical grammar. Some things become obvious that the original equations, or the traditional bucket sketches, keep hidden. Family resemblances jump out — the MOPEX series, the Flex variants, the Tank models reveal themselves as small mutations of a shared skeleton, and one starts to suspect that the space of conceptual models is much smaller than the number of their names suggests. Complexity becomes measurable at a glance: you can literally count places, transitions, splitters and see where a model concentrates its assumptions. And the pathologies show up too — when the wiring of a model resists a planar, readable drawing, as it happens with SACRAMENTO, that is telling you something about the model, not about the drawing. In this sense the EPN works as a diagnostic instrument, not merely an illustration.

There is also a forward-looking reason to care. Once a model is a graph with typed nodes, it is data: it can be stored, compared, composed with other graphs, translated automatically into code — which is what we pursue in the GEOframe/OMS3 world — and it connects naturally with the compositional, category-theoretic view of open systems I discussed apropos of stock and flow diagrams. The forty-six drawings below are therefore not an endpoint but a dataset.

All the previous material on the topic is collected under the EPN label of this blog, starting from the original announcement of the WRR paper.

References

Bancheri, Marialaura, Francesco Serafin, and Riccardo Rigon. 2019. "The Representation of Hydrological Dynamical Systems Using Extended Petri Nets (EPN)." Water Resources Research 55 (11): 8895–8921. https://doi.org/10.1029/2019WR025099

Rigon, Riccardo, and Marialaura Bancheri. 2021. "On the Relations between the Hydrological Dynamical Systems of Water Budget, Travel Time, Response Time and Tracer Concentrations." Hydrological Processes 35 (1). https://doi.org/10.1002/hyp.14007

Knoben, W. J. M., J. Freer, K. J. A. Fowler, M. C. Peel, and R. A. Woods. 2019. "Modular Assessment of Rainfall-Runoff Models Toolbox (MARRMoT) v1.0: An Open Source, Extendable Framework Providing Implementations of 46 Conceptual Hydrologic Models as Continuous Space-State Formulations." Geoscientific Model Development. https://gmd.copernicus.org/articles/12/2463/2019/

Monday, June 29, 2026

What is a DARTH, and which is its way to implement a digital twin of Hydrology ?

So what, exactly, is a DARTH? Not the software, not the cloud — the thing itself. This post is my attempt to answer, in thirteen tenets.


Digital twins are everywhere now, at least we see several contributions that name themselves such. They appear in the great international programmes, in the roadmaps of agencies, in the slides of almost every keynote about the future of Earth science. Many of them are magnificent feats of engineering: high-resolution solvers, elastic cloud, fast emulators. And yet, watching talk after talk, I kept feeling that something was missing. Technology is not the same thing as a vision. A high-resolution engine and a cloud are not, by themselves, a scientific instrument.

The precedent I keep returning to is FAIR. Years ago the FAIR principles changed the way our community treats data — not by inventing any new technology, but by writing down, compactly and citably, what good stewardship requires: that data be findable, accessible, interoperable, reusable. Their power was in the act of definition. We need something similar for twins. But a twin is neither only data nor only software. It is a model bound to a real basin, kept in correspondence with it, and used to make claims about its past, present, and possible futures. So I sat down and tried to write what makes such a twin trustworthy.

I came out with seven points. Talking them over with colleagues, the seven became thirteen, and they arranged themselves naturally into five movements — from what a twin is, through the record it keeps and the machinery that runs it, to the commons that builds it and the ends it serves.

I · Representation — what a twin is

1. A multi-resolution, multi-process, representation of the hydrological cycle, built from interchangeable modelling solutions that close mass and energy budgets and quantify their own error — at least in a subjective, Bayesian sense — propagated across scales.

2. Bound to a real system: calibrated, validated, and — where data allow — kept synchronised with the basin through data assimilation. This binding to reality is what distinguishes a twin from a mere simulator.

3. Transparent — no black boxes. Every component is inspectable, and even the machine-learning parts carry a stated structure and an interpretable role.

II · Data — the record it keeps

4. All data, consumed and produced, are geo-registered, versioned, and FAIR.

5. Every result is reproducible end to end — code, parameters, environment, and data lineage recorded as provenance. FAIR governs the data; this governs the computation.

III · Software — the machinery that runs it

6. Model parts are interchangeable by construction, so alternative descriptions can compete as falsifiable hypotheses.

7. Deployable over the web and, through shared standards and interfaces, interoperable across infrastructures — components and twins from different groups composing together, running from laptop to HPC.

8. Open source: built on, released as, and developed in the open, and free of lock-in.

IV · Community — the commons that builds it

9. A shared infrastructure, not isolated codes, that serves the widest community and grows with knowledge.

10. Organised, by construction, for participation and cooperation — for the collective action of scientists.

11. Stewarded: it carries its own documentation, training, and transparent governance, so that it outlives any single project or generation of its makers.

V · Purpose — the ends it serves

12. General-purpose by design — prediction, scenarios, decisions, education, or pure inquiry alike.

13. Bounded by an ethical purpose: to serve the public good and the stewardship of water and land, and to do no harm.

Please observe that Number 1, excludes practically all exiting model, which are certainly not multi-resolution, neither multiprocess. Therefore, for now, we have to consider DARTHs as an "organizing metaphor", i.e. a working program.  If you make me choose the tenets I care most about, they are these. Number 2, the binding to observation: a model that never meets a measurement is a beautiful animation, not a twin. Number 3, no black boxes: I am not against machine learning — I use it — but a learned component still has to say what it is and what role it plays. Number 7, interoperability among infrastructures: no platform is a twin of the planet on its own; the digital Earth appears only when many of them interoperate. One Earth, many infrastructures. And number 13, the ethical bound, which I added last and on purpose — openness and transparency are not only engineering choices, they are how we stay accountable.

Here is the part I most want to insist on: these are not wishes. The means to honour most of them already exist, in the open. The Basic Model Interface (CSDMS) makes components interchangeable and couplable; the OGC API – Processes family lets us deliver and chain models as web services across infrastructures; and the Object Modeling System with its cloud companion CSIP turns model components into open services at scale. GEOframe and GEOtop are simply our own way of walking that path. What no standard hands you for free is the last rung — transparency, honest uncertainty, components that behave as hypotheses rather than as fitted curves. That rung is the science, and it stays our job.

I am posting this as a draft, deliberately, because arguing about it in the open is rather the point of tenet 10. We are also writing it up — in the spirit of the FAIR paper — as a short article, anchored to those existing standards. If you think I have a tenet wrong, or that I have missed one, please tell me. That is how a manifesto earns the name.


The one-page manifesto (PDF): here.  ·  The short paper, in preparation: draft.  ·  The original blueprint: Rigon et al., HESS Opinions: Participatory Digital eARth Twin Hydrology systems (DARTHs), HESS 26, 4773–4800 (2022).

Sunday, June 28, 2026

DARThs 2026 for Vth Summer School of the IAEG

I was invited to explain the idea of Digital Twins of the Earth System at the IAEG Summer School in Aosta. This time it was in person — a welcome change from the Chandigarh and Bern talks, which were both online — and the occasion was a good reason to rework and rearrange material I had used before.


The talk followed this outline:

(For anyone who wants the definition itself — what a DARTh actually is — I set it out separately, as thirteen tenets, in an earlier post, after my talk)

From my by-now rather large collection I had also prepared a few further sets of slides covering the processes of interest (the flesh to add to the bone). I did not manage to show them, for lack of time, but they follow the same thread, and I am leaving them here for anyone of IAEGists curious to see where we think this is heading:

I should be honest about that last group. The closing part of the DARThs 2027 presentation is still under construction: it needs more thinking, and a deeper reading of several resources I cite but with which I have no direct experience yet. It is, frankly, a work in progress — and I would rather say so than pretend otherwise. If any of it is useful to you, or if you see where it should go next, I would be glad to hear from you.

Because you are probably interested in landslides and, consequently on Richards equations, and its generalizations, you can find material here:


Slides: the presentation (and the additional sets mentioned above).
Video: the recording of the talk will be added here once it is available — [to come].

Monday, June 15, 2026

A 30-Year 1-km Daily Precipitation and Air Temperature Dataset for the Po River District (Italy)

 Mountains are unkind to gridded data. The processes that matter most in Alpine terrain — orographic rainfall, elevation-dependent temperature, the sharp contrasts between a valley floor and a ridge a few kilometres away — live at scales that most continental products simply cannot see. A 10-km cell averages away exactly the gradients a hydrologist needs.

So we built something finer. Together with colleagues from the University of Trento, the C3A centre, Fondazione Edmund Mach, the Po River Basin District Authority, and led by Hossein Salehi, we have produced a 1-km, daily precipitation and temperature dataset covering the entire Po River District over the full 1991–2020 climatological reference period. To our knowledge, no publicly available product previously combined all three of those properties — kilometre resolution, daily steps, and a continuous 30-year record — for this basin.

The dataset is now openly available on Zenodo under a CC BY 4.0 licence.


Why the Po District is a hard test

The Po River District is arguably one of Europe's most topographically demanding hydrological systems. It spans roughly 83,000 km² and stretches from sea level in the Adriatic delta to nearly 4,800 m in the Alpine headwaters. That relief produces strong spatial contrasts in both rainfall and temperature, and it governs snow accumulation, melt, runoff, and water availability across the region. Any interpolation method that ignores elevation is doomed from the start.

How it was made

The dataset rests on a harmonised, multi-source observational network: 1,583 precipitation stations and 1,555 temperature stations surviving quality control, drawn from the regional ARPA agencies and supplemented with the EEAR-Clim dataset. We deliberately extended a 20-km buffer beyond the district boundary and pulled in stations there too, so that interpolation near the edges — and across watershed divides — would not be starved of data.

Interpolation was carried out in the GEOframe new kriging framework:

  • Precipitation uses Ordinary Kriging.
  • Temperature uses Detrended Kriging, with elevation as the trend variable. A daily linear regression estimates the lapse rate for each day, removes the elevation signal before kriging, then restores it at every grid cell. The lapse rate is therefore allowed to breathe with the synoptic conditions rather than being fixed at a textbook value.

A nice methodological detail: at every daily time step, the empirical semivariogram is re-fitted against five candidate models (Exponential, Gaussian, Linear, Power, Spherical), with parameters optimised by Particle Swarm Optimisation, and the best-fitting model is selected for that day. The structure of the field is re-estimated daily rather than imposed once.

Does it work?

Leave-one-out cross-validation across the whole 30-year record says yes.

  • Precipitation: mean KGE above 0.84 (All-Days) and 0.82 (Wet-Days), with mean absolute errors of 1.28 mm and 3.05 mm respectively. As expected from kriging's conditional bias and smoothing, wet-day skill drops a little and shifts slightly toward underestimation of peaks.
  • Temperature: mean KGE of 0.88, correlation of 0.98, MAE of 1.14 °C, RMSE of 1.5 °C, and essentially no bias (+0.02 °C). The elevation detrending earns its keep.

The honest caveats are spatial. Errors concentrate in the high-relief northern sectors and along the southern boundary, and skill declines measurably with altitude — for precipitation, MAE rises by roughly 0.54 mm per 1000 m on all days and 0.87 mm per 1000 m on wet days. This is a station-density story more than a method story: the mountains are where the gauges thin out. We also note that no wind-undercatch correction was applied, so high-elevation snowfall is likely underestimated — something to keep in mind for Alpine applications.

Reassuringly, the annual diagnostics show gradual, continuous improvement over the three decades (precipitation KGE climbing from ~0.76–0.78 in the early 1990s to ~0.83–0.84 by the mid-2010s) with no abrupt step changes — evidence that progressive network densification, not methodological artefacts, drives the trend. The dataset is temporally coherent.

What the resolution buys you

Benchmarking against E-OBS (~10 km) and EMO (1 arcmin) makes the case for going fine. Two extremes are particularly telling:

  • During Storm Alex (October 2020), the maximum three-day accumulation reaches 482 mm in the 1-km product over western Piedmont, against only 277 mm in E-OBS — a loss of roughly 43% of the peak signal at coarser resolution.
  • For minimum annual temperature, the 1-km field reaches −11.1 °C where E-OBS reads only −4.7 °C and EMO −9.8 °C. Pixel-averaging quietly amputates the cold tail of high-altitude climate.

In short: kilometre-scale topographic forcing can only be represented faithfully when the grid is commensurate with the physiographic gradients doing the forcing.

Getting the data

The product is distributed as annual NetCDF files (CF conventions), one per variable per year — 60 files in total — readable with xarray, netCDF4, R's ncdf4/terra, or QGIS/ArcGIS. It is intended as spatially consistent meteorological forcing for hydrological and ecohydrological models, not as calibration ground truth.

It is a small piece of infrastructure, but the kind we keep needing: a clean, open, high-resolution climatic backdrop against which the hydrology of a complex basin can actually be modelled.

Reference

  • Hossein Salehi, Daniele Andreis, Sohaib Baig, Gaia Roati, Marco Brian, Francesco Tornatore, Giuseppe Formetta, and Riccardo Rigon, A 30-Year 1-km Daily Precipitation and Air Temperature Dataset for the Po River District (Italy), submitted to ESSD.

Saturday, June 13, 2026

Am I Running a Ponzi Scheme? On Visions, Promises, and the Responsibility of a Supervisor

 Paul Krugman published a piece this week calling Elon Musk a "human Ponzi scheme." The argument is sharp: Musk sustains the valuation of today's ventures by selling belief in tomorrow's promises — Hyperloops, Mars colonies, fully autonomous taxis — always just a few years away, recycled indefinitely. The scheme works not because anything is delivered, but because new promises replenish the credibility consumed by the old ones. It is, Krugman argues, structurally fraudulent.

I read it, and an uncomfortable question formed. I had just uploaded a post on Petri-net-based implementations of hydrological systems — a vision that is, let me be honest, far from realized. I have done this before: kinetic theories of unsaturated flow, new theories about stomatal resistance, new variational frameworks still being written up. Big ideas, posted with enthusiasm, with real students working in the lab. Am I doing the same thing? Am I a human Ponzi scheme in miniature, dressed in academic clothing?

I want to think through this carefully — not to exonerate myself cheaply, but because the question matters to the people who work with me.


What makes a Ponzi scheme a Ponzi scheme

The defining feature is not the gap between vision and reality. That gap exists in all serious science. The defining feature is the concealment of that gap, combined with the use of new promises to discharge the accountability created by old ones. Musk's Mars colony of 2025 was never reexamined; it simply became Mars 2030, and no one was asked to reckon with the intervening silence.

There is also an asymmetry of information that is deliberate. Musk knows his timelines are fantasy. His investors — retail and institutional alike — are not in the same epistemic position. That asymmetry is where the fraud lives.

Science works differently, at least in principle. When I post about Petri nets as a future architecture for hydrological modeling, I am not claiming the code exists. The blog is not a prospectus. Specialists who read it know immediately where the idea sits on the spectrum from speculation to implementation. The gap is not hidden; it is the point.

So no, I am not running a Ponzi scheme in the Krugman sense. But that is not quite a clean acquittal.



The real risk: exploration as a tax on completion

The honest concern is subtler. A lab led by someone who genuinely loves imagining new frameworks can develop a culture in which exploration is always more exciting than consolidation. A new formalism on Monday, a new variational principle by Thursday, a blog post by Friday. The momentum feels like productivity. It may be, for the professor. For a PhD student two years into a thesis, it can feel like the ground is perpetually shifting.

The danger is not that the visions are false. It is that students absorb — implicitly, without anyone saying it — that finishing is less prestigious than imagining. That the real work of the lab happens at the frontier of speculation, and that the careful, slow, unglamorous work of implementation and validation is somehow secondary. This is a subtle tax on completion rates, and it falls hardest on the students who are temperamentally builders rather than theorists, which is most students.

I have to be honest with myself: I do not know with certainty that I have always avoided this. The Petri net post, the kinetic theory papers, the O-EPN trilogy (which is actually still undisclosed)— these are genuine intellectual commitments. But I cannot assume their excitement is equally distributed across the lab. For some of my students, each new horizon I announce may be one more reason to feel that where they are is not where the interesting things are happening.


What the antidote looks like

The solution is not to stop imagining. That would impoverish the science and, frankly, it is not something I am constitutionally capable of. The solution is to maintain two registers, strictly separated.

The first register is the frontier: blog posts, preprints, EGU talks, kinetic theories, Petri nets, variational frameworks. This is where I think out loud, and it should remain open and speculative and sometimes wrong.

The second register is the accountability register: what each student is finishing, by when, with what criteria for success. This register has to exist independently of where the frontier is pointing. If the Petri net vision shifts the direction of the lab in five years, fine. But Giulia's (an invented name) thesis on snow redistribution is due in eighteen months, and its completion conditions cannot migrate because I posted something exciting on a Tuesday.

The two registers must not contaminate each other. The blog can run ahead; the supervision contract cannot.

This also means I owe my students something explicit: a clear statement, periodically renewed, of what they are responsible for completing, in terms that do not depend on the broader vision landing. Not "your chapter on the kinetic theory will matter when the whole framework is published," but "your chapter is complete when it answers these three questions, and it will stand on its own regardless of what happens to the rest."


The asymmetry I have not yet named

There is a further complication I owe my students, and it sharpens the concern rather than resolving it.

What appears on this blog — the Petri net post, the kinetic theory papers — is not the full picture of what I am working on. There are deeper theoretical threads, more fundamental unifications, that I have deliberately kept undisclosed while they mature. Over the coming months I will begin to publish them. When I do, some of what my students have been building will suddenly acquire a context they could not have seen from inside it.

I want to be clear about why I work this way: ideas need to consolidate before they are exposed to the world. Posting a half-formed framework does more harm than good, both to the science and to the students who might try to build on it. The sequencing is intentional.

But I cannot pretend this creates no cost. When a student cannot see the architecture their work belongs to, they can feel they are assembling pieces of a puzzle whose picture has not been shown to them. That is not dishonesty — the picture is real, and it will be shown — but it is an asymmetry of information between supervisor and student that I have a responsibility to manage carefully. A Ponzi scheme exploits information asymmetry for extraction. A research program that is being disclosed in sequence is something different, but the asymmetry still creates a burden, and it falls on them, not on me.

What I owe, therefore, is not premature disclosure but enough of the map that each student can locate their work within it. Not the full territory — that is still being charted — but a reliable answer to the question: where does what I am doing sit, and why does it matter, even if I cannot yet see everything it connects to?


A note to my students, directly

If you are reading this and you work with me: the visions I post are real commitments, not performances. I believe the Petri net architecture will eventually be the right way to implement GEOframe components. I believe the kinetic theory will reshape how we think about unsaturated flow. And there are further things I am working toward that I have not yet posted, which will give additional context to work some of you are already doing. You will see them as they become ready.

But none of this means your work depends on my broader bets paying off. Each thesis, each paper, stands on its own — and if it does not, that is a failure of supervision, not a feature of ambitious science.

If you have ever felt that the horizon kept moving before you could reach it, or that you were building without knowing what you were building toward: tell me! That conversation is overdue, and it is one I should be initiating, not waiting for you to start.

The difference between a Ponzi scheme and a research program is that the research program is answerable to reality — and so is its supervisor.


For future working: A note for a comprehensive object oriented implementation of hydrological dynamical systems

Here is an ambition worth stating plainly: a single engine that can solve any hydrological dynamical system, where building a new model means instantiating a few new classes rather than touching the engine at all. Not a model — a kit. The bricks are the storages and the fluxes; the engine assembles them, differentiates them, and solves them; and the same solvers are reused no matter what physics you bolt on. You add a new process by extending the kit, never by editing the machinery — open to extension, closed to modification — and you do it by writing to interfaces rather than to concrete classes, so the solver never needs to know, or care, what it is solving. The reward is a system that is at once generic, efficient, and expandable, with strikingly little code to maintain.
NOt forgetting that this is very preliminary material, food for thinking, probably bugged material, please find:

This is not a new creed. It is the generic-programming philosophy that Berti set out for scientific computing two decades ago — efficient, reusable components built on the right abstractions, so that code stops being rewritten for every variant — and it is exactly the spirit in which Niccolò and I built WHETGEO-1D (Tubini and Rigon, 2022), where a ClosureEquation interface and a factory let you swap van Genuchten for Brooks–Corey without disturbing a line of the solver. What I want to do here is take that same philosophy and lift it from the one-dimensional soil column up to the whole topology of a dynamical system, and the thing that makes it possible is an old friend.

The friend is the Extended Petri Net. A hydrological dynamical system is one: storages are places, fluxes are transitions, and a third set of objects, the controllers, complete the causal wiring. Follow that picture all the way down into the software, and the thing every modeller secretly dreads — assembling, by hand, the system of equations to hand to a solver — almost disappears.

The grammar, and why "universal" is not a boast

Before the software, the picture. An EPN is drawn with a small, fixed vocabulary, and once you have it the claim of universality stops being rhetorical. A place is a circle, a transition a square; a square carrying a black dot is a driven input, the rain falling into the net; a dashed square is the outlet to the world. A diamond is a splitter, where one quantity divides into branches whose fractions sum to one — precipitation parting into snow and rain. A dotted circle is a collector, a summing junction with no storage of its own. And a little histogram marks a flux computed by convolution, a unit hydrograph. That is very nearly the whole alphabet.

Why believe it is enough? Because Marialaura, Anna De Nardi and I drew all forty-six models of the MARRMoT collection (Knoben et al., 2019) in exactly this vocabulary — Collie, GR4J, TOPMODEL, HBV, Sacramento, VIC, the Tank cascades, the whole zoo — and each one turns out to be just a different choice of places, fluxes and wiring. If a single alphabet spells every word in the dictionary, it is the right alphabet. The classes that follow are nothing more than this grammar given types.

One class of storages, many kinds of flux

The first thing the Petri-net view tells you is an asymmetry. A place is universal: it is a state variable whose time variation we study, and one storage is, as an object, exactly like another. A bucket of soil water, a snowpack, a channel reach — all of them are just \(S_i\) with a balance to satisfy. So in an object-oriented design, storages are a single class.

Fluxes are the opposite. A flux can be a known time series (a forcing), or a constitutive law that declares a mathematical form and a dependence on the state. So a transition wants to be an interface with concrete implementations — an external flux here, a Darcy-Buckingham law there, a power-law discharge somewhere else. Each flux knows two things that matter for what follows: where it moves mass (its source and target places) and which state variables it reads. Those two are not the same, and keeping them apart is the whole trick.

Once you take that seriously, the "many kinds of flux" become a small, nameable family. There is the external flux (a forcing) and the constitutive flux (a law of the state); the controller, a quantity derived from the state that gates a flux without carrying any mass; the splitter and the collector of the grammar above; the stoichiometric flux, one rate metered into several currencies, which we will need the moment evapotranspiration appears; and the convolution flux, the one transition that carries a memory. They all implement the same interface. The only place the software must be careful is with the threshold laws that conceptual models love — the \(\text{if } S>S_{\max}\), the \(\max(\cdot,0)\) — which are not differentiable at the kink; those enter in regularised form, the same medicine the soil-water retention curve already takes.

The two graphs

An EPN actually carries two graphs over the same nodes, and conflating them is, I think, why generic model engines so often turn into a tangle.

The first is the incidence graph — the Petri net proper. It records which flux moves water between which storages, and it is summarised by the incidence matrix \(\mathbf{C}\), with \(+1\) where a flux enters a storage and \(-1\) where it leaves. From it, the entire model collapses into one line:

\[ \frac{\mathrm{d}\mathbf{S}}{\mathrm{d}t} \;=\; \mathbf{C}\,\mathbf{Q}(\mathbf{S},t). \]

That is conservation, and nothing more. The second graph is the causal one, directed on the storages alone: there is an arc from \(S_j\) to \(S_i\) whenever the equation for \(S_i\) contains a flux that reads \(S_j\). This is the graph that decides how the equations are coupled.

And here is where the controllers finally make sense. A controller is an arc that lives in the second graph but not in the first — a flux that is gated or modulated by some storage without any mass passing through that storage. The read arcs and inhibitor arcs of Petri-net theory. They carry no water, so they are absent from \(\mathbf{C}\); but they carry causation, so they are present in the dependency graph and therefore in the Jacobian. That is exactly what we mean when we say controllers "complete the causal structure of the model".

Assembling the system the solver can eat

If you want an implicit step — and for cyclically coupled, stiff budgets you almost always do — backward Euler turns the master equation into a residual,

\[ \mathbf{F}(\mathbf{S}^{\,n+1}) \;:=\; \bigl(\mathbf{S}^{\,n+1}-\mathbf{S}^{\,n}\bigr) -\Delta t\,\mathbf{C}\,\mathbf{Q}(\mathbf{S}^{\,n+1},t^{\,n+1}) \;=\; \mathbf{0}, \]

and a Newton method needs its Jacobian,

\[ \mathbf{J} \;=\; \mathbf{I} \;-\; \Delta t\,\mathbf{C}\,\frac{\partial \mathbf{Q}}{\partial \mathbf{S}}. \]

This is the passage people worry about: how do you build this nonlinear system automatically for an arbitrary model? The answer is that the structure is already in the objects. The sparsity of \(\partial\mathbf{Q}/\partial\mathbf{S}\) is just the list of dependencies each flux declared. So the assembler becomes a single scatter loop over the fluxes — exactly like assembling element matrices in a finite-element code. You walk the fluxes once; each one drops its value into the balance of its two endpoints and its derivative into the matching rows of the Jacobian. You never build \(\mathbf{C}\) or the flux Jacobian as dense matrices; they assemble themselves, entry by entry.

The derivatives I would get from automatic differentiation. If each flux is written over a differentiable scalar (in Java, Hipparchus' DerivativeStructure), one forward evaluation returns both the flux value and its partials. Concretely, a linear reservoir is just

DerivativeStructure evaluate(AdContext ctx, double t) {
    return ctx.value(from).divide(tau);   // Q = S_from / tau
}

and the engine differentiates it for you. The consequence is the thing I actually care about: you write the physics once, per flux, and never again touch the solver. Adding a new constitutive law costs you its forward formula and nothing else.

Loops, sequences, and where the parallelism hides

There is one more gift in the causal graph. Run Tarjan's algorithm on it and you get its strongly connected components. A component with more than one storage is a loop — a knot of mutually dependent equations that has to be solved simultaneously. Every other component is a single equation that can be solved in turn. The graph of components is a DAG, and its topological order is simply the order in which to solve. In the algebra of the Jacobian this is a block-triangular structure; it is the same decomposition that equation-based modelling languages call BLT. And components sitting at the same level of that DAG do not depend on one another, so they can go to different threads. The parallelism was never something we had to impose — it was sitting in the dependency graph all along, waiting to be read off.

The solver, finally, gets to be ignorant. It sees only a residual, a Jacobian, and a starting guess. That is enough to let an off-the-shelf Newton–Raphson handle the easy blocks and a Nested Newton (Casulli–Zanolli) handle the monotone Richards-type ones — without either of them ever knowing what they are solving.

Is it efficient? Yes — but structurally

The natural worry is that all this generality must cost something at runtime. It does not, or rather, the cost lands exactly where it should. The only expensive operation — the implicit Newton solve — happens only inside the loops; the rest of the network, which is most of it, is cheap explicit updates. And the whole structural analysis — finding the loops, the solution order, the sparsity of the Jacobian — depends only on the graph, which never changes in time. So you do it once, at the start, and pay nothing more for it on the millions of timesteps that follow. The efficiency is not a clever trick in the inner loop; it is a consequence of letting the structure tell you where the hard work actually is. The one honest caveat is that you must respect that structure: solve everything monolithically and you throw the gift away. Couple only what is genuinely stiff, and let the rest run loose and parallel.

Net3, upgraded

This is where Francesco Serafin's Net3 comes in, and the fit is almost too neat — Net3 grew out of the same EPN picture. Net3 takes a model as a directed acyclic graph and runs it in parallel, which is wonderful for a river network (a tree is a DAG) but awkward for coupled dynamics, because coupling makes loops, and a DAG cannot hold a loop. The repair is the one move we already have: take each loop, each strongly connected component, and crush it into a single super-node whose insides are the simultaneous solve. The graph of super-nodes is a DAG again, and Net3 schedules it exactly as before. The coupled solving lives inside the node; the parallel routing lives between nodes. Net3 keeps doing what it is good at, and inherits the one thing it could not do.

Three budgets, one net — and the trouble with ET

The original EPN paper already hints that we might want to solve more than water: the energy budget, the carbon budget, all at once. The beauty is that the equation is the same, \(\dot{\mathbf{S}}_b = \mathbf{C}_b\,\mathbf{Q}_b\); only the meaning of the parameters changes. Water places hold storages, energy places hold internal energy, carbon places hold pools. What ties them together are the controllers — quantities derived from one budget's state that reach into another. Temperature, born of the energy budget, governs evapotranspiration in the water budget; soil moisture, born of the water budget, governs the thermal conductivity in the energy budget and the stomata in the carbon budget. Each of these is, once again, an arc that lives in the causal graph but in nobody's incidence matrix.

And then there is the genuinely awkward case, the one that makes the whole thing interesting: a single quantity that belongs to two budgets at once. Evapotranspiration is the textbook offender. It is a loss of water, at rate \(E\); it is also a loss of energy, at rate \(\lambda E\), the latent heat carried away. How do you stop the two budgets from quarrelling about how much of it happened?

The clean answer is to stop thinking of separate budgets and to write one net over all the currencies at once, letting the incidence matrix carry not just \(\pm 1\) but real stoichiometric coefficients. Then ET is a single column with an entry of \(-1\) in the water rows and \(-\lambda\) in the energy rows. You evaluate it once — it has one rate — and drop that one rate into both budgets, scaled appropriately. The consequence is the thing I find quietly satisfying: the latent heat is exactly \(\lambda\) times the water loss at every step of the iteration, not just at the end. The two budgets cannot disagree, because there is only one number. Conservation across currencies stops being something you check and becomes something the structure guarantees.

If you have ever wondered what Penman–Monteith really is, this is it. Penman solves for the surface temperature and the evaporation rate together, between the energy and the mass budgets — which is precisely solving one of these little coupled super-nodes with a shared ET column and a shared temperature controller. The multi-currency net is just Penman–Monteith let off its leash: the same closure, now for any number of budgets, solved numerically rather than by hand. And when all the controllers descend from a single free energy, the cross-couplings ought to be symmetric — Onsager reciprocity — which gives a quiet, structural way to check that the coupled model is thermodynamically honest.

Routing, travel times, and the unit hydrograph

One flux refuses to be memoryless, and it rewards a closer look, because its kernel is not arbitrary — it is a travel-time distribution. The instantaneous unit hydrograph carries the effective rainfall to the outlet by convolution, and the cleanest way to hold it is not the IUH \(f\) itself but its integral, the S-function

\[ s_f(T) \;:=\; \int_0^T f(y)\,\mathrm{d}y, \]

which is, up to the catchment area, the cumulative distribution of travel times — the very residence-time object that runs through the age-ranked budget story (Rigon, Bancheri and Green, 2016). Write the discharge against travel time and a single rain record contributes differences of \(s_f\) over its own length; the records then simply superpose, because the routing is linear and time-invariant. That is the entire numerical recipe, worked out impulse by impulse in the illustrated guide (Rigon et al., 2022b; Rigon et al., 2016).

The interesting part is what the kernel's origin decides. A parametric hydrograph — an exponential, which is just a single linear reservoir; or a Nash cascade — reduces exactly to a little chain of reservoir places, so it folds back into the basic vocabulary and asks for no new type. A geomorphological hydrograph does not: the width function, read off a digital elevation model as the area of the catchment at each flow distance from the outlet and mapped to time by a velocity, gives \(s_f\) straight from the shape of the basin and is no finite chain of reservoirs. That is exactly why the convolution flux has to be a first-class citizen rather than sugar over a cascade. And the linearity is a genuine assumption: when the hydrograph changes shape with the storm — an event-specific GIUH — the kernel becomes a controller of the forcing, and the clean convolution gives way to the general, time-varying case.

There is a quiet bonus for anyone thinking of running the model in real time. Because each incoming rain record commits the discharge for the next several steps — water already fallen, travel times already fixed — the convolution hands you a short forecast for nothing, unmodifiable by rain that has not yet arrived. Feeding the engine live data is then only a matter of swapping the file behind a forcing for a streaming source; the engine never notices whether the rain fell last year or a minute ago.

Why I like this

What pleases me here is how much the architecture buys by simply refusing to mix two things up. Conservation lives in the incidence matrix. Causation lives in the dependency graph. The physics lives in the fluxes, written one at a time. And the assembler — the small piece of code that compiles all of it into a system of equations — is one loop. It is the kind of separation that, once you see it, makes you wonder why the equations ever felt like the hard part. They were never the hard part. The hard part was deciding what was a place, what was a flux, and what was only a controller.

And that, in the end, is the whole point of the kit. Every new model — a different catchment, a snow scheme, a coupled carbon budget — is a handful of new flux classes implementing the same interface, dropped into the same engine, solved by the same Newton. Nothing in the machinery changes; the machinery was closed to modification from the start. The code stays small not because we were clever line by line, but because we let the abstraction carry the weight. That is what generic programming promised for scientific computing, and it is satisfying to watch hydrology turn out to be such a natural place to collect on the promise.

References

Bancheri, M., Serafin, F., and Rigon, R. (2019). The Representation of Hydrological Dynamical Systems Using Extended Petri Nets (EPN). Water Resources Research, 55(11), 8895–8921. doi:10.1029/2019WR025099.

Berti, G. (2000). Generic Software Components for Scientific Computing. PhD thesis, BTU Cottbus. See also Berti, G. (2006), GrAL — the grid algorithms library, Future Generation Computer Systems, 22(1–2), 110–122.

Knoben, W. J. M., Freer, J. E., Fowler, K. J. A., Peel, M. C., and Woods, R. A. (2019). Modular Assessment of Rainfall–Runoff Models Toolbox (MARRMoT) v1.2: an open-source, extendable framework providing implementations of 46 conceptual hydrologic models as continuous state-space formulations. Geoscientific Model Development, 12, 2463–2480. doi:10.5194/gmd-12-2463-2019.

Rigon, R., Bancheri, M., Formetta, G., and de Lavenne, A. (2016a). The geomorphological unit hydrograph from a historical-critical perspective. Earth Surface Processes and Landforms, 41(1), 27–37. doi:10.1002/esp.3855.

Rigon, R., Bancheri, M., and Green, T. R. (2016b). Age-ranked hydrological budgets and a travel time description of catchment hydrology. Hydrology and Earth System Sciences, 20(12), 4929–4947. doi:10.5194/hess-20-4929-2016.

Rigon, R., Formetta, G., Bancheri, M., Tubini, N., D'Amato, C., David, O., and Massari, C. (2022a). HESS Opinions: Participatory Digital eARth Twin Hydrology systems (DARTHs) for everyone — a blueprint for hydrologists. Hydrology and Earth System Sciences, 26, 4773–4800. doi:10.5194/hess-26-4773-2022.

Rigon, R., Franceschi, S., Formetta, G., Bancheri, M., and Tubini, N. (2022b). An illustrated guide to IUH/GIUH estimation. Authorea preprint. doi:10.22541/au.164192110.08629205/v1.

Serafin, F. (2019). Enabling Modeling Framework with Surrogate Modeling Capabilities and Complex Networks (the Net3 subsystem). PhD thesis, University of Trento. See also Serafin, F., David, O., Carlson, J. R., Green, T. R., and Rigon, R. (2021), Environmental Modelling & Software, 146, 105231.

Tubini, N. and Rigon, R. (2022). Implementing the Water, HEat and Transport model in GEOframe (WHETGEO-1D v.1.0): algorithms, informatics, design patterns, open science features, and 1D deployment. Geoscientific Model Development, 15, 75–104. doi:10.5194/gmd-15-75-2022.