From 206160e276689d1ecac3285bdcfc21cdcc502251 Mon Sep 17 00:00:00 2001 From: Kristine Karstens Date: Thu, 21 Nov 2024 15:10:25 +0100 Subject: [PATCH] move all grassland_apr22 related inputs to be executed only with the dev flag '+grasslandRealization' --- .buildlibrary | 2 +- CITATION.cff | 4 ++-- DESCRIPTION | 4 ++-- R/fullCELLULARMAGPIE.R | 52 +++++++++++++++++++++--------------------- README.md | 6 ++--- 5 files changed, 34 insertions(+), 34 deletions(-) diff --git a/.buildlibrary b/.buildlibrary index 042fbad2..f08a9ce1 100644 --- a/.buildlibrary +++ b/.buildlibrary @@ -1,4 +1,4 @@ -ValidationKey: '30561202' +ValidationKey: '30673440' AutocreateReadme: yes AcceptedWarnings: - 'Warning: package .* was built under R version' diff --git a/CITATION.cff b/CITATION.cff index 7fc8c84a..249f1156 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: 'mrmagpie: madrat based MAgPIE Input Data Library' -version: 1.52.6 -date-released: '2024-10-31' +version: 1.53.0 +date-released: '2024-11-21' abstract: Provides functions for MAgPIE country and cellular input data generation. authors: - family-names: Karstens diff --git a/DESCRIPTION b/DESCRIPTION index be6bb198..2195061a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Type: Package Package: mrmagpie Title: madrat based MAgPIE Input Data Library -Version: 1.52.6 -Date: 2024-10-31 +Version: 1.53.0 +Date: 2024-11-21 Authors@R: c( person("Kristine", "Karstens", , "karstens@pik-potsdam.de", role = c("aut", "cre")), person("Jan Philipp", "Dietrich", , "dietrich@pik-potsdam.de", role = "aut"), diff --git a/R/fullCELLULARMAGPIE.R b/R/fullCELLULARMAGPIE.R index b6ce08c8..4a3b4cb6 100644 --- a/R/fullCELLULARMAGPIE.R +++ b/R/fullCELLULARMAGPIE.R @@ -257,26 +257,28 @@ fullCELLULARMAGPIE <- function(rev = numeric_version("0.1"), dev = "", round = roundArea, file = paste0("SNVTargetCropland_", ctype, ".mz")) # 31 past - calcOutput("GrasslandBiomass", round = 3, file = "f31_grass_bio_hist.cs3", - cells = cells, aggregate = "region") - calcOutput("LUH2v2", aggregate = "cluster", landuse_types = "LUH2v2", - cellular = TRUE, cells = cells, - file = paste0("f31_LUH2v2_", ctype, ".mz")) - # hard coded climate scenario for harmonization of data - calcOutput("GrasslandsYields", lpjml = lpjml[["grass"]], climatetype = "MRI-ESM2-0:ssp126", - subtype = "/co2/Nreturn0p5", # nolint - lsu_levels = c(seq(0, 2.2, 0.2), 2.5), past_mngmt = "mdef", - file = paste0("f31_grassl_yld_", ctype, ".mz"), years = magYears, - cells = cells, aggregate = "cluster") - calcOutput("GrasslandsYields", lpjml = lpjml[["grass"]], climatetype = "MRI-ESM2-0:ssp126", - subtype = "/co2/Nreturn0p5", # nolint - lsu_levels = c(seq(0, 2.2, 0.2), 2.5), past_mngmt = "mdef", - file = paste0("f31_grassl_yld.mz"), years = magYears, - cells = cells, aggregate = FALSE) - calcOutput("MaxPastureSuit", climatetype = climatetype, lpjml = lpjml[["natveg"]], cells = cells, - file = paste0("f31_max_managed_pasture_", ctype, ".mz"), years = magYears, aggregate = "cluster") - calcOutput("MaxPastureSuit", climatetype = climatetype, lpjml = lpjml[["natveg"]], cells = cells, - file = "f31_max_managed_pasture.mz", years = magYears, aggregate = FALSE) + if (grepl("+grasslandRealization", dev)) { + calcOutput("GrasslandBiomass", round = 3, file = "f31_grass_bio_hist.cs3", + cells = cells, aggregate = "region") + calcOutput("LUH2v2", aggregate = "cluster", landuse_types = "LUH2v2", + cellular = TRUE, cells = cells, + file = paste0("f31_LUH2v2_", ctype, ".mz")) + # hard coded climate scenario for harmonization of data + calcOutput("GrasslandsYields", lpjml = lpjml[["grass"]], climatetype = "MRI-ESM2-0:ssp126", + subtype = "/co2/Nreturn0p5", # nolint + lsu_levels = c(seq(0, 2.2, 0.2), 2.5), past_mngmt = "mdef", + file = paste0("f31_grassl_yld_", ctype, ".mz"), years = magYears, + cells = cells, aggregate = "cluster") + calcOutput("GrasslandsYields", lpjml = lpjml[["grass"]], climatetype = "MRI-ESM2-0:ssp126", + subtype = "/co2/Nreturn0p5", # nolint + lsu_levels = c(seq(0, 2.2, 0.2), 2.5), past_mngmt = "mdef", + file = paste0("f31_grassl_yld.mz"), years = magYears, + cells = cells, aggregate = FALSE) + calcOutput("MaxPastureSuit", climatetype = climatetype, lpjml = lpjml[["natveg"]], cells = cells, + file = paste0("f31_max_managed_pasture_", ctype, ".mz"), years = magYears, aggregate = "cluster") + calcOutput("MaxPastureSuit", climatetype = climatetype, lpjml = lpjml[["natveg"]], cells = cells, + file = "f31_max_managed_pasture.mz", years = magYears, aggregate = FALSE) + } if (grepl("+PastrMngtLevels", dev)) { calcOutput("PastrMngtLevels", climatetype = paste0("MRI-ESM2-0", ":", climatescen), @@ -340,14 +342,12 @@ fullCELLULARMAGPIE <- function(rev = numeric_version("0.1"), dev = "", file = paste0("forestageclasses_", ctype, ".mz")) calcOutput("PotentialForestArea", - refData = "lpj", cells = cells, lpjml = lpjml, climatetype = climatetype, years = lpjYears, - aggregate = FALSE, round = roundArea, file = "pot_forest_area_0.5.mz" - ) + refData = "lpj", cells = cells, lpjml = lpjml, climatetype = climatetype, years = lpjYears, + aggregate = FALSE, round = roundArea, file = "pot_forest_area_0.5.mz") calcOutput("PotentialForestArea", - refData = "lpj", cells = cells, lpjml = lpjml, climatetype = climatetype, years = lpjYears, - aggregate = "cluster", round = roundArea, file = paste0("pot_forest_area_", ctype, ".mz") - ) + refData = "lpj", cells = cells, lpjml = lpjml, climatetype = climatetype, years = lpjYears, + aggregate = "cluster", round = roundArea, file = paste0("pot_forest_area_", ctype, ".mz")) # 37 labour prod calcOutput("LabourProdImpactEmu", aggregate = "cluster", cells = cells, subtype = "impact", diff --git a/README.md b/README.md index 969ae599..da667c72 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # madrat based MAgPIE Input Data Library -R package **mrmagpie**, version **1.52.6** +R package **mrmagpie**, version **1.53.0** [![CRAN status](https://www.r-pkg.org/badges/version/mrmagpie)](https://cran.r-project.org/package=mrmagpie) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.4319612.svg)](https://doi.org/10.5281/zenodo.4319612) [![R build status](https://github.com/pik-piam/mrmagpie/workflows/check/badge.svg)](https://github.com/pik-piam/mrmagpie/actions) [![codecov](https://codecov.io/gh/pik-piam/mrmagpie/branch/master/graph/badge.svg)](https://app.codecov.io/gh/pik-piam/mrmagpie) [![r-universe](https://pik-piam.r-universe.dev/badges/mrmagpie)](https://pik-piam.r-universe.dev/builds) @@ -39,7 +39,7 @@ In case of questions / problems please contact Kristine Karstens . +Karstens K, Dietrich J, Chen D, Windisch M, Alves M, Beier F, Köberle A, v. Jeetze P, Mishra A, Humpenoeder F, Sauer P (2024). _mrmagpie: madrat based MAgPIE Input Data Library_. doi:10.5281/zenodo.4319612 , R package version 1.53.0, . A BibTeX entry for LaTeX users is @@ -48,7 +48,7 @@ A BibTeX entry for LaTeX users is title = {mrmagpie: madrat based MAgPIE Input Data Library}, author = {Kristine Karstens and Jan Philipp Dietrich and David Chen and Michael Windisch and Marcos Alves and Felicitas Beier and Alexandre Köberle and Patrick {v. Jeetze} and Abhijeet Mishra and Florian Humpenoeder and Pascal Sauer}, year = {2024}, - note = {R package version 1.52.6}, + note = {R package version 1.53.0}, doi = {10.5281/zenodo.4319612}, url = {https://github.com/pik-piam/mrmagpie}, }