Required files
To run wflow, several files are required. These include a settings file and input data. The input data is typically separated into static maps and forcing data, and both are provided in netCDF files, except for lake storage and rating curves that are supplied via CSV files. Below is a brief overview of the different files:
- The
settings.toml
file contains information on the simulation period, links to the input files (and their names in the netCDF files), and connect the correct variable names in the netCDF files to the variables and parameters of wflow. - The
staticmaps.nc
file contains spatial information such as elevation, gauge locations, land use, and drainage direction, etc. This file can also contain maps with parameter values. - The
forcing.nc
file contains time series data for precipitation, temperature and potential evaporation (as a 3D array).
The configuration file (settings.toml
)
The configuration file contains all relevant settings for running wflow, such as the simulation period, the model settings, the mapping between input files and (internal) model parameters. More details and explanations can be found here. An example configuration file is presented below.
Click to show example .toml file
# This is a TOML configuration file for Wflow.
# Relative file paths are interpreted as being relative to this TOML file.
# Wflow documentation https://deltares.github.io/Wflow.jl/dev/
# TOML documentation: https://github.com/toml-lang/toml
endtime = 2000-01-10T00:00:00
dir_input = "data/input"
dir_output = "data/output"
loglevel = "info"
[input]
path_forcing = "forcing-moselle.nc"
path_static = "staticmaps-moselle.nc"
# these are not directly part of the model
ldd = "wflow_ldd"
river_location = "wflow_river"
subcatchment = "wflow_subcatch"
# specify the internal IDs of the parameters which vary over time
# the external name mapping needs to be below together with the other mappings
forcing = [
"vertical.atmospheric_forcing.precipitation",
"vertical.atmospheric_forcing.temperature",
"vertical.atmospheric_forcing.potential_evaporation",
]
cyclic = ["vertical.vegetation_parameter_set.leaf_area_index"]
[input.vertical.vegetation_parameter_set]
leaf_area_index = "LAI"
kext = "Kext"
storage_specific_leaf = "Sl"
storage_wood = "Swood"
rootingdepth = "RootingDepth"
[input.vertical.interception.parameters]
e_r = "EoverR"
[input.vertical.atmospheric_forcing]
potential_evaporation = "pet"
precipitation = "precip"
temperature = "temp"
[input.vertical.runoff.parameters]
waterfrac = "WaterFrac"
[input.vertical.soil.parameters]
c = "c"
cf_soil = "cf_soil"
f = "f"
infiltcappath = "InfiltCapPath"
infiltcapsoil = "InfiltCapSoil"
theta_r = "thetaR"
theta_s = "thetaS"
maxleakage = "MaxLeakage"
pathfrac = "PathFrac"
rootdistpar = "rootdistpar"
soilthickness = "SoilThickness"
kv_0 = "KsatVer"
[input.vertical.snow.parameters]
tt = "TT"
tti = "TTI"
ttm = "TTM"
cfmax = "Cfmax"
[input.lateral.river]
length = "wflow_riverlength"
n = "N_River"
slope = "RiverSlope"
width = "wflow_riverwidth"
[input.lateral.river.reservoir]
area = "ResSimpleArea"
areas = "wflow_reservoirareas"
demand = "ResDemand"
locs = "wflow_reservoirlocs"
maxrelease = "ResMaxRelease"
maxvolume = "ResMaxVolume"
targetfullfrac = "ResTargetFullFrac"
targetminfrac = "ResTargetMinFrac"
[input.lateral.subsurface]
ksathorfrac = "KsatHorFrac"
[input.lateral.land]
n = "N"
slope = "Slope"
[model]
thicknesslayers = [100, 300, 800]
type = "sbm"
[csv]
path = "output_moselle_simple.csv"
[[csv.column]]
coordinate.x = 7.378
coordinate.y = 50.204
header = "Q"
parameter = "lateral.river.variables.q"
[[csv.column]]
header = "recharge"
parameter = "vertical.soil.variables.recharge"
reducer = "mean"
The static input data (staticmaps.nc
)
The list below contains a brief overview of several essential static maps required to run wflow. These NC variables names refer to the example data of the wflow_sbm + kinematic wave model (see here). Example data for the other model configurations can be found here.
Description | NC variable name | unit |
---|---|---|
Flow direction (1-9) | wflow_ldd |
- |
Map indicating the river cells (0-1) | wflow_river |
- |
The length of the river | wflow_riverlength |
m |
The width of the river | wflow_riverwidth |
m |
Mask of the basin | wflow_subcatch |
- |
Land slope | Slope |
m m\(^{-1}\) |
River slope | RiverSlope |
m m\(^{-1}\) |
As mentioned before, the model parameters can also be defined as spatial maps. They can be included in the same netCDF file, as long as their variable names are correctly mapped in the TOML settings file. See the section on example models on how to use this functionality.
When using cyclic data, three different options are supported: - 12 (monthly) - 365 (daily, where Feb. 29 is not present, so the value for Feb. 28 is taken. Dec. 31 is represented by DOY 365) - 366 (where Feb. 29 represents DOY 60, and Dec. 31 DOY 366)
In contrast to the right-labelling of the forcing data (see below), the DOY/month of the current time step is used. For example: to simulate 2023-06-14 00:00:00 (with a daily time step), the DOY value at position 6 (when 12 values are provided), 165 (when 365 values are provided) or 166 (when 366 values are provided).
The forcing data (forcing.nc
)
The forcing data typically contains the meteorological boundary conditions. This data is provided as a single netCDF file, with several variables containing the forcing data for precipitation, temperature and potential evaporation. The code snippet below shows the contents of the example file (downloaded here), and displaying the content with NCDatasets
in Julia. As can be seen, each forcing variable (precip
, pet
and temp
) consists of a three-dimensional dataset (x
, y
, and time
), and each timestep consists of a two-dimensional map with values at each grid cell. Only values within the basin are required.
Wflow expects the forcing to be “right-labelled”. This means that e.g. daily precipitation at 2023-06-15 00:00:00 is the accumulated total precipitation between 2023-06-14 00:00:00 and 2023-06-15 00:00:00.
For optimal computational performance, it is recommended to have chunks in the time dimension. This way, only part of the forcing file needs to be read and kept in memory. We recommend using a chunk size in the time dimension with size 1. Using larger chunks can largely degrade computational performance.
Click to show example forcing.nc file
Group: /
Dimensions
time = 366
y = 313
x = 291
Variables
time (366)
Datatype: Int64
Dimensions: time
Attributes:
units = days since 2000-01-02 00:00:00
calendar = proleptic_gregorian
y (313)
Datatype: Float64
Dimensions: y
Attributes:
_FillValue = NaN
x (291)
Datatype: Float64
Dimensions: x
Attributes:
_FillValue = NaN
spatial_ref
Attributes:
crs_wkt = GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AXIS["Latitude",NORTH],AXIS["Longitude",EAST],AUTHORITY["EPSG","4326"]]
x_dim = x
y_dim = y
dim0 = time
precip (291 × 313 × 366)
Datatype: Float32
Dimensions: x × y × time
Attributes:
_FillValue = NaN
unit = mm
precip_fn = era5
coordinates = idx_out spatial_ref mask
idx_out (291 × 313)
Datatype: Int32
Dimensions: x × y
mask (291 × 313)
Datatype: UInt8
Dimensions: x × y
pet (291 × 313 × 366)
Datatype: Float32
Dimensions: x × y × time
Attributes:
_FillValue = NaN
unit = mm
pet_fn = era5
pet_method = debruin
coordinates = idx_out spatial_ref mask
temp (291 × 313 × 366)
Datatype: Float32
Dimensions: x × y × time
Attributes:
_FillValue = NaN
unit = degree C.
temp_fn = era5
temp_correction = True
coordinates = idx_out spatial_ref mask
Global attributes
unit = mm
precip_fn = era5