Skip to contents

This function applies the data extracted by senorge_extract_grid() to a SWAT+ project using SWATprepR. Please note you need to pass "Auxiliary data" to this function of additional meteorological data such that SWAT+ can be run (SeNorge only has precipitation and temperature, more variables are needed to run SWAT+)

Usage

swatplus_senorge(
  extract_path,
  metadata,
  DEM,
  aux_data,
  epsg_code,
  write_path,
  db_path = NULL,
  fill_missing = TRUE,
  period_starts = NA,
  period_ends = NA,
  clean_files = TRUE,
  verbose = FALSE
)

Arguments

extract_path

string, path to the directory where data was extracted using senorge_extract_grid()

metadata

string, path to the metadata shape file generated by senorge_extract_grid().

DEM

string, path to a .tif raster of a DEM which covers the area of the extracted grid.

aux_data

string, path to .xlsx sheet in SWATprepR format with Auxiliary meteo data (this is needed, as SeNorge does not have all required variables to run SWAT+)

epsg_code

SWATprepR: integer value fo the EPSG code of the projection of the auxilliary data (See ?SWATprepR::load_template())

write_path

SWATprepR: Character, path to the SWAT+ txtinout folder (example "my_model").

db_path

SWATprepR: A character string representing the path to the SWAT+ SQLite database (e.g., "./output/project.sqlite").

fill_missing

SWATprepR: (optional) Boolean, TRUE - fill data for missing stations with data from closest stations with available data. FALSE - leave stations without data. Weather generator will be used to fill missing variables for a model. Default fill_missing = TRUE.

period_starts

SWATprepR: (optional) Character, date string (example '1991-01-01'). Default period_starts = NA, stands for all available in data.

period_ends

SWATprepR: (optional) Character, date string (example '2020-12-31'). Default period_ends = NA, stands for all available in data.

clean_files

SWATprepR: Logical, if TRUE, will remove all existing weather files in model setup folder before writing new ones. Default clean_files = TRUE.

verbose

logical, print status?

Value

Returns TRUE if function finishes task.

Examples

#TODO