extract_watersheds_output: Function to extract all output data from SWAT model...

Description Usage Arguments Value Examples

View source: R/f_extract_watersheds_output.R

Description

This function allows reading in all output.rch, output.sub, output.hru files generated by SWAT2012 in Lithuanian EPA model, which was applied for different climate and measures scenarios.

Usage

1
2
3
4
5
6
7
8
9
extract_watersheds_output(
  watersheds_folder_path,
  scenarios,
  output_type,
  starting_date,
  ending_date,
  output_files = c("sub", "rch", "hru"),
  save_results_to_files = FALSE
)

Arguments

watersheds_folder_path

String giving path to the Watersheds folder where all output results are saved. (example "../../MODEL/MODEL_CLIMATE_LONG/Setup/Watersheds")

scenarios

Vector providing scenario name used in saving modeling results. Example for combining climate and measures could be: as.vector(outer(c("C1", "C2"), c("M1", "M2"), paste, sep="_")). This would allow generation of vector, which could be used in loop. An example, scenarios = c("HIRHAM5_rcp45_measure_30'", "HIRHAM5_rcp45_measure_31", "HIRHAM5_rcp85_measure_30", "HIRHAM5_rcp85_measure_31")

output_type

Number the same as in IPRINT (0 - Monthly, 1 - Daily, 2 - Year)

starting_date

Sting with time series starting date (example "1997-01-01")

ending_date

Sting with time series ending date (example "2019-12-31")

output_files

Vector of files endings for output files to extract.

save_results_to_files

Logical value with TRUE or FALSE values. If TRUE results will be saved to hru.rda, rch.rda, sub.rda files in working directory.

Value

List with three data.frames: rch, sub and hru for data extracted from different output files.

Examples

1
##extract_watersheds_output(path, scenarios, 2, "1997-01-01", "2099-12-31", c("sub"), TRUE)

biopsichas/swattools documentation built on May 27, 2021, 6:17 p.m.