Friday, October 30, 2020

Use Git and Github

 When working to a software you should try its design at best, then write your code with or without an IDE and finally check and test your code. Let’s for the moment skip the check and test question which has its own development and concentrate on the first phases of your work. Your design was good but your coding goes trough various modifications and, sometimes, you get lost. That is the time to use a Version Control System, a tool that allows you to recover older versions of your code and track your code history.  This is what summarizes this nice and free course on Coursera.   A VCS is a highly recommended tool even if you work alone. there are many of VCSs but here we concentrate our attention on Git, the free and open source VCs designed and implemented by Linus Torvalds also knows as the initial developer  of the Linux OS and maintainer of its kernel. If you are one who prefer to read books, there is at least one open book on Git, and you can find it here. Otherwise, the Coursera videos are certainly worth to be seen. Coursera does not only introduces Git  but also Github, but we will be back on it later. An interesting short introduction to both Git and Github can be found in this short tutorial. However, if you want to face the topics orderly, please first complete the video lectures. 

Git is not useful when you just work alone but when you want to share your work with other. In this case you have to chose a repository and Github is exactly what you are looking for (also for repositories there  are alternatives but among the many we have chosen the more popular for Open Source Software). In this case you have to lear what Github is, how it works and how to send and document your code over there. The Coursera videos and the tutorial help you in this task.  Obviously if a VCS is important when you work alone, it is much more important when you work in a group where potentially many people cooperate simultaneously to the same project. The videos and the documentation cover also these case. Best practice are important (see also here)!

The above resources introduce you to the command line use of Git but eventually you want to do it inside a IDE. Because I and most of my collaborators use Eclipse (for Java programming) I also address you to the Lars Vogel tutorial where it is shown how to use EGit.  Other valuable resources are this and these other ones

Thursday, October 22, 2020

On putting plants in hydrological models in practice

 The work of Concetta D’Amato Ph.D. started with joining together a reasonable evapotranspiration model with a solid infiltration model building a virtual lysimeter.

The basic is to have the two models to connect, and we, in GEOframe, have them, due to the work of Michele Bottazzi and Niccolò Tubini. The first built Prospero, the GEOframe component that use a novel formulation of the Penman-Monteith solution for evapotranspiration, the second designed and coded a Richardz 1D solver based on a novel algorithm. 

Obviously attaching the two models was not as easy as it can be thought, since the goal was to have a coupled system in which transpiration depends on water content and water content depends on transpiration with feedbacks among the few systems. The presentation illustrate how the coupling works and some simulations. At present the simulations are virtual reality, meaning that they are not parametrized according to some real case, but we hope to find appropriate data in the Watzon project. The figure, under which, by clicking you’ll find Concetta’s presentation, illustrates the directions her research can take in the following years. One goal was to do better than Hydrus 1D, being more reliable, more robust, more flexible, multiplatform and open source. Maybe we already accomplished it :-) ?

Freezing soil requires new algorithms

Assuming you have got the physics right and you wrote the right equations, which is not given for granted when you deal with freezing soils, you have to solve the equations. This paper, deals with this last topic: given the freezing soil equation it implements a new algorithm to solve it. This algorithm was invented by Casulli and Zanolli in their 2010 paper. They called it nested Newton, we renamed it NCZ from Newton-Casulli-Zanolli. It was implemented for solving Richards equation which present a spiky term called hydraulic capacity, that poses serous challenges to the convergence of the solver. We extended here to a new equation with the same type of terms. In fact all equations that involve phase transitions have terms of this type. 

To someone a new algorithm for integration of some equation can seem a minor achievement but, while in some type of simulation, the numerical errors of traditional methods can be somewhat constrained, in most of the simulation they do not and tend to increase up to a point that any prediction either quantitative or qualitative becomes useless. Obviously our case has an enormous effect when dealing with simulations of permafrost areas under the threat of climate change. If this introduction makes you curious, you can find the the preprint at The Cryosphere page, by clicking on the Figure above.


Casulli, Vincenzo, and ZANOLLI. 2010. “A Nested Newton-Type Algorithm for Finite Colume Methods Solving Richards’ Equation in Mixed Form.” SIAM Journal of Scientific Computing 32 (4): 2225–73.

Tubini, Niccolò, Stephan Gruber, and Riccardo Rigon. “A Method for Solving Heat Transfer with Phase Change in Ice or Soil That Allows for Large Time Steps While Guaranteeing Energy Conservation.”

Sunday, October 18, 2020

It's time to revise the GIUH

GIUH has been a valuable approximate tool for getting the hydrologic response. A review can be found in:
The question of maximum discharges treated inside the theory can be found in
The role of hillslope and channels was treated in:
Jointly with my first paper that proved the role of the geometric/topological structure of the river network in forming the hydrologic response,
these papers constitute, on my side, quite a body of contribution on the topic.  There are other greater contributor and their work is cited in the review paper I cited for first.

However, the theory has some limitations. Its applicability is based on the:
  • assumption that the rainfall is uniformly distributed (but C. Cudennec and coworkers were able to generalize it, see review paper)
having some recipes to get the effective runoff (i.e. separation of the total rainfall in quick surface water and baseflow and, besides, in evapotranspiration). Another limitation derives from the fact that
That’s why I went back to consider simpler reservoirs systems to get a clue of the interplay of the acting processes. This research work brought to the studies on representation of these reservoir models, to get the good old models streamlined for their structure, e.g.
and see especially the interactions among processes. The preprint-paper
is (among other things) a trial to get all the types of lumped models related with understanding where the diverse theories can be plugged together. Maybe a little convoluted as way of thinking but hopefully effective.
Another remark regards that once upon a time I was looking and satisfied with discharge, now I try to check the water and the energy budget and, therefore, the overall budget. Let’s see what comes next and if I am able to close the circle.  For who is still interested to implement a GIUH solver, please look at here.

P.S. - In the whole GEOframe/NewAge stuff, river geomorphology is present through the connectivity of the Hydrologic Response Units. Hence geomorphology is not absent: it is just not present in the simple way allowed by the GIUH that permitted to obtain those remarkable semi-analytic results present in the cited papers. 

Thursday, October 15, 2020

Save the date ! The GEOframe Winter School 2021 (GWS2021)

The third edition of the Winter School on GEOframe (GWS2021) will be held between January 7 and 16, 2021 in Trento, Italy. The course is devoted to Ph.D. Students, Post-docs, Young researchers (and Professionals!) interested in estimating all the components of the hydrological cycle (rainfall, evapotranspiration, snow-melting, and river discharge). The system allows to work out catchments from very small to continental (e.g. Abera et al., 2017a,b), up to build operational solutions, as the one used in in Basilicata. The aim of the course is to enable participants to run their own simulations and, eventually, on their own catchments and estimate the hydrological budget components. Previous Winter school material is freely available at the GEOframe blog.
Compared to what was done in the past courses, there will be more practice and a more detailed work on evapotranspiration and rainfall-runoff. It will be much more focused on exercises and on getting the water budget performed under various hypotheses on models' structure.

Due to COVID-19/COVID-SARS-2 the lectures and the work will be limited to, at most, 10 people in presence but it will be possible to follow the class remotely either synchronous online and asynchronous online (we’ll use a “blended” type of teaching based on Zoom). There is no fee or subscription for the asynchronous classes (and no personal support, just the support coming through the geoframe users mailing list). Synchronous  classes with no personal support though require subscription and the payment of a small fee of 10 Euros or (for Italians) a subscription to the Italian Hydrological Society. However, who requires a certificate of participation, and want personal support, must pay a fee (150 euros). Getting the certificate will be subject to present a report and an analysis of a catchment performed with the GEOframe tools. Tourists are  welcomed but obviously real learning requires exercise and some effort.

Instructors will be



Next Day/Task

