diff --git a/CITATION.cff b/CITATION.cff index d6ebb2dfb..27469a034 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: 'mrremind: MadRat REMIND Input Data Package' -version: 0.271.1 -date-released: '2026-06-12' +version: 0.271.3 +date-released: '2026-06-15' abstract: The mrremind packages contains data preprocessing for the REMIND model. authors: - family-names: Baumstark diff --git a/DESCRIPTION b/DESCRIPTION index 3d1470703..86d504962 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Type: Package Package: mrremind Title: MadRat REMIND Input Data Package -Version: 0.271.1 -Date: 2026-06-12 +Version: 0.271.3 +Date: 2026-06-15 Authors@R: c( person("Lavinia", "Baumstark", , "lavinia@pik-potsdam.de", role = c("aut", "cre")), person("Renato", "Rodrigues", role = "aut"), diff --git a/R/calcCostOfCapital.R b/R/calcCostOfCapital.R new file mode 100644 index 000000000..a3ad04e4b --- /dev/null +++ b/R/calcCostOfCapital.R @@ -0,0 +1,16 @@ +#' Calculate capital costs for energy technologies +#' +#' Provides REMIND data for 25_WACC Module +#' +#' @author Diamantis Koutsandreas + +calcCostOfCapital <- function() { + output <- readSource("ETH_WACC") + return( + list( + x = output, unit = "%", + description = "Technology WACC markups across REMIND region", + isocountries = FALSE + ) + ) +} diff --git a/R/calcPHI.R b/R/calcPHI.R new file mode 100644 index 000000000..b2b2a2b57 --- /dev/null +++ b/R/calcPHI.R @@ -0,0 +1,18 @@ +#' Provides REMIND data for realization Investment_Inefficiencies in 01_macro Module +#' +#' @author Diamantis Koutsandreas +#' +#' +calcPHI <- function() { + + output <- readSource("IMF_PHI") + getNames(output) <- NULL + return( + list( + x = output, + unit = "%", + description = "share of investments in each region that are not transformed into productive capital", + isocountries = FALSE + ) + ) +} diff --git a/R/fullREMIND.R b/R/fullREMIND.R index 0b890a1f6..9df74dab3 100644 --- a/R/fullREMIND.R +++ b/R/fullREMIND.R @@ -32,6 +32,7 @@ fullREMIND <- function() { calcOutput("RatioPPP2MER", round = 8, file = "pm_shPPPMER.cs4r") calcOutput("MacroInvestments", round = 8, file = "p01_boundInvMacro.cs4r") + calcOutput("PHI", file = "p01_phi.cs4r", aggregate = FALSE) calcOutput("PETaxes", subtype = "subsidies", round = 2, file = "f21_tau_pe_sub.cs4r") calcOutput("FETaxes", subtype = "taxes", round = 2, file = "f21_tau_fe_tax.cs4r") @@ -42,6 +43,8 @@ fullREMIND <- function() { calcOutput("ExpertGuess", subtype = "subConvergenceRollback", round = 2, file = "f21_sub_convergence_rollback.cs4r") calcOutput("Capital", scenario = gdpPopScen, signif = 4, file = "f29_capitalQuantity.cs4r") + calcOutput("CostOfCapital", file = "p25_wacc.cs4r", aggregate = FALSE) + # Exogenous demand scenarios activated by cm_exogDem_scen calcOutput("ExogDemScen", round = 8, file = "p47_exogDemScen.cs4r") diff --git a/R/readETH_WACC.R b/R/readETH_WACC.R new file mode 100644 index 000000000..f976ccf37 --- /dev/null +++ b/R/readETH_WACC.R @@ -0,0 +1,27 @@ +#' This function reads WACC markup data across technologies for each of +#' the REMIND regions +#' @author Diamantis Koutsandreas + +readETH_WACC <- function() { + years <- c(2010, 2015, 2020, 2025, 2030, 2035, 2040, 2045, 2050, + 2055, 2060, 2070, 2080, 2090, 2100, 2110, 2130, 2150) + + data <- readxl::read_xlsx("Source_data_WACC.xlsx", + sheet = "wacc_markups", + range = "A1:CH13") %>% + pivot_longer(cols = 2:86, names_to = "tewacc", values_to = "value") %>% + rename(reg = 1) # Rename the region column to 'reg' + + data_expanded <- data %>% + dplyr::slice(rep(seq_len(dplyr::n()), each = length(years))) %>% + mutate(t = rep(years, times = nrow(data))) + + data_expanded <- data_expanded %>% + select("t", "reg", "tewacc", "value") + + return(as.magpie(data_expanded)) +} + + + + diff --git a/R/readIMF_PHI.R b/R/readIMF_PHI.R new file mode 100644 index 000000000..b30b15fbe --- /dev/null +++ b/R/readIMF_PHI.R @@ -0,0 +1,56 @@ +# This function reads country-level financial efficiency data from the IMF +# and computes the PHI parameter by assigning the most efficient country +# a value of 0.87 and the least efficient country a value of 0.60, with all +# other countries mapped proportionally between these bounds. The PHI bounds +# are determined based on IMF data. + +#' @author Diamantis Koutsandreas + +readIMF_PHI <- function() { + + # ------------------------------------------------------------ + # Read raw country-level dataset + # ------------------------------------------------------------ + raw <- readxl::read_xlsx( + "Source_data_PHI.xlsx", + sheet = "Country_PHI" + ) + + # ------------------------------------------------------------ + # Clean numeric columns + # ------------------------------------------------------------ + raw_clean <- raw %>% + dplyr::mutate( + Efficiency = as.numeric(.data$Efficiency), + GDP = as.numeric(gsub(",", "", .data$GDP)) + ) + + # ------------------------------------------------------------ + # Min–max normalization of Efficiency → Phi (country level) + # ------------------------------------------------------------ + eff_min <- min(raw_clean$Efficiency, na.rm = TRUE) + eff_max <- max(raw_clean$Efficiency, na.rm = TRUE) + + raw_phi <- raw_clean %>% + dplyr::mutate( + phi_country = + 0.60 + + (.data$Efficiency - eff_min) * + (0.87 - 0.60) / + (eff_max - eff_min) + ) + + phi_region <- raw_phi %>% + dplyr::group_by(.data$Remind_Region) %>% + dplyr::summarise( + value = + sum(.data$phi_country * .data$GDP, na.rm = TRUE) / + sum(.data$GDP, na.rm = TRUE), + .groups = "drop" + ) %>% + dplyr::rename(region = .data$Remind_Region) + + output <- as.magpie(phi_region) + getNames(output) <- NULL + return(output) +} diff --git a/README.md b/README.md index f0ba5e775..87b5ace6a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # MadRat REMIND Input Data Package -R package **mrremind**, version **0.271.1** +R package **mrremind**, version **0.271.3** [![R build status](https://github.com/pik-piam/mrremind/workflows/check/badge.svg)](https://github.com/pik-piam/mrremind/actions) [![codecov](https://codecov.io/gh/pik-piam/mrremind/branch/master/graph/badge.svg)](https://app.codecov.io/gh/pik-piam/mrremind) [![r-universe](https://pik-piam.r-universe.dev/badges/mrremind)](https://pik-piam.r-universe.dev/builds) @@ -39,7 +39,7 @@ In case of questions / problems please contact Lavinia Baumstark . +Baumstark L, Rodrigues R, Levesque A, Oeser J, Bertram C, Mouratiadou I, Malik A, Schreyer F, Soergel B, Rottoli M, Mishra A, Dirnaichner A, Pehl M, Giannousakis A, Klein D, Strefler J, Feldhaus L, Brecha R, Rauner S, Dietrich J, Bi S, Benke F, Weigmann P, Richters O, Hasse R, Fuchs S, Mandaroux R, Koch J, Abrahao G, Dorndorf T (2026). "mrremind: MadRat REMIND Input Data Package." Version: 0.271.3, . A BibTeX entry for LaTeX users is @@ -47,9 +47,9 @@ A BibTeX entry for LaTeX users is @Misc{, title = {mrremind: MadRat REMIND Input Data Package}, author = {Lavinia Baumstark and Renato Rodrigues and Antoine Levesque and Julian Oeser and Christoph Bertram and Ioanna Mouratiadou and Aman Malik and Felix Schreyer and Bjoern Soergel and Marianna Rottoli and Abhijeet Mishra and Alois Dirnaichner and Michaja Pehl and Anastasis Giannousakis and David Klein and Jessica Strefler and Lukas Feldhaus and Regina Brecha and Sebastian Rauner and Jan Philipp Dietrich and Stephen Bi and Falk Benke and Pascal Weigmann and Oliver Richters and Robin Hasse and Sophie Fuchs and Rahel Mandaroux and Johannes Koch and Gabriel Abrahao and Tabea Dorndorf}, - date = {2026-06-12}, + date = {2026-06-15}, year = {2026}, url = {https://github.com/pik-piam/mrremind}, - note = {Version: 0.271.1}, + note = {Version: 0.271.3}, } ``` diff --git a/man/calcCostOfCapital.Rd b/man/calcCostOfCapital.Rd new file mode 100644 index 000000000..245a53b54 --- /dev/null +++ b/man/calcCostOfCapital.Rd @@ -0,0 +1,14 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/calcCostOfCapital.R +\name{calcCostOfCapital} +\alias{calcCostOfCapital} +\title{Calculate capital costs for energy technologies} +\usage{ +calcCostOfCapital() +} +\description{ +Provides REMIND data for 25_WACC Module +} +\author{ +Diamantis Koutsandreas +} diff --git a/man/calcPHI.Rd b/man/calcPHI.Rd new file mode 100644 index 000000000..a742e7179 --- /dev/null +++ b/man/calcPHI.Rd @@ -0,0 +1,14 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/calcPHI.R +\name{calcPHI} +\alias{calcPHI} +\title{Provides REMIND data for realization Investment_Inefficiencies in 01_macro Module} +\usage{ +calcPHI() +} +\description{ +Provides REMIND data for realization Investment_Inefficiencies in 01_macro Module +} +\author{ +Diamantis Koutsandreas +} diff --git a/man/readETH_WACC.Rd b/man/readETH_WACC.Rd new file mode 100644 index 000000000..f2af18f2b --- /dev/null +++ b/man/readETH_WACC.Rd @@ -0,0 +1,16 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/readETH_WACC.R +\name{readETH_WACC} +\alias{readETH_WACC} +\title{This function reads WACC markup data across technologies for each of +the REMIND regions} +\usage{ +readETH_WACC() +} +\description{ +This function reads WACC markup data across technologies for each of +the REMIND regions +} +\author{ +Diamantis Koutsandreas +}