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
2 changes: 1 addition & 1 deletion .buildlibrary
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ValidationKey: '6037668'
ValidationKey: '6060168'
AutocreateReadme: yes
AutocreateCITATION: yes
AcceptedWarnings:
Expand Down
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: '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
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: 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"),
Expand Down
25 changes: 19 additions & 6 deletions R/calcCeTrade.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)

Expand Down Expand Up @@ -38,17 +38,17 @@ In case of questions / problems please contact Jakob Dürrwächter <jakobdu@pik-

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

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

A BibTeX entry for LaTeX users is

```latex
@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},
}
```
Loading