diff --git a/.buildlibrary b/.buildlibrary index eee1b6b..4ce590e 100644 --- a/.buildlibrary +++ b/.buildlibrary @@ -1,4 +1,4 @@ -ValidationKey: '4390386' +ValidationKey: '4410252' AutocreateReadme: yes AcceptedWarnings: - 'Warning: package ''.*'' was built under R version' diff --git a/CITATION.cff b/CITATION.cff index 3dd6b4e..a84d35f 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -2,7 +2,7 @@ cff-version: 1.2.0 message: If you use this software, please cite it using the metadata from this file. type: software title: 'magpie4: MAgPIE outputs R package for MAgPIE version 4.x' -version: 2.2.1 +version: 2.2.2 date-released: '2024-05-23' abstract: Common output routines for extracting results from the MAgPIE framework (versions 4.x). @@ -65,6 +65,7 @@ authors: - family-names: Vartika given-names: Singh license: LGPL-3.0 +keywords: ~ repository-code: https://github.com/pik-piam/magpie4 doi: 10.5281/zenodo.1158582 diff --git a/DESCRIPTION b/DESCRIPTION index 0ec894e..982c804 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: magpie4 Title: MAgPIE outputs R package for MAgPIE version 4.x -Version: 2.2.1 +Version: 2.2.2 Date: 2024-05-23 Authors@R: c( person("Benjamin Leon", "Bodirsky", , "bodirsky@pik-potsdam.de", role = c("aut", "cre")), diff --git a/R/emisCO2.R b/R/emisCO2.R index 5dbe6ef..197e975 100644 --- a/R/emisCO2.R +++ b/R/emisCO2.R @@ -137,12 +137,11 @@ emisCO2 <- function(gdx, file = NULL, level = "cell", unit = "gas", primforest <- carbonDensities[, , "primforest"] # --- age class carbon densities, excl forestry - ageClassCarbonDensities <- readGDX(gdx, "pm_carbon_density_ac")[, years, ] - secdforest <- ageClassCarbonDensities + secdforest <- readGDX(gdx, "pm_carbon_density_secdforest_ac", "pm_carbon_density_ac", format = list("first_found"))[, years, ] secdforest <- add_dimension(secdforest, dim = 3.1, add = "land", nm = "secdforest") - other <- ageClassCarbonDensities + other <- readGDX(gdx, "pm_carbon_density_other_ac", "pm_carbon_density_ac", format = list("first_found"))[, years, ] other <- add_dimension(other, dim = 3.1, add = "land", nm = "other") # croptreecover <- readGDX(gdx, "p29_carbon_density_ac", react = "silent")[, years, ] @@ -185,7 +184,7 @@ emisCO2 <- function(gdx, file = NULL, level = "cell", unit = "gas", # --- cropland and pasture topsoilCarbonDensities <- readGDX(gdx, "i59_topsoilc_density")[, years, ] # i59, not f59 as in dynamic realization - subsoilCarbonDensities <- readGDX(gdx, "subsoilCarbonDensities")[, years, ] + subsoilCarbonDensities <- readGDX(gdx, "i59_subsoilc_density")[, years, ] cropland[, , "soilc"] <- topsoilCarbonDensities + subsoilCarbonDensities @@ -527,7 +526,7 @@ emisCO2 <- function(gdx, file = NULL, level = "cell", unit = "gas", primforestDisturbanceLoss <- readGDX(gdx, "p35_disturbance_loss_primf") disturbanceLossAcEst <- dimSums(disturbanceLoss, dim = 3) + dimSums(primforestDisturbanceLoss, dim = 3) - recoveredForest <- readGDX(gdx, "p35_recovered_forest") * -1 + recoveredForest <- readGDX(gdx, "p35_maturesecdf","p35_recovered_forest", format = list("first_found")) * -1 regrowthEmisSecdforest <- .regrowth(densityAg = densityAg, area = area, @@ -544,7 +543,7 @@ emisCO2 <- function(gdx, file = NULL, level = "cell", unit = "gas", expansion <- readGDX(gdx, "ov35_other_expansion", select = list(type = "level")) expansion <- .expansionAc(expansion, reduction) - recoveredForest <- readGDX(gdx, "p35_recovered_forest") + recoveredForest <- readGDX(gdx, "p35_maturesecdf","p35_recovered_forest", format = list("first_found")) regrowthEmisOther <- .regrowth(densityAg = densityAg, area = area, diff --git a/README.md b/README.md index b434280..6ada369 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # MAgPIE outputs R package for MAgPIE version 4.x -R package **magpie4**, version **2.2.1** +R package **magpie4**, version **2.2.2** [![CRAN status](https://www.r-pkg.org/badges/version/magpie4)](https://cran.r-project.org/package=magpie4) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1158582.svg)](https://doi.org/10.5281/zenodo.1158582) [![R build status](https://github.com/pik-piam/magpie4/workflows/check/badge.svg)](https://github.com/pik-piam/magpie4/actions) [![codecov](https://codecov.io/gh/pik-piam/magpie4/branch/master/graph/badge.svg)](https://app.codecov.io/gh/pik-piam/magpie4) [![r-universe](https://pik-piam.r-universe.dev/badges/magpie4)](https://pik-piam.r-universe.dev/builds) @@ -39,7 +39,7 @@ In case of questions / problems please contact Benjamin Leon Bodirsky , R package version 2.2.1, . +Bodirsky B, Humpenoeder F, Dietrich J, Stevanovic M, Weindl I, Karstens K, Wang X, Mishra A, Beier F, Breier J, Yalew A, Chen D, Biewald A, Wirth S, von Jeetze P, Leip D, Crawford M, Alves M (2024). _magpie4: MAgPIE outputs R package for MAgPIE version 4.x_. doi:10.5281/zenodo.1158582 , R package version 2.2.2, . A BibTeX entry for LaTeX users is @@ -48,8 +48,8 @@ A BibTeX entry for LaTeX users is title = {magpie4: MAgPIE outputs R package for MAgPIE version 4.x}, author = {Benjamin Leon Bodirsky and Florian Humpenoeder and Jan Philipp Dietrich and Miodrag Stevanovic and Isabelle Weindl and Kristine Karstens and Xiaoxi Wang and Abhijeet Mishra and Felicitas Beier and Jannes Breier and Amsalu Woldie Yalew and David Chen and Anne Biewald and Stephen Wirth and Patrick {von Jeetze} and Debbora Leip and Michael Crawford and Marcos Alves}, year = {2024}, - note = {R package version 2.2.1}, - doi = {10.5281/zenodo.1158582}, + note = {R package version 2.2.2}, url = {https://github.com/pik-piam/magpie4}, + doi = {10.5281/zenodo.1158582}, } ```