Building a model#
This plugin allows to build a complete Wflow Sediment model from available data. Once the configuration and data libraries are set, you can build a model by using:
activate hydromt-wflow
hydromt build wflow_sediment path/to/built_model -r "{'basin': [x, y]}" -i wflow_sediment_build.yml -d data_sources.yml -vvv
The recommended region options for a proper implementation of the Wflow Sediment model are:
basin
subbasin
Configuration file#
Settings to build or update a Wflow Sediment model are managed in a configuration file. In this file, every option from each model component can be changed by the user in its corresponding section.
Note that the order in which the components are listed in the configuration file is important:
setup_basemaps should always be run first to determine the model domain
setup_rivers should be run right after setup_basemaps as it influences several other setup components (lakes, reservoirs, riverbedsed, floodplains, gauges)
Below is an example configuration file that can be used to build a complete Wflow Sediment model
.yml file
. Each section corresponds
to a model component with the same name.
setup_config: # options parsed to wflow toml file <section>.<option>
time.starttime: "2010-02-02T00:00:00"
time.endtime: "2010-02-10T00:00:00"
time.timestepsecs: 86400
output.netcdf_grid.path: output.nc
output.netcdf_grid.compressionlevel: 1
output.netcdf_grid.variables.soil_erosion__mass_flow_rate: soil_loss
output.netcdf_grid.variables.river_water_sediment~suspended__mass_concentration: suspended_solids
setup_basemaps:
hydrography_fn: merit_hydro # source hydrography data {merit_hydro, merit_hydro_1k}
basin_index_fn: merit_hydro_index # source of basin index corresponding to hydrography_fn
upscale_method: ihu # upscaling method for flow direction data, by default 'ihu'
res: 0.00833 # build the model at a 30 arc sec (~1km) resolution
setup_rivers:
hydrography_fn: merit_hydro # source hydrography data, should correspond to hydrography_fn in setup_basemaps
river_geom_fn: hydro_rivers_lin # river source data with river width and bankfull discharge
river_upa: 30 # minimum upstream area threshold for the river map [km2]
min_rivwth: 30 # minimum river width [m]
slope_len: 2000 # length over which tp calculate river slope [m]
smooth_len: 5000 # length over which to smooth river depth and river width [m]
setup_reservoirs:
reservoirs_fn: hydro_reservoirs # source for reservoirs shape and attributes
min_area: 1.0 # minimum lake area to consider [km2]
trapping_default: 1.0 # default trapping efficiency for reservoirs [0-1]
setup_lakes:
lakes_fn: hydro_lakes # source for lakes based on hydroLAKES: {hydro_lakes}
min_area: 1.0 # minimum reservoir area to consider [km2]
setup_riverbedsed:
setup_lulcmaps:
lulc_fn: globcover_2009 # source for lulc maps: {globcover, vito, corine}
lulc_mapping_fn: globcover_mapping_default # default mapping for lulc classes
setup_canopymaps:
canopy_fn: simard # source for vegetation canopy height: {simard}
setup_soilmaps:
soil_fn: soilgrids # source for soilmaps: {soilgrids}
usle_k_method: renard # method to compute the USLE K factor: {renard, epic}
add_aggregates: True # if True add small and large aggregates to soil composition
setup_outlets:
river_only: True
setup_gauges:
gauges_fn: grdc # If not None add gaugemap. Either a path or known gauges_fn: {grdc}
snap_to_river: True # If True snaps gauges from source to river
derive_subcatch: False # if True derive subcatch map based on gauges.
setup_constant_pars: # constant parameters values
river_water_sediment__bagnold_transport_capacity_coefficient: 0.0000175
river_water_sediment__bagnold_transport_capacity_exponent: 1.4
soil_erosion__answers_overland_flow_factor: 0.9
soil_erosion__eurosem_exponent: 2.0
sediment__particle_density: 2650
clay__mean_diameter: 2
silt__mean_diameter: 10
"sediment_aggregates~small__mean_diameter": 30
sand__mean_diameter: 200
"sediment_aggregates~large__mean_diameter": 500
gravel__mean_diameter: 2000
Selecting data#
Data sources in HydroMT are provided in one of several yaml libraries. These libraries contain required information on the different data sources so that HydroMT can process them for the different models. There are three ways for the user to select which data libraries to use:
For testing and examples purposes, HydroMT can use the data stored in the hydromt-artifacts which contains an extract of global data for a small region around the Piave river in Northern Italy. to use this predefined catalog, the user can add -d artifact_data to the build / update command line.
Another options for Deltares users is to select the deltares_data library (requires access to the Deltares P-drive). In the command lines examples below, this is done by adding -d deltares_data predefined catalog to the build / update command line.
Finally, the user can prepare its own yaml catalog (see HydroMT documentation to check the guidelines). These user libraries can be added either in the command line using the -d option and path/to/yaml or in the ini file with the data_libs option in the [global] sections.
Extending a Wflow (SBM) model with a Wflow Sediment model#
If you already have a Wflow model and you want to extend it in order to include sediment as well, then you do not need to build the
Wflow Sediment model from scratch. You can instead update
the Wflow model with the additional components needed by Wflow Sediment.
These components are available in a template .yml file
and shown below. The corresponding
command line would be:
activate hydromt-wflow
hydromt update wflow_sediment path/to/wflow_model_to_extend -o path/to/wflow_sediment_model -i wflow_extend_sediment.yml -d data_sources.yml -vvv
read_config: # read a template config file for wflow sediment to be able to extend from a sbm model
config_fn: data/wflow_sediment.toml
setup_config: # options parsed to wflow toml file <section>.<option>
time.starttime: 2010-01-01T00:00:00
time.endtime: 2010-03-31T00:00:00
time.timestepsecs: 86400
output.netcdf_grid.path: output.nc
output.netcdf_grid.compressionlevel: 1
output.netcdf_grid.variables.soil_erosion__mass_flow_rate: soil_loss
output.netcdf_grid.variables.river_water_sediment~suspended__mass_concentration: suspended_solids
setup_riverbedsed:
bedsed_mapping_fn: # path to a mapping csv file from streamorder to river bed particles characteristics if any, else default is used
# # If you do have data on trapping efficiency, you can re-run setup_reservoirs to add it
# Else you can use a default of 1 via setup_constant_pars below
# setup_reservoirs:
# reservoirs_fn: hydro_reservoirs # source for reservoirs shape and attributes
# min_area: 1.0 # minimum lake area to consider [km2]
# trapping_default: 1.0 # default trapping efficiency for reservoirs [0-1]
setup_lulcmaps:
lulc_fn: globcover_2009 # source for lulc maps: {globcover, vito, corine}
lulc_mapping_fn: globcover_mapping_default # default mapping for lulc classes
setup_canopymaps:
canopy_fn: simard # source for vegetation canopy height: {simard}
setup_soilmaps:
soil_fn: soilgrids # source for soilmaps: {soilgrids}
usle_k_method: renard # method to compute the USLE K factor: {renard, epic}
add_aggregates: True # if True add small and large aggregates to soil composition
setup_outlets:
river_only: True
setup_gauges:
gauges_fn: grdc # If not None add gaugemap. Either a path or known gauges_fn: {grdc}
snap_to_river: True # If True snaps gauges from source to river
derive_subcatch: False # if True derive subcatch map based on gauges.
setup_constant_pars: # constant parameters values
river_water_sediment__bagnold_transport_capacity_coefficient: 0.0000175
river_water_sediment__bagnold_transport_capacity_exponent: 1.4
soil_erosion__answers_overland_flow_factor: 0.9
soil_erosion__eurosem_exponent: 2.0
sediment__particle_density: 2650
clay__mean_diameter: 2
silt__mean_diameter: 10
"sediment_aggregates~small__mean_diameter": 30
sand__mean_diameter: 200
"sediment_aggregates~large__mean_diameter": 500
gravel__mean_diameter: 2000
"reservoir_water_sediment~bedload__trapping_efficiency": 1.0