Skip to content

Validation mif - #65

Merged
leonieschweiger merged 16 commits into
pik-piam:mainfrom
leonieschweiger:validation_mif
Jul 20, 2026
Merged

Validation mif#65
leonieschweiger merged 16 commits into
pik-piam:mainfrom
leonieschweiger:validation_mif

Conversation

@leonieschweiger

@leonieschweiger leonieschweiger commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Creates a validation mif for the REMIND-MFA.
New sources are added that provide projections of plastics demand & production and are integrated into the new validation mif.

@leonieschweiger
leonieschweiger marked this pull request as ready for review July 20, 2026 08:20

@JakobBD JakobBD left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff, and impressive!
Probably good to let Falk have a look?

@bennet21 bennet21 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, Leonie, this is really cool stuff! Does fullVALIDATIONMFA now automatically run in the preprocessing?
I didn't do a full review, so my comments are mainly for improving my understanding :)

Comment thread R/calcPlIEA.R Outdated
Comment thread R/fullVALIDATIONMFA.R
Comment thread R/fullVALIDATIONMFA.R
valfile <- "validation.mif"

# Pottinger 2024 plastics material flows (all scenarios) ----
calcOutput(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we prepare material sections like in fullMFA? :)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea, let's implement this as soon as we add validation data for steel or cement :)

Comment thread DESCRIPTION
magclass (>= 6.16.1),
mrdrivers (>= 4.0.0),
mrcommonsenergy (>= 0.3.4),
mrindustry (>= 1.2.1),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where do we need mrindustry now? :)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am using 2 sources in the validation mif for plastics that are also used in mrindustry - Stegmann2022 and IEA_Petrochem.

@fbenke-pik fbenke-pik Jul 20, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important to note that this creates a hierarchy between mrindustry and mrmfa for the first time. Not a problem per-se, but the moment you also need functions from mrmfa in mrindustry, you will need to start moving stuff to mrcommonsenergy.

See also: https://gitlab.pik-potsdam.de/rse/rsewiki/-/wikis/REMIND-mr-package-structure

@leonieschweiger

Copy link
Copy Markdown
Collaborator Author

Thanks, Leonie, this is really cool stuff! Does fullVALIDATIONMFA now automatically run in the preprocessing? I didn't do a full review, so my comments are mainly for improving my understanding :)

I have not yet integrated it into our preprocessing, so far I have only run it locally. Good point though, I will do this in a next step once this is merged.

@fbenke-pik fbenke-pik left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, none of my comments are change requests, only FYI / remarks.

Comment thread R/calcPlGaoCabrera.R Outdated
Comment thread R/calcPlIEA.R
x = out,
weight = pop,
unit = "kg/cap",
description = paste(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally, I am a big fan of glue:

description = glue::glue(
   "Per-capita Global production of key thermoplastics 1980-2050 from IEA 'The Future of \\
   Petrochemicals' (2018), Figure 4.2 (Reference Technology Scenario), reported \\
   at the global level under the IAMC variables Production|Chemicals|Plastics \\
   and Material Demand|Chemicals|Plastics.; population from UN WPP (estimates + medium)."
)

Comment thread R/calcPlPottinger.R
# subset to keep only mapped variables
x <- x[, , variables_kept]
new_names <- iamc[variables_kept]
getItems(x, dim = 3.2) <- as.vector(new_names)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, toolAggregate has been fixed to not blow up dimensions with more than one subdimension, so this should now work as well and yield identical results

  map <- data.frame(
    from = c("totalConsumptionMt", "primaryProductionMt", "secondaryProductionMt"),
    to =  c("Material Demand|Chemicals|Plastics", "Production|Chemicals|Plastics|Primary", "Production|Chemicals|Plastics|Secondary")
  )

  x <- toolAggregate(x, dim = 3.2, map, partrel = TRUE, verbosity = 2)

@fbenke-pik

Copy link
Copy Markdown
Contributor

Just in case you haven't done this yet, please run preprocessing with this and verify that it does not crash and the mif looks good.

@leonieschweiger
leonieschweiger merged commit 1630f23 into pik-piam:main Jul 20, 2026
1 check passed
@leonieschweiger
leonieschweiger deleted the validation_mif branch July 20, 2026 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants