aboutsummaryrefslogtreecommitdiff
path: root/R/PEC_sw_focus.R
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2017-06-20 16:40:21 +0200
committerJohannes Ranke <jranke@uni-bremen.de>2017-06-20 16:40:21 +0200
commit0607a619d92d582ba40f9c0c3b32a1d0a8791655 (patch)
tree68a9fcff9959f2c03ab952c02457dc7303b6fb38 /R/PEC_sw_focus.R
parent0d60c88ba7e0693a832056ea3db5cc0eaf3b0819 (diff)
Possibility to turn off formation in water
This makes it possible to compare the Step 1 output with earlier versions of the Steps 12 tool.
Diffstat (limited to 'R/PEC_sw_focus.R')
-rw-r--r--R/PEC_sw_focus.R13
1 files changed, 11 insertions, 2 deletions
diff --git a/R/PEC_sw_focus.R b/R/PEC_sw_focus.R
index aed83a0..1471c40 100644
--- a/R/PEC_sw_focus.R
+++ b/R/PEC_sw_focus.R
@@ -48,6 +48,9 @@
#' for June to September. If NA, only step 1 PECsw are calculated
#' @param interception One of 'no interception' (default), 'minimal crop cover',
#' 'average crop cover' or 'full canopy'
+#' @param met_form_water Should the metabolite formation in water be taken into
+#' account? This can be switched off to check the influence and to compare
+#' with previous versions of the Steps 12 calculator
#' @param txt_file the name, and potentially the full path to the
#' Steps.12 input text file to which the specification of the run(s)
#' should be written
@@ -72,6 +75,7 @@ PEC_sw_focus <- function(parent, rate, n = 1, i = NA,
season = c(NA, "of", "mm", "js"),
interception = c("no interception", "minimal crop cover",
"average crop cover", "full canopy"),
+ met_form_water = TRUE,
txt_file = "pesticide.txt", overwrite = FALSE, append = TRUE)
{
if (n > 1 & is.na(i)) stop("Please specify the interval i if n > 1")
@@ -215,8 +219,13 @@ PEC_sw_focus <- function(parent, rate, n = 1, i = NA,
# Metabolite formed in water (this part is not documented in the Help files
# of the Steps 1/2 calculator):
if (!is.null(met)) {
- eq_rate_rd_parent_s = mw_ratio * max_ws * rate
- eq_rate_rd_s_tot = eq_rate_rd_s + eq_rate_rd_parent_s
+ if (met_form_water) {
+ eq_rate_rd_parent_s = mw_ratio * max_ws * rate
+ eq_rate_rd_s_tot = eq_rate_rd_s + eq_rate_rd_parent_s
+ } else {
+ eq_rate_rd_parent_s = NA
+ eq_rate_rd_s_tot = eq_rate_rd_s
+ }
} else {
eq_rate_rd_parent_s = NA
eq_rate_rd_s_tot = eq_rate_rd_s

Contact - Imprint