Reservoirs and wetlands
Overview¶
Reservoirs are standalone water body objects in the routing network. They receive inflow from upstream channels, HRUs, or recall objects, store it, and release it according to a decision table in res_rel.dtl. Each reservoir runs sediment settling, in-pond nutrient processes, and optional pesticide, salt, and constituent processes.
Wetlands are a separate object type linked to individual HRUs. They sit on the HRU surface, intercept surface runoff before it reaches the channel, and run a similar water balance and sediment-nutrient set as reservoirs. Wetland storage is configured per HRU in wetland.wet.
Process equations¶
Reservoir water balance¶
The daily water balance for a reservoir in res_control.f90 is
where:
inflowis the upstream hydrograph (ht1).precipis precipitation onto the water surface from the assigned weather station, using the current surface area.outflowis the release computed byres_hydro.f90.evapis potential evaporation times the water surface area, optionally adjusted by the reservoir evaporation coefficient.seepis seepage through the bed, computed from the bed hydraulic conductivity over the surface area.irrigis water withdrawn for irrigation through the water allocation module.
Surface area as a function of storage is interpolated from the principal volume pvol_m3 and emergency volume evol_m3 defined for the reservoir.
Release rules via res_rel.dtl¶
Releases are not hard-coded. Each reservoir points to a decision table in res_rel.dtl. The table lists conditions (volume above principal, day of year, downstream demand, ...) and corresponding actions (weir release, target release, percent of volume, irrigation supply, ...). At each daily step res_hydro.f90:
- Walks the action list (
d_tbl%acts). - For each action, evaluates whether all condition alternatives are satisfied (
d_tbl%act_hit). - Fires the corresponding release equation.
Release types include:
weir_releasefor a weir of heightwbody_prm%weir_hgtand widthwbody_prm%weir_wid. The discharge over time follows the weir equation with the daily volume above the weir crest as the head source.pvol_releaseandevol_releasefor releases triggered when storage exceeds the principal or emergency volume.- Doell-style storage-based release with coefficient
krand exponentalpha(Jose T 2025 extension inres_hydro.f90). - Hanazaki monthly-target release using monthly inflow and demand.
- HYPE seasonal sine and linear storage modulation for hydropower-style operations.
The weir branch calls res_weir_release.f90 to integrate over sub-daily steps.
Reservoir sediment¶
res_sediment.f90 computes settling using a first-order rate. If the in-reservoir sediment concentration (ppm) exceeds the equilibrium concentration wbody_prm%sed%nsed, the excess is reduced by the settling coefficient wbody_prm%sed_stlr_co:
After settling, sand, large aggregates, silt, clay, and gravel are recomputed; all of the sand-sized fraction is assumed to deposit. Outflow sediment leaves at the post-settling concentration.
Reservoir nutrients¶
res_nutrient.f90 runs an in-pond nutrient set: settling of organic N and organic P, mineralisation, nitrification, and algal growth limited by light and nutrients. Soluble nutrients track storage-weighted concentration and leave at the outflow concentration. Settling rates are read from nutrients-res.nut.
Reservoir pesticides, salts, constituents¶
res_pest.f90, res_salt.f90, and res_cs.f90 run when those constituent modules are active. See Pesticides and Salts and constituents.
Wetlands on HRUs¶
Wetlands are configured per HRU via wet_initial.f90 and wetland.wet. Each wetland has:
- Principal volume
wet_ob%pvol(m^3) computed fromwet_hyd%pdep(principal depth, mm) times the HRU area. - Emergency volume
wet_ob%evol(m^3) fromwet_hyd%edep. - Principal and emergency surface areas
psaandesa. - Optional weir geometry
weir_hgtandweir_widread fromweir.res.
The wetland state wet(iihru) is the same water_body type used for reservoirs. In hru_control.f90 the HRU surface runoff is routed into the wetland (wet(j) = wet(j) + ht1), the wetland runs its water balance and release (using the same res_hydro machinery on a wetland), and the outflow is added to the HRU outgoing hydrograph. Storage to depth uses a quadratic relation from wet_hyd%bcoef and wet_hyd%ccoef:
with the positive root taken.
Wetlands run their own sediment, nutrient, pesticide, salt, and constituent routines using the same module code paths as reservoirs.
Switches and parameters¶
| Switch / parameter | Default | File | Effect |
|---|---|---|---|
res_hyd%iyres |
per reservoir | hydrology-res.res |
Year reservoir comes online |
res_hyd%mores |
per reservoir | hydrology-res.res |
Month reservoir comes online |
pvol_m3 |
per reservoir | hydrology-res.res |
Principal volume (m^3) |
evol_m3 |
per reservoir | hydrology-res.res |
Emergency volume (m^3) |
wbody_prm%sed%nsed |
per reservoir | sediment-res.sed |
Equilibrium sediment concentration (ppm) |
wbody_prm%sed_stlr_co |
per reservoir | sediment-res.sed |
Sediment settling coefficient |
wbody_prm%weir_hgt |
per reservoir | weir.res |
Weir height (m) |
wbody_prm%weir_wid |
per reservoir | weir.res |
Weir width (m) |
res_ob%release_dtl |
per reservoir | dtl (res_rel.dtl) |
Decision table name for release rules |
wet_hyd%pdep |
per HRU wetland | wetland.wet |
Principal depth (mm) |
wet_hyd%edep |
per HRU wetland | wetland.wet |
Emergency depth (mm) |
wet_hyd%psa |
per HRU wetland | wetland.wet |
Principal surface area fraction of HRU |
wet_hyd%esa |
per HRU wetland | wetland.wet |
Emergency surface area fraction of HRU |
wet_hyd%bcoef |
per HRU wetland | wetland.wet |
Storage-depth quadratic coefficient |
wet_hyd%ccoef |
per HRU wetland | wetland.wet |
Storage-depth quadratic coefficient |
TODO: verify default values in hydrology-res.res, sediment-res.sed, nutrients-res.nut, weir.res, and wetland.wet against their respective _read.f90 readers.
Implementation¶
Source modules in swatplus/src/:
res_control.f90is the master daily driver for a reservoir object. Adds inflow, computes the water balance, calls release, sediment, nutrient, pesticide, salt, and constituent routines.res_hydro.f90evaluates the release decision table and computes outflow. Houses weir, principal-volume, emergency-volume, Doell, Hanazaki, and HYPE release branches.res_weir_release.f90integrates weir discharge over sub-daily steps.res_rel_conds.f90evaluates release conditions specific to reservoirs.res_sediment.f90computes in-reservoir sediment settling.res_nutrient.f90runs in-reservoir nutrient transformations.res_pest.f90handles reservoir pesticides.res_salt.f90,res_cs.f90handle salts and constituents.res_initial.f90,res_allo.f90,res_objects.f90set up reservoir state at simulation start.res_read.f90,res_read_hyd.f90,res_read_sed.f90,res_read_nut.f90,res_read_weir.f90,res_read_init.f90,res_read_conds.f90,res_read_elements.f90,res_read_csdb.f90,res_read_saltdb.f90,res_read_salt_cs.f90read the reservoir input files.reservoir_module.f90defines reservoir types includingwet_obfor wetlands.reservoir_data_module.f90andreservoir_conditions_module.f90hold parameter and conditions arrays.reservoir_output.f90,res_pesticide_output.f90,res_salt_output.f90,res_cs_output.f90write reservoir outputs.wet_initial.f90initialises a wetland on each flagged HRU.wet_all_initial.f90initialises all wetlands at simulation start.wet_fp_init.f90sets up the wetland-floodplain link to channels.wet_read.f90,wet_read_hyd.f90,wet_read_salt_cs.f90read wetland input files.wet_irrp.f90handles irrigation withdrawal from a wetland.wet_cs.f90,wet_cs_output.f90,wet_salt.f90,wet_salt_output.f90handle wetland constituents and salts.
Related pages¶
- Decision tables for how release rules are evaluated.
dtlfor the decision table input file format.resfor the reservoir input files.wetfor the wetland input files.- Channels for downstream routing.
- Aquifer, reservoir, and plant output.