diff --git a/.buildlibrary b/.buildlibrary index 68e42bce..f422610e 100644 --- a/.buildlibrary +++ b/.buildlibrary @@ -1,4 +1,4 @@ -ValidationKey: '224695314' +ValidationKey: '224749174' 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 53e5d86b..e1628d77 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: 'remind2: The REMIND R package (2nd generation)' -version: 1.135.8 -date-released: '2024-03-01' +version: 1.135.9 +date-released: '2024-03-04' abstract: Contains the REMIND-specific routines for data and model output manipulation. authors: - family-names: Rodrigues diff --git a/DESCRIPTION b/DESCRIPTION index 66850993..ac4dea6a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Type: Package Package: remind2 Title: The REMIND R package (2nd generation) -Version: 1.135.8 -Date: 2024-03-01 +Version: 1.135.9 +Date: 2024-03-04 Authors@R: c( person("Renato", "Rodrigues", , "renato.rodrigues@pik-potsdam.de", role = c("aut", "cre")), person("Lavinia", "Baumstark", role = "aut"), diff --git a/R/reportEmi.R b/R/reportEmi.R index 9d32b10e..1ca92fbb 100644 --- a/R/reportEmi.R +++ b/R/reportEmi.R @@ -320,12 +320,12 @@ reportEmi <- function(gdx, output = NULL, regionSubsetList = NULL, t = c(seq(200 } # Read-in plastic-related variables - vm_plasticsCarbon <- readGDX(gdx, "vm_plasticsCarbon", field = "l", restore_zeros = FALSE, react = "silent")[,t,] - if (length(vm_plasticsCarbon) == 0) { - vm_plasticsCarbon <- NULL + v37_plasticsCarbon <- readGDX(gdx, "v37_plasticsCarbon", field = "l", restore_zeros = FALSE, react = "silent")[,t,] + if (length(v37_plasticsCarbon) == 0) { + v37_plasticsCarbon <- NULL } - if (!is.null(vm_plasticsCarbon)){ + if (!is.null(v37_plasticsCarbon)){ vm_feedstockEmiUnknownFate <- readGDX(gdx, "vm_feedstockEmiUnknownFate", field = "l", restore_zeros = FALSE, spatial = 2, react = "silent")[,t,] vm_incinerationEmi <- readGDX(gdx, "vm_incinerationEmi", field = "l", restore_zeros = FALSE, @@ -336,8 +336,8 @@ reportEmi <- function(gdx, output = NULL, regionSubsetList = NULL, t = c(seq(200 # create new variable for carbon embedded in non-incinerated plastics: # plastics that do not get incinerated and come from biogenic sources - # or synfuels (regardless of synfuel origin) - if (!is.null(vm_plasticsCarbon)) { + # or synfuels (regardless of syfuel origin) + if (!is.null(v37_plasticsCarbon)) { plastic_CDR <- mselect(vm_nonIncineratedPlastics, all_enty = c(entySEbio, entySEsyn)) } else { plastic_CDR <- collapseDim(vm_co2eq)*0 @@ -483,7 +483,7 @@ reportEmi <- function(gdx, output = NULL, regionSubsetList = NULL, t = c(seq(200 # CO2 emissions from the end-of-life of carbon-bearing products -if (!is.null(vm_plasticsCarbon)) { +if (!is.null(v37_plasticsCarbon)) { out <- mbind(out, setNames(dimSums(vm_feedstockEmiUnknownFate, dim=3)* GtC_2_MtCO2, "Emi|CO2|Energy|Waste|+|Feedstocks unknown fate (Mt CO2/yr)"), @@ -676,7 +676,7 @@ if (!is.null(vm_plasticsCarbon)) { EmiIndSubSec <- pm_emifac.fe.indst * o37_demFeIndSub_woNonEn[, , getNames(pm_emifac.fe.indst)] # calculate demand-side Solids, Liquids and gases emissions (after industry CO2 Capture) - if (!is.null(vm_plasticsCarbon)){ + if (!is.null(v37_plasticsCarbon)){ out <- mbind(out, # solids emissions: direct solids emissions of all sectors - industry CCS of solids @@ -810,7 +810,7 @@ if (!is.null(vm_plasticsCarbon)) { variable = paste0(variable_prefix, .data$variable, variable_postfix)) # if feedstocks are represented in REMIND - if (!is.null(vm_plasticsCarbon)){ + if (!is.null(v37_plasticsCarbon)){ plastic_CDR_SubSec <- add_dimension(plastic_CDR, dim = 3.1, add = 'secInd37', nm = 'chemicals') out <- mbind( @@ -1376,19 +1376,19 @@ if (!is.null(vm_plasticsCarbon)) { ) # add materials-related carbon management variables only if available - if (!is.null(vm_plasticsCarbon)){ + if (!is.null(v37_plasticsCarbon)){ # carbon management: flows of carbon going into materials out <- mbind(out, # carbon in plastics - setNames(dimSums(vm_plasticsCarbon, dim = 3) * GtC_2_MtCO2, + setNames(dimSums(v37_plasticsCarbon, dim = 3) * GtC_2_MtCO2, "Carbon Management|Materials|+|Plastics (Mt CO2/yr)"), # carbon in carbon fibres #setNames(dimSums( carbonfibersVariable * GtC_2_MtCO2, # "Carbon Management|Materials|+|Carbon fibers (Mt CO2/yr)"), # total co2 in materials # other materials need to be added here - setNames(dimSums(vm_plasticsCarbon, dim = 3) * GtC_2_MtCO2, + setNames(dimSums(v37_plasticsCarbon, dim = 3) * GtC_2_MtCO2, "Carbon Management|Materials (Mt CO2/yr)") ) @@ -1407,11 +1407,11 @@ if (!is.null(vm_plasticsCarbon)) { # # carbon management: origin of plastics out <- mbind(out, - setNames(dimSums(mselect(vm_plasticsCarbon, all_enty=c("seliqsyn","sesosyn","segasyn")))* GtC_2_MtCO2, + setNames(dimSums(mselect(v37_plasticsCarbon, all_enty=c("seliqsyn","sesosyn","segasyn")))* GtC_2_MtCO2, "Carbon Management|Materials|Plastics|+|Synfuels (Mt CO2/yr)"), - setNames(dimSums(mselect(vm_plasticsCarbon, all_enty=c("seliqbio","sesobio","segabio")))* GtC_2_MtCO2, + setNames(dimSums(mselect(v37_plasticsCarbon, all_enty=c("seliqbio","sesobio","segabio")))* GtC_2_MtCO2, "Carbon Management|Materials|Plastics|+|Biomass (Mt CO2/yr)"), - setNames(dimSums(mselect(vm_plasticsCarbon, all_enty=c("seliqfos","sesofos","segafos")))* GtC_2_MtCO2, + setNames(dimSums(mselect(v37_plasticsCarbon, all_enty=c("seliqfos","sesofos","segafos")))* GtC_2_MtCO2, "Carbon Management|Materials|Plastics|+|Fossil (Mt CO2/yr)") ) } @@ -1707,7 +1707,7 @@ if (!is.null(vm_plasticsCarbon)) { p_share_atmosco2[is.na(p_share_atmosco2)] <- 0 # CDR reporting if plastic-removals are considered - if (!is.null(vm_plasticsCarbon)){ + if (!is.null(v37_plasticsCarbon)){ # calculate share of atmospheric and biogenic carbon contained in plastic products p_share_atmBiogco2 <- dimSums( ( out[,,"Carbon Management|Materials|Plastics|+|Biomass (Mt CO2/yr)"] @@ -1862,7 +1862,7 @@ if (!is.null(vm_plasticsCarbon)) { ## Gross emissions in Energy|Waste sector## ########################################### -if (!is.null(vm_plasticsCarbon)){ +if (!is.null(v37_plasticsCarbon)){ # calculate gross emissions in energy waste sector out <- mbind(out, # total gross energy waste emissions @@ -1875,7 +1875,7 @@ if (!is.null(vm_plasticsCarbon)){ ## total gross variables ## ########################### # if feedstocks are available -if (!is.null(vm_plasticsCarbon)){ +if (!is.null(v37_plasticsCarbon)){ out <- mbind(out, # total gross energy emissions setNames(out[, , "Emi|CO2|+|Energy (Mt CO2/yr)"] @@ -2230,7 +2230,7 @@ if (!is.null(vm_plasticsCarbon)){ ############################### # note that Emi|GHG|Energy|Waste corresponds to end-of-life emissions of products of the chemicals sector # and it is different to Emi|GHG|+++|Waste -if (!is.null(vm_plasticsCarbon)){ +if (!is.null(v37_plasticsCarbon)){ out <- mbind(out, setNames(out[, , "Emi|CO2|Energy|+|Waste (Mt CO2/yr)"], "Emi|GHG|Energy|+|Waste (Mt CO2eq/yr)")) @@ -2277,7 +2277,7 @@ if (!is.null(vm_plasticsCarbon)){ ##(ecxl. negative emissions from BECCS and carbon storage of carbon-neutral synthetic fuels) ## note Emi|CO2|CDR|... variables are negative. That's why we substract them to get from net to gross emissions. -if (!is.null(vm_plasticsCarbon)){ +if (!is.null(v37_plasticsCarbon)){ out <- mbind(out, # total gross waste emissions @@ -2414,7 +2414,7 @@ if (!is.null(vm_plasticsCarbon)){ ################################### ## When feedstocks are available ## ################################### - if(!is.null(vm_plasticsCarbon)){ + if(!is.null(v37_plasticsCarbon)){ out <- mbind(out, # energy supply setNames( @@ -3007,7 +3007,7 @@ out <- mbind(out, # emissions variables for which we want to calculate cumulative values -if (!is.null(vm_plasticsCarbon)) { +if (!is.null(v37_plasticsCarbon)) { vars.cumulate <- c("Emi|GHG (Mt CO2eq/yr)", "Emi|CO2 (Mt CO2/yr)", "Emi|CO2|Energy and Industrial Processes (Mt CO2/yr)", diff --git a/README.md b/README.md index ec64dcd0..0d1356a4 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # The REMIND R package (2nd generation) -R package **remind2**, version **1.135.8** +R package **remind2**, version **1.135.9** [![CRAN status](https://www.r-pkg.org/badges/version/remind2)](https://cran.r-project.org/package=remind2) [![R build status](https://github.com/pik-piam/remind2/workflows/check/badge.svg)](https://github.com/pik-piam/remind2/actions) [![codecov](https://codecov.io/gh/pik-piam/remind2/branch/master/graph/badge.svg)](https://app.codecov.io/gh/pik-piam/remind2) [![r-universe](https://pik-piam.r-universe.dev/badges/remind2)](https://pik-piam.r-universe.dev/builds) @@ -49,7 +49,7 @@ In case of questions / problems please contact Renato Rodrigues . +Rodrigues R, Baumstark L, Benke F, Dietrich J, Dirnaichner A, Duerrwaechter J, Führlich P, Giannousakis A, Hasse R, Hilaire J, Klein D, Koch J, Kowalczyk K, Levesque A, Malik A, Merfort A, Merfort L, Morena-Leiva S, Pehl M, Pietzcker R, Rauner S, Richters O, Rottoli M, Schötz C, Schreyer F, Siala K, Sörgel B, Spahr M, Strefler J, Verpoort P, Weigmann P (2024). _remind2: The REMIND R package (2nd generation)_. R package version 1.135.9, . A BibTeX entry for LaTeX users is @@ -58,7 +58,7 @@ A BibTeX entry for LaTeX users is title = {remind2: The REMIND R package (2nd generation)}, author = {Renato Rodrigues and Lavinia Baumstark and Falk Benke and Jan Philipp Dietrich and Alois Dirnaichner and Jakob Duerrwaechter and Pascal Führlich and Anastasis Giannousakis and Robin Hasse and Jérome Hilaire and David Klein and Johannes Koch and Katarzyna Kowalczyk and Antoine Levesque and Aman Malik and Anne Merfort and Leon Merfort and Simón Morena-Leiva and Michaja Pehl and Robert Pietzcker and Sebastian Rauner and Oliver Richters and Marianna Rottoli and Christof Schötz and Felix Schreyer and Kais Siala and Björn Sörgel and Mike Spahr and Jessica Strefler and Philipp Verpoort and Pascal Weigmann}, year = {2024}, - note = {R package version 1.135.8}, + note = {R package version 1.135.9}, url = {https://github.com/pik-piam/remind2}, } ``` diff --git a/man/remind2-package.Rd b/man/remind2-package.Rd index 5169a479..7b64919d 100644 --- a/man/remind2-package.Rd +++ b/man/remind2-package.Rd @@ -3,6 +3,7 @@ \docType{package} \name{remind2-package} \alias{remind2-package} +\alias{_PACKAGE} \alias{remind2} \title{The REMIND R package (2nd generation)} \description{