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/R/calcCeTrade.R b/R/calcCeTrade.R index e2c1542b..aca2e198 100644 --- a/R/calcCeTrade.R +++ b/R/calcCeTrade.R @@ -83,18 +83,25 @@ 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) 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. + # 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) - reference[zero_prod_regions, ] <- gdp_reference[zero_prod_regions, ] + 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 shipping_cost <- readSource("OWID", subtype = "shipping_costs") @@ -115,10 +122,16 @@ 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 + # 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, 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 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}, } ```