From 4965e2a1f93b347e91837a98284df3882a9b2826 Mon Sep 17 00:00:00 2001 From: tabeado Date: Wed, 10 Jan 2024 10:46:55 +0100 Subject: [PATCH 1/4] Update reporting after renaming v33_emi to vm_emiCdrTeDetail --- .buildlibrary | 2 +- CITATION.cff | 4 ++-- DESCRIPTION | 4 ++-- R/reportEmi.R | 22 +++++++++++----------- README.md | 6 +++--- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.buildlibrary b/.buildlibrary index cd09b8c6..b2f02be4 100644 --- a/.buildlibrary +++ b/.buildlibrary @@ -1,4 +1,4 @@ -ValidationKey: '222568458' +ValidationKey: '222644604' 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 92840aca..5b50be5c 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.128.3 -date-released: '2024-01-04' +version: 1.128.4 +date-released: '2024-01-09' abstract: Contains the REMIND-specific routines for data and model output manipulation. authors: - family-names: Rodrigues diff --git a/DESCRIPTION b/DESCRIPTION index 8489d0fa..5f53dbdd 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Type: Package Package: remind2 Title: The REMIND R package (2nd generation) -Version: 1.128.3 -Date: 2024-01-04 +Version: 1.128.4 +Date: 2024-01-09 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 78902f69..a34c7e88 100644 --- a/R/reportEmi.R +++ b/R/reportEmi.R @@ -173,9 +173,9 @@ reportEmi <- function(gdx, output = NULL, regionSubsetList = NULL, t = c(seq(200 # total captured CO2 vm_co2capture <- readGDX(gdx, "vm_co2capture", field = "l", restore_zeros = F)[, t, ] - v33_emi <- readGDX(gdx, "v33_emi", field = "l", restore_zeros = F, react = "silent")[, t, ] + vm_emiCdrTeDetail <- readGDX(gdx, c("vm_emiCdrTeDetail","v33_emi"), field = "l", restore_zeros = F, react = "silent")[, t, ] - if (is.null(v33_emi)) { # compatibility with the CDR module before the portfolio was added + if (is.null(vm_emiCdrTeDetail)) { # compatibility with the CDR module before the portfolio was added # captured CO2 by DAC v33_emiDAC <- readGDX(gdx, "v33_emiDAC", field = "l", restore_zeros = F, react = "silent")[, t, ] if (is.null(v33_emiDAC)) { @@ -187,8 +187,8 @@ reportEmi <- function(gdx, output = NULL, regionSubsetList = NULL, t = c(seq(200 v33_emiEW <- new.magpie(getItems(vm_co2capture, "all_regi"), getItems(vm_co2capture, "ttot"), fill = 0) } # variable used in the rest of the reporting - v33_emi <- mbind(v33_emiDAC, v33_emiEW) - v33_emi <- setNames(v33_emi, c("dac", "weathering")) + vm_emiCdrTeDetail <- mbind(v33_emiDAC, v33_emiEW) + vm_emiCdrTeDetail <- setNames(vm_emiCdrTeDetail, c("dac", "weathering")) } # stored CO2 vm_co2CCS <- readGDX(gdx, "vm_co2CCS", field = "l", restore_zeros = F)[, t, ] @@ -1110,7 +1110,7 @@ if (!is.null(vm_plasticsCarbon)) { # vm_emiTeMkt is variable in REMIND closest to energy co2 emissions (dimSums(sel_vm_emiTeMkt_co2, dim = 3) # subtract non-BECCS CCU CO2 (i.e., non-CCS part of DAC) - - (1 - p_share_CCS) * (-v33_emi[, , "dac"]) + - (1 - p_share_CCS) * (-vm_emiCdrTeDetail[, , "dac"]) # deduce co2 captured by industrial processes which is not stored but used for CCU # -> gets accounted in industrial process emissions - vm_emiIndCCS[, , "co2cement_process"]*(1-p_share_CCS)) * GtC_2_MtCO2, @@ -1160,7 +1160,7 @@ if (!is.null(vm_plasticsCarbon)) { setNames(dimSums(vm_emiMacSector[, , "co2luc"], dim = 3) * GtC_2_MtCO2, "Emi|CO2|+|Land-Use Change (Mt CO2/yr)"), # negative emissions from (non-BECCS) CDR (DACCS, EW) - setNames((v33_emi[, , "weathering"] + v33_emi[, , "dac"] * p_share_CCS) * GtC_2_MtCO2, + setNames((vm_emiCdrTeDetail[, , "weathering"] + vm_emiCdrTeDetail[, , "dac"] * p_share_CCS) * GtC_2_MtCO2, "Emi|CO2|+|non-BECCS CDR (Mt CO2/yr)") ) @@ -1193,7 +1193,7 @@ if (!is.null(vm_plasticsCarbon)) { setNames(dimSums(vm_emiMacSector[, , "co2luc"], dim = 3) * GtC_2_MtCO2, "Emi|CO2|+|Land-Use Change (Mt CO2/yr)"), # negative emissions from (non-BECCS) CDR (DACCS, EW) - setNames((v33_emi[, , "weathering"] + v33_emi[, , "dac"] * p_share_CCS) * GtC_2_MtCO2, + setNames((vm_emiCdrTeDetail[, , "weathering"] + vm_emiCdrTeDetail[, , "dac"] * p_share_CCS) * GtC_2_MtCO2, "Emi|CO2|+|non-BECCS CDR (Mt CO2/yr)") ) @@ -1381,7 +1381,7 @@ if (!is.null(vm_plasticsCarbon)) { setNames(dimSums(vm_emiIndCCS[, , "co2cement_process"], dim = 3) * GtC_2_MtCO2, "Carbon Management|Carbon Capture|Industry Process|+|Cement (Mt CO2/yr)"), # total co2 captured by DAC - setNames(-v33_emi[, , "dac"] * GtC_2_MtCO2, + setNames(-vm_emiCdrTeDetail[, , "dac"] * GtC_2_MtCO2, "Carbon Management|Carbon Capture|+|DAC (Mt CO2/yr)"), # total co2 captured setNames(vm_co2capture * GtC_2_MtCO2, @@ -1744,7 +1744,7 @@ if (!is.null(vm_plasticsCarbon)) { "Emi|CO2|CDR|DACCS (Mt CO2/yr)"), # total EW # total co2 captured by EW - setNames(v33_emi[, , "weathering"] * GtC_2_MtCO2, + setNames(vm_emiCdrTeDetail[, , "weathering"] * GtC_2_MtCO2, "Emi|CO2|CDR|EW (Mt CO2/yr)")) out <- mbind(out, @@ -1783,7 +1783,7 @@ if (!is.null(vm_plasticsCarbon)) { "Emi|CO2|CDR|DACCS (Mt CO2/yr)"), # total EW # total co2 captured by EW - setNames(v33_emi[, , "weathering"] * GtC_2_MtCO2, + setNames(vm_emiCdrTeDetail[, , "weathering"] * GtC_2_MtCO2, "Emi|CO2|CDR|EW (Mt CO2/yr)")) out <- mbind(out, @@ -2397,7 +2397,7 @@ if (!is.null(vm_plasticsCarbon)) { # CDR energy-related emissions (dimSums(mselect(EmiFeCarrier[, , "ETS"], emi_sectors = "CDR"), dim = 3) # Captured CO2 by non-BECCS capture technologies - + (v33_emi[, , "weathering"] + v33_emi[, , "dac"] * p_share_CCS)) * GtC_2_MtCO2, + + (vm_emiCdrTeDetail[, , "weathering"] + vm_emiCdrTeDetail[, , "dac"] * p_share_CCS)) * GtC_2_MtCO2, "Emi|GHG|ETS|+|non-BECCS CDR (Mt CO2eq/yr)"), # Extraction diff --git a/README.md b/README.md index b4a5d2a0..342e343c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # The REMIND R package (2nd generation) -R package **remind2**, version **1.128.3** +R package **remind2**, version **1.128.4** [![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, 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.128.4, . 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 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.128.3}, + note = {R package version 1.128.4}, url = {https://github.com/pik-piam/remind2}, } ``` From 36bc28e5ad41b142cb767d0ff2e19187f296baa2 Mon Sep 17 00:00:00 2001 From: Jakob Duerrwaechter <44020564+JakobBD@users.noreply.github.com> Date: Fri, 12 Jan 2024 15:06:09 +0100 Subject: [PATCH 2/4] Adjust LCOE reporting to renamed variable vm_costInvTeAdj (#504) * adjust LCOE reporting to variable name change * buildLibrary --- .buildlibrary | 2 +- CITATION.cff | 4 ++-- DESCRIPTION | 4 ++-- R/reportLCOE.R | 8 ++++---- README.md | 6 +++--- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.buildlibrary b/.buildlibrary index b44c1664..104f2f9b 100644 --- a/.buildlibrary +++ b/.buildlibrary @@ -1,4 +1,4 @@ -ValidationKey: '222762990' +ValidationKey: '222825036' 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 2d177af4..57270301 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.129.0 -date-released: '2024-01-09' +version: 1.129.2 +date-released: '2024-01-11' abstract: Contains the REMIND-specific routines for data and model output manipulation. authors: - family-names: Rodrigues diff --git a/DESCRIPTION b/DESCRIPTION index 09e5bd9f..06810329 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Type: Package Package: remind2 Title: The REMIND R package (2nd generation) -Version: 1.129.0 -Date: 2024-01-09 +Version: 1.129.2 +Date: 2024-01-11 Authors@R: c( person("Renato", "Rodrigues", , "renato.rodrigues@pik-potsdam.de", role = c("aut", "cre")), person("Lavinia", "Baumstark", role = "aut"), diff --git a/R/reportLCOE.R b/R/reportLCOE.R index d7c70dca..fab39872 100644 --- a/R/reportLCOE.R +++ b/R/reportLCOE.R @@ -127,8 +127,8 @@ reportLCOE <- function(gdx, output.type = "both"){ p47_taxCO2eq_AggFE <- readGDX(gdx,"p47_taxCO2eq_AggFE", restore_zeros=F, react = "silent") ## variables - v_costInvTeDir <- readGDX(gdx,name=c("v_costInvTeDir","vm_costInvTeDir","v_directteinv"),field="l",format="first_found")[,ttot,] ## Total direct Investment Cost in Timestep - v_costInvTeAdj <- readGDX(gdx,name=c("v_costInvTeAdj"),field="l",format="first_found")[,ttot,] ## total adjustment cost in period + vm_costInvTeDir <- readGDX(gdx,name=c("vm_costInvTeDir","v_costInvTeDir","v_directteinv"),field="l",format="first_found")[,ttot,] ## Total direct Investment Cost in Timestep + vm_costInvTeAdj <- readGDX(gdx,name=c("vm_costInvTeAdj","v_costInvTeAdj"),field="l",format="first_found")[,ttot,] ## total adjustment cost in period vm_capEarlyReti <- readGDX(gdx,name=c("vm_capEarlyReti"),field="l",format="first_found")[,ttot,] vm_deltaCap <- readGDX(gdx,name=c("vm_deltaCap"),field="l",format="first_found")[,ttot,] vm_demPe <- readGDX(gdx,name=c("vm_demPe","v_pedem"),field="l",restore_zeros=FALSE,format="first_found") @@ -174,13 +174,13 @@ reportLCOE <- function(gdx, output.type = "both"){ te_inv_annuity <- 1e+12 * te_annuity[,,te] * mbind( v_investcost[,ttot_before2005,te] * dimSums(vm_deltaCap[teall2rlf][,ttot_before2005,te],dim=3.2), - v_costInvTeDir[,ttot_from2005,te] + vm_costInvTeDir[,ttot_from2005,te] ) te_inv_annuity_wadj <- 1e+12 * te_annuity[,,te] * mbind( v_investcost[,ttot_before2005,te] * dimSums(vm_deltaCap[teall2rlf][,ttot_before2005,te],dim=3.2), - v_costInvTeAdj[,ttot_from2005,te] + v_costInvTeDir[,ttot_from2005,te] + vm_costInvTeAdj[,ttot_from2005,te] + vm_costInvTeDir[,ttot_from2005,te] ) # average LCOE components ---- diff --git a/README.md b/README.md index d678d227..563f92c0 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # The REMIND R package (2nd generation) -R package **remind2**, version **1.129.0** +R package **remind2**, version **1.129.2** [![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, 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.129.2, . 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 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.129.0}, + note = {R package version 1.129.2}, url = {https://github.com/pik-piam/remind2}, } ``` From 884afe8f5b803e77331df03663ca36feba211b82 Mon Sep 17 00:00:00 2001 From: tabeado Date: Fri, 12 Jan 2024 16:44:01 +0100 Subject: [PATCH 3/4] buildLibrary --- .buildlibrary | 2 +- CITATION.cff | 4 ++-- DESCRIPTION | 4 ++-- README.md | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.buildlibrary b/.buildlibrary index 104f2f9b..7b548e7b 100644 --- a/.buildlibrary +++ b/.buildlibrary @@ -1,4 +1,4 @@ -ValidationKey: '222825036' +ValidationKey: '222856062' 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 57270301..dbb36836 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.129.2 -date-released: '2024-01-11' +version: 1.129.3 +date-released: '2024-01-12' abstract: Contains the REMIND-specific routines for data and model output manipulation. authors: - family-names: Rodrigues diff --git a/DESCRIPTION b/DESCRIPTION index 06810329..28b810ce 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Type: Package Package: remind2 Title: The REMIND R package (2nd generation) -Version: 1.129.2 -Date: 2024-01-11 +Version: 1.129.3 +Date: 2024-01-12 Authors@R: c( person("Renato", "Rodrigues", , "renato.rodrigues@pik-potsdam.de", role = c("aut", "cre")), person("Lavinia", "Baumstark", role = "aut"), diff --git a/README.md b/README.md index 563f92c0..7bac9b32 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # The REMIND R package (2nd generation) -R package **remind2**, version **1.129.2** +R package **remind2**, version **1.129.3** [![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, 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.129.3, . 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 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.129.2}, + note = {R package version 1.129.3}, url = {https://github.com/pik-piam/remind2}, } ``` From 5dd8d90d65bcae32e248702a7ea00002f11aa9f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pascal=20F=C3=BChrlich?= <82826417+pfuehrlich-pik@users.noreply.github.com> Date: Tue, 16 Jan 2024 11:11:49 +0100 Subject: [PATCH 4/4] Update remind2-package.R --- R/remind2-package.R | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/R/remind2-package.R b/R/remind2-package.R index d2f9f3ea..46b81cb0 100644 --- a/R/remind2-package.R +++ b/R/remind2-package.R @@ -4,5 +4,4 @@ #' #' @name remind2-package #' @aliases remind2-package remind2 -#' @docType package -NULL +"_PACKAGE"