From 6a5fef3e25908f169333baa780468392127a0716 Mon Sep 17 00:00:00 2001 From: Bennet Weiss Date: Wed, 28 Oct 2026 12:07:51 +0100 Subject: [PATCH 1/4] convert gdp to cement tonnes --- R/calcCeTrade.R | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/R/calcCeTrade.R b/R/calcCeTrade.R index 63abb529..91bd27a4 100644 --- a/R/calcCeTrade.R +++ b/R/calcCeTrade.R @@ -92,10 +92,12 @@ calcCeTrade <- function(subtype, category, HS = "92", target_years = NULL) { reference <- production_reference target_years <- getYears(production_reference, as.integer = TRUE) - # complement base reference with GDP data where in regions without production + # complement base reference with GDP data where in regions without production. + # GDP is converted to cement-equivalents with the yearly global cement intensity of GDP gdp_reference <- calcOutput("CoGDP", aggregate = FALSE, years = target_years) zero_prod_regions <- getItems(production_reference[dimSums(production_reference, dim = c(2, 3)) == 0, , ], dim = 1) - reference[zero_prod_regions, ] <- gdp_reference[zero_prod_regions, ] + cement_intensity <- dimSums(production_reference, dim = c(1, 3)) / dimSums(gdp_reference, dim = c(1, 3)) + reference[zero_prod_regions, ] <- gdp_reference[zero_prod_regions, ] * cement_intensity # add global shipping cost to base reference as bulk trade generally got cheaper over time shipping_cost <- readSource("OWID", subtype = "shipping_costs") From 45a1cf4f4091fa70992a4037a7b54035b4529e5e Mon Sep 17 00:00:00 2001 From: Bennet Weiss Date: Wed, 28 Oct 2026 14:03:00 +0100 Subject: [PATCH 2/4] improve US reference --- R/calcCeTrade.R | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/R/calcCeTrade.R b/R/calcCeTrade.R index 98da1394..4b74e5e1 100644 --- a/R/calcCeTrade.R +++ b/R/calcCeTrade.R @@ -83,8 +83,8 @@ calcCeTrade <- function(subtype, category, HS = "92", target_years = NULL) { # Aggregation to avoid intra-regional trade # ---------------------------------------------------------------------------- - # construct reference for backcasting based on production/gdp and shipping costs. - # Note: reference has region-specific units. + # construct reference for backcasting based on production/gdp and shipping costs, + # expressed in tonnes of trade. # cement production data as base reference production_reference <- calcOutput("CeCementProduction", aggregate = FALSE, years = target_years) @@ -117,10 +117,15 @@ calcCeTrade <- function(subtype, category, HS = "92", target_years = NULL) { shipping_cost <- toolTimeSpline(shipping_cost, dof = 10) reference <- reference / shipping_cost + # transform reference (t production / shipping cost index) to tonnes of trade: + # use the global ratio of BACI trade to the reference over BACI years + trade_ratio <- dimSums(x, dim = c(1, 2, 3)) / dimSums(reference[, getYears(x), ], dim = c(1, 2, 3)) + reference <- reference * trade_ratio + # replace US reference with total clinker + cement trade data from USGS us_reference <- readSource("USGSDS140", subtype = subtype)["USA", ] - us_reference <- toolBackcastByReference(us_reference, production_reference["USA", ], doForecast = FALSE) - us_reference <- toolBackcastByReference(us_reference, production_reference["USA", ], doForecast = TRUE) + us_reference <- toolBackcastByReference(us_reference, reference["USA", ], doForecast = FALSE) + us_reference <- toolBackcastByReference(us_reference, reference["USA", ], doForecast = TRUE) us_reference <- us_reference[, target_years, ] reference["USA", ] <- us_reference From 5af347eabba9d957b4f740ec98f4d3554cf57350 Mon Sep 17 00:00:00 2001 From: Bennet Weiss Date: Wed, 28 Oct 2026 14:39:11 +0100 Subject: [PATCH 3/4] remove China from global intensity --- R/calcCeTrade.R | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/R/calcCeTrade.R b/R/calcCeTrade.R index 4b74e5e1..aca2e198 100644 --- a/R/calcCeTrade.R +++ b/R/calcCeTrade.R @@ -92,10 +92,15 @@ calcCeTrade <- function(subtype, category, HS = "92", target_years = NULL) { target_years <- getYears(production_reference, as.integer = TRUE) # complement base reference with GDP data where in regions without production. - # GDP is converted to cement-equivalents with the yearly global cement intensity of GDP + # GDP is converted to cement-equivalents with the yearly global cement intensity of GDP. + # China is excluded as its construction boom (and potential decline) would dominate the global intensity. gdp_reference <- calcOutput("CoGDP", aggregate = FALSE, years = target_years) zero_prod_regions <- getItems(production_reference[dimSums(production_reference, dim = c(2, 3)) == 0, , ], dim = 1) - cement_intensity <- dimSums(production_reference, dim = c(1, 3)) / dimSums(gdp_reference, dim = c(1, 3)) + intensity_regions <- setdiff(getItems(production_reference, dim = 1), "CHN") + cement_intensity <- ( + dimSums(production_reference[intensity_regions, , ], dim = c(1, 3)) + / dimSums(gdp_reference[intensity_regions, , ], dim = c(1, 3)) + ) reference[zero_prod_regions, ] <- gdp_reference[zero_prod_regions, ] * cement_intensity # add global shipping cost to base reference as bulk trade generally got cheaper over time @@ -123,6 +128,7 @@ calcCeTrade <- function(subtype, category, HS = "92", target_years = NULL) { reference <- reference * trade_ratio # replace US reference with total clinker + cement trade data from USGS + # Note: This slightly overweights the US in custom regional aggregations that combine the US with other countries. us_reference <- readSource("USGSDS140", subtype = subtype)["USA", ] us_reference <- toolBackcastByReference(us_reference, reference["USA", ], doForecast = FALSE) us_reference <- toolBackcastByReference(us_reference, reference["USA", ], doForecast = TRUE) From f2bd86cfed75fe9ba87a995b2541751029a33203 Mon Sep 17 00:00:00 2001 From: Bennet Weiss Date: Wed, 28 Oct 2026 14:49:42 +0100 Subject: [PATCH 4/4] build library --- .buildlibrary | 2 +- CITATION.cff | 4 ++-- DESCRIPTION | 4 ++-- README.md | 8 ++++---- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.buildlibrary b/.buildlibrary index b2ccdc6b..deac5b38 100644 --- a/.buildlibrary +++ b/.buildlibrary @@ -1,4 +1,4 @@ -ValidationKey: '6037668' +ValidationKey: '6060168' AutocreateReadme: yes AutocreateCITATION: yes AcceptedWarnings: diff --git a/CITATION.cff b/CITATION.cff index 5567927f..a75a8c2b 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: 'mrmfa: Input data generation for the REMIND MFA' -version: 2.9.1 -date-released: '2026-10-22' +version: 2.9.2 +date-released: '2026-10-28' abstract: The mrmfa packages contains data preprocessing for the REMIND MFA. authors: - family-names: Dürrwächter diff --git a/DESCRIPTION b/DESCRIPTION index 659bc45d..cdbfef0c 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Type: Package Package: mrmfa Title: Input data generation for the REMIND MFA -Version: 2.9.1 -Date: 2026-10-22 +Version: 2.9.2 +Date: 2026-10-28 Authors@R: c( person("Jakob", "Dürrwächter", , "jakobdu@pik-potsdam.de", role = c("aut", "cre")), person("Bennet", "Weiss", , "bennet.weiss@pik-potsdam.de", role = "aut"), diff --git a/README.md b/README.md index 58a80ebe..3385dd6c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Input data generation for the REMIND MFA -R package **mrmfa**, version **2.9.1** +R package **mrmfa**, version **2.9.2** [![R build status](https://github.com/pik-piam/mrmfa/workflows/check/badge.svg)](https://github.com/pik-piam/mrmfa/actions) [![codecov](https://codecov.io/gh/pik-piam/mrmfa/branch/master/graph/badge.svg)](https://app.codecov.io/gh/pik-piam/mrmfa) @@ -38,7 +38,7 @@ In case of questions / problems please contact Jakob Dürrwächter . +Dürrwächter J, Weiss B, Schweiger L, Benke F, Diez T, Hosak M, Zhang Q (2026). "mrmfa: Input data generation for the REMIND MFA." Version: 2.9.2, . A BibTeX entry for LaTeX users is @@ -46,9 +46,9 @@ A BibTeX entry for LaTeX users is @Misc{, title = {mrmfa: Input data generation for the REMIND MFA}, author = {Jakob Dürrwächter and Bennet Weiss and Leonie Schweiger and Falk Benke and Tobias Diez and Merlin Jo Hosak and Qianzhi Zhang}, - date = {2026-10-22}, + date = {2026-10-28}, year = {2026}, url = {https://github.com/pik-piam/mrmfa}, - note = {Version: 2.9.1}, + note = {Version: 2.9.2}, } ```