Skip to contents

This function updates a SWAT+ model text files and writes the atmodep.cli file for a given dataframe containing atmospheric deposition data.

Usage

add_atmo_dep(df, write_path, t_ext = "year")

Arguments

df

A data frame containing columns "DATE," "NH4_RF," "NO3_RF," "NH4_DRY," and "NO3_DRY" obtained from the get_atmo_dep function.

write_path

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

t_ext

(optional) A string indicating the type of time aggregation: 'year' for yearly averages, 'month' for monthly averages, and 'annual' for the average of the entire period. Default default t_ext = "year".

Value

Writes data to 'atmodep.cli' file and can update the SWAT+ SQLite database with codes and connections to atmospheric deposition data.

See also

Author

Svajunas Plunge (svajunas.plunge@gmail.com)

Moritz Shore (moritzshore@gmail.com)

Examples

if (FALSE) {
  basin_path <- system.file("extdata", "GIS/basin.shp", package = "SWATprepR")
  df <- get_atmo_dep(basin_path)
  project_path <- "./output/test"
  add_atmo_dep(df, project_path)
}