Subscriptions for having credits for this class and support can be obtained all year long after January 15,  2021: please visit and compile the form or write to abouthydrology@gmail.con with subject: GWS2021 if you need more information. After payment of the fee you can have individual support and gain the participation certificate if you setup and perform an exercise with the GEOframe tools. You can do it on a your own catchment or we can provide you with a catchment and the required data. 

How snowy are the Alps ?

 A recent preprint was submitted to The Cryosphere were a large group of colleagues scientists analyzed the snow precipitation in more than 2000 gauges all over the Alps. This research is not only important for assessing the effects of climate change but also will be a benchmark to other more local studies on snowfall. 

I think it could be a good reading for many, therefore I am sharing its information here. By clicking on the Figure you download the paper.

Friday, October 9, 2020

Introducing the Extended Petri Net using an example

 This is, in my intention, gentle introduction to the Extended Petri Net on which we wrote a paper recently. That is the definitive reference on the topic. However, a presentation  can smooth out some difficulties that the constraint a paper imposes do not allow. So, below, please find the presentation, bu clicking on the Figure. 

The same material was presented elsewhere in a more compressed form but here, it was expanded to make it more understandable. The presentation is live on my VIMEO channel and if you have half of an hour you can follow it. 

I hope you enjoy it. EPN are not only a clear representation for hydrological and, in general, compartmental model of the water budget but, also, van be use to represent any compartmental model and can become a "lingua franca" for who analyzes and implement models.

Thursday, October 8, 2020


                                                            Do you know what I was, how I lived?  You know
                                                            what despair is; then
                                                            winter should have meaning for you.
                                                            I did not expect to survive,
earth suppressing me. I didn't expect
to waken again, to feel
in damp earth my body
able to respond again, remembering
after so long how to open again
in the cold light
of earliest spring--

afraid, yes, but among you again
crying yes risk joy

in the raw wind of the new world.

Louise Glück

Thursday, October 1, 2020

WATZON seminar series - I

 The Project WATZON  has almost finished the first year of work. It was a troubled year,  since the COVID-19 pandemic and we could not meet and do the field work required. However, we learn to use better the resources Internet brought to us. Upon the initiative of Paolo Nasta we started a series of on-line conferences on the tools and topics of the project. He is providing in these days seminars about the use of Hydrus-1D, a leading software for estimating infiltration by using Richards equation.  He accepted his material to be uploaded on my VIMEO WATZON Channel.

To interested people, Paolo suggest the following material

Lecture 1: Introduction to Hydrus-1D - First part

Lecture 2: Introduction to Hydrus-1D-Second part
Lecture 3: Treating tracers with Hydrus-1d
Lecture 4 - Going deeper isotope transport in Hydrus-1D
Paolo Nasta also wrote: "In the attached Excel file I extracted Fig.6 from the  Stumpp's paper. In this exercise we consider only delta18O transport. First of all, we all need to measure delta18O for each rainfall event. This is quite unfeasible. But...we need to sample rainfall as much as we can in order to make reliable interpolation of delta18O contents in ech daily rainfall episode! Stable isotopes of water are reported in the delta notation as the δ-content (‰), which is a relative deviation from the international standard V-SMOW (Vienna-Standard Mean Ocean Water). Mostly, the δ-content is negative. It is not possible to calculate with negative “concentrations” in HYDRUS-1D, and therefore, the user has to add an arbitrary value to all isotope data for the simulations (input and observation data). Do not take the absolute values though!
In the PRIN WATZON activities, we sample the isotope concentration in the rainfall (very frequently!), plant, soil (at different depths) and groundwater table sporadically (it means every two weeks hopefully). So we use rainfall-isotope conc. as input.
We use the other sporadic isotope concentrations (in soil, plant, groundwater) as observation data for inverse modeling in Hydrus-1D. In inverse modeling we optimize the unknown parameters related to water flow (vG parameters, Feddes parameters) and solute transport (dispersivity, solute root uptake etc.).
Once we get the optimized parameters, we can have fun and run long-term simulations with known precipitation, known rainfall-isotope and calculate soil residence time, or travel times from rainfall to transpired water or to groundwater in each site. Please, let me know. I think it is getting quite clear so far.