From 72c56f4246966c1bea627f601cf3cc457734f023 Mon Sep 17 00:00:00 2001 From: Johannes Ranke Date: Tue, 19 Feb 2019 12:27:00 +0100 Subject: Add German drainage calculations using Exposit 3.02 --- ChangeLog | 6 + DESCRIPTION | 2 +- NAMESPACE | 1 + R/PEC_sw_exposit_runoff.R | 105 ++++++++-- docs/reference/PEC_sw_exposit_drainage.html | 239 ++++++++++++++++++++++ docs/reference/PEC_sw_exposit_runoff.html | 26 ++- docs/reference/perc_runoff_exposit.html | 4 +- docs/reference/perc_runoff_reduction_exposit.html | 6 +- docs/reference/pesticide.txt | 4 + man/PEC_sw_exposit_drainage.Rd | 60 ++++++ man/PEC_sw_exposit_runoff.Rd | 18 +- man/perc_runoff_exposit.Rd | 4 +- man/perc_runoff_reduction_exposit.Rd | 4 +- test.log | 12 +- tests/testthat/test_PEC_soil.R | 14 +- tests/testthat/test_exposit.R | 80 ++++++-- 16 files changed, 518 insertions(+), 67 deletions(-) create mode 100644 docs/reference/PEC_sw_exposit_drainage.html create mode 100644 man/PEC_sw_exposit_drainage.Rd diff --git a/ChangeLog b/ChangeLog index 73f709a..d019be0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +commit e5a077e28153f6494c99d6945b8b1bd239464609 +Author: Johannes Ranke +Date: 2019-02-08 15:25:19 +0100 + + Make SSLRC and PEC drainage UK accept NA for Koc + commit b935273d651301b271e0cb66bf36c2bbc1d15b32 Author: Johannes Ranke Date: 2019-01-31 01:40:24 +0100 diff --git a/DESCRIPTION b/DESCRIPTION index 994bc4e..f73bfe6 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,7 +2,7 @@ Package: pfm Type: Package Title: Utilities for Pesticide Fate Modelling Version: 0.5.3 -Date: 2019-02-08 +Date: 2019-02-19 Authors@R: person("Johannes Ranke", email = "jranke@uni-bremen.de", role = c("aut", "cre", "cph"), comment = c(ORCID = "0000-0003-4371-6538")) diff --git a/NAMESPACE b/NAMESPACE index 256eb3f..59e8040 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -19,6 +19,7 @@ export(PEC_soil) export(PEC_soil_mets) export(PEC_sw_drainage_UK) export(PEC_sw_drift) +export(PEC_sw_exposit_drainage) export(PEC_sw_exposit_runoff) export(PEC_sw_focus) export(PEC_sw_sed) diff --git a/R/PEC_sw_exposit_runoff.R b/R/PEC_sw_exposit_runoff.R index 733f621..a9cbf07 100644 --- a/R/PEC_sw_exposit_runoff.R +++ b/R/PEC_sw_exposit_runoff.R @@ -12,8 +12,8 @@ #' \item{bound}{The percentage of the applied substance transferred to an #' adjacent water body bound to eroding particles} #' } -#' @source Excel 3.01 spreadsheet available from -#' \url{https://www.bvl.bund.de/DE/04_Pflanzenschutzmittel/03_Antragsteller/04_Zulassungsverfahren/07_Naturhaushalt/psm_naturhaush_node.html#doc1400590bodyText3} +#' @source Excel 3.02 spreadsheet available from +#' \url{https://www.bvl.bund.de/EN/04_PlantProtectionProducts/03_Applicants/04_AuthorisationProcedure/08_Environment/ppp_environment_node.html} #' @export perc_runoff_exposit #' @examples #' print(perc_runoff_exposit) @@ -39,13 +39,13 @@ rownames(perc_runoff_exposit) <- Koc_classes #' \item{dissolved}{The reduction percentage for the dissolved phase} #' \item{bound}{The reduction percentage for the particulate phase} #' } -#' @source Excel 3.01 spreadsheet available from -#' \url{https://www.bvl.bund.de/DE/04_Pflanzenschutzmittel/03_Antragsteller/04_Zulassungsverfahren/07_Naturhaushalt/psm_naturhaush_node.html#doc1400590bodyText3} +#' @source Excel 3.02 spreadsheet available from +#' \url{https://www.bvl.bund.de/EN/04_PlantProtectionProducts/03_Applicants/04_AuthorisationProcedure/08_Environment/ppp_environment_node.html} #' @export #' @examples #' print(perc_runoff_reduction_exposit) perc_runoff_reduction_exposit <- list( - "3.01" = data.frame( + "3.02" = data.frame( dissolved = c(0, 40, 60, 80), bound = c(0, 40, 85, 95), row.names = c("No buffer", paste(c(5, 10, 20), "m"))), @@ -57,16 +57,18 @@ perc_runoff_reduction_exposit <- list( #' Calculate PEC surface water due to runoff and erosion as in Exposit 3 #' -#' This is a reimplementation of the calculation described in the Exposit 3.01 spreadsheet file, -#' in the worksheet "Konzept Runoff". Calculation of sediment PEC values is not implemented. +#' This is a reimplementation of the calculation described in the Exposit 3.02 spreadsheet file, +#' in the worksheet "Konzept Runoff". #' #' @param rate The application rate in g/ha +#' @param interception The fraction intercepted by the crop #' @param Koc The sorption coefficient to soil organic carbon #' @param DT50 The soil half-life in days #' @param t_runoff The time between application and the runoff event, where degradation occurs, in days #' @param exposit_reduction_version The version of the reduction factors to be used #' @param V_ditch The volume of the ditch is assumed to be 1 m * 100 m * 30 cm = 30 m3 #' @param V_event The unreduced runoff volume, equivalent to 10 mm precipitation on 1 ha +#' @param dilution The dilution factor #' @return A list containing the following components #' \describe{ #' \item{perc_runoff}{The runoff percentages for dissolved and bound substance} @@ -75,17 +77,17 @@ perc_runoff_reduction_exposit <- list( #' for the different distances. If the rate was given in g/ha, the PECsw are in microg/L.} #' } #' @export -#' @source Excel 3.01 spreadsheet available from +#' @source Excel 3.02 spreadsheet available from #' \url{https://www.bvl.bund.de/DE/04_Pflanzenschutzmittel/03_Antragsteller/04_Zulassungsverfahren/07_Naturhaushalt/psm_naturhaush_node.html#doc1400590bodyText3} #' @seealso \code{\link{perc_runoff_exposit}} for runoff loss percentages and \code{\link{perc_runoff_reduction_exposit}} for runoff reduction percentages used #' @examples -#' PEC_sw_exposit_runoff(500, 150) -PEC_sw_exposit_runoff <- function(rate, Koc, DT50 = Inf, t_runoff = 3, - exposit_reduction_version = c("3.01", "2.0"), - V_ditch = 30, V_event = 100) +#' PEC_sw_exposit_runoff(500, Koc = 150) +PEC_sw_exposit_runoff <- function(rate, interception = 0, Koc, DT50 = Inf, t_runoff = 3, + exposit_reduction_version = c("3.02", "2.0"), + V_ditch = 30, V_event = 100, dilution = 2) { k_deg <- log(2)/DT50 - input <- rate * 1 * exp(-k_deg * t_runoff) # assumes 1 ha treated area + input <- rate * (1 - interception) * 1 * exp(-k_deg * t_runoff) # assumes 1 ha treated area if (length(Koc) > 1) stop("Only one compound at a time supported") @@ -96,8 +98,8 @@ PEC_sw_exposit_runoff <- function(rate, Koc, DT50 = Inf, t_runoff = 3, transfer_runoff <- 1 - reduction_runoff V_runoff <- V_event * (1 - reduction_runoff[["dissolved"]]) # m3 - V_ditch_runoff <- V_ditch + V_runoff - V_flowing_ditch_runoff <- 2 * V_ditch_runoff + V_flowing_ditch_runoff <- dilution * (V_ditch + V_runoff) + f_runoff_exposit <- function(Koc) { Koc_breaks <- c(perc_runoff_exposit$Koc_lower_bound, Inf) Koc_classes <- as.character(cut(Koc, Koc_breaks, labels = rownames(perc_runoff_exposit))) @@ -118,3 +120,76 @@ PEC_sw_exposit_runoff <- function(rate, Koc, DT50 = Inf, t_runoff = 3, PEC_sw_runoff = PEC_sw_runoff) return(result) } + +#' Calculate PEC surface water due to drainage as in Exposit 3 +#' +#' This is a reimplementation of the calculation described in the Exposit 3.02 spreadsheet file, +#' in the worksheet "Konzept Drainage". Although there are four groups of +#' compounds ("Gefährdungsgruppen"), only one distinction is made in the +#' calculations, between compounds with low mobility (group 1) and compounds +#' with modest to high mobility (groups 2, 3 and 4). In this implementation, +#' the group is derived only from the Koc, if not given explicitly. For +#' details, see the discussion of the function arguments below. +#' +#' @param rate The application rate in g/ha +#' @param interception The fraction intercepted by the crop +#' @param Koc The sorption coefficient to soil organic carbon used to determine the mobility. A trigger +#' value of 550 L/kg is used in order to decide if Koc >> 500. +#' @param mobility Overrides what is determined from the Koc. +#' @param DT50 The soil half-life in days +#' @param t_drainage The time between application and the drainage event, where degradation occurs, in days +#' @param V_ditch The volume of the ditch is assumed to be 1 m * 100 m * 30 cm = 30 m3 +#' @param V_drainage The drainage volume, equivalent to 1 mm precipitation on 1 ha for spring/summer or 10 mm for +#' autumn/winter/early spring. +#' @param dilution The dilution factor +#' @return A list containing the following components +#' \describe{ +#' \item{perc_runoff}{The runoff percentages for dissolved and bound substance} +#' \item{runoff}{A matrix containing dissolved and bound input for the different distances} +#' \item{PEC_sw_runoff}{A matrix containing PEC values for dissolved and bound substance +#' for the different distances. If the rate was given in g/ha, the PECsw are in microg/L.} +#' } +#' @export +#' @source Excel 3.02 spreadsheet available from +#' \url{https://www.bvl.bund.de/DE/04_Pflanzenschutzmittel/03_Antragsteller/04_Zulassungsverfahren/07_Naturhaushalt/psm_naturhaush_node.html#doc1400590bodyText3} +#' @seealso \code{\link{perc_runoff_exposit}} for runoff loss percentages and \code{\link{perc_runoff_reduction_exposit}} for runoff reduction percentages used +#' @examples +#' PEC_sw_exposit_drainage(500, Koc = 150) +PEC_sw_exposit_drainage <- function(rate, interception = 0, Koc = NA, mobility = c(NA, "low", "high"), DT50 = Inf, t_drainage = 3, + V_ditch = 30, V_drainage = c(spring = 10, autumn = 100), dilution = 2) +{ + # Rückstand zum Zeitpunkt des Niederschlagsereignisses (residue at the time of the drainage event) + k_deg <- log(2)/DT50 + residue <- rate * (1 - interception) * 1 * exp(-k_deg * t_drainage) # assumes 1 ha treated area + + mobility <- match.arg(mobility) + if (is.na(mobility)) { + if (is.na(Koc)) stop("Koc is needed if the mobility is not specified") + else { + if (Koc > 550) mobility = "low" + else mobility = "high" + } + } + + V_ditch_drainage <- V_ditch + V_drainage + V_flowing_ditch_drainage <- dilution * V_ditch_drainage + + # Gesamtaustrag (total fraction of the residue drained) + if (mobility == "low") { + f_drainage_total <- c(spring = 0.01 * 1e-2, + autumn = 0.05 * 1e-2) + } else { + f_drainage_total <- c(spring = 0.2 * 1e-2, + autumn = 1.0 * 1e-2) + } + + f_peak = c(spring = 0.125, autumn = 0.25) # Stoßbelastung (fraction drained at event) + + PEC_sw_drainage <- 1000 * residue * f_drainage_total * f_peak / V_flowing_ditch_drainage + + result <- list( + perc_drainage_total = 100 * f_drainage_total, + perc_peak = 100 * f_peak, + PEC_sw_drainage = PEC_sw_drainage) + return(result) +} diff --git a/docs/reference/PEC_sw_exposit_drainage.html b/docs/reference/PEC_sw_exposit_drainage.html new file mode 100644 index 0000000..62d83fa --- /dev/null +++ b/docs/reference/PEC_sw_exposit_drainage.html @@ -0,0 +1,239 @@ + + + + + + + + +Calculate PEC surface water due to drainage as in Exposit 3 — PEC_sw_exposit_drainage • pfm + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ +
+
+ + +
+ +

