From 40978e47791e9f55650d110646f30b913ccbaf9c Mon Sep 17 00:00:00 2001 From: tabeado Date: Wed, 24 Jan 2024 15:04:45 +0100 Subject: [PATCH 1/6] add maximum geologic CO2 storage variables to reporting --- R/reportEmi.R | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/R/reportEmi.R b/R/reportEmi.R index 5ee780cf..2c61fcbe 100644 --- a/R/reportEmi.R +++ b/R/reportEmi.R @@ -201,6 +201,9 @@ reportEmi <- function(gdx, output = NULL, regionSubsetList = NULL, t = c(seq(200 # variable to release captured CO2 when no CCU capacities are standing anymore vent captured CO2 v_co2capturevalve <- readGDX(gdx, "v_co2capturevalve", field = "l", restore_zeros = F)[, t, ] + # maximum annual CO2 storage potential assumed + max_geolStorage <- readGDX(gdx, "vm_co2CCS", field = "up", restore_zeros = F)[, t, ] # CO2 captured per industry subsector + # CO2 captured per industry subsector # NOTE: The parameter pm_IndstCO2Captured was calculated without taking into # account the different emission factors of energy carriers, so we recalculate @@ -1625,6 +1628,19 @@ if (!is.null(vm_plasticsCarbon)) { ### carbon storage ---- + # maximum annual carbon storage and share that is used + out <- mbind(out, + setNames(dimSums(max_geolStorage, dim = 3, na.rm = T) * GtC_2_MtCO2, + "Carbon Management|Storage|Maximum annual CO2 storage potential (Mt CO2/yr)") + ) + # share of annual storage potential used + out <- mbind(out, + + setNames(dimSums(vm_co2CCS, dim = 3, na.rm = T) / dimSums(max_geolStorage, dim = 3, na.rm = T) * 100, + "Carbon Management|Storage|Share of annual potential used (%)")%>% + ifelse(is.finite(.), ., 0) + ) + # calculate carbon storage variables out <- mbind(out, @@ -2675,19 +2691,24 @@ if (!is.null(vm_plasticsCarbon)) { ## aggregate intensive variables ---- .regionSubsetList <- c(list('GLO' = getItems(vm_co2CCS, dim = 'all_regi')), regionSubsetList) - + i <- seq_along(.regionSubsetList) for (i in seq_along(.regionSubsetList)) { - var <- 'Carbon Management|Share of Stored CO2 from Captured CO2 (%)' - + var1 <- "Carbon Management|Share of Stored CO2 from Captured CO2 (%)" + var2 <- "Carbon Management|Storage|Share of annual potential used (%)" target_region <- .regionSubsetList[i] source_regions <- .regionSubsetList[[i]] - - out[names(target_region),,var] <- ( + out[names(target_region),,var1] <- ( dimSums(vm_co2CCS[source_regions,,], dim = c(1, 3), na.rm = TRUE) / dimSums(vm_co2capture[source_regions,,], dim = c(1, 3)) * 100 ) %>% ifelse(is.finite(.), ., 0) # set NaN (division by 0) to 0 + + out[names(target_region),,var2] <- ( + dimSums(vm_co2CCS[source_regions,,], dim = c(1,3), na.rm = T) + / dimSums(max_geolStorage[source_regions,,], dim = c(1,3), na.rm = T) + * 100) %>% + ifelse(is.finite(.), ., 0) # set NaN (division by 0) to 0 } From bb66a8a235c5a1c05d1af064e262ada2cb9f8484 Mon Sep 17 00:00:00 2001 From: tabeado Date: Wed, 24 Jan 2024 15:06:21 +0100 Subject: [PATCH 2/6] add plots showing extent of use of available CO2 storage to CS2 --- inst/markdown/compareScenarios2/cs2_09_carbon_management.Rmd | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/inst/markdown/compareScenarios2/cs2_09_carbon_management.Rmd b/inst/markdown/compareScenarios2/cs2_09_carbon_management.Rmd index d7b18af9..6322e164 100644 --- a/inst/markdown/compareScenarios2/cs2_09_carbon_management.Rmd +++ b/inst/markdown/compareScenarios2/cs2_09_carbon_management.Rmd @@ -16,6 +16,10 @@ showAreaAndBarPlotsPlus(data, "Carbon Management|Carbon Capture|Industry Energy" showLinePlots(data, "Carbon Management|Storage") showAreaAndBarPlotsPlus(data, "Carbon Management|Storage", scales = "fixed") showAreaAndBarPlotsPlus(data, "Carbon Management|Storage|Industry Energy", scales = "fixed") +showLinePlots(data, "Carbon Management|Storage|Share of annual potential used") +showAreaAndBarPlots(data, + vars = c("Carbon Management|Storage"), + tot = "Carbon Management|Storage|Maximum annual CO2 storage potential") ``` ## Usage From b42c2ffff08e20504261964651779ee61c1eb26d Mon Sep 17 00:00:00 2001 From: tabeado Date: Thu, 25 Jan 2024 15:35:12 +0100 Subject: [PATCH 3/6] increment version --- .buildlibrary | 2 +- CITATION.cff | 4 ++-- DESCRIPTION | 4 ++-- README.md | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.buildlibrary b/.buildlibrary index 1aa3d824..e026d41e 100644 --- a/.buildlibrary +++ b/.buildlibrary @@ -1,4 +1,4 @@ -ValidationKey: '223107200' +ValidationKey: '223338570' 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 c00231c8..9041a112 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.130.0 -date-released: '2024-01-22' +version: 1.131.0 +date-released: '2024-01-25' abstract: Contains the REMIND-specific routines for data and model output manipulation. authors: - family-names: Rodrigues diff --git a/DESCRIPTION b/DESCRIPTION index 382d5071..6176a631 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Type: Package Package: remind2 Title: The REMIND R package (2nd generation) -Version: 1.130.0 -Date: 2024-01-22 +Version: 1.131.0 +Date: 2024-01-25 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 2ac9ade3..85e56b05 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # The REMIND R package (2nd generation) -R package **remind2**, version **1.130.0** +R package **remind2**, version **1.131.0** [![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.131.0, . 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.130.0}, + note = {R package version 1.131.0}, url = {https://github.com/pik-piam/remind2}, } ``` From f06b1a6660d8affd80b2c4501c1729f8135da7bf Mon Sep 17 00:00:00 2001 From: tabeado Date: Wed, 31 Jan 2024 12:17:05 +0100 Subject: [PATCH 4/6] Merge branch 'master' of https://github.com/pik-piam/remind2 into CarbonStorageDetail --- .buildlibrary | 2 +- .pre-commit-config.yaml | 2 +- CITATION.cff | 2 +- DESCRIPTION | 4 +- R/loadModeltest.R | 44 ++++---- README.md | 6 +- .../cs2_04_energy_supply.Rmd | 100 +++++++++--------- .../cs2_05_energy_demand.Rmd | 66 ++++++------ .../compareScenarios2/cs2_10_tech_cost.Rmd | 44 ++++++++ ...s_function.Rmd => cs2_11_ces_function.Rmd} | 0 man/loadModeltest.Rd | 4 +- 11 files changed, 163 insertions(+), 111 deletions(-) create mode 100644 inst/markdown/compareScenarios2/cs2_10_tech_cost.Rmd rename inst/markdown/compareScenarios2/{cs2_10_ces_function.Rmd => cs2_11_ces_function.Rmd} (100%) diff --git a/.buildlibrary b/.buildlibrary index e026d41e..198c5ad7 100644 --- a/.buildlibrary +++ b/.buildlibrary @@ -1,4 +1,4 @@ -ValidationKey: '223338570' +ValidationKey: '223160847' AcceptedWarnings: - 'Warning: package ''.*'' was built under R version' - 'Warning: namespace ''.*'' is not available and has been replaced' diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2f134668..6073834a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,7 +15,7 @@ repos: - id: mixed-line-ending - repo: https://github.com/lorenzwalthert/precommit - rev: v0.3.2.9025 + rev: v0.3.2.9027 hooks: - id: parsable-R - id: deps-in-desc diff --git a/CITATION.cff b/CITATION.cff index 9041a112..a180adf0 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: 'remind2: The REMIND R package (2nd generation)' -version: 1.131.0 +version: 1.130.1 date-released: '2024-01-25' abstract: Contains the REMIND-specific routines for data and model output manipulation. authors: diff --git a/DESCRIPTION b/DESCRIPTION index 6176a631..b9b0fee7 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: remind2 Title: The REMIND R package (2nd generation) -Version: 1.131.0 +Version: 1.130.1 Date: 2024-01-25 Authors@R: c( person("Renato", "Rodrigues", , "renato.rodrigues@pik-potsdam.de", role = c("aut", "cre")), @@ -89,6 +89,6 @@ Suggests: VignetteBuilder: knitr Encoding: UTF-8 -RoxygenNote: 7.3.0 +RoxygenNote: 7.3.1 Config/testthat/parallel: true Config/testthat/edition: 3 diff --git a/R/loadModeltest.R b/R/loadModeltest.R index 0e064154..a5c5a721 100644 --- a/R/loadModeltest.R +++ b/R/loadModeltest.R @@ -1,9 +1,9 @@ #' @importFrom utils globalVariables -globalVariables(".") +globalVariables(".") # nolint getProjectPath <- function(project = "remind") { - possibleProjectLocations <- file.path(c("//clusterfs.pik-potsdam.de", "/p/projects"), project) + possibleProjectLocations <- file.path(c("//clusterfs.pik-potsdam.de", "/p/projects"), project) # nolint sel <- which(file.exists(possibleProjectLocations))[1] if (is.na(sel)) stop("Cannot determine a path to projects on the cluster.") possibleProjectLocations[sel] @@ -13,14 +13,15 @@ getProjectPath <- function(project = "remind") { #' @importFrom dplyr bind_cols getNewsestModeltests <- function(namePattern, requireMif) { - modeltestOutPath <- file.path(getProjectPath(), "modeltests/output") + modeltestOutPath <- file.path(getProjectPath(), "modeltests", "remind", "output") entries <- dir(modeltestOutPath) allRunNames <- entries %>% grep( x = ., pattern = "^[a-zA-Z0-9-]+_\\d{4}-\\d{2}-\\d{2}_\\d{2}\\.\\d{2}\\.\\d{2}$", - value = TRUE) + value = TRUE + ) allRuns <- allRunNames %>% strsplit("_", fixed = TRUE) %>% @@ -31,6 +32,8 @@ getNewsestModeltests <- function(namePattern, requireMif) { bind_cols(runName = allRunNames) %>% mutate(date = as.Date(.data$date)) %>% mutate(path = file.path(.env$modeltestOutPath, .data$runName)) %>% + filter(date >= max(.data$date) - 180) %>% # limit to half a year + filter(file.exists(file.path(.data$path, "config.Rdata"))) %>% mutate(mifScen = getMifScenPath(.data$path)) selectedRuns <- allRuns %>% @@ -57,11 +60,11 @@ getNewsestModeltests <- function(namePattern, requireMif) { #' } #' @export loadCs2Data <- function( - mifScen, - mifHist, - cfgScen = NULL, - cfgDefault = NULL, - envir = globalenv() + mifScen, + mifHist, + cfgScen = NULL, + cfgDefault = NULL, + envir = globalenv() ) { folder <- tempdir() @@ -76,7 +79,8 @@ loadCs2Data <- function( outputFile = outputFile, sections = NULL, envir = envir, - quiet = TRUE) + quiet = TRUE + ) file.remove(file.path(folder, paste0(outputFile, ".pdf"))) return(invisible(NULL)) } @@ -112,15 +116,15 @@ cs2InputPaths <- function(outputDirs) { #' ssp1 <- new.env() #' ssp2eu <- new.env() #' loadModeltest(ssp1, "^SSP1-AMT-") -#' loadModeltest(ssp2eu, "^SSP2EU-AMT-") +#' loadModeltest(ssp2eu, "^SSP2EU-.*-AMT$") #' ssp1$data #' ssp2eu$data #' } #' @export loadModeltest <- function( - envir = globalenv(), - namePattern = "^SSP2EU-AMT-", - folder = tempdir() + envir = globalenv(), + namePattern = "^SSP2EU-.*-AMT$", + folder = tempdir() ) { stopifnot(is.environment(envir)) @@ -143,7 +147,8 @@ loadModeltest <- function( mifScen = file.path(folder, paste0(modeltests$name, ".mif")), mifHist = file.path(folder, "historical.mif"), cfgScen = file.path(folder, paste0(modeltests$name, ".Rdata")), - cfgDefault = file.path(folder, "default.cfg")) + cfgDefault = file.path(folder, "default.cfg") + ) copyFile <- function(from, to) { cat("Copying\n ", paste(from, collapse = "\n "), @@ -155,7 +160,8 @@ loadModeltest <- function( warning( "failed copying following files\n", paste(from[!success], collapse = "\n"), - immediate. = TRUE) + immediate. = TRUE + ) } copyFile(path$mifScen, tmpPath$mifScen) @@ -169,14 +175,16 @@ loadModeltest <- function( "user specified environment" else environmentName(envir), - ".\n", sep = "") + ".\n", sep = "" + ) loadCs2Data( mifScen = tmpPath$mifScen, mifHist = tmpPath$mifHist, cfgScen = tmpPath$cfgScen, cfgDefault = tmpPath$cfgDefault, - envir = envir) + envir = envir + ) cat("Done.\n") diff --git a/README.md b/README.md index 85e56b05..2ed5445c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # The REMIND R package (2nd generation) -R package **remind2**, version **1.131.0** +R package **remind2**, version **1.130.1** [![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.130.1, . 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.131.0}, + note = {R package version 1.130.1}, url = {https://github.com/pik-piam/remind2}, } ``` diff --git a/inst/markdown/compareScenarios2/cs2_04_energy_supply.Rmd b/inst/markdown/compareScenarios2/cs2_04_energy_supply.Rmd index e33d1550..f5ce6564 100644 --- a/inst/markdown/compareScenarios2/cs2_04_energy_supply.Rmd +++ b/inst/markdown/compareScenarios2/cs2_04_energy_supply.Rmd @@ -102,8 +102,8 @@ showLinePlots(data, "Cap|Electricity|Hydrogen") ``` ## PE Mix -### PE|Coal -```{r PE|Coal} +### PE Coal +```{r PE Coal} items <- c( "PE|Coal|Hydrogen", "PE|Coal|Electricity", @@ -115,8 +115,8 @@ items <- c( showAreaAndBarPlots(data, items, orderVars = "user", scales = "fixed") ``` -### PE|Gas -```{r PE|Gas} +### PE Gas +```{r PE Gas} items <- c( "PE|Gas|Hydrogen|w/ CC", "PE|Gas|Hydrogen|w/o CC", @@ -131,9 +131,9 @@ showAreaAndBarPlots(data, items, orderVars = "user", scales = "fixed") ``` -### PE|Biomass +### PE Biomass -```{r PE|Biomass} +```{r PE Biomass} items <- c( "PE|Biomass|Hydrogen|w/ CC", "PE|Biomass|Hydrogen|w/o CC", @@ -158,18 +158,18 @@ showLinePlots(data, "PE|Biomass") showLinePlots(data, "Primary Energy Production|Biomass|Energy Crops") ``` -### PE|Coal|Extraction -```{r PE|Coal|Extraction} +### PE Coal Extraction +```{r PE Coal Extraction} showLinePlots(data, "Res|Extraction|Coal") ``` -### PE|Oil|Extraction -```{r PE|Oil|Extraction} +### PE Oil Extraction +```{r PE Oil Extraction} showLinePlots(data, "Res|Extraction|Oil") ``` -### PE|Gas|Extraction -```{r PE|Gas|Extraction} +### PE Gas Extraction +```{r PE Gas Extraction} showLinePlots(data, "Res|Extraction|Gas") ``` @@ -205,8 +205,8 @@ showAreaAndBarPlots(data, items, tot, orderVars="user", scales = "fixed") -### SE|Electricity - Usage -```{r SE|Electricity - Usage} +### SE Electricity - Usage +```{r SE Electricity - Usage} tot <- "SE|Electricity" @@ -225,8 +225,8 @@ showAreaAndBarPlots(data, items, tot, orderVars="user", scales = "fixed") ``` -### SE|Heat -```{r SE|Heat} +### SE Heat +```{r SE Heat} tot <- "SE|Heat" items <- c( "SE|Heat|Electricity|Heat Pump", @@ -238,8 +238,8 @@ showAreaAndBarPlots(data, items, tot, orderVars="user", scales = "fixed") ``` -### SE|Hydrogen -```{r SE|Hydrogen} +### SE Hydrogen +```{r SE Hydrogen} tot <- "SE|Hydrogen" @@ -258,8 +258,8 @@ items <- c( showAreaAndBarPlots(data, items, tot, orderVars="user", scales = "fixed") ``` -### SE|Hydrogen - Usage -```{r SE|Hydrogen - Usage} +### SE Hydrogen - Usage +```{r SE Hydrogen - Usage} tot <- "SE|Hydrogen" @@ -277,8 +277,8 @@ showAreaAndBarPlots(data, items, tot, scales = "fixed") -### SE|Solids -```{r SE|Solids} +### SE Solids +```{r SE Solids} tot <- "SE|Solids" @@ -290,9 +290,9 @@ showAreaAndBarPlots(data, items, tot, scales = "fixed") ``` -### SE|Liquids +### SE Liquids -```{r SE|Liquids} +```{r SE Liquids} tot <- "SE|Liquids" @@ -311,8 +311,8 @@ items <- c( showAreaAndBarPlots(data, items, tot, orderVars="user", scales = "fixed") ``` -### SE|Gases -```{r SE|Gases} +### SE Gases +```{r SE Gases} tot <- "SE|Gases" @@ -335,35 +335,35 @@ showAreaAndBarPlots(data, items, tot, orderVars="user", scales = "fixed") ## Secondary Energy line plots - totals -### SE|Electricity -```{r SE|Electricity total line} +### SE Electricity +```{r SE Electricity total line} showLinePlots(data, "SE|Electricity") ``` -### SE|Heat -```{r SE|Heat total line} +### SE Heat +```{r SE Heat total line} showLinePlots(data, "SE|Heat") ``` -### SE|Hydrogen -```{r SE|Hydrogen total line} +### SE Hydrogen +```{r SE Hydrogen total line} showLinePlots(data, "SE|Hydrogen") ``` -### SE|Solids -```{r SE|Solids total line} +### SE Solids +```{r SE Solids total line} showLinePlots(data, "SE|Solids") ``` -### SE|Liquids -```{r SE|Liquids total line} +### SE Liquids +```{r SE Liquids total line} showLinePlots(data, "SE|Liquids") ``` -### SE|Gases -```{r SE|Gases total line} +### SE Gases +```{r SE Gases total line} showLinePlots(data, "SE|Gases") ``` @@ -373,8 +373,8 @@ showLinePlots(data, "SE|Gases") ## Secondary Energy line plots - detail -### SE|Electricity -```{r SE|Electricity detail line} +### SE Electricity +```{r SE Electricity detail line} showLinePlots(data, "SE|Electricity|Gas") showLinePlots(data, "SE|Electricity|Coal") showLinePlots(data, "SE|Electricity|Oil") @@ -391,8 +391,8 @@ showLinePlots(data, "SE|Electricity|Biomass") ``` -### SE|Heat -```{r SE|Heat detail line} +### SE Heat +```{r SE Heat detail line} showLinePlots(data, "SE|Heat|Coal") showLinePlots(data, "SE|Heat|Gas") @@ -401,8 +401,8 @@ showLinePlots(data, "SE|Heat|Electricity|Heat Pump") ``` -### SE|Hydrogen -```{r SE|Hydrogen detail line} +### SE Hydrogen +```{r SE Hydrogen detail line} showLinePlots(data, "SE|Hydrogen|Biomass|w/ CC") showLinePlots(data, "SE|Hydrogen|Biomass|w/o CC") @@ -416,16 +416,16 @@ showLinePlots(data, "SE|Hydrogen|Net Imports") ``` -### SE|Solids -```{r SE|Solids detail line} +### SE Solids +```{r SE Solids detail line} showLinePlots(data, "SE|Solids|Coal") showLinePlots(data, "SE|Solids|Biomass") showLinePlots(data, "SE|Solids|Traditional Biomass") ``` -### SE|Liquids +### SE Liquids -```{r SE|Liquids detail line} +```{r SE Liquids detail line} showLinePlots(data, "SE|Liquids|Fossil|Oil") @@ -441,8 +441,8 @@ showLinePlots(data, "SE|Liquids|Hydrogen") ``` -### SE|Gases -```{r SE|Gases detail line} +### SE Gases +```{r SE Gases detail line} showLinePlots(data, c("SE|Gases|Fossil|Natural Gas", "SE|Gases|Gas")) showLinePlots(data, "SE|Gases|Fossil|Coal") showLinePlots(data, "SE|Gases|Biomass") diff --git a/inst/markdown/compareScenarios2/cs2_05_energy_demand.Rmd b/inst/markdown/compareScenarios2/cs2_05_energy_demand.Rmd index 682b638b..fb4f5158 100644 --- a/inst/markdown/compareScenarios2/cs2_05_energy_demand.Rmd +++ b/inst/markdown/compareScenarios2/cs2_05_energy_demand.Rmd @@ -19,23 +19,23 @@ items <- c( \newpage -#### FE|* Area Plots +#### FE Area Plots -```{r FE|* Area Plots} +```{r FE Area Plots} showAreaAndBarPlots(data, items, tot, orderVars = "user", scales = "fixed") showAreaAndBarPlots(data, items, tot, orderVars = "user", fill = TRUE) ``` -#### FE|* Line Plots +#### FE Line Plots -```{r FE|* Line Plots} +```{r FE Line Plots} showLinePlots(data, tot) walk(items, showLinePlots, data = data) ``` -#### FE|Electricity|Share +#### FE Electricity Share -```{r FE|Electricity|Share} +```{r FE Electricity Share} showLinePlots(data, "FE|Electricity|Share") ``` @@ -73,24 +73,24 @@ items2 <- c( \newpage -#### FE|Buildings|* Area Plots +#### FE Buildings Area Plots -```{r FE|Buildings|* Area Plots} +```{r FE Buildings Area Plots} showAreaAndBarPlots(data, items, tot, orderVars = "user", scales = "fixed") showAreaAndBarPlots(data, items, tot, orderVars = "user", fill = TRUE) showAreaAndBarPlots(data, items2, tot, orderVars = "user", scales = "fixed") ``` -#### FE|Buildings|* Line Plots +#### FE Buildings Line Plots -```{r FE|Buildings|* Line Plots} +```{r FE Buildings Line Plots} showLinePlots(data, tot) walk(items, showLinePlots, data = data) ``` -#### FE|Buildings|Electricity|Share +#### Electricity Share in Buildings Final Energy -```{r FE|Buildings|Electricity|Share} +```{r Electricity Share in Buildings Final Energy} showLinePlots(data, "FE|Buildings|Electricity|Share") ``` @@ -128,24 +128,24 @@ items2 <- c( \newpage -#### FE|Industry|* Area Plots +#### FE Industry Area Plots -```{r FE|Industry|* Area Plots} +```{r FE Industry Area Plots} showAreaAndBarPlots(data, items, tot, orderVars = "user", scales = "fixed") showAreaAndBarPlots(data, items, tot, orderVars = "user", fill = TRUE) showAreaAndBarPlots(data, items2, tot, orderVars = "user", scales = "fixed") ``` -#### FE|Industry|* Line Plots +#### FE Industry Line Plots -```{r FE|Industry|* Line Plots} +```{r FE Industry Line Plots} showLinePlots(data, tot) walk(items, showLinePlots, data = data) ``` -#### FE|Industry|Electricity|Share +#### Electricity Share in Industry Final Energy -```{r FE|Industry|Electricity|Share} +```{r Electricity Share in Industry Final Energy} showLinePlots(data, "FE|Industry|Electricity|Share") ``` @@ -250,8 +250,8 @@ items <- c( showAreaAndBarPlots(data, items, tot, orderVars = "user", scales = "fixed") ``` -### FE|Industry|* line plots -```{r FE|Industry|* line plots} +### FE Industry line plots +```{r FE Industry line plots} showLinePlots(data, "FE|Industry|Steel") showLinePlots(data, "FE|Industry|Steel|Primary") showLinePlots(data, "FE|Industry|Steel|Secondary") @@ -262,9 +262,9 @@ showLinePlots(data, c("FE|Industry|Other Industry", "FE|Industry|other")) ``` -### FE|Non-energy Use|Industry per carrier and SE origin +### FE Non-energy Use Industry per carrier and SE origin -```{r} +```{r FE Non-energy Use Industry per carrier and SE origin} tot <- "FE|Non-energy Use|Industry" items <- c( "FE|Non-energy Use|Industry|Solids|Fossil", @@ -281,7 +281,7 @@ showAreaAndBarPlots(data, items, tot) ### Specific Energy Consumption -```{r} +```{r Specific Energy Consumption} # estimated values for thermodynamic limits are hard coded here. Could be # improved @@ -361,24 +361,24 @@ items2 <- c( \newpage -#### FE|Transport|* Area Plots -- with Bunkers +#### FE Transport Area Plots -- with Bunkers -```{r FE|Transport|* Area Plots -- with Bunkers} +```{r FE Transport Area Plots -- with Bunkers} showAreaAndBarPlots(data, items, tot, orderVars = "user", scales = "fixed") showAreaAndBarPlots(data, items, tot, orderVars = "user", fill = TRUE) showAreaAndBarPlots(data, items2, tot, orderVars = "user", scales = "fixed") ``` -#### FE|Transport|* Line Plots -- with Bunkers +#### FE Transport Line Plots -- with Bunkers -```{r FE|Transport|* Line Plots -- with Bunkers} +```{r FE Transport Line Plots -- with Bunkers} showLinePlots(data, tot) walk(items, showLinePlots, data = data) ``` -#### FE|Transport|Electricity|Share +#### Electricity Share in Transport Final Energy -```{r FE|Transport|Electricity|Share} +```{r Electricity Share in Transport Final Energy} showLinePlots(data, "FE|Transport|Electricity|Share") ``` @@ -407,17 +407,17 @@ items2 <- c( \newpage -#### FE|Transport|* Area Plots -- w/o Bunkers +#### FE Transport Area Plots -- w/o Bunkers -```{r FE|Transport|* Area Plots -- w/o Bunkers} +```{r FE Transport Area Plots -- w/o Bunkers} showAreaAndBarPlots(data, items, tot, orderVars = "user", scales = "fixed") showAreaAndBarPlots(data, items, tot, orderVars = "user", fill = TRUE) showAreaAndBarPlots(data, items2, tot, orderVars = "user", scales = "fixed") ``` -#### FE|Transport|* Line Plots -- w/o Bunkers +#### FE Transport Line Plots -- w/o Bunkers -```{r FE|Transport|* Line Plots -- w/o Bunkers} +```{r FE Transport Line Plots -- w/o Bunkers} showLinePlots(data, tot) walk(items, showLinePlots, data = data) ``` diff --git a/inst/markdown/compareScenarios2/cs2_10_tech_cost.Rmd b/inst/markdown/compareScenarios2/cs2_10_tech_cost.Rmd new file mode 100644 index 00000000..4edf2469 --- /dev/null +++ b/inst/markdown/compareScenarios2/cs2_10_tech_cost.Rmd @@ -0,0 +1,44 @@ +# Technology capital costs + +## Electricity generating technology capital costs +### Renewables, storage and nuclear +```{r Renewables, storage and nuclear} +showLinePlots(data, "Tech|Electricity|Solar|PV|Capital Costs") +showLinePlots(data, "Tech|Electricity|Wind|Onshore|Capital Costs") +showLinePlots(data, "Tech|Electricity|Wind|Offshore|Capital Costs") +showLinePlots(data, "Tech|Electricity|Storage|Battery|For PV|Capital Costs") +showLinePlots(data, "Tech|Electricity|Nuclear|Capital Costs") +``` + +### Direct and indirect electrifications +```{r Direct and indirect electrifications} +showLinePlots(data, "Tech|Heat|Electricity|Heat Pump|Capital Costs") +showLinePlots(data, "Tech|Hydrogen|Electricity|Capital Costs") +showLinePlots(data, "Tech|Liquids|Hydrogen|Capital Costs") +``` + +### Carbon management technologies +```{r Carbon management technologies} +showLinePlots(data, "Tech|Hydrogen|Gas|w/ CC|Capital Costs") +showLinePlots(data, "Tech|CO2 Storage|Capital Costs|w/ Adj Costs") +showLinePlots(data, "Tech|DAC|Capital Costs|w/ Adj Costs") +``` + + +### Gas technologies +```{r Gas technologies} +showLinePlots(data, "Tech|Electricity|Gas|Combined Cycle w/ CC|Capital Costs") +showLinePlots(data, "Tech|Electricity|Gas|Gas Turbine|Capital Costs") +showLinePlots(data, "Tech|Electricity|Gas|Combined Heat and Power w/o CC|Capital Costs") +``` + + +### Coal technologies +```{r Coal technologies} +showLinePlots(data, "Tech|Electricity|Coal|Pulverised Coal w/ CC|Capital Costs") +showLinePlots(data, "Tech|Electricity|Coal|Gasification Combined Cycle w/o CC|Capital Costs") +showLinePlots(data, "Tech|Electricity|Coal|Combined Heat and Power w/o CC|Capital Costs") +showLinePlots(data, "Tech|Heat|Coal|Capital Costs") +``` + + diff --git a/inst/markdown/compareScenarios2/cs2_10_ces_function.Rmd b/inst/markdown/compareScenarios2/cs2_11_ces_function.Rmd similarity index 100% rename from inst/markdown/compareScenarios2/cs2_10_ces_function.Rmd rename to inst/markdown/compareScenarios2/cs2_11_ces_function.Rmd diff --git a/man/loadModeltest.Rd b/man/loadModeltest.Rd index b581795a..a7efe778 100644 --- a/man/loadModeltest.Rd +++ b/man/loadModeltest.Rd @@ -6,7 +6,7 @@ \usage{ loadModeltest( envir = globalenv(), - namePattern = "^SSP2EU-AMT-", + namePattern = "^SSP2EU-.*-AMT$", folder = tempdir() ) } @@ -31,7 +31,7 @@ loadModeltest() ssp1 <- new.env() ssp2eu <- new.env() loadModeltest(ssp1, "^SSP1-AMT-") -loadModeltest(ssp2eu, "^SSP2EU-AMT-") +loadModeltest(ssp2eu, "^SSP2EU-.*-AMT$") ssp1$data ssp2eu$data } From 6b6287b59f6ed5290f3a856cd455f9b283f5c0ce Mon Sep 17 00:00:00 2001 From: tabeado Date: Wed, 31 Jan 2024 13:26:27 +0100 Subject: [PATCH 5/6] increment version --- .buildlibrary | 2 +- .pre-commit-config.yaml | 2 +- CITATION.cff | 4 ++-- DESCRIPTION | 4 ++-- README.md | 6 +++--- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.buildlibrary b/.buildlibrary index 198c5ad7..b8209afb 100644 --- a/.buildlibrary +++ b/.buildlibrary @@ -1,4 +1,4 @@ -ValidationKey: '223160847' +ValidationKey: '223406430' AcceptedWarnings: - 'Warning: package ''.*'' was built under R version' - 'Warning: namespace ''.*'' is not available and has been replaced' diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6073834a..2f134668 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,7 +15,7 @@ repos: - id: mixed-line-ending - repo: https://github.com/lorenzwalthert/precommit - rev: v0.3.2.9027 + rev: v0.3.2.9025 hooks: - id: parsable-R - id: deps-in-desc diff --git a/CITATION.cff b/CITATION.cff index a180adf0..165835d8 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.130.1 -date-released: '2024-01-25' +version: 1.131.0 +date-released: '2024-01-31' abstract: Contains the REMIND-specific routines for data and model output manipulation. authors: - family-names: Rodrigues diff --git a/DESCRIPTION b/DESCRIPTION index b9b0fee7..9a424867 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Type: Package Package: remind2 Title: The REMIND R package (2nd generation) -Version: 1.130.1 -Date: 2024-01-25 +Version: 1.131.0 +Date: 2024-01-31 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 2ed5445c..85e56b05 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # The REMIND R package (2nd generation) -R package **remind2**, version **1.130.1** +R package **remind2**, version **1.131.0** [![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.131.0, . 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.130.1}, + note = {R package version 1.131.0}, url = {https://github.com/pik-piam/remind2}, } ``` From acecf03d0e3512bff533adcd66ed90f82c3911bf Mon Sep 17 00:00:00 2001 From: tabeado Date: Fri, 2 Feb 2024 14:13:15 +0100 Subject: [PATCH 6/6] increment version --- .buildlibrary | 2 +- CITATION.cff | 2 +- DESCRIPTION | 2 +- README.md | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.buildlibrary b/.buildlibrary index 6488ae2c..59182618 100644 --- a/.buildlibrary +++ b/.buildlibrary @@ -1,4 +1,4 @@ -ValidationKey: '223468560' +ValidationKey: '223626600' 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 a814f309..484f4c0f 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: 'remind2: The REMIND R package (2nd generation)' -version: 1.131.2 +version: 1.132.0 date-released: '2024-02-02' abstract: Contains the REMIND-specific routines for data and model output manipulation. authors: diff --git a/DESCRIPTION b/DESCRIPTION index dcdd6de1..b0e61c81 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: remind2 Title: The REMIND R package (2nd generation) -Version: 1.131.2 +Version: 1.132.0 Date: 2024-02-02 Authors@R: c( person("Renato", "Rodrigues", , "renato.rodrigues@pik-potsdam.de", role = c("aut", "cre")), diff --git a/README.md b/README.md index 00c52db0..4548a0c1 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # The REMIND R package (2nd generation) -R package **remind2**, version **1.131.2** +R package **remind2**, version **1.132.0** [![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.132.0, . 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.131.2}, + note = {R package version 1.132.0}, url = {https://github.com/pik-piam/remind2}, } ```