The goal of SWATprepR
is to help with the SWAT+
model input data preparation.
There are mostly functions, which were developed for the implementation
of modeling tasks in the OPTAIN project. These
tools are intended to fill the gaps in the SWAT+ workflow along side the
main tools developed by Christoph
Schuerz. Therefore, we highly
recommend trying and using these tools:
- SWATbuildR1 - R tool for building SWAT+ setups;
- SWATfarmR - R tool for preparing management schedules for SWAT model;
- SWATdoctR - A collection of functions in R and routines for SWAT model calibration and model diagnostics;
- SWATrunR (former SWATplusR) - R tool for sensitivity analyse, model calibration and validation.
Detailed information about packages, workflow steps, input data, SWAT+ parameters, model calibration, validation, etc., could be found in the SWAT+ modeling protocol.
You can install the development version of SWATprepR from GitHub with:
# install.packages("devtools")
devtools::install_github("biopsichas/SWATprepR")
# euptf2 package is needed and used for soil parameter functions
devtools::install_github("tkdweber/euptf2")
All the data required to run and test package are installed with package in the extdata folder. Exact location on computer could be found running lines below. Please run it on your system to find it for you.
library(SWATprepR)
temp_path <- system.file("extdata", package = "SWATprepR")
print(temp_path)
#> [1] "C:/Users/laptop/AppData/Local/R/win-library/4.2/SWATprepR/extdata"
In order to use SWATprepR package functions with your data you should prepare your data to be inline with templates we have provided in extdata folder. Such are:
- calibration_data.xlsx - template for loading calibration (water flow and water quality variables) data.
- weather_data.xlsx - template for loading weather variables.
- usersoils.csv - example of loading soil parameters dataset.
- GIS/ - folder with GIS layers needed to run some functions.
Data prepared according to templates can be directly loaded into R and all the functions applied as described.
Footnotes
-
For access please inquire at christoph.schuerz@ufz.de. ↩