Monday, January 23, 2017

Parallel Computing with Muskel 2

Programming on parallel architectures or on multicores machines is becoming a necessity nowadays that computation capability is growing through the addition of processors or/and cores. I always refused in the past to really work on these topics, because my souls has been sold to “the physics” of the processes and not to computation intricacies. I saw young people spend their youngness on experimental computer architectures that never became mainstream. The progress was vehement and impressive and cancelled most of those efforts of who, not being computer scientists, also lost their own identity as hydrologists or environmental scientists.

With the years, standard parallelization tools sprout out as OpenMP and MPI (for C/C++ and FORTRAN) that entered in the common baggage of modellers.

Since my idiosyncrasies with parallel computing what I looked for was actually to use languages that implement natively the idea of parallell, i.e. multithread languages, like Java, Go, C#, Scala (for a list, look for instance here). At the same time my attention was attracted by skeletons (see skeletal Parallelism here) or high level structured parallel programming enablers, i.e. infrastructure that, at the price of some performance loss, offer a simplified scheme for parallelism.

My very first approach, more than ten years ago, was with the Assist scheme promoted by Marco Vanneschi and his group in Pisa. That approach failed because the project that would intended to finance got through but we were warned not to use it (not because Assist was bad, but because, parallel computing strategies were pertinent to another project in the Agency that was funding us, and they did not want to have something that could potentially disturbing it).

Finally, recently, along courses and resorts, I came back to it to see how Assist story has grown. I googled and I had the kind answers of Professor Marco Danelutto (GS) of the Parallel Programming Models group at the University of Pisa (Italy).

Actually I was asking him about one of the new creatures, Muskel, which was supposed (by me) to be a modern implementation in Java of their ideas. He, however, told me that Muskel was obsolete, but there was the new work of one of his Master student who just finished a new effort that could have been defined Muskel2 and was pretty integrated with Java 8.

The student is Christian Simonelli, his thesis is here. The infrastructure developed is on GitHub: . The wiki is here.

So, after all, you have something to investigate and to learn from.

Saturday, January 21, 2017

GEOtop was dockerized during last week

Dear GEOtop aficionados. Francesco Serafin with the help of Olaf David fully 'dockerized' GEOtop during last week:

You can run it now on Linux, Mac, Windows, Amazon, Google, via this Docker image. There is description on how to use it, pretty simple. This is exciting, since it makes building the model on all platform now obsolete and you can get it out easily to more collaborators. In our opinion this is the best way to disseminate a model like this. Please spread the word and have people using it.
If you want to know what Docker is you can click on the Docker logo above.

Monday, January 16, 2017

Reservoirology #4: the case of Richards 1d

This is the follow up of Reservoirology #3 post, where (there) I used  Petri nets to represent ordinary differential equations (ODEs). Here, instead, I try to use the same graphical formalism to represent Partial Differential Equations (PDEs), by extending a little the graphics.
Let's say that the number of specifications needed is larger here and, therefore, a lot of ancillary information has to be conveyed through Tables (and some interpretation). However, click on the figure above if you are curious to know more.

Wednesday, January 11, 2017

CLIMAWARE scientific outcomes

This post address the results of the scientific outcomes of the project CLIMAWARE. This was financed by our University with the main scope of gathering around a topic researchers from different Departments. We chose to work on impacts of climate on river Adige. Part of the results were posted on this blog as soon as they came out. Others will be posted eventually.
We did not obtain all the results we promised at the beginning (but we had a 20% financial cut) but, nevertheless, I think we achieve something.

  • We started to match views from various disciplines. 
  • We get several journal papers accepted where we pushed sciences a little forward
  • We improved our models JGrass-NewAGE, Weezard, Hyperstream
  • We started new experiments
  • We've got fun
In you want a more complete view of our work, please look at the scientific report here. Unfortunately it is in Italian, but a synthesis in English will follow soon. Papers below are not all specifically about river Adige but were considered as  works preliminary to the application to to it. Other more applicative papers will follow (eighteen months is not a so long period!).
In Spring we will organise a meeting day where we will summarise our results and talk about spinoffs of the project.

A note: Talking with one of the colleagues who originated this type of call, he asked: how many papers did you publish together (with people from other disciplines)? The papers you published with your guys, you would have had in any case.
You can see looking below and judge yourself (but the picture will be complete in a year from now).
My answer was: first it is not really true that I (we) would have published the same amount of papers. Some of the papers were produced because money sustained those not already enrolled at University who took care, at least, of many details.
a) eighteen months is a too short period to produce something together (really new stuff, I mean) with people you did not interacted before;
b) Spatial and temporal scale of different disciplines can be really different. It is not easy to fill the gaps. A project like our can make researches getting closer but not eliminate the differences magically.
c) Often proper journals for these interdisciplinary efforts are missing. Sci. Total Environ. (a.k.a. Stoten) is one of them, but it has its own targets to be respected, too.

