diff --git a/.buildlibrary b/.buildlibrary index 44f95c37..5265fe7e 100644 --- a/.buildlibrary +++ b/.buildlibrary @@ -1,4 +1,4 @@ -ValidationKey: '219696204' +ValidationKey: '219760608' 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 52c699fa..1d058c8e 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.119.3 -date-released: '2023-09-28' +version: 1.119.4 +date-released: '2023-10-02' abstract: Contains the REMIND-specific routines for data and model output manipulation. authors: - family-names: Rodrigues diff --git a/DESCRIPTION b/DESCRIPTION index cc9b26cc..9813b166 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Type: Package Package: remind2 Title: The REMIND R package (2nd generation) -Version: 1.119.3 -Date: 2023-09-28 +Version: 1.119.4 +Date: 2023-10-02 Authors@R: c( person("Renato", "Rodrigues", , "renato.rodrigues@pik-potsdam.de", role = c("aut", "cre")), person("Lavinia", "Baumstark", role = "aut"), diff --git a/R/reportCapacity.R b/R/reportCapacity.R index 1e2c71c9..fd6680d9 100644 --- a/R/reportCapacity.R +++ b/R/reportCapacity.R @@ -316,5 +316,6 @@ reportCapacity <- function(gdx, regionSubsetList = NULL, t = c(seq(2005, 2060, 5 if (!is.null(regionSubsetList)) tmp <- mbind(tmp, calc_regionSubset_sums(tmp, regionSubsetList)) + getSets(tmp)[3] <- "variable" return(tmp) } diff --git a/R/reportCapitalStock.R b/R/reportCapitalStock.R index 180603b8..0e96735e 100644 --- a/R/reportCapitalStock.R +++ b/R/reportCapitalStock.R @@ -127,5 +127,6 @@ reportCapitalStock <- function(gdx,regionSubsetList=NULL,t=c(seq(2005,2060,5),se if (!is.null(regionSubsetList)) tmp <- mbind(tmp, calc_regionSubset_sums(tmp, regionSubsetList)) + getSets(tmp)[3] <- "variable" return(tmp) } diff --git a/R/reportCosts.R b/R/reportCosts.R index 3c7fac88..4421fc43 100644 --- a/R/reportCosts.R +++ b/R/reportCosts.R @@ -656,6 +656,7 @@ reportCosts <- function(gdx,output=NULL,regionSubsetList=NULL,t=c(seq(2005,2060, # add other region aggregations if (!is.null(regionSubsetList)) tmp <- mbind(tmp, calc_regionSubset_sums(tmp, regionSubsetList)) - + + getSets(tmp)[3] <- "variable" return(tmp) } diff --git a/R/reportCrossVariables.R b/R/reportCrossVariables.R index c149dc46..bc32dd4d 100644 --- a/R/reportCrossVariables.R +++ b/R/reportCrossVariables.R @@ -477,5 +477,6 @@ reportCrossVariables <- function(gdx, output = NULL, regionSubsetList = NULL, could not be calculated for this regional resolution") } + getSets(out)[3] <- "variable" return(out) } diff --git a/R/reportEmi.R b/R/reportEmi.R index 5374abab..2d2f77d9 100644 --- a/R/reportEmi.R +++ b/R/reportEmi.R @@ -2524,9 +2524,6 @@ reportEmi <- function(gdx, output = NULL, regionSubsetList = NULL, t = c(seq(200 out <- mbind(out, out.cumul) - - - + getSets(out)[3] <- "variable" return(out) - } diff --git a/R/reportEmiAirPol.R b/R/reportEmiAirPol.R index f04f20e7..924ef7b7 100644 --- a/R/reportEmiAirPol.R +++ b/R/reportEmiAirPol.R @@ -618,5 +618,6 @@ reportEmiAirPol <- function(gdx,regionSubsetList=NULL,t=c(seq(2005,2060,5),seq(2 } else {stop("not allowed AP-realization")} + getSets(out)[3] <- "variable" return(out) } diff --git a/R/reportEmployment.R b/R/reportEmployment.R index 51419722..e6e91082 100644 --- a/R/reportEmployment.R +++ b/R/reportEmployment.R @@ -264,5 +264,6 @@ remFilter <- remFilter[, , c("New Cap|Electricity|Hydro", "Cap|Electricity|Hydro jobs <- mbind(jobsCi, jobsOm, jobsProd, jobsManf) + getSets(jobs)[3] <- "variable" return(jobs) } diff --git a/R/reportEnergyInvestment.R b/R/reportEnergyInvestment.R index 9515b48a..03926e69 100644 --- a/R/reportEnergyInvestment.R +++ b/R/reportEnergyInvestment.R @@ -215,5 +215,6 @@ reportEnergyInvestment <- function(gdx, regionSubsetList = NULL, t = c(seq(2005, if (!is.null(regionSubsetList)) tmp <- mbind(tmp, calc_regionSubset_sums(tmp, regionSubsetList)) + getSets(tmp)[3] <- "variable" return(tmp) } diff --git a/R/reportExtraction.R b/R/reportExtraction.R index baea7303..56a35f3b 100644 --- a/R/reportExtraction.R +++ b/R/reportExtraction.R @@ -282,5 +282,6 @@ grades[is.na(grades)] <- 0 if (!is.null(regionSubsetList)) out <- mbind(out, calc_regionSubset_sums(out, regionSubsetList)) + getSets(out)[3] <- "variable" return(out) } diff --git a/R/reportFE.R b/R/reportFE.R index 0ded93a6..9cc5475b 100644 --- a/R/reportFE.R +++ b/R/reportFE.R @@ -1747,5 +1747,6 @@ reportFE <- function(gdx, regionSubsetList = NULL, ) } + getSets(out)[3] <- "variable" return(out) } diff --git a/R/reportLCOE.R b/R/reportLCOE.R index a6692dd9..b10c7b29 100644 --- a/R/reportLCOE.R +++ b/R/reportLCOE.R @@ -1,7 +1,7 @@ #' Read in GDX and calculate LCOE reporting used in convGDX2MIF_LCOE. #' #' This function provides a post-processing calculation of LCOE (Levelized Cost of Energy) for energy conversion technologies in REMIND. -#' In incluldes most technologies that generate secondary energy and the distribution technologies which convert secondary energy to final energy. +#' It includes most technologies that generate secondary energy and the distribution technologies which convert secondary energy to final energy. #' This script calculates two different types of LCOE: average LCOE (standing system) and marginal LCOE (new plant). #' The average LCOE reflect the total cost incurred by the technology deployment in a specific time step divided by its energy output. #' The marginal LCOE estimate the per-unit lifetime cost of the output if the model added another capacity of that technology in the respective time step. @@ -1599,8 +1599,3 @@ reportLCOE <- function(gdx, output.type = "both"){ return(LCOE.out) } - - - - - diff --git a/R/reportMacroEconomy.R b/R/reportMacroEconomy.R index ed7633da..e3e946ad 100644 --- a/R/reportMacroEconomy.R +++ b/R/reportMacroEconomy.R @@ -403,5 +403,6 @@ reportMacroEconomy <- function(gdx, regionSubsetList = NULL, } # add interest rate out <- mbind(out, inteRate) + getSets(out)[3] <- "variable" return(out) } diff --git a/R/reportPE.R b/R/reportPE.R index 87a6500a..6f85dd9f 100644 --- a/R/reportPE.R +++ b/R/reportPE.R @@ -194,6 +194,7 @@ reportPE <- function(gdx,regionSubsetList=NULL,t=c(seq(2005,2060,5),seq(2070,211 # add other region aggregations if (!is.null(regionSubsetList)) out <- mbind(out, calc_regionSubset_sums(out, regionSubsetList)) - + + getSets(out)[3] <- "variable" return(out) } diff --git a/R/reportPolicyCosts.R b/R/reportPolicyCosts.R index a571d37b..24028e46 100644 --- a/R/reportPolicyCosts.R +++ b/R/reportPolicyCosts.R @@ -94,6 +94,7 @@ reportPolicyCosts <- function(gdx,gdx_ref,regionSubsetList=NULL,t=c(seq(2005,206 # add other region aggregations if (!is.null(regionSubsetList)) tmp <- mbind(tmp, calc_regionSubset_sums(tmp, regionSubsetList)) - + + getSets(tmp)[3] <- "variable" return(tmp) } diff --git a/R/reportPrices.R b/R/reportPrices.R index 126912b3..90623455 100644 --- a/R/reportPrices.R +++ b/R/reportPrices.R @@ -1129,5 +1129,6 @@ reportPrices <- function(gdx, output=NULL, regionSubsetList=NULL, # out <- mbind(out, tmp2) # } + getSets(out)[3] <- "variable" return(out) } diff --git a/R/reportSDPVariables.R b/R/reportSDPVariables.R index 146fc91f..cb798d75 100644 --- a/R/reportSDPVariables.R +++ b/R/reportSDPVariables.R @@ -221,6 +221,6 @@ reportSDPVariables <- function( output <- mbind(output,addUEperCapForBuildings(output)) output <- mbind(output,addIntensityUE(output)) - + getSets(output)[3] <- "variable" return(output) } diff --git a/R/reportSE.R b/R/reportSE.R index 525a2ff2..a5e29c15 100644 --- a/R/reportSE.R +++ b/R/reportSE.R @@ -490,5 +490,6 @@ reportSE <- function(gdx, regionSubsetList = NULL, t = c(seq(2005, 2060, 5), seq if (!is.null(regionSubsetList)) out <- mbind(out, calc_regionSubset_sums(out, regionSubsetList)) + getSets(out)[3] <- "variable" return(out) } diff --git a/R/reportTax.R b/R/reportTax.R index a0f71066..c034eaee 100644 --- a/R/reportTax.R +++ b/R/reportTax.R @@ -312,5 +312,6 @@ reportTax <- function(gdx,output=NULL,regionSubsetList=NULL,t=c(seq(2005,2060,5) out["GLO",,vars] <- NA out[names(regionSubsetList),,vars] <- NA + getSets(out)[3] <- "variable" return(out) } diff --git a/R/reportTechnology.R b/R/reportTechnology.R index c88134e4..01763307 100644 --- a/R/reportTechnology.R +++ b/R/reportTechnology.R @@ -385,5 +385,6 @@ reportTechnology <- function(gdx, output = NULL, regionSubsetList = NULL, t = c( tmp[is.na(tmp)] <- 0 # tmp is NA if weight is zero for all regions within the GLO or the specific region aggregation. Therefore, we replace all NAs with zeros. + getSets(tmp)[3] <- "variable" return(tmp) } diff --git a/R/reportTrade.R b/R/reportTrade.R index c3d72e8a..17e8d156 100644 --- a/R/reportTrade.R +++ b/R/reportTrade.R @@ -132,13 +132,8 @@ reportTrade <- function(gdx,regionSubsetList=NULL,t=c(seq(2005,2060,5),seq(2070, tmp <- mbind(tmp,setNames(trade[,,"perm"] * price[,,"perm"] * 1000, "Trade|Emi Allowances|Value (billion US$2005/yr)")) tmp <- mbind(tmp,setNames(dimSums( trade[,,set_trade] * price[,,set_trade],dim = 3) * 1000, "Trade|All|Value (billion US$2005/yr)")) tmp <- mbind(tmp,setNames(dimSums( trade[,,set_trade] * price[,,set_trade],dim = 3), "Current Account (billion US$2005/yr)")) - - - - - - # rename dimensions in the magpie object - names(dimnames(tmp))[3] = 'variable' - + + # rename dimensions in the magpie object + getSets(tmp)[3] <- "variable" return(tmp) } diff --git a/README.md b/README.md index 0417eaba..623160ba 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # The REMIND R package (2nd generation) -R package **remind2**, version **1.119.3** +R package **remind2**, version **1.119.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 (2023). _remind2: The REMIND R package (2nd generation)_. R package version 1.119.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 = {2023}, - note = {R package version 1.119.3}, + note = {R package version 1.119.4}, url = {https://github.com/pik-piam/remind2}, } ``` diff --git a/man/reportLCOE.Rd b/man/reportLCOE.Rd index bdb4ec66..3518acb1 100644 --- a/man/reportLCOE.Rd +++ b/man/reportLCOE.Rd @@ -19,7 +19,7 @@ MAgPIE object - LCOE calculated by model post-processing. Two types a) standing } \description{ This function provides a post-processing calculation of LCOE (Levelized Cost of Energy) for energy conversion technologies in REMIND. -In incluldes most technologies that generate secondary energy and the distribution technologies which convert secondary energy to final energy. +It includes most technologies that generate secondary energy and the distribution technologies which convert secondary energy to final energy. This script calculates two different types of LCOE: average LCOE (standing system) and marginal LCOE (new plant). The average LCOE reflect the total cost incurred by the technology deployment in a specific time step divided by its energy output. The marginal LCOE estimate the per-unit lifetime cost of the output if the model added another capacity of that technology in the respective time step.