From 0607a619d92d582ba40f9c0c3b32a1d0a8791655 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Tue, 20 Jun 2017 16:40:21 +0200 Subject: 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. --- R/PEC_sw_focus.R | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'R/PEC_sw_focus.R') 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 -- cgit v1.2.1