This repository contains the code and documentation for a hydrological model usecase
for the InterTwin project. The usecase is based on utilizing HydroMT and Wflow to
simulate hydrological processes in the Adige river basin.
Relevant links:
InterTwin project
HydroMT
Wflow
The aim of this usecase is to demostrate the integration of HydroMT and Wflow as a
self contained OGC Application Package. The OGC Application Package is a standard
for packaging and distributing geospatial applications.
Each application package is a self-contained directory that contains all the necessary
files and metadata to run the application. The application package includes a CWL
workflow, input parameters, and metadata files.
HydroMT (Hydro Model Tools) is an open-source Python package that facilitates the process of building and analyzing spatial geoscientific models with a focus on water system models. It does so by automating the workflow to go from raw data to a complete model instance which is ready to run and to analyse model results once the simulation has finished. HydroMT builds on the latest packages in the scientific and geospatial python eco-system including xarray, rasterio, rioxarray, geopandas, scipy and pyflwdir. Source: Deltares HydroMT
data_catalog.yaml
: describes the name and metadata of data collections \wflow_init.yaml
: declares which collection from data_catalog.yaml to use and model setup options \region
: this is an argument to pass to HydroMT CLI that defines the region of interest
- Directory with required data and config file to run Wflow
hydromt build wflow -r "{'subbasin':[ 11.4750, 46.8717 ], 'strord':3}" -d data_catalog.yaml -i wflow_init.yaml
Data volumes:
1. v1: data catalog
2. v2: model directory, the model will be saved in a subdirectory \<MODELNAME\> in /model directory...
The HydroMT image is built using the following command and can be found in the /experimental/hydromt
directory:
./docker_build_and_publish.sh
The script automatically builds the image and publishes it to the eurac registry.
region: "{'subbasin':[ 11.4750, 46.8717 ], 'strord':3}"
setupconfig:
class: File
path: wflow.ini
catalog:
class: File
path: hydromt_data.yaml
volume_data:
class: Directory
path: /mnt/CEPH_PROJECTS/InterTwin/Wflow/data
cwltool -w output.json hydromt-build.cwl params.yaml
docker run -v /mnt/CEPH_PROJECTS/InterTwin/hydrologic_data:/data -v /mnt/CEPH_PROJECTS/InterTwin/workflows/wflow:/model -it --rm intertwin:hydromt build
docker build -t gitlab.inf.unibz.it:4567/remsen/cdr/climax/meteo-data-pipeline:hydromt .
docker push gitlab.inf.unibz.it:4567/remsen/cdr/climax/meteo-data-pipeline:hydromt
Wflow is Deltares’ solution for modelling hydrological processes, allowing users to account for precipitation, interception, snow accumulation and melt, evapotranspiration, soil water, surface water and groundwater recharge in a fully distributed environment. Successfully applied worldwide for analyzing flood hazards, drought, climate change impacts and land use changes, wflow is growing to be a leader in hydrology solutions. Wflow is conceived as a framework, within which multiple distributed model concepts are available, which maximizes the use of open earth observation data, making it the hydrological model of choice for data scarce environments. Based on gridded topography, soil, land use and climate data, wflow calculates all hydrological fluxes at any given grid cell in the model at a given time step. Source: Deltares Wflow
1. config file
2. staticmaps.nc
3. forcings.nc
4. state.nc
(optional)
1.hydrological variables
2. User Parameters:
3. Warm-up period
\
1. v1: model directory, corresponding subdirectory <MODELNAME> as created by HydroMT
The Wflow image is built using the following command and can be found in the /experimental/wflow
directory:
./docker_build_and_publish.sh
docker run -v $HOME/dev/InterTwin-wflow-app/hydromt/cwl/81iegmjn/model:/data -it --rm gitlab.inf.unibz.it:4567/remsen/cdr/climax/meteo-data-pipeline:wflow run_wflow wflow_sbm.toml
cd wflow/cwl
cwltool --no-read-only --no-match-user wflow-run.cwl params_wflow.yaml
This section describes how the HydroMT and Wflow applications are packaged as OGC
Application Packages. The OGC Application Package is a standard for packaging and
distributing geospatial applications.
Each application package is a self-contained directory that contains all the necessary
files and metadata to run the application. The application package includes a CWL
workflow, input parameters, and metadata files. The application package can be \
This section describes how the HydroMT and Wflow applications are packaged as OGC
Application Packages.
The HydroMT Application Package is available in the following directory:
/experimental/hydromt/
HydroMT process diagram:
The directory contains everything needed to run the HydroMT application. The Dockerfile contains the
environment setup and dependencies for the HydroMT application.
The image is automatically pulled from the eurac registry when the application is run.
To execute the HydroMT application, the user needs to provide the following inputs:
1. data catalog
2. setup file
3. region
These can be specified in:
/experimental/hydromt/cwl/params.yaml
The HydroMT application package can be executed using the following command from the /experimental/hydromt/cwl/ directory
:
cwltool --outdir ./hydromt-output hydromt-build.cwl#hydromt-build params.yaml
Note: The --outdir
flag specifies the output directory for the application package. This can be customized to the user's preference.
The Wflow Application Package is available in the following directory:
/experimental/wflow/
Wflow process diagram:
The following inputs as described in the params-exp-wflow.yaml file are required to run the Wflow application:
1. runconfig
2. forcings
3. hydromtdata
4. volume_data
5. staticmaps
Wflon be run from the command line using the following command from the /experimental/wflow/cwl/
directory:
cwltool --outdir ./wflow-output --no-read-only --no-match-user wflow-exp-run.cwl#run-wflow params-exp-wflow.yaml
The output of the Wflow application package is a set of hydrological variables. The output directory can be customized using the --outdir
flag.