aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--DESCRIPTION2
-rw-r--r--NAMESPACE1
-rw-r--r--R/PEC_sw_exposit_runoff.R105
-rw-r--r--docs/reference/PEC_sw_exposit_drainage.html239
-rw-r--r--docs/reference/PEC_sw_exposit_runoff.html26
-rw-r--r--docs/reference/perc_runoff_exposit.html4
-rw-r--r--docs/reference/perc_runoff_reduction_exposit.html6
-rw-r--r--docs/reference/pesticide.txt4
-rw-r--r--man/PEC_sw_exposit_drainage.Rd60
-rw-r--r--man/PEC_sw_exposit_runoff.Rd18
-rw-r--r--man/perc_runoff_exposit.Rd4
-rw-r--r--man/perc_runoff_reduction_exposit.Rd4
-rw-r--r--test.log12
-rw-r--r--tests/testthat/test_PEC_soil.R14
-rw-r--r--tests/testthat/test_exposit.R80
16 files changed, 518 insertions, 67 deletions
diff --git a/ChangeLog b/ChangeLog
index 73f709a..d019be0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+commit e5a077e28153f6494c99d6945b8b1bd239464609
+Author: Johannes Ranke <jranke@uni-bremen.de>
+Date: 2019-02-08 15:25:19 +0100
+
+ Make SSLRC and PEC drainage UK accept NA for Koc
+
commit b935273d651301b271e0cb66bf36c2bbc1d15b32
Author: Johannes Ranke <jranke@uni-bremen.de>
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 @@
+<!-- Generated by pkgdown: do not edit by hand -->
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+<meta http-equiv="X-UA-Compatible" content="IE=edge">
+<meta name="viewport" content="width=device-width, initial-scale=1.0">
+
+<title>Calculate PEC surface water due to drainage as in Exposit 3 — PEC_sw_exposit_drainage • pfm</title>
+
+<!-- jquery -->
+<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
+<!-- Bootstrap -->
+
+<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha256-916EbMg70RQy9LHiGkXzG8hSg9EdNy97GazNG/aiY1w=" crossorigin="anonymous" />
+<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
+
+<!-- Font Awesome icons -->
+<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
+
+<!-- clipboard.js -->
+<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script>
+
+<!-- sticky kit -->
+<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script>
+
+<!-- pkgdown -->
+<link href="../pkgdown.css" rel="stylesheet">
+<script src="../pkgdown.js"></script>
+
+
+
+<meta property="og:title" content="Calculate PEC surface water due to drainage as in Exposit 3 — PEC_sw_exposit_drainage" />
+
+<meta property="og:description" content="This is a reimplementation of the calculation described in the Exposit 3.02 spreadsheet file,
+in the worksheet &quot;Konzept Drainage&quot;. Although there are four groups of
+compounds (&quot;Gefährdungsgruppen&quot;), 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." />
+<meta name="twitter:card" content="summary" />
+
+
+
+<!-- mathjax -->
+<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
+<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script>
+
+<!--[if lt IE 9]>
+<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
+<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
+<![endif]-->
+
+
+ </head>
+
+ <body>
+ <div class="container template-reference-topic">
+ <header>
+ <div class="navbar navbar-default navbar-fixed-top" role="navigation">
+ <div class="container">
+ <div class="navbar-header">
+ <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
+ <span class="sr-only">Toggle navigation</span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ </button>
+ <span class="navbar-brand">
+ <a class="navbar-link" href="../index.html">pfm</a>
+ <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.5.3</span>
+ </span>
+ </div>
+
+ <div id="navbar" class="navbar-collapse collapse">
+ <ul class="nav navbar-nav">
+ <li>
+ <a href="../index.html">
+ <span class="fa fa-home fa-lg"></span>
+
+ </a>
+</li>
+<li>
+ <a href="../reference/index.html">Reference</a>
+</li>
+ </ul>
+
+ <ul class="nav navbar-nav navbar-right">
+ <li>
+ <a href="https://github.com/jranke/pfm">
+ <span class="fa fa-github fa-lg"></span>
+
+ </a>
+</li>
+ </ul>
+
+ </div><!--/.nav-collapse -->
+ </div><!--/.container -->
+</div><!--/.navbar -->
+
+
+ </header>
+
+<div class="row">
+ <div class="col-md-9 contents">
+ <div class="page-header">
+ <h1>Calculate PEC surface water due to drainage as in Exposit 3</h1>
+ <small class="dont-index">Source: <a href='https://github.com/jranke/pfm/blob/master/R/PEC_sw_exposit_runoff.R'><code>R/PEC_sw_exposit_runoff.R</code></a></small>
+ <div class="hidden name"><code>PEC_sw_exposit_drainage.Rd</code></div>
+ </div>
+
+ <div class="ref-description">
+
+ <p>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.</p>
+
+ </div>
+
+ <pre class="usage"><span class='fu'>PEC_sw_exposit_drainage</span>(<span class='no'>rate</span>, <span class='kw'>interception</span> <span class='kw'>=</span> <span class='fl'>0</span>, <span class='kw'>Koc</span> <span class='kw'>=</span> <span class='fl'>NA</span>,
+ <span class='kw'>mobility</span> <span class='kw'>=</span> <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/c'>c</a></span>(<span class='fl'>NA</span>, <span class='st'>"low"</span>, <span class='st'>"high"</span>), <span class='kw'>DT50</span> <span class='kw'>=</span> <span class='fl'>Inf</span>, <span class='kw'>t_drainage</span> <span class='kw'>=</span> <span class='fl'>3</span>,
+ <span class='kw'>V_ditch</span> <span class='kw'>=</span> <span class='fl'>30</span>, <span class='kw'>V_drainage</span> <span class='kw'>=</span> <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/c'>c</a></span>(<span class='kw'>spring</span> <span class='kw'>=</span> <span class='fl'>10</span>, <span class='kw'>autumn</span> <span class='kw'>=</span> <span class='fl'>100</span>),
+ <span class='kw'>dilution</span> <span class='kw'>=</span> <span class='fl'>2</span>)</pre>
+
+ <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
+ <table class="ref-arguments">
+ <colgroup><col class="name" /><col class="desc" /></colgroup>
+ <tr>
+ <th>rate</th>
+ <td><p>The application rate in g/ha</p></td>
+ </tr>
+ <tr>
+ <th>interception</th>
+ <td><p>The fraction intercepted by the crop</p></td>
+ </tr>
+ <tr>
+ <th>Koc</th>
+ <td><p>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 &gt;&gt; 500.</p></td>
+ </tr>
+ <tr>
+ <th>mobility</th>
+ <td><p>Overrides what is determined from the Koc.</p></td>
+ </tr>
+ <tr>
+ <th>DT50</th>
+ <td><p>The soil half-life in days</p></td>
+ </tr>
+ <tr>
+ <th>t_drainage</th>
+ <td><p>The time between application and the drainage event, where degradation occurs, in days</p></td>
+ </tr>
+ <tr>
+ <th>V_ditch</th>
+ <td><p>The volume of the ditch is assumed to be 1 m * 100 m * 30 cm = 30 m3</p></td>
+ </tr>
+ <tr>
+ <th>V_drainage</th>
+ <td><p>The drainage volume, equivalent to 1 mm precipitation on 1 ha for spring/summer or 10 mm for
+autumn/winter/early spring.</p></td>
+ </tr>
+ <tr>
+ <th>dilution</th>
+ <td><p>The dilution factor</p></td>
+ </tr>
+ </table>
+
+ <h2 class="hasAnchor" id="source"><a class="anchor" href="#source"></a>Source</h2>
+
+ <p>Excel 3.02 spreadsheet available from
+ <a href='https://www.bvl.bund.de/DE/04_Pflanzenschutzmittel/03_Antragsteller/04_Zulassungsverfahren/07_Naturhaushalt/psm_naturhaush_node.html#doc1400590bodyText3'>https://www.bvl.bund.de/DE/04_Pflanzenschutzmittel/03_Antragsteller/04_Zulassungsverfahren/07_Naturhaushalt/psm_naturhaush_node.html#doc1400590bodyText3</a></p>
+
+ <h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
+
+ <p>A list containing the following components</p><dl class='dl-horizontal'>
+ <dt>perc_runoff</dt><dd><p>The runoff percentages for dissolved and bound substance</p></dd>
+ <dt>runoff</dt><dd><p>A matrix containing dissolved and bound input for the different distances</p></dd>
+ <dt>PEC_sw_runoff</dt><dd><p>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.</p></dd>
+ </dl>
+
+
+ <h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2>
+
+ <div class='dont-index'><p><code><a href='perc_runoff_exposit.html'>perc_runoff_exposit</a></code> for runoff loss percentages and <code><a href='perc_runoff_reduction_exposit.html'>perc_runoff_reduction_exposit</a></code> for runoff reduction percentages used</p></div>
+
+
+ <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
+ <pre class="examples"><div class='input'> <span class='fu'>PEC_sw_exposit_drainage</span>(<span class='fl'>500</span>, <span class='kw'>Koc</span> <span class='kw'>=</span> <span class='fl'>150</span>)</div><div class='output co'>#&gt; $perc_drainage_total
+#&gt; spring autumn
+#&gt; 0.2 1.0
+#&gt;
+#&gt; $perc_peak
+#&gt; spring autumn
+#&gt; 12.5 25.0
+#&gt;
+#&gt; $PEC_sw_drainage
+#&gt; spring autumn
+#&gt; 1.562500 4.807692
+#&gt; </div></pre>
+ </div>
+ <div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
+ <h2>Contents</h2>
+ <ul class="nav nav-pills nav-stacked">
+ <li><a href="#arguments">Arguments</a></li>
+
+ <li><a href="#source">Source</a></li>
+
+ <li><a href="#value">Value</a></li>
+
+ <li><a href="#see-also">See also</a></li>
+
+ <li><a href="#examples">Examples</a></li>
+ </ul>
+
+ </div>
+</div>
+
+ <footer>
+ <div class="copyright">
+ <p>Developed by Johannes Ranke.</p>
+</div>
+
+<div class="pkgdown">
+ <p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.3.0.</p>
+</div>
+ </footer>
+ </div>
+
+
+
+ </body>
+</html>
+
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 @@
<meta property="og:title" content="Calculate PEC surface water due to runoff and erosion as in Exposit 3 — PEC_sw_exposit_runoff" />
-<meta property="og:description" content="This is a reimplementation of the calculation described in the Exposit 3.01 spreadsheet file,
-in the worksheet &quot;Konzept Runoff&quot;. Calculation of sediment PEC values is not implemented." />
+<meta property="og:description" content="This is a reimplementation of the calculation described in the Exposit 3.02 spreadsheet file,
+in the worksheet &quot;Konzept Runoff&quot;." />
<meta name="twitter:card" content="summary" />
@@ -107,14 +107,14 @@ in the worksheet &quot;Konzept Runoff&quot;. Calculation of sediment PEC values
<div class="ref-description">
- <p>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.</p>
+ <p>This is a reimplementation of the calculation described in the Exposit 3.02 spreadsheet file,
+in the worksheet "Konzept Runoff".</p>
</div>
- <pre class="usage"><span class='fu'>PEC_sw_exposit_runoff</span>(<span class='no'>rate</span>, <span class='no'>Koc</span>, <span class='kw'>DT50</span> <span class='kw'>=</span> <span class='fl'>Inf</span>, <span class='kw'>t_runoff</span> <span class='kw'>=</span> <span class='fl'>3</span>,
- <span class='kw'>exposit_reduction_version</span> <span class='kw'>=</span> <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/c'>c</a></span>(<span class='st'>"3.01"</span>, <span class='st'>"2.0"</span>), <span class='kw'>V_ditch</span> <span class='kw'>=</span> <span class='fl'>30</span>,
- <span class='kw'>V_event</span> <span class='kw'>=</span> <span class='fl'>100</span>)</pre>
+ <pre class="usage"><span class='fu'>PEC_sw_exposit_runoff</span>(<span class='no'>rate</span>, <span class='kw'>interception</span> <span class='kw'>=</span> <span class='fl'>0</span>, <span class='no'>Koc</span>, <span class='kw'>DT50</span> <span class='kw'>=</span> <span class='fl'>Inf</span>,
+ <span class='kw'>t_runoff</span> <span class='kw'>=</span> <span class='fl'>3</span>, <span class='kw'>exposit_reduction_version</span> <span class='kw'>=</span> <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/c'>c</a></span>(<span class='st'>"3.02"</span>, <span class='st'>"2.0"</span>),
+ <span class='kw'>V_ditch</span> <span class='kw'>=</span> <span class='fl'>30</span>, <span class='kw'>V_event</span> <span class='kw'>=</span> <span class='fl'>100</span>, <span class='kw'>dilution</span> <span class='kw'>=</span> <span class='fl'>2</span>)</pre>
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
<table class="ref-arguments">
@@ -124,6 +124,10 @@ in the worksheet "Konzept Runoff". Calculation of sediment PEC values is not imp
<td><p>The application rate in g/ha</p></td>
</tr>
<tr>
+ <th>interception</th>
+ <td><p>The fraction intercepted by the crop</p></td>
+ </tr>
+ <tr>
<th>Koc</th>
<td><p>The sorption coefficient to soil organic carbon</p></td>
</tr>
@@ -147,11 +151,15 @@ in the worksheet "Konzept Runoff". Calculation of sediment PEC values is not imp
<th>V_event</th>
<td><p>The unreduced runoff volume, equivalent to 10 mm precipitation on 1 ha</p></td>
</tr>
+ <tr>
+ <th>dilution</th>
+ <td><p>The dilution factor</p></td>
+ </tr>
</table>
<h2 class="hasAnchor" id="source"><a class="anchor" href="#source"></a>Source</h2>
- <p>Excel 3.01 spreadsheet available from
+ <p>Excel 3.02 spreadsheet available from
<a href='https://www.bvl.bund.de/DE/04_Pflanzenschutzmittel/03_Antragsteller/04_Zulassungsverfahren/07_Naturhaushalt/psm_naturhaush_node.html#doc1400590bodyText3'>https://www.bvl.bund.de/DE/04_Pflanzenschutzmittel/03_Antragsteller/04_Zulassungsverfahren/07_Naturhaushalt/psm_naturhaush_node.html#doc1400590bodyText3</a></p>
<h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
@@ -170,7 +178,7 @@ in the worksheet "Konzept Runoff". Calculation of sediment PEC values is not imp
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
- <pre class="examples"><div class='input'> <span class='fu'>PEC_sw_exposit_runoff</span>(<span class='fl'>500</span>, <span class='fl'>150</span>)</div><div class='output co'>#&gt; $perc_runoff
+ <pre class="examples"><div class='input'> <span class='fu'>PEC_sw_exposit_runoff</span>(<span class='fl'>500</span>, <span class='kw'>Koc</span> <span class='kw'>=</span> <span class='fl'>150</span>)</div><div class='output co'>#&gt; $perc_runoff
#&gt; dissolved bound
#&gt; 0.248 0.001
#&gt;
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 @@
<h2 class="hasAnchor" id="source"><a class="anchor" href="#source"></a>Source</h2>
- <p>Excel 3.01 spreadsheet available from
- <a href='https://www.bvl.bund.de/DE/04_Pflanzenschutzmittel/03_Antragsteller/04_Zulassungsverfahren/07_Naturhaushalt/psm_naturhaush_node.html#doc1400590bodyText3'>https://www.bvl.bund.de/DE/04_Pflanzenschutzmittel/03_Antragsteller/04_Zulassungsverfahren/07_Naturhaushalt/psm_naturhaush_node.html#doc1400590bodyText3</a></p>
+ <p>Excel 3.02 spreadsheet available from
+ <a href='https://www.bvl.bund.de/EN/04_PlantProtectionProducts/03_Applicants/04_AuthorisationProcedure/08_Environment/ppp_environment_node.html'>https://www.bvl.bund.de/EN/04_PlantProtectionProducts/03_Applicants/04_AuthorisationProcedure/08_Environment/ppp_environment_node.html</a></p>
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
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.</p><dl class='dl-horizontal'>
<h2 class="hasAnchor" id="source"><a class="anchor" href="#source"></a>Source</h2>
- <p>Excel 3.01 spreadsheet available from
- <a href='https://www.bvl.bund.de/DE/04_Pflanzenschutzmittel/03_Antragsteller/04_Zulassungsverfahren/07_Naturhaushalt/psm_naturhaush_node.html#doc1400590bodyText3'>https://www.bvl.bund.de/DE/04_Pflanzenschutzmittel/03_Antragsteller/04_Zulassungsverfahren/07_Naturhaushalt/psm_naturhaush_node.html#doc1400590bodyText3</a></p>
+ <p>Excel 3.02 spreadsheet available from
+ <a href='https://www.bvl.bund.de/EN/04_PlantProtectionProducts/03_Applicants/04_AuthorisationProcedure/08_Environment/ppp_environment_node.html'>https://www.bvl.bund.de/EN/04_PlantProtectionProducts/03_Applicants/04_AuthorisationProcedure/08_Environment/ppp_environment_node.html</a></p>
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
- <pre class="examples"><div class='input'><span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/print'>print</a></span>(<span class='no'>perc_runoff_reduction_exposit</span>)</div><div class='output co'>#&gt; $`3.01`
+ <pre class="examples"><div class='input'><span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/print'>print</a></span>(<span class='no'>perc_runoff_reduction_exposit</span>)</div><div class='output co'>#&gt; $`3.02`
#&gt; dissolved bound
#&gt; No buffer 0 0
#&gt; 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)
})

Contact - Imprint