Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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"),
Expand Down
16 changes: 16 additions & 0 deletions R/calcCostOfCapital.R
Original file line number Diff line number Diff line change
@@ -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
)
)
}
18 changes: 18 additions & 0 deletions R/calcPHI.R
Original file line number Diff line number Diff line change
@@ -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
)
)
}
3 changes: 3 additions & 0 deletions R/fullREMIND.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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")
Expand Down
27 changes: 27 additions & 0 deletions R/readETH_WACC.R
Original file line number Diff line number Diff line change
@@ -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))
}




56 changes: 56 additions & 0 deletions R/readIMF_PHI.R
Original file line number Diff line number Diff line change
@@ -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)
}
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)

Expand Down Expand Up @@ -39,17 +39,17 @@ In case of questions / problems please contact Lavinia Baumstark <lavinia@pik-po

To cite package **mrremind** in publications use:

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.1, <https://github.com/pik-piam/mrremind>.
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, <https://github.com/pik-piam/mrremind>.

A BibTeX entry for LaTeX users is

```latex
@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},
}
```
14 changes: 14 additions & 0 deletions man/calcCostOfCapital.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions man/calcPHI.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions man/readETH_WACC.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading