A Toolbox for Soil and Water Assessment Tool (SWAT) watershed hydrological modelling
Abstract
This toolbox provides a set of predefined functions designed for watershed modelling with SWAT (Soil and Water Assessment Tool), allowing simplified model sharing and execution, as well as including SWAT into more complex cross-domain modelling frameworks (Example: Source-to-sea modeling with Marine Modelling System Tool box). This toolbox include SWATrunR functions to execute SWAT2012 and SWAT+ models. Models are executed in linux environment and executable version rev60.5.7_64rel_linux for SWAT+ and rev688_64rel_linux for SWAT2012. Developed in the open-source R scripting language, the toolbox consists of three functions that automate key steps in model execution, scenario generation, and output processing: a) swat-simulation: Tool that runs SWAT models (swat+ and swat2012 versions) in a remote server using SWATrunR R package functions, provided TxtInOut directory (as a URL to a zip TxtInOut folder), time frame parameters and required output variables. The tool allows to perform model calibration by adding calibration parameters as a json file formatted as described in SWATrunR documentation. Function outputs are composed of two databases on SQLite format. One database called “inputs.sqlite” with the log details of the model run for predictability. and second named “thread_1.sqlite” with the requested model outputs. b) swatplus-lulc-change (for SWAT+ only): Updates the LULC assigned to selected Hydrological Response Units (HRUs) by modifying the lu_mgt column in the hru-data.hru file. The tool requires two text files as input: (1) a file containing the URL of the zipped TxtInOut folder, and (2) a file containing the URL of a CSV file with the HRU IDs to be updated in the first column and their corresponding new LULC values in the second column. c) swat-marine-connection: Converts SWAT+ simulation outputs from SQLite format into a TXT file structured for ingestion by the Marine Modelling System workflow in VRE AquaINFRA. The resulting TXT file contains three columns: the first column contains the date, the second column contains the flow values (m3/s) and the 3rd column contains the temperature values (Cº). This modular and adaptable toolbox is applicable to various environmental studies, beyond the Tordera Watershed (Spain) in the Mediterranean use case, where it has been applied to measure the impact of Land Use Land Cover Changes in water quantity at the river mouth. The swat simulation tool can also be adapted to simulate any of the variables encompassed by SWAT+ and SWAT2012 modelling framework.
Publication details
- Journal / source
- CDI B2Share
- Publication date
- 17 September 2026
- Language
- EN