References (published so far: several others are ongoing)

Abera, W.W., Brocca L, and Rigon R., Abera, W., Brocca, L., Rigon, R. (2016).
Comparative evaluation of different satellite rainfall estimation products and bias correction in the Upper Blue Nile (UBN) basin. Atmospheric Research, 178-179, 471?483., 2016.

Berzi, D., Fraccarollo, L., 2015: Turbulence Locality and Granular-like Fluid Shear Viscosity in Collisional Suspensions. Physical Review Letters, 115,
194501-1-194501-5, doi: 10.1103/PhysRevLett.115.194501.

Berzi, D., Fraccarollo L., 2016: Intense sediment transport: Collisional to turbulent suspension. Physics of Fluids, 28, 023302, doi: 10.1063/1.4941770.

Formetta, G., Bancheri M., Rigon R., Testing site-specific parameterizations of longwave radiation integrated in a GIS-based hydrological model,  Hydrol. Earth Syst. Sci., 20, 4641-4654, 2016

Geneletti, Sartori, Schiavo, 2016. The impact of climate and land use change on agriculture in Europe: A computable general equilibrium analysis, Mimeo.

Larcher, M., Jenkins, J.T., 2015: “The evolution of segregation in dense inclined flows of binary mixtures of spheres”. Journal of Fluid Mechanics, 782, 405-429.

Rigon R., Bancheri M., Green T., Age-ranked hydrological budgets and a travel time description of catchment hydrology, Hydrol. Earth Syst. Sci., 20, 4929-4947, 2016,

Rigon R. , Bancheri M. , Formetta G. , deLavenne A. , The geomorphic unit hydrograph from a historical-critical perspective, Earth Sci. Proc. and Landforms, 41(1), 27-37, 2016.

Sartori, Schiavo, Fracasso, Riccaboni, 2016. Modeling the future evolution of the virtual water trade network: A combination of network and gravity models. SIS Working Paper No 2016-4, August 2016 (inviato a Advances in Water Resource Management).

Scolozzi R., Geneletti D., 2016: The anthroposphere as an anticipatory system: Open questions on steering the climate. Sci. Total Environ. doi: 10.1016/j.scitotenv.2016.10.086.

Tuesday, January 10, 2017

Topics and concepts Titus Brown is excited about

This is kind of easy for me. Taking Titus Brown's (GS) post from my blogroll, and addressing my readers to it. He is writing about open science and research reproducibility. His guidelines for his lab are also an effort worth to read for my students.

You better go directly to his blogpost to read it, but let me summarise the topics he covered for a minimum of information.

1. The wonderful ongoing discussion around significance and reproducibility.

2. Blogging as a way to explore issues without prior approval from Top People.

3. Open source as a model for open science.

4. Computational narratives as the engine of collaborative data science.

5. mybinder: deploy running Jupyter Notebooks from GitHub repos in Docker containers

6. Overlay journals.

7. Bjorn Brembs.

8. Idea futures or prediction markets.

9. Open peer review by a selected papers network.

10. A call to arms: make outbreak research open access.

You have just to click on the link to get it.

Wednesday, January 4, 2017

Drying porous media

Evapotranspiration and soil water retention curves (SWRC) are intimately related. This was already apparent in the recent works of Dani Or and coworkers. Recently,  caused by studies to support the Master Thesis work by Niccolò Tubini on freezing soil, all these issues came back to my attention. As a result, I did a little of literary review (see below) which covered non traditional journals for a hydrologist, and which, however, is equally well illuminating of the aspects of the drying phenomenon.

Being as simple as possible, what I undeerstood in my readings is that the drying process (e.g. Metzger and Tsotsass, 2010) proceeds in a interplay between evaporation and capillary fluxes. Water evaporate from any meniscus, at different rates which are commanded locally by the Fick’s law of diffusion. The gradient moving water around is the difference between the saturation water vapor content (vapor tension) close to the meniscus and the vapor content already present in air gas. Since vapor tension in larger menisci (as described by Kelvin’s effect) is higher, larger pores evaporate faster than smaller pores. Because, water vapor above smaller menisci is less than over larger menisci, we must have an equilibrating vapor flow from larger pores to smaller pores locations (the same Fick’s law is acting). However, a second, and probably faster,  water transport is happening through the liquid phase. Internal pressures among pores of different size are imbalanced and a laminar fluid flows happens between them. This flow is controlled by the liquid viscosity. If viscosity is low, larger pores replenish smaller pores until they are emptied very fast. If viscosity is high smaller pores are also emptied.  At the extreme cases, low viscosity means (if large pores span the whole control volume) no mean gradient of water content, high  viscosity the formation of an evaporation front.
During process, besides temperature (which control both vapor tension, according to Clausius-Clapeyron relation and water viscosity - wi) what determines the evolution of the drying phenomenon are the topology and the geometry of the pores space, and the amount of liquid water itself.  The latter determines the continuity (or the discontinuity) of the water phase. When continuity of the water phase is broken (I imagine by the effect of heterogenous nucleation of air bubbles under high water tension values) smaller pores cannot be anymore supplied by water from larger pores, and macroscopic evaporation rate decays fast (I was tempted to say exponentially: but this has a quantitative interpretation that could not be true).

