From 52c50bd47701384c5dd01808bde7fad63dff7b08 Mon Sep 17 00:00:00 2001 From: Felicitas Date: Mon, 30 Sep 2024 18:52:23 +0200 Subject: [PATCH] correct no irrig req correction for areas that are currently multiple cropped and irrigated in calcPotMulticroppingShare --- .buildlibrary | 2 +- CITATION.cff | 4 ++-- DESCRIPTION | 4 ++-- R/calcPotMulticroppingShare.R | 7 ++++++- README.md | 6 +++--- 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.buildlibrary b/.buildlibrary index 8d9009d..ed9fc51 100644 --- a/.buildlibrary +++ b/.buildlibrary @@ -1,4 +1,4 @@ -ValidationKey: '22669794' +ValidationKey: '22695460' AcceptedWarnings: - 'Warning: package ''.*'' was built under R version' - 'Warning: namespace ''.*'' is not available and has been replaced' diff --git a/CITATION.cff b/CITATION.cff index 459ec45..118849a 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -2,8 +2,8 @@ cff-version: 1.2.0 message: If you use this software, please cite it using the metadata from this file. type: software title: 'mrwater: madrat based MAgPIE water Input Data Library' -version: 1.13.4 -date-released: '2024-09-25' +version: 1.13.5 +date-released: '2024-09-30' abstract: Provides functions for MAgPIE cellular input data generation and stand-alone water calculations. authors: diff --git a/DESCRIPTION b/DESCRIPTION index 8d22b30..2c95d89 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,11 +1,11 @@ Type: Package Package: mrwater Title: madrat based MAgPIE water Input Data Library -Version: 1.13.4 +Version: 1.13.5 URL: https://github.com/pik-piam/mrwater, https: //doi.org/10.5281/zenodo.5801680 License: LGPL-3 | file LICENSE -Date: 2024-09-25 +Date: 2024-09-30 Authors@R: c(person("Felicitas", "Beier", email = "beier@pik-potsdam.de", role = c("aut","cre")), person("Jens", "Heinke", email = "heinke@pik-potsdam.de", role = "aut"), person("Kristine", "Karstens", email = "karstens@pik-potsdam.de", role = "aut"), diff --git a/R/calcPotMulticroppingShare.R b/R/calcPotMulticroppingShare.R index 8f78d8e..2e4b4d9 100644 --- a/R/calcPotMulticroppingShare.R +++ b/R/calcPotMulticroppingShare.R @@ -262,6 +262,9 @@ calcPotMulticroppingShare <- function(scenario, lpjml, climatetype, # Assign the calculated value out[, , "irrigated"] <- potShr + } else { + shrMC <- noReqSecond + shrMC[, , ] <- 0 } # For single cropping case: no areas are suitable for multiple cropping @@ -271,7 +274,9 @@ calcPotMulticroppingShare <- function(scenario, lpjml, climatetype, # Crops that have no irrigation water requirements in second season # are not multiple cropped under irrigated conditions - out[, , "irrigated"][noReqSecond] <- 0 + # unless they are reported to be under irrigated multiple cropping + # and committed agriculture is activated + out[, , "irrigated"][noReqSecond] <- shrMC[noReqSecond] # Checks if (any(is.na(out))) { diff --git a/README.md b/README.md index 3f77317..a097301 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # madrat based MAgPIE water Input Data Library -R package **mrwater**, version **1.13.4** +R package **mrwater**, version **1.13.5** [![CRAN status](https://www.r-pkg.org/badges/version/mrwater)](https://cran.r-project.org/package=mrwater) [![R build status](https://github.com/pik-piam/mrwater/workflows/check/badge.svg)](https://github.com/pik-piam/mrwater/actions) [![codecov](https://codecov.io/gh/pik-piam/mrwater/branch/master/graph/badge.svg)](https://app.codecov.io/gh/pik-piam/mrwater) [![r-universe](https://pik-piam.r-universe.dev/badges/mrwater)](https://pik-piam.r-universe.dev/builds) @@ -50,7 +50,7 @@ In case of questions / problems please contact Felicitas Beier . +Beier F, Heinke J, Karstens K, Bodirsky B, Dietrich J (2024). _mrwater: madrat based MAgPIE water Input Data Library_. R package version 1.13.5, . A BibTeX entry for LaTeX users is @@ -59,7 +59,7 @@ A BibTeX entry for LaTeX users is title = {mrwater: madrat based MAgPIE water Input Data Library}, author = {Felicitas Beier and Jens Heinke and Kristine Karstens and Benjamin Leon Bodirsky and Jan Philipp Dietrich}, year = {2024}, - note = {R package version 1.13.4}, + note = {R package version 1.13.5}, url = {https://github.com/pik-piam/mrwater}, } ```