This is a reimplementation of the calculation described in the Exposit 3.02 spreadsheet file, +in the worksheet "Konzept Drainage". Although there are four groups of +compounds ("Gefährdungsgruppen"), only one distinction is made in the +calculations, between compounds with low mobility (group 1) and compounds +with modest to high mobility (groups 2, 3 and 4). In this implementation, +the group is derived only from the Koc, if not given explicitly. For +details, see the discussion of the function arguments below.

+ +
+ +
PEC_sw_exposit_drainage(rate, interception = 0, Koc = NA,
+  mobility = c(NA, "low", "high"), DT50 = Inf, t_drainage = 3,
+  V_ditch = 30, V_drainage = c(spring = 10, autumn = 100),
+  dilution = 2)
+ +

Arguments

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
rate

The application rate in g/ha

interception

The fraction intercepted by the crop

Koc

The sorption coefficient to soil organic carbon used to determine the mobility. A trigger +value of 550 L/kg is used in order to decide if Koc >> 500.

mobility

Overrides what is determined from the Koc.

DT50

The soil half-life in days

t_drainage

The time between application and the drainage event, where degradation occurs, in days

V_ditch

The volume of the ditch is assumed to be 1 m * 100 m * 30 cm = 30 m3

V_drainage

The drainage volume, equivalent to 1 mm precipitation on 1 ha for spring/summer or 10 mm for +autumn/winter/early spring.

dilution

The dilution factor

+ +

Source

+ +

Excel 3.02 spreadsheet available from + https://www.bvl.bund.de/DE/04_Pflanzenschutzmittel/03_Antragsteller/04_Zulassungsverfahren/07_Naturhaushalt/psm_naturhaush_node.html#doc1400590bodyText3

+ +

Value

+ +

A list containing the following components

+
perc_runoff

The runoff percentages for dissolved and bound substance

+
runoff

A matrix containing dissolved and bound input for the different distances

+
PEC_sw_runoff

A matrix containing PEC values for dissolved and bound substance + for the different distances. If the rate was given in g/ha, the PECsw are in microg/L.

+
+ + +

See also

+ +

perc_runoff_exposit for runoff loss percentages and perc_runoff_reduction_exposit for runoff reduction percentages used

+ + +

Examples

+
PEC_sw_exposit_drainage(500, Koc = 150)
#> $perc_drainage_total +#> spring autumn +#> 0.2 1.0 +#> +#> $perc_peak +#> spring autumn +#> 12.5 25.0 +#> +#> $PEC_sw_drainage +#> spring autumn +#> 1.562500 4.807692 +#>
+
+ +
+ +
+ + +
+

Site built with pkgdown 1.3.0.

+
+
+
+ + + + + + diff --git a/docs/reference/PEC_sw_exposit_runoff.html b/docs/reference/PEC_sw_exposit_runoff.html index f86ad1e..3d7097a 100644 --- a/docs/reference/PEC_sw_exposit_runoff.html +++ b/docs/reference/PEC_sw_exposit_runoff.html @@ -32,8 +32,8 @@ - + @@ -107,14 +107,14 @@ in the worksheet "Konzept Runoff". Calculation of sediment PEC values
-

This is a reimplementation of the calculation described in the Exposit 3.01 spreadsheet file, -in the worksheet "Konzept Runoff". Calculation of sediment PEC values is not implemented.

+

This is a reimplementation of the calculation described in the Exposit 3.02 spreadsheet file, +in the worksheet "Konzept Runoff".

-
PEC_sw_exposit_runoff(rate, Koc, DT50 = Inf, t_runoff = 3,
-  exposit_reduction_version = c("3.01", "2.0"), V_ditch = 30,
-  V_event = 100)
+
PEC_sw_exposit_runoff(rate, interception = 0, Koc, DT50 = Inf,
+  t_runoff = 3, exposit_reduction_version = c("3.02", "2.0"),
+  V_ditch = 30, V_event = 100, dilution = 2)

Arguments

@@ -123,6 +123,10 @@ in the worksheet "Konzept Runoff". Calculation of sediment PEC values is not imp + + + + @@ -147,11 +151,15 @@ in the worksheet "Konzept Runoff". Calculation of sediment PEC values is not imp + + + +
rate

The application rate in g/ha

interception

The fraction intercepted by the crop

Koc

The sorption coefficient to soil organic carbon

V_event

The unreduced runoff volume, equivalent to 10 mm precipitation on 1 ha

dilution

The dilution factor

Source

-

Excel 3.01 spreadsheet available from +

Excel 3.02 spreadsheet available from https://www.bvl.bund.de/DE/04_Pflanzenschutzmittel/03_Antragsteller/04_Zulassungsverfahren/07_Naturhaushalt/psm_naturhaush_node.html#doc1400590bodyText3

Value

@@ -170,7 +178,7 @@ in the worksheet "Konzept Runoff". Calculation of sediment PEC values is not imp

Examples

-
PEC_sw_exposit_runoff(500, 150)
#> $perc_runoff +
PEC_sw_exposit_runoff(500, Koc = 150)
#> $perc_runoff #> dissolved bound #> 0.248 0.001 #> diff --git a/docs/reference/perc_runoff_exposit.html b/docs/reference/perc_runoff_exposit.html index e600a1c..737dbb5 100644 --- a/docs/reference/perc_runoff_exposit.html +++ b/docs/reference/perc_runoff_exposit.html @@ -124,8 +124,8 @@

Source

-

Excel 3.01 spreadsheet available from - https://www.bvl.bund.de/DE/04_Pflanzenschutzmittel/03_Antragsteller/04_Zulassungsverfahren/07_Naturhaushalt/psm_naturhaush_node.html#doc1400590bodyText3

+

Excel 3.02 spreadsheet available from + https://www.bvl.bund.de/EN/04_PlantProtectionProducts/03_Applicants/04_AuthorisationProcedure/08_Environment/ppp_environment_node.html

Examples

diff --git a/docs/reference/perc_runoff_reduction_exposit.html b/docs/reference/perc_runoff_reduction_exposit.html index 9170b37..818e2be 100644 --- a/docs/reference/perc_runoff_reduction_exposit.html +++ b/docs/reference/perc_runoff_reduction_exposit.html @@ -124,12 +124,12 @@ from which the values were taken.

Source

-

Excel 3.01 spreadsheet available from - https://www.bvl.bund.de/DE/04_Pflanzenschutzmittel/03_Antragsteller/04_Zulassungsverfahren/07_Naturhaushalt/psm_naturhaush_node.html#doc1400590bodyText3

+

Excel 3.02 spreadsheet available from + https://www.bvl.bund.de/EN/04_PlantProtectionProducts/03_Applicants/04_AuthorisationProcedure/08_Environment/ppp_environment_node.html

Examples

-
print(perc_runoff_reduction_exposit)
#> $`3.01` +
print(perc_runoff_reduction_exposit)
#> $`3.02` #> dissolved bound #> No buffer 0 0 #> 5 m 40 40 diff --git a/docs/reference/pesticide.txt b/docs/reference/pesticide.txt index 38d58ba..20f4237 100644 --- a/docs/reference/pesticide.txt +++ b/docs/reference/pesticide.txt @@ -47,3 +47,7 @@ Dummy 1 cereals, spring n NA Dummy 1 cereals, spring n NA -99.00 -99.00 60 M1 cereals, winter n NA M1 cereals, winter n NA 250.00 100.00 100.00 50.00 100.00 100.00 0.00E+00 50.00 1000.00 1.00 0.00E+00 1.00 -99.00 -99.00 -99.00 -99.00 0.00E+00 1.00 Dummy 1 cereals, spring n NA Dummy 1 cereals, spring n NA -99.00 -99.00 6000.00 344.80 0.00E+00 6.00 0.00E+00 0.00E+00 3000.00 1.00 0.00E+00 0.00E+00 0.00E+00 -99.00 -99.00 -99.00 0.00E+00 1.00 M1 cereals, winter n NA M1 cereals, winter n NA 250.00 100.00 100.00 50.00 100.00 100.00 0.00E+00 50.00 1000.00 1.00 0.00E+00 1.00 -99.00 -99.00 -99.00 -99.00 0.00E+00 1.00 +Dummy 1 cereals, spring n NA Dummy 1 cereals, spring n NA -99.00 -99.00 6000.00 344.80 0.00E+00 6.00 0.00E+00 0.00E+00 3000.00 1.00 0.00E+00 0.00E+00 0.00E+00 -99.00 -99.00 -99.00 0.00E+00 1.00 +M1 cereals, winter n NA M1 cereals, winter n NA 250.00 100.00 100.00 50.00 100.00 100.00 0.00E+00 50.00 1000.00 1.00 0.00E+00 1.00 -99.00 -99.00 -99.00 -99.00 0.00E+00 1.00 +Dummy 1 cereals, spring n NA Dummy 1 cereals, spring n NA -99.00 -99.00 6000.00 344.80 0.00E+00 6.00 0.00E+00 0.00E+00 3000.00 1.00 0.00E+00 0.00E+00 0.00E+00 -99.00 -99.00 -99.00 0.00E+00 1.00 +M1 cereals, winter n NA M1 cereals, winter n NA 250.00 100.00 100.00 50.00 100.00 100.00 0.00E+00 50.00 1000.00 1.00 0.00E+00 1.00 -99.00 -99.00 -99.00 -99.00 0.00E+00 1.00 diff --git a/man/PEC_sw_exposit_drainage.Rd b/man/PEC_sw_exposit_drainage.Rd new file mode 100644 index 0000000..237d8cf --- /dev/null +++ b/man/PEC_sw_exposit_drainage.Rd @@ -0,0 +1,60 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/PEC_sw_exposit_runoff.R +\name{PEC_sw_exposit_drainage} +\alias{PEC_sw_exposit_drainage} +\title{Calculate PEC surface water due to drainage as in Exposit 3} +\source{ +Excel 3.02 spreadsheet available from + \url{https://www.bvl.bund.de/DE/04_Pflanzenschutzmittel/03_Antragsteller/04_Zulassungsverfahren/07_Naturhaushalt/psm_naturhaush_node.html#doc1400590bodyText3} +} +\usage{ +PEC_sw_exposit_drainage(rate, interception = 0, Koc = NA, + mobility = c(NA, "low", "high"), DT50 = Inf, t_drainage = 3, + V_ditch = 30, V_drainage = c(spring = 10, autumn = 100), + dilution = 2) +} +\arguments{ +\item{rate}{The application rate in g/ha} + +\item{interception}{The fraction intercepted by the crop} + +\item{Koc}{The sorption coefficient to soil organic carbon used to determine the mobility. A trigger +value of 550 L/kg is used in order to decide if Koc >> 500.} + +\item{mobility}{Overrides what is determined from the Koc.} + +\item{DT50}{The soil half-life in days} + +\item{t_drainage}{The time between application and the drainage event, where degradation occurs, in days} + +\item{V_ditch}{The volume of the ditch is assumed to be 1 m * 100 m * 30 cm = 30 m3} + +\item{V_drainage}{The drainage volume, equivalent to 1 mm precipitation on 1 ha for spring/summer or 10 mm for +autumn/winter/early spring.} + +\item{dilution}{The dilution factor} +} +\value{ +A list containing the following components + \describe{ + \item{perc_runoff}{The runoff percentages for dissolved and bound substance} + \item{runoff}{A matrix containing dissolved and bound input for the different distances} + \item{PEC_sw_runoff}{A matrix containing PEC values for dissolved and bound substance + for the different distances. If the rate was given in g/ha, the PECsw are in microg/L.} + } +} +\description{ +This is a reimplementation of the calculation described in the Exposit 3.02 spreadsheet file, +in the worksheet "Konzept Drainage". Although there are four groups of +compounds ("Gefährdungsgruppen"), only one distinction is made in the +calculations, between compounds with low mobility (group 1) and compounds +with modest to high mobility (groups 2, 3 and 4). In this implementation, +the group is derived only from the Koc, if not given explicitly. For +details, see the discussion of the function arguments below. +} +\examples{ + PEC_sw_exposit_drainage(500, Koc = 150) +} +\seealso{ +\code{\link{perc_runoff_exposit}} for runoff loss percentages and \code{\link{perc_runoff_reduction_exposit}} for runoff reduction percentages used +} diff --git a/man/PEC_sw_exposit_runoff.Rd b/man/PEC_sw_exposit_runoff.Rd index 779c251..dee6bbf 100644 --- a/man/PEC_sw_exposit_runoff.Rd +++ b/man/PEC_sw_exposit_runoff.Rd @@ -4,17 +4,19 @@ \alias{PEC_sw_exposit_runoff} \title{Calculate PEC surface water due to runoff and erosion as in Exposit 3} \source{ -Excel 3.01 spreadsheet available from +Excel 3.02 spreadsheet available from \url{https://www.bvl.bund.de/DE/04_Pflanzenschutzmittel/03_Antragsteller/04_Zulassungsverfahren/07_Naturhaushalt/psm_naturhaush_node.html#doc1400590bodyText3} } \usage{ -PEC_sw_exposit_runoff(rate, Koc, DT50 = Inf, t_runoff = 3, - exposit_reduction_version = c("3.01", "2.0"), V_ditch = 30, - V_event = 100) +PEC_sw_exposit_runoff(rate, interception = 0, Koc, DT50 = Inf, + t_runoff = 3, exposit_reduction_version = c("3.02", "2.0"), + V_ditch = 30, V_event = 100, dilution = 2) } \arguments{ \item{rate}{The application rate in g/ha} +\item{interception}{The fraction intercepted by the crop} + \item{Koc}{The sorption coefficient to soil organic carbon} \item{DT50}{The soil half-life in days} @@ -26,6 +28,8 @@ PEC_sw_exposit_runoff(rate, Koc, DT50 = Inf, t_runoff = 3, \item{V_ditch}{The volume of the ditch is assumed to be 1 m * 100 m * 30 cm = 30 m3} \item{V_event}{The unreduced runoff volume, equivalent to 10 mm precipitation on 1 ha} + +\item{dilution}{The dilution factor} } \value{ A list containing the following components @@ -37,11 +41,11 @@ A list containing the following components } } \description{ -This is a reimplementation of the calculation described in the Exposit 3.01 spreadsheet file, -in the worksheet "Konzept Runoff". Calculation of sediment PEC values is not implemented. +This is a reimplementation of the calculation described in the Exposit 3.02 spreadsheet file, +in the worksheet "Konzept Runoff". } \examples{ - PEC_sw_exposit_runoff(500, 150) + PEC_sw_exposit_runoff(500, Koc = 150) } \seealso{ \code{\link{perc_runoff_exposit}} for runoff loss percentages and \code{\link{perc_runoff_reduction_exposit}} for runoff reduction percentages used diff --git a/man/perc_runoff_exposit.Rd b/man/perc_runoff_exposit.Rd index bdc36e8..3f072df 100644 --- a/man/perc_runoff_exposit.Rd +++ b/man/perc_runoff_exposit.Rd @@ -13,8 +13,8 @@ adjacent water body bound to eroding particles} }} \source{ -Excel 3.01 spreadsheet available from - \url{https://www.bvl.bund.de/DE/04_Pflanzenschutzmittel/03_Antragsteller/04_Zulassungsverfahren/07_Naturhaushalt/psm_naturhaush_node.html#doc1400590bodyText3} +Excel 3.02 spreadsheet available from + \url{https://www.bvl.bund.de/EN/04_PlantProtectionProducts/03_Applicants/04_AuthorisationProcedure/08_Environment/ppp_environment_node.html} } \description{ A table of the loss percentages used in Exposit 3 for the twelve different Koc classes diff --git a/man/perc_runoff_reduction_exposit.Rd b/man/perc_runoff_reduction_exposit.Rd index bc93b29..644653e 100644 --- a/man/perc_runoff_reduction_exposit.Rd +++ b/man/perc_runoff_reduction_exposit.Rd @@ -13,8 +13,8 @@ from which the values were taken. \item{bound}{The reduction percentage for the particulate phase} }} \source{ -Excel 3.01 spreadsheet available from - \url{https://www.bvl.bund.de/DE/04_Pflanzenschutzmittel/03_Antragsteller/04_Zulassungsverfahren/07_Naturhaushalt/psm_naturhaush_node.html#doc1400590bodyText3} +Excel 3.02 spreadsheet available from + \url{https://www.bvl.bund.de/EN/04_PlantProtectionProducts/03_Applicants/04_AuthorisationProcedure/08_Environment/ppp_environment_node.html} } \usage{ perc_runoff_reduction_exposit diff --git a/test.log b/test.log index 66f99f8..8b2e67b 100644 --- a/test.log +++ b/test.log @@ -1,26 +1,24 @@ Loading pfm -Loading required package: testthat Loading required package: R6 Loading required package: mkin Testing pfm ✔ | OK F W S | Context - ⠏ | 0 | Exposit runoff calculations ⠋ | 1 | Exposit runoff calculations ⠙ | 2 | Exposit runoff calculations ⠹ | 3 | Exposit runoff calculations ✔ | 3 | Exposit runoff calculations + ⠏ | 0 | Exposit calculations ⠋ | 1 | Exposit calculations ⠙ | 2 | Exposit calculations ⠹ | 3 | Exposit calculations ⠸ | 4 | Exposit calculations ⠼ | 5 | Exposit calculations ⠴ | 6 | Exposit calculations ✔ | 6 | Exposit calculations ⠏ | 0 | Geometric mean calculation ⠋ | 1 | Geometric mean calculation ⠙ | 2 | Geometric mean calculation ⠹ | 3 | Geometric mean calculation ⠸ | 4 | Geometric mean calculation ⠼ | 5 | Geometric mean calculation ⠴ | 6 | Geometric mean calculation ✔ | 6 | Geometric mean calculation ⠏ | 0 | Check max_twa for parent mkinfit models against analytical solutions ⠋ | 1 | Check max_twa for parent mkinfit models against analytical solutions ✔ | 1 | Check max_twa for parent mkinfit models against analytical solutions [1.0 s] ⠏ | 0 | Simple PEC sediment calculations ⠋ | 1 | Simple PEC sediment calculations ✔ | 1 | Simple PEC sediment calculations - ⠏ | 0 | Simple PEC soil calculations ⠋ | 1 | Simple PEC soil calculations ⠙ | 2 | Simple PEC soil calculations ⠹ | 3 | Simple PEC soil calculations ⠸ | 4 | Simple PEC soil calculations ⠼ | 5 | Simple PEC soil calculations ⠴ | 6 | Simple PEC soil calculations ⠦ | 7 | Simple PEC soil calculations ⠧ | 8 | Simple PEC soil calculations ⠇ | 9 | Simple PEC soil calculations ⠏ | 10 | Simple PEC soil calculations ⠋ | 11 | Simple PEC soil calculations ⠙ | 12 | Simple PEC soil calculations ⠹ | 13 | Simple PEC soil calculations ✔ | 13 | Simple PEC soil calculations + ⠏ | 0 | Simple PEC soil calculations ⠋ | 1 | Simple PEC soil calculations ⠙ | 2 | Simple PEC soil calculations ⠹ | 3 | Simple PEC soil calculations ⠸ | 4 | Simple PEC soil calculations ⠼ | 5 | Simple PEC soil calculations ⠴ | 6 | Simple PEC soil calculations ⠦ | 7 | Simple PEC soil calculations ⠧ | 8 | Simple PEC soil calculations ⠇ | 9 | Simple PEC soil calculations ⠏ | 10 | Simple PEC soil calculations ⠋ | 11 | Simple PEC soil calculations ⠙ | 12 | Simple PEC soil calculations ⠹ | 13 | Simple PEC soil calculations ⠸ | 14 | Simple PEC soil calculations ⠼ | 15 | Simple PEC soil calculations ⠴ | 16 | Simple PEC soil calculations ⠦ | 17 | Simple PEC soil calculations ✔ | 17 | Simple PEC soil calculations [0.2 s] ⠏ | 0 | Simple PEC surface water calculations with drift entry ⠋ | 1 | Simple PEC surface water calculations with drift entry ⠙ | 2 | Simple PEC surface water calculations with drift entry ✔ | 2 | Simple PEC surface water calculations with drift entry - ⠏ | 0 | Create PELMO runs from psm files and execute them ⠋ | 1 | Create PELMO runs from psm files and execute them ⠙ | 2 | Create PELMO runs from psm files and execute them ⠹ | 3 | Create PELMO runs from psm files and execute them ⠸ | 4 | Create PELMO runs from psm files and execute them ⠼ | 5 | Create PELMO runs from psm files and execute them ⠴ | 6 | Create PELMO runs from psm files and execute them ⠦ | 7 | Create PELMO runs from psm files and execute them ⠧ | 8 | Create PELMO runs from psm files and execute them ⠇ | 9 | Create PELMO runs from psm files and execute them ⠏ | 10 | Create PELMO runs from psm files and execute them ⠋ | 11 | Create PELMO runs from psm files and execute them ⠙ | 12 | Create PELMO runs from psm files and execute them ⠹ | 13 | Create PELMO runs from psm files and execute them ⠸ | 14 | Create PELMO runs from psm files and execute them ⠼ | 15 | Create PELMO runs from psm files and execute them ⠴ | 16 | Create PELMO runs from psm files and execute them ⠦ | 17 | Create PELMO runs from psm files and execute them ⠧ | 18 | Create PELMO runs from psm files and execute them ⠇ | 19 | Create PELMO runs from psm files and execute them ⠏ | 20 | Create PELMO runs from psm files and execute them ⠋ | 21 | Create PELMO runs from psm files and execute them ⠙ | 22 | Create PELMO runs from psm files and execute them ⠹ | 23 | Create PELMO runs from psm files and execute them ⠸ | 24 | Create PELMO runs from psm files and execute them ⠼ | 25 | Create PELMO runs from psm files and execute them ⠴ | 26 | Create PELMO runs from psm files and execute them ⠦ | 27 | Create PELMO runs from psm files and execute them ⠧ | 28 | Create PELMO runs from psm files and execute them ⠇ | 29 | Create PELMO runs from psm files and execute them ⠏ | 30 | Create PELMO runs from psm files and execute them ⠋ | 31 | Create PELMO runs from psm files and execute them ⠙ | 32 | Create PELMO runs from psm files and execute them ⠹ | 33 | Create PELMO runs from psm files and execute them ⠸ | 34 | Create PELMO runs from psm files and execute them ⠼ | 35 | Create PELMO runs from psm files and execute them ⠴ | 36 | Create PELMO runs from psm files and execute them ⠦ | 37 | Create PELMO runs from psm files and execute them ⠧ | 38 | Create PELMO runs from psm files and execute them ⠇ | 39 | Create PELMO runs from psm files and execute them ⠏ | 40 | Create PELMO runs from psm files and execute them ⠋ | 41 | Create PELMO runs from psm files and execute them ⠙ | 42 | Create PELMO runs from psm files and execute them ⠹ | 43 | Create PELMO runs from psm files and execute them ⠸ | 44 | Create PELMO runs from psm files and execute them ⠼ | 45 | Create PELMO runs from psm files and execute them ⠴ | 46 | Create PELMO runs from psm files and execute them ⠦ | 47 | Create PELMO runs from psm files and execute them ⠧ | 48 | Create PELMO runs from psm files and execute them ⠇ | 49 | Create PELMO runs from psm files and execute them ⠏ | 50 | Create PELMO runs from psm files and execute them ⠋ | 51 | Create PELMO runs from psm files and execute them ⠙ | 52 | Create PELMO runs from psm files and execute them ⠹ | 53 | Create PELMO runs from psm files and execute them ⠸ | 54 | Create PELMO runs from psm files and execute them ⠼ | 55 | Create PELMO runs from psm files and execute them ⠴ | 56 | Create PELMO runs from psm files and execute them ⠦ | 57 | Create PELMO runs from psm files and execute them ⠧ | 58 | Create PELMO runs from psm files and execute them ⠇ | 59 | Create PELMO runs from psm files and execute them ⠏ | 60 | Create PELMO runs from psm files and execute them ⠋ | 61 | Create PELMO runs from psm files and execute them ⠙ | 62 | Create PELMO runs from psm files and execute them ⠹ | 63 | Create PELMO runs from psm files and execute them ⠸ | 64 | Create PELMO runs from psm files and execute them ⠼ | 65 | Create PELMO runs from psm files and execute them ⠴ | 66 | Create PELMO runs from psm files and execute them ⠦ | 67 | Create PELMO runs from psm files and execute them ⠧ | 68 | Create PELMO runs from psm files and execute them ⠇ | 69 | Create PELMO runs from psm files and execute them ⠏ | 70 | Create PELMO runs from psm files and execute them ⠋ | 71 | Create PELMO runs from psm files and execute them ⠙ | 72 | Create PELMO runs from psm files and execute them ⠹ | 73 | Create PELMO runs from psm files and execute them ⠸ | 74 | Create PELMO runs from psm files and execute them ⠼ | 75 | Create PELMO runs from psm files and execute them ⠴ | 76 | Create PELMO runs from psm files and execute them ⠦ | 77 | Create PELMO runs from psm files and execute them ⠧ | 78 | Create PELMO runs from psm files and execute them ⠇ | 79 | Create PELMO runs from psm files and execute them ⠏ | 80 | Create PELMO runs from psm files and execute them ⠋ | 81 | Create PELMO runs from psm files and execute them ⠙ | 82 | Create PELMO runs from psm files and execute them ⠹ | 83 | Create PELMO runs from psm files and execute them ⠸ | 84 | Create PELMO runs from psm files and execute them ⠼ | 85 | Create PELMO runs from psm files and execute them ⠴ | 86 | Create PELMO runs from psm files and execute them ⠦ | 87 | Create PELMO runs from psm files and execute them ⠧ | 88 | Create PELMO runs from psm files and execute them ⠇ | 89 | Create PELMO runs from psm files and execute them ⠏ | 90 | Create PELMO runs from psm files and execute them ⠋ | 91 | Create PELMO runs from psm files and execute them ⠙ | 92 | Create PELMO runs from psm files and execute them ⠹ | 93 | Create PELMO runs from psm files and execute them ⠸ | 94 | Create PELMO runs from psm files and execute them ⠼ | 95 | Create PELMO runs from psm files and execute them ⠴ | 96 | Create PELMO runs from psm files and execute them ⠦ | 97 | Create PELMO runs from psm files and execute them ⠧ | 98 | Create PELMO runs from psm files and execute them ⠇ | 99 | Create PELMO runs from psm files and execute them ⠏ | 100 | Create PELMO runs from psm files and execute them ⠋ | 101 | Create PELMO runs from psm files and execute them ⠙ | 102 | Create PELMO runs from psm files and execute them ⠹ | 103 | Create PELMO runs from psm files and execute them ⠸ | 104 | Create PELMO runs from psm files and execute them ⠼ | 105 | Create PELMO runs from psm files and execute them ⠴ | 106 | Create PELMO runs from psm files and execute them ⠦ | 107 | Create PELMO runs from psm files and execute them ⠧ | 108 | Create PELMO runs from psm files and execute them ⠇ | 109 | Create PELMO runs from psm files and execute them ⠏ | 110 | Create PELMO runs from psm files and execute them ⠋ | 111 | Create PELMO runs from psm files and execute them ⠙ | 112 | Create PELMO runs from psm files and execute them ⠹ | 113 | Create PELMO runs from psm files and execute them ⠸ | 114 | Create PELMO runs from psm files and execute them ⠼ | 115 | Create PELMO runs from psm files and execute them ⠴ | 116 | Create PELMO runs from psm files and execute them ⠦ | 117 | Create PELMO runs from psm files and execute them ⠧ | 118 | Create PELMO runs from psm files and execute them ⠇ | 119 | Create PELMO runs from psm files and execute them ⠏ | 120 | Create PELMO runs from psm files and execute them ⠋ | 121 | Create PELMO runs from psm files and execute them ⠙ | 122 | Create PELMO runs from psm files and execute them ⠹ | 123 | Create PELMO runs from psm files and execute them ⠸ | 124 | Create PELMO runs from psm files and execute them ⠼ | 125 | Create PELMO runs from psm files and execute them ⠴ | 126 | Create PELMO runs from psm files and execute them ⠦ | 127 | Create PELMO runs from psm files and execute them ⠧ | 128 | Create PELMO runs from psm files and execute them ⠇ | 129 | Create PELMO runs from psm files and execute them ⠏ | 130 | Create PELMO runs from psm files and execute them ⠋ | 131 | Create PELMO runs from psm files and execute them ⠙ | 132 | Create PELMO runs from psm files and execute them ⠹ | 133 | Create PELMO runs from psm files and execute them ⠸ | 134 | Create PELMO runs from psm files and execute them ⠼ | 135 | Create PELMO runs from psm files and execute them ⠴ | 136 | Create PELMO runs from psm files and execute them ⠦ | 137 | Create PELMO runs from psm files and execute them ⠧ | 138 | Create PELMO runs from psm files and execute them ⠇ | 139 | Create PELMO runs from psm files and execute them ⠏ | 140 | Create PELMO runs from psm files and execute them ⠋ | 141 | Create PELMO runs from psm files and execute them ⠙ | 142 | Create PELMO runs from psm files and execute them ⠹ | 143 | Create PELMO runs from psm files and execute them ⠸ | 144 | Create PELMO runs from psm files and execute them ⠼ | 145 | Create PELMO runs from psm files and execute them ⠴ | 146 | Create PELMO runs from psm files and execute them ⠦ | 147 | Create PELMO runs from psm files and execute them ⠧ | 148 | Create PELMO runs from psm files and execute them ⠇ | 149 | Create PELMO runs from psm files and execute them ⠏ | 150 | Create PELMO runs from psm files and execute them ⠋ | 151 | Create PELMO runs from psm files and execute them ⠙ | 152 | Create PELMO runs from psm files and execute them ⠹ | 153 | Create PELMO runs from psm files and execute them ⠸ | 154 | Create PELMO runs from psm files and execute them ⠼ | 155 | Create PELMO runs from psm files and execute them ⠴ | 156 | Create PELMO runs from psm files and execute them ⠦ | 157 | Create PELMO runs from psm files and execute them ⠧ | 158 | Create PELMO runs from psm files and execute them ⠇ | 159 | Create PELMO runs from psm files and execute them ⠏ | 160 | Create PELMO runs from psm files and execute them ⠋ | 161 | Create PELMO runs from psm files and execute them ⠙ | 162 | Create PELMO runs from psm files and execute them ⠹ | 163 | Create PELMO runs from psm files and execute them ⠸ | 164 | Create PELMO runs from psm files and execute them ⠼ | 165 | Create PELMO runs from psm files and execute them ⠴ | 166 | Create PELMO runs from psm files and execute them ⠦ | 167 | Create PELMO runs from psm files and execute them ⠧ | 168 | Create PELMO runs from psm files and execute them ⠇ | 169 | Create PELMO runs from psm files and execute them ⠏ | 170 | Create PELMO runs from psm files and execute them ⠋ | 171 | Create PELMO runs from psm files and execute them ⠙ | 172 | Create PELMO runs from psm files and execute them ⠹ | 173 | Create PELMO runs from psm files and execute them ⠸ | 174 | Create PELMO runs from psm files and execute them ⠼ | 175 | Create PELMO runs from psm files and execute them ⠴ | 176 | Create PELMO runs from psm files and execute them ⠦ | 177 | Create PELMO runs from psm files and execute them ⠧ | 178 | Create PELMO runs from psm files and execute them ⠇ | 179 | Create PELMO runs from psm files and execute them ⠏ | 180 | Create PELMO runs from psm files and execute them ⠋ | 181 | Create PELMO runs from psm files and execute them ⠙ | 182 | Create PELMO runs from psm files and execute them ⠹ | 183 | Create PELMO runs from psm files and execute them ⠸ | 184 | Create PELMO runs from psm files and execute them ⠼ | 185 | Create PELMO runs from psm files and execute them ⠴ | 186 | Create PELMO runs from psm files and execute them ⠦ | 187 | Create PELMO runs from psm files and execute them ⠧ | 188 | Create PELMO runs from psm files and execute them ⠇ | 189 | Create PELMO runs from psm files and execute them ⠏ | 190 | Create PELMO runs from psm files and execute them ⠋ | 191 | Create PELMO runs from psm files and execute them ⠙ | 192 | Create PELMO runs from psm files and execute them ⠹ | 193 | Create PELMO runs from psm files and execute them ⠸ | 194 | Create PELMO runs from psm files and execute them ⠼ | 195 | Create PELMO runs from psm files and execute them ⠴ | 196 | Create PELMO runs from psm files and execute them ⠦ | 197 | Create PELMO runs from psm files and execute them ⠧ | 198 | Create PELMO runs from psm files and execute them ⠇ | 199 | Create PELMO runs from psm files and execute them ⠏ | 200 | Create PELMO runs from psm files and execute them ⠋ | 201 | Create PELMO runs from psm files and execute them ⠙ | 202 | Create PELMO runs from psm files and execute them ⠹ | 203 | Create PELMO runs from psm files and execute them ⠸ | 204 | Create PELMO runs from psm files and execute them ⠼ | 205 | Create PELMO runs from psm files and execute them ⠴ | 206 | Create PELMO runs from psm files and execute them ⠦ | 207 | Create PELMO runs from psm files and execute them ⠧ | 208 | Create PELMO runs from psm files and execute them ⠇ | 209 | Create PELMO runs from psm files and execute them ⠏ | 210 | Create PELMO runs from psm files and execute them ⠋ | 211 | Create PELMO runs from psm files and execute them ⠙ | 212 | Create PELMO runs from psm files and execute them ⠹ | 213 | Create PELMO runs from psm files and execute them ⠸ | 214 | Create PELMO runs from psm files and execute them ⠼ | 215 | Create PELMO runs from psm files and execute them ⠴ | 216 | Create PELMO runs from psm files and execute them ⠦ | 217 | Create PELMO runs from psm files and execute them ⠧ | 218 | Create PELMO runs from psm files and execute them ⠇ | 219 | Create PELMO runs from psm files and execute them ✔ | 219 | Create PELMO runs from psm files and execute them [76.0 s] ⠏ | 0 | Actual and time weighted average concentrations for SFO kinetics ⠋ | 1 | Actual and time weighted average concentrations for SFO kinetics ✔ | 1 | Actual and time weighted average concentrations for SFO kinetics ⠏ | 0 | FOCUS Step 1 calculations ⠋ | 1 | FOCUS Step 1 calculations ⠙ | 2 | FOCUS Step 1 calculations ⠹ | 3 | FOCUS Step 1 calculations ⠸ | 4 | FOCUS Step 1 calculations ⠼ | 5 | FOCUS Step 1 calculations ⠴ | 6 | FOCUS Step 1 calculations ⠦ | 7 | FOCUS Step 1 calculations ⠧ | 8 | FOCUS Step 1 calculations ⠇ | 9 | FOCUS Step 1 calculations ✔ | 9 | FOCUS Step 1 calculations [0.1 s] ⠏ | 0 | FOCUS Steps 12 input files ⠋ | 1 | FOCUS Steps 12 input files ⠙ | 2 | FOCUS Steps 12 input files ⠹ | 3 | FOCUS Steps 12 input files ⠸ | 4 | FOCUS Steps 12 input files ⠼ | 5 | FOCUS Steps 12 input files ⠴ | 6 | FOCUS Steps 12 input files ⠦ | 7 | FOCUS Steps 12 input files ⠧ | 8 | FOCUS Steps 12 input files ✔ | 8 | FOCUS Steps 12 input files - ⠏ | 0 | Read and analyse TOXSWA cwa files ⠋ | 1 | Read and analyse TOXSWA cwa files ⠙ | 2 | Read and analyse TOXSWA cwa files ⠹ | 3 | Read and analyse TOXSWA cwa files ⠸ | 4 | Read and analyse TOXSWA cwa files ⠼ | 5 | Read and analyse TOXSWA cwa files ⠴ | 6 | Read and analyse TOXSWA cwa files ⠦ | 7 | Read and analyse TOXSWA cwa files ✔ | 7 | Read and analyse TOXSWA cwa files [6.0 s] + ⠏ | 0 | Read and analyse TOXSWA cwa files ⠋ | 1 | Read and analyse TOXSWA cwa files ⠙ | 2 | Read and analyse TOXSWA cwa files ⠹ | 3 | Read and analyse TOXSWA cwa files ⠸ | 4 | Read and analyse TOXSWA cwa files ⠼ | 5 | Read and analyse TOXSWA cwa files ⠴ | 6 | Read and analyse TOXSWA cwa files ⠦ | 7 | Read and analyse TOXSWA cwa files ✔ | 7 | Read and analyse TOXSWA cwa files [5.5 s] ⠏ | 0 | UK drainage PEC calculations ⠋ | 1 | UK drainage PEC calculations ⠙ | 2 | UK drainage PEC calculations ⠹ | 3 | UK drainage PEC calculations ⠸ | 4 | UK drainage PEC calculations ⠼ | 5 | UK drainage PEC calculations ⠴ | 6 | UK drainage PEC calculations ⠦ | 7 | UK drainage PEC calculations ⠧ | 8 | UK drainage PEC calculations ⠇ | 9 | UK drainage PEC calculations ⠏ | 10 | UK drainage PEC calculations ⠋ | 11 | UK drainage PEC calculations ⠙ | 12 | UK drainage PEC calculations ✔ | 12 | UK drainage PEC calculations ══ Results ═════════════════════════════════════════════════════════════════════════════════════════ -Duration: 83.5 s +Duration: 7.0 s -OK: 282 +OK: 70 Failed: 0 Warnings: 0 Skipped: 0 diff --git a/tests/testthat/test_PEC_soil.R b/tests/testthat/test_PEC_soil.R index 6e4e30b..810389f 100644 --- a/tests/testthat/test_PEC_soil.R +++ b/tests/testthat/test_PEC_soil.R @@ -132,15 +132,21 @@ test_that("Long term FOMC PEC soil from ESCAPE can be reproduced", { # Application of 100 g/ha with 25% interception and FOMC degradation type a fomc_50_a <- PEC_soil(100, interception = 0.25, FOMC = c(alpha = 1, beta = 10), interval = 365, tillage_depth = 20, n_periods = 50) - fomc_long_a <- PEC_soil(100, interception = 0.25, FOMC = c(alpha = 1, beta = 10), - interval = 365, tillage_depth = 20) + expect_warning( + fomc_long_a <- PEC_soil(100, interception = 0.25, FOMC = c(alpha = 1, beta = 10), + interval = 365, tillage_depth = 20), + "pseudo-plateau" + ) # Application of 100 g/ha with 25% interception and FOMC degradation type b # The long term PEC is much lower than when adding FOMC curves for 50 years fomc_50_b <- PEC_soil(100, interception = 0.25, FOMC = c(alpha = 0.5, beta = 20), interval = 365, tillage_depth = 20, n_periods = 50) - fomc_long_b <- PEC_soil(100, interception = 0.25, FOMC = c(alpha = 0.5, beta = 20), - interval = 365, tillage_depth = 20) + expect_warning( + fomc_long_b <- PEC_soil(100, interception = 0.25, FOMC = c(alpha = 0.5, beta = 20), + interval = 365, tillage_depth = 20), + "pseudo-plateau" + ) expect_true(fomc_50_b > fomc_long_b) diff --git a/tests/testthat/test_exposit.R b/tests/testthat/test_exposit.R index 667b4ee..f6a2de4 100644 --- a/tests/testthat/test_exposit.R +++ b/tests/testthat/test_exposit.R @@ -1,25 +1,75 @@ library(pfm) -context("Exposit runoff calculations") +context("Exposit calculations") +# Expected results are from the Exposit 3.02, downloaded 2019-02-15 -test_that("Runoff PECsw are as in Exposit 3.01", { - # Expected results are from the Exposit 3.01, downloaded 2017-10-27 +test_that("Runoff PECsw are as in Exposit 3.02", { + # 100 g/ha, Koc = 1000 L/kg, DT50 = 1000 days + res_exposit_1 <- data.frame( + runoff = c(183.62, 110.17, 73.45, 36.72), + erosion = c(19.96, 11.98, 2.99, 1.00), + PEC_dissolved = c(0.71, 0.61, 0.52, 0.37), + PEC_total = c(0.78, 0.68, 0.55, 0.38)) + + res_1 <- PEC_sw_exposit_runoff(100, Koc = 1000, DT50 = 1000) + res_pfm_1 <- data.frame( + runoff = round(1000 * res_1$runoff["dissolved"], 2), + erosion = round(1000 * res_1$runoff["bound"], 2), + PEC_dissolved = round(res_1$PEC_sw_runoff, 2)["dissolved"], + PEC_total = round(res_1$PEC_sw_runoff["dissolved"] + res_1$PEC_sw_runoff["bound"], 2)) + expect_equivalent(res_exposit_1, res_pfm_1) + + # 10 g/ha, Koc = 300000 L/kg, DT50 = 10 days + res_exposit_2 <- data.frame( + runoff = c(0.08, 0.05, 0.03, 0.02), + erosion = c(36.63, 21.98, 5.49, 1.83), + PEC_dissolved = c(0, 0, 0, 0), + PEC_total = c(0.14, 0.12, 0.04, 0.02)) + res_2 <- PEC_sw_exposit_runoff(10, Koc = 300000, DT50 = 10) + res_pfm_2 <- data.frame( + runoff = round(1000 * res_2$runoff["dissolved"], 2), + erosion = round(1000 * res_2$runoff["bound"], 2), + PEC_dissolved = round(res_2$PEC_sw_runoff, 2)["dissolved"], + PEC_total = round(res_2$PEC_sw_runoff["dissolved"] + res_2$PEC_sw_runoff["bound"], 2)) + + expect_equivalent(res_exposit_2, res_pfm_2) + + # 200 g/ha, Koc = 30 L/kg, DT50 = 100 days + res_exposit_3 <- data.frame( + runoff = c(295.78, 177.47, 118.31, 59.16), + erosion = rep(0.00, 4), + PEC_dissolved = c(1.14, 0.99, 0.85, 0.59), + PEC_total = c(1.14, 0.99, 0.85, 0.59)) + + res_3 <- PEC_sw_exposit_runoff(200, Koc = 30, DT50 = 100) + res_pfm_3 <- data.frame( + runoff = round(1000 * res_3$runoff["dissolved"], 2), + erosion = round(1000 * res_3$runoff["bound"], 2), + PEC_dissolved = round(res_3$PEC_sw_runoff, 2)["dissolved"], + PEC_total = round(res_3$PEC_sw_runoff["dissolved"] + res_3$PEC_sw_runoff["bound"], 2)) + + expect_equivalent(res_exposit_3, res_pfm_3) +}) + +test_that("Drainage PECsw are as in Exposit 3.02", { # 100 g/ha, Koc = 1000 L/kg, DT50 = 1000 days - PEC_spreadsheet_1 <- data.frame(dissolved = c(0.706, 0.612, 0.525, 0.367), - total = c(0.783, 0.679, 0.546, 0.377)) + res_exposit_1 <- c(spring = 0.02, autumn = 0.05) - PEC_pfm_1 <- round(PEC_sw_exposit_runoff(100, Koc = 1000, DT50 = 1000)$PEC_sw_runoff, 3)[c("dissolved", "total")] - expect_equivalent(PEC_spreadsheet_1, PEC_pfm_1) + res_1 <- PEC_sw_exposit_drainage(100, Koc = 1000, DT50 = 1000) + res_pfm_1 <- round(res_1$PEC_sw_drainage, 2) + expect_equivalent(res_exposit_1, res_pfm_1) # 10 g/ha, Koc = 300000 L/kg, DT50 = 10 days - PEC_spreadsheet_2 <- data.frame(dissolved = c(0, 0, 0, 0), - total = c(0.141, 0.122, 0.039, 0.018)) - PEC_pfm_2 <- round(PEC_sw_exposit_runoff(10, Koc = 300000, DT50 = 10)$PEC_sw_runoff, 3)[c("dissolved", "total")] - expect_equivalent(PEC_spreadsheet_2, PEC_pfm_2) + res_exposit_2 <- c(spring = 0.00, autumn = 0.00) + + res_2 <- PEC_sw_exposit_drainage(10, Koc = 300000, DT50 = 10) + res_pfm_2 <- round(res_2$PEC_sw_drainage, 2) + expect_equivalent(res_exposit_2, res_pfm_2) # 200 g/ha, Koc = 30 L/kg, DT50 = 100 days - PEC_spreadsheet_3 <- data.frame(dissolved = c(1.138, 0.986, 0.845, 0.592), - total = c(1.138, 0.986, 0.845, 0.592)) - PEC_pfm_3 <- round(PEC_sw_exposit_runoff(200, Koc = 30, DT50 = 100)$PEC_sw_runoff, 3)[c("dissolved", "total")] - expect_equivalent(PEC_spreadsheet_3, PEC_pfm_3) + res_exposit_3 <- c(spring = 0.61, autumn = 1.88) + + res_3 <- PEC_sw_exposit_drainage(200, Koc = 30, DT50 = 100) + res_pfm_3 <- round(res_3$PEC_sw_drainage, 2) + expect_equivalent(res_exposit_3, res_pfm_3) }) -- cgit v1.2.1