Overall, the outer water vapor content (which previously I called  "the vapor content already present in air gas") is determined by the turbulent transport of vapor. Therefore, the picture is pretty dynamic, heterogeneous, and quite in disequilibrium. The three equation of mass, energy and momentum conservation must be used to account properly for the phenomenon.

The poor hydrologist problem (php) is how to reduce this complexity at the macro (representative elementary volume - REV) scale. It is clear that playing around with all the above factors very different dynamics can be obtained which could appear weird or unlikely to happen. Pores in soil, at the end, do not have all the variety of structures and connection a mathematically oriented (or perverted) mind can image, and therefore, I hope, a macroscopic synthesis is possible.

Some would argue that this synthesis is already present and, being the actual theory that constitutes the core of the modern treatment of the Richards equation (starting from Mualem, 1976). Others remind the series of papers by Whitaker in late seventies. A must read, indeed.
However, I am not sure that this cannot be improved. The point were the latter theories are weaker is the description of the geometry and topology of porous media, which in both cases is simplified.


Defraeye, T. (2014). Advanced computational modelling for drying processes – A review. Applied Energy, 131, 323–344.

Kemp, I. C. (2007). Drying software: past,present, and fuure. Drying Technology, 25, 1249–1263.

Metzger, T., & Tsotsas, E. (2010). Network models for capillary porous media: application to drying technology. Chemie Ingenieur Technik, 82(6), 869–879.

Metzger, T., Vu, T. H., Irawan, A., Surasami, V. K., & Tsotsas, E. (2008). Pore-Scale Modelling of Transport phenomena in drying, 187–204.

Mualem, Y. (1976). A new model fro predicting the hydraulic conductivity of unsaturated porous media. Water Resources Research, 12(3), 513–522.

Neethirajan, S., Jayas, D. S., White, N. D. G., & Zhang, H. (2008). Investigation of 3D geometry of bulk wheat and pea pores using X-ray computed tomography images. Computers and Electronics in
Agriculture, 63(2), 104–111.

Prat, M. (2011). Pore Network Models of Drying, Contact Angle, and Film Flows. Chem. Eng. Technol., 34(7), 1029–1038.

Shokri, N., & Sahimi, M. (2012). Structure of drying fronts in three-dimensional porous media. Physical Review E, 85(6), 066312–1–8.

Vorhauer, N., Metzger, T., & Tsotsas, E. (2010). Empirical Macroscopic Model for Drying of Porous Media Based on Pore Networks and Scaling Theory. Drying Technology, 28(8), 991–1000.

Vu, T. H. (2006, June 1). Influence of pore size distribution on drying behaviour of porous media by a continuous model. Universität Magdeburg.

Whitaker, S. Simultaneous heat, mass and momentum transfer in porous media. Advances in Heat Transfer 1977, 13, 119–203.
  Yang, F., Griffa, M., Bonnin, A., Mokso, R., Di Bella, C., Munch, B., et al. (2016). Visualization of water drying in porous materials by X-ray phase contrast imaging. Journal of Microscopy, 261(1), 88–104.

Saturday, December 17, 2016

Lectures on probability and second order random fields

This is a gift from twenty five years ago. These are lectures from a short course held in Padua at the Department of Applied Mathematics. We were younger then ! I remember the lectures by Diego Bricio Hernandez as exciting and interesting. Looking back at the nineties, one of the dominant topics, were random fields and the interplay of randomness with hydrological phenomena. The work of Gedeon Dagan was one of the growing paradigms. But random fields and techniques (see Bras and Rodriguez-Iturbe book) were ubiquitous in Hydrology. Here they come the Lectures by Diego Bricio Hernandez, a Mexican scholar in sabbatical at Padua University.

You can find the same lectures also on Google Books, but clicking on the figure above, you will have the pdf.  Diego also wrote this "On some guiding principles in mathematical modelling with special emphasis on determinism". Oldies but goodies.