diff options
author | Johannes Ranke <jranke@uni-bremen.de> | 2018-09-22 09:54:59 +0200 |
---|---|---|
committer | Johannes Ranke <jranke@uni-bremen.de> | 2018-09-22 09:54:59 +0200 |
commit | 8452daa2015aa645dcc1eca3ec2bba5726603e4e (patch) | |
tree | 579e7f36c1ac234ddb0cbdc7cf359d784be5e779 /tests/testthat | |
parent | ff7e67a4d3415419dd3f712ef1af7467ebf65508 (diff) |
Add test and update docs
Diffstat (limited to 'tests/testthat')
-rw-r--r-- | tests/testthat/test_PEC_soil.R | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/testthat/test_PEC_soil.R b/tests/testthat/test_PEC_soil.R index 34b4749..6e4e30b 100644 --- a/tests/testthat/test_PEC_soil.R +++ b/tests/testthat/test_PEC_soil.R @@ -127,3 +127,23 @@ test_that("Tier 1 PEC soil example for Pesticide F in EFSA guidance from 2015 ca expect_equivalent(round(results_pfm, 2), results_guidance) expect_equivalent(round(results_pfm_pw, 2), results_guidance_pw) }) + +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) + + # 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_true(fomc_50_b > fomc_long_b) + + # The benchmark results were obtained with ESCAPE + expect_equivalent(round(fomc_long_b, 4), 0.1424) +}) |