From 126113f6c56810a4ca45a41af5fd31777f2ab452 Mon Sep 17 00:00:00 2001 From: Felix Schreyer Date: Mon, 4 Mar 2024 14:17:10 +0100 Subject: [PATCH 1/5] add SE tax for electrolysis to LCOE reporting --- R/reportLCOE.R | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/R/reportLCOE.R b/R/reportLCOE.R index ef40fc2b..739b5e9b 100644 --- a/R/reportLCOE.R +++ b/R/reportLCOE.R @@ -1181,6 +1181,26 @@ df.co2price.weighted <- df.pomeg.expand %>% rename(tech = all_te, FlexPriceShare = value) %>% select(region, period, tech, FlexPriceShare) + +### Read SE Tax for Electrolysis ---- + + # read SE tax for electrolysis from GDX + v21_tau_SE_tax <- readGDX(gdx, "v21_tau_SE_tax", field = "l", restore_zeros = F) + # if not SE tax in run, set to 0 + if(is.null(v21_tau_SE_tax)) { + v21_tau_SE_tax <- vm_costTeCapital + v21_tau_SE_tax[,,] <- 0 + } + + df.tau_SE_tax <- as.quitte(v21_tau_SE_tax) %>% + rename(tech = all_te, tau_SE_tax = value) %>% + select(region, period, tech, tau_SE_tax) %>% + # convert to USD2015/MWh + mutate( tau_SE_tax = 1.2 / as.vector(s_twa2mwh) * 1e12 * tau_SE_tax) + + + + ### Read Final Energy Taxes ---- @@ -1269,6 +1289,7 @@ df.co2price.weighted <- df.pomeg.expand %>% left_join(df.curtShare, by = c("region", "period", "tech")) %>% left_join(df.CCStax, by = c("region", "period", "tech")) %>% left_join(df.flexPriceShare, by = c("region", "period", "tech")) %>% + left_join(df.tau_SE_tax, by = c("region", "period", "tech")) %>% left_join(df.FEtax, relationship = "many-to-many", by = c("region", "period", "output")) %>% left_join(df.AddTeInvH2, by = c("region", "period", "tech", "sector")) %>% # filter to only have LCOE technologies @@ -1283,7 +1304,7 @@ df.co2price.weighted <- df.pomeg.expand %>% # replace NA by 0 in certain columns # columns where NA should be replaced by 0 col.NA.zero <- c("OMF","OMV", "AdjCost","co2.price","co2.price.weighted", "fuel.price","fuel.price.weighted", "co2_dem","emiFac.se2fe","Co2.Capt.Price", - "secfuel.prod", "secfuel.price", "curtShare","CCStax.cost","FEtax","AddH2TdCost") + "secfuel.prod", "secfuel.price", "curtShare","CCStax.cost","FEtax","AddH2TdCost","tau_SE_tax") df.LCOE[,col.NA.zero][is.na(df.LCOE[,col.NA.zero])] <- 0 # replace NA by 1 in certain columns @@ -1385,6 +1406,8 @@ df.co2price.weighted <- df.pomeg.expand %>% # Flex Tax benefit for electrolysis # FlexPriceShare denotes share of the electricity price that electrolysis sees mutate( `Flex Tax` = -(1-FlexPriceShare) * `Fuel Cost (time step prices)`) %>% + # SE tax for electrolysis, calculates fuel cost increase due to taxes and grid fees on electricity going into electrolysis + mutate(`SE Tax` = tau_SE_tax / eff) %>% # se2fe technologies come with FE tax mutate( `FE Tax` = FEtax, # FE H2 has some additional t&d cost at low H2 shares (phase-in cost) in REMIND @@ -1393,10 +1416,10 @@ df.co2price.weighted <- df.pomeg.expand %>% mutate( # Total LCOE with fuel cost and co2 tax cost based on fuel prices and carbon prices of time step for which LCOE are calculated `Total LCOE (time step prices)` = `Investment Cost` + `OMF Cost` + `OMV Cost` + `Adjustment Cost` + `Fuel Cost (time step prices)` + `CO2 Tax Cost (time step prices)` + - `CO2 Provision Cost` + `Second Fuel Cost` + `CCS Tax Cost` + `Curtailment Cost` + `Flex Tax` + `FE Tax` + `Additional H2 t&d Cost`, + `CO2 Provision Cost` + `Second Fuel Cost` + `CCS Tax Cost` + `Curtailment Cost` + `Flex Tax` + `SE Tax` + `FE Tax` + `Additional H2 t&d Cost`, # Total LCOE with fuel cost and co2 tax cost based on fuel prices and carbon prices that are intertemporally weighted and averaged over the plant lifetime `Total LCOE (intertemporal prices)` = `Investment Cost` + `OMF Cost` + `OMV Cost` + `Adjustment Cost` + `Fuel Cost (intertemporal prices)` + `CO2 Tax Cost (intertemporal prices)` + - `CO2 Provision Cost` + `Second Fuel Cost` + `CCS Tax Cost` + `Curtailment Cost` + `Flex Tax` + `FE Tax` + `Additional H2 t&d Cost`) + `CO2 Provision Cost` + `Second Fuel Cost` + `CCS Tax Cost` + `Curtailment Cost` + `Flex Tax` + `SE Tax` + `FE Tax` + `Additional H2 t&d Cost`) # Levelized Cost of UE in Buildings Putty Realization ---- @@ -1478,7 +1501,7 @@ df.co2price.weighted <- df.pomeg.expand %>% `Fuel Cost (time step prices)` , `CO2 Tax Cost (time step prices)`, `Fuel Cost (intertemporal prices)`, `CO2 Tax Cost (intertemporal prices)`, `CO2 Provision Cost`,`Second Fuel Cost`, `Curtailment Cost`, - `CCS Tax Cost`, `Flex Tax`,`FE Tax`,`Additional H2 t&d Cost`, + `CCS Tax Cost`, `Flex Tax`,`SE Tax`,`FE Tax`,`Additional H2 t&d Cost`, `Total LCOE (time step prices)`, `Total LCOE (intertemporal prices)` ) %>% From f9f8e5578b5f2e714071a4f6f088e1315a3eebdc Mon Sep 17 00:00:00 2001 From: Felix Schreyer Date: Wed, 13 Mar 2024 15:40:58 +0100 Subject: [PATCH 2/5] adapt compatibility of reporting library after renaming p_teAnnuity to pm_teAnnuity in REMIND code --- R/reportLCOE.R | 2 +- R/reportPrices.R | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/R/reportLCOE.R b/R/reportLCOE.R index 739b5e9b..76c81ebf 100644 --- a/R/reportLCOE.R +++ b/R/reportLCOE.R @@ -795,7 +795,7 @@ reportLCOE <- function(gdx, output.type = "both"){ # # annuity factor from REMIND, # TODO: check whether this is the same as calculated above # so far only used in levelized cost of DAC calculation below - p_teAnnuity <- readGDX(gdx, "p_teAnnuity", restore_zeros = F) + p_teAnnuity <- readGDX(gdx, c("p_teAnnuity","pm_teAnnuity"), restore_zeros = F) ### Read marginal adjustment costs ---- diff --git a/R/reportPrices.R b/R/reportPrices.R index bd034cbb..406787a1 100644 --- a/R/reportPrices.R +++ b/R/reportPrices.R @@ -468,7 +468,7 @@ reportPrices <- function(gdx, output=NULL, regionSubsetList=NULL, ) vm_costTeCapital <- readGDX(gdx, "vm_costTeCapital", field = "l", restore_zeros = F)[, YearsFrom2005, tech] # [tr USD2005/TWh] - p_teAnnuity <- readGDX(gdx, "p_teAnnuity", restore_zeros = F)[, , tech] + p_teAnnuity <- readGDX(gdx, c("p_teAnnuity","pm_teAnnuity"), restore_zeros = F)[, , tech] vm_capFac <- readGDX(gdx, "vm_capFac", field = "l", restore_zeros = F)[, YearsFrom2005, tech] * 8760 pm_data_omf <- readGDX(gdx, "pm_data", restore_zeros = F)[, , "omf"][, , tech] From ff56b7c746c0e422b7cca860b641bb12c5eeb977 Mon Sep 17 00:00:00 2001 From: Felix Schreyer Date: Thu, 14 Mar 2024 15:53:27 +0100 Subject: [PATCH 3/5] some fixes for buildlibrary to pass --- R/reportLCOE.R | 2 ++ 1 file changed, 2 insertions(+) diff --git a/R/reportLCOE.R b/R/reportLCOE.R index 76c81ebf..6fb31e82 100644 --- a/R/reportLCOE.R +++ b/R/reportLCOE.R @@ -621,6 +621,8 @@ reportLCOE <- function(gdx, output.type = "both"){ `Total LCOE (time step prices)` <- NULL `Total LCOE (intertemporal prices)` <- NULL `Adjustment Cost` <- NULL + `SE Tax` <- NULL + `tau_SE_tax` <- NULL From 009e53a95ef5d80358d15f0736a27a9db9e539df Mon Sep 17 00:00:00 2001 From: Felix Schreyer Date: Thu, 14 Mar 2024 20:52:33 +0100 Subject: [PATCH 4/5] increase library 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 949b1913..feff1f87 100644 --- a/.buildlibrary +++ b/.buildlibrary @@ -1,4 +1,4 @@ -ValidationKey: '2247142940' +ValidationKey: '2247162736' 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 28747bc9..c35bb3fc 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.135.15 +version: 1.135.16 date-released: '2024-03-14' abstract: Contains the REMIND-specific routines for data and model output manipulation. authors: diff --git a/DESCRIPTION b/DESCRIPTION index 4994f93e..b3f36387 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: remind2 Title: The REMIND R package (2nd generation) -Version: 1.135.15 +Version: 1.135.16 Date: 2024-03-14 Authors@R: c( person("Renato", "Rodrigues", , "renato.rodrigues@pik-potsdam.de", role = c("aut", "cre")), diff --git a/README.md b/README.md index 4b16b6de..e2fabb94 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # The REMIND R package (2nd generation) -R package **remind2**, version **1.135.15** +R package **remind2**, version **1.135.16** [![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.16, . 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.15}, + note = {R package version 1.135.16}, url = {https://github.com/pik-piam/remind2}, } ``` From d226bf2b97db092a06c61f635835a908e3583271 Mon Sep 17 00:00:00 2001 From: Felix Schreyer Date: Thu, 14 Mar 2024 21:24:49 +0100 Subject: [PATCH 5/5] increment library 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 feff1f87..19bad143 100644 --- a/.buildlibrary +++ b/.buildlibrary @@ -1,4 +1,4 @@ -ValidationKey: '2247162736' +ValidationKey: '2247182532' 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 c35bb3fc..c3b1dde1 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.135.16 +version: 1.135.17 date-released: '2024-03-14' abstract: Contains the REMIND-specific routines for data and model output manipulation. authors: diff --git a/DESCRIPTION b/DESCRIPTION index b3f36387..ce31f957 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: remind2 Title: The REMIND R package (2nd generation) -Version: 1.135.16 +Version: 1.135.17 Date: 2024-03-14 Authors@R: c( person("Renato", "Rodrigues", , "renato.rodrigues@pik-potsdam.de", role = c("aut", "cre")), diff --git a/README.md b/README.md index e2fabb94..8c9182e7 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # The REMIND R package (2nd generation) -R package **remind2**, version **1.135.16** +R package **remind2**, version **1.135.17** [![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.17, . 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.16}, + note = {R package version 1.135.17}, url = {https://github.com/pik-piam/remind2}, } ```