Tuesday, December 26, 2023

Code Washing

 This time, I want to address the concerning issue of students inappropriately reusing open-source code without a clear understanding of open-source licenses.



It's crucial for students to grasp the essence of open source licenses, understanding that they are not just permissions to copy but guidelines for responsible use. Engaging with open-source code should involve a genuine learning process, encouraging students to comprehend and apply the principles embedded in the code they explore.
Merely having access to code doesn't grant the right to take it, make superficial changes, or translating from a programming language to another, remove original authors, and claim the altered code as their own. While open source encourages learning through code exposure, wholesale copying with only minor alterations, especially without restructuring for object-oriented code, doesn't constitute "creating a new code base."
In such instances, phrases like 'I looked at Mickey Mouse code, but I am using my own code' are, at the very least, misleading and likely a form of plagiarism. I term this practice "code washing." My plea: steer clear of it and adhere to ethical behavior.
The notion of "code washing" not only undermines the integrity of individual work but also compromises the collaborative spirit of open source. It's essential to emphasize that acknowledging and respecting the original authors not only aligns with ethical standards but also fosters a culture of transparency and collaboration in the coding community.

Friday, November 17, 2023

Some pills on what we do for agriculture droughts

 Just to introduce the debate about droughts simulation, agriculture, new technologies that can be used for improving agriculture. Below the presentation.



Just click on the Figure to see the presentation given at the Festival della Meteorologia 2023. 


Thursday, November 9, 2023

Java for Hydrologists 101

There are a few postings on Java in this blog. Since I want to teach it to my students, I am quietly starting to populate this page with presentations which, eventually, will constitute the core of an informal class (;-)) the Java for Hydrologsts 101. The first version of this blog dated back to more than 10 years ago and this gives the idea on how slow thing could go. The text presented here is at present the same but I am progressively modifying it. 


The primary aim of JfH-101 is not merely to impart basic Java knowledge, but to delve into topics and issues that align with my hydrologist experience. In collaboration with my colleagues and friends from GEOframes, we plan to cover not only Java, but also OMS3, and when appropriate, Geotools and Horton Machine (former JGrasstools). We won't overlook Ant, Maven, Gradle, Giteither. Meanwhile, we'll address topics pertinent to object oriented programming. 

Programming is less about discussing theory and more about practical application. Therefore, many of our slides will prompt you to take action and apply what you've learned.

Various (overwhelming) material can be found at the Java for Hydrologist OSF repository The new video will be added to the Java 101 for hydrologists Vimeo Showcase.  Here below, you'll find all the material in a ordered form: 

Topics

0 - Getting Started (mostly things to read -or start to read- before the start) (Vimeo2023)

Oldies but Goldies

* -  A few diversions
* - Reading  data from the system's console
* - Reading data from a File

* - Working with Git
The more challenging course is here


References

Please go to this blogpost where you can find links to books and various material. 


^* - From the links you can quite understand the I rely very much on Lars Vogel site for the basic stuff. It is not obviously the only good resource available (stackoverflow is another one, for instance, and many others will be addressed). Now you can also take the code and splice into  a LLM and have further information and help. 

Saturday, October 28, 2023

CARITRO Project: Snow droughts e green water: how climate change modifies the hydrological cycle in the Alpine Region.

Due to the impact of climate change, the Alpine region is experiencing a dual effect: a decrease in snowfall leading to snow droughts, and an increase in water losses through evapotranspiration, also known as green water. These changes have significant implications for the sustainable management of water resources and the preservation of ecosystems. This project, funded by the CARITRO foundation, aims to address these challenges by developing innovative models to accurately quantify snow melt and evapotranspiration losses. The ultimate goal is to provide practitioners with user-friendly calculation tools that are more advanced than traditional lumped models but less complex than intricate "process-based" 3D models. Initially proposed by Niccolò Tubini, the project has been taken up by John Mohd Wani with minimal modifications.  


The complete project plan can be found here

Friday, October 27, 2023

Open Science by Design

In the framework of the meeting "Community over Commercialization \, Open Science, Intellectual Property and Data" I was graciously invited by professor Roberto Caso to talk about my experience with developing open source models and promoting open science. Various the topic I tried to rise: the transmission of science in a university environment, why open source coding, why open science, which methodology can be used.


The presentation can be found @ https://osf.io/798vu and if any video record will be available, I will share it. 


Friday, October 20, 2023

Identifying Snowfall Elevation Patterns by Assimilating Satellite- Based Snow Depth Retrievals

Precipitation in mountain regions is highly variable and poorly measured, posing important challenges to water resource management. Traditional methods to estimate precipitation include in-situ gauges, doppler weather radars, satellite radars and radiometers, numerical modeling and reanalysis products. Each of these methods is unable to adequately capture complex orographic precipitation. Here, we propose a novel approach to characterize orographic snowfall over mountain regions. We use a particle batch smoother to leverage satellite information from Sentinel-1 derived snow depth retrievals and to correct various gridded precipitation products. This novel approach is tested using a simple snow model for an alpine basin located in Trentino Alto Adige, Italy. We quantify the precipitation biases across the basin and found that the assimilation method (i) corrects for snowfall biases and uncertainties, (ii) leads to cumulative snowfall elevation patterns that are consistent across precipitation products, and (iii) results in overall improved basin-wide snow variables (snow depth and snow cover area) and basin streamflow estimates.



The analysis of the snowfall elevation patterns' spatial characteristics indicates that the proposed assimilation scheme results in more accurate spatial patterns in the snowfall distribution across the entire basin. The derived snowfall orographic patterns contribute to a comprehensive improvement of mountain hydrologic variables such as snow depth, snow cover area, and streamflow. The most significant enhancements in streamflow are observed during the spring and summer months when peak flow observations align more accurately with the posterior cases than the prior ones. These results primarily stem from the fact that the assimilation of Sentinel-1 assigns less snowfall to the lower-elevation regions of the basin, while higher rates are assigned to the higher elevation. As summer approaches, water is released more slowly from the higher elevation via snow-melt than in the prior case, which aligns better with observations. The assimilation of Sentinel-1 effectively downscales coarser-resolution precipitation products. While the prior snowfall cumulative elevation pattern has a small gradient across elevation bands, these patterns are consistent across elevations and precipitation products after the assimilation of snow depth retrievals. In conclusion, this study provides a framework for correcting snowfall orographic patterns across other seasonally-snow dominated mountain areas of the world, especially where in-situ data are scarce. The full paper can be found by clicking on the Figure above.
Reference


Girotto, Manuela, Giuseppe Formetta, Shima Azimi, Claire Bachand, Marianne Cowherd, Gabrielle De Lannoy, Hans Lievens, et al. 2023. “Identifying Snowfall Elevation Patterns by Assimilating Satellite-Based Snow Depth Retrievals.” The Science of the Total Environment, September, 167312. https://doi.org/10.1016/j.scitotenv.2023.167312.

Thursday, October 19, 2023

Water4All - WaMaWaDit project

The project WaMA-WaDiT: Water Management and Adaption based on Watershed Digital Twins was financed in the Water4All call and therefore, we will be able to start a new exciting adventure with some challenge. 

This proposal aims to understand the impact of extreme climate events such as droughts and floods on water management systems, with the goal of developing optimized management strategies that maximize water security under both current and future climate change conditions. The knowledge gained will be used to create a watershed digital twin framework, applicable to various watersheds with different water-related issues. A guide will be published detailing the process of building digital twins for specific watersheds and problems.



The proposal  that you can find in its complete form by clicking on the above logo, pursues three main objectives: the scientific, the practical, and the product objectives. The scientific objective focuses on improving our understanding of how drought and floods affect water management systems, and how optimal strategies can mitigate these effects. This involves several sub-objectives, such as determining the best databases for modeling water management problems, analyzing systematic errors in climate and hydrologic predictions, improving the inclusion of groundwater dynamics models, incorporating complex snow dynamics, assessing the effect of long-term forecasts of extreme events on reservoir management, and improving the parameterization of single hydrological processes.

The practical objective is to create a methodology that systematizes the proposal and assessment of adaptation measures in reservoirs. This methodology will provide a clear guide on how to develop decision frameworks based on the most robust numerical models or digital twins of the watershed. It will also tackle how to manage hydroclimatic extremes like floods and droughts, emphasizing dynamic management of safety margins to maximize water availability and ways to reduce the impact of persistent droughts.

The product objective is to implement this methodology in a free, open-source software tool that simplifies the use of scientific knowledge for decision-makers and reservoir managers. This tool aims to be robust and scalable, providing a first-order approximation to any problem. It will encourage end-users to adopt optimal tools for their needs by demonstrating the power