Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore condition for project-specific emissions reporting #523

Merged

Conversation

mellamoSimon
Copy link
Contributor

@mellamoSimon mellamoSimon commented Feb 6, 2024

This restores a condition designed to enable the reporting of industry emissions from feedstocks with an ad-hoc ex-post fix designed for the Ariadne project. Used when feedstock flows are not available (older remind versions).
This PR is NOT intended to fix the inconsistencies in emissions accounting. That will come in this one: #530 .

@fbenke-pik
Copy link
Contributor

fbenke-pik commented Feb 6, 2024

The test also fails for ECEMF. The problem is the variable emi.vars.wNonEn, which is declared under the condition you introduced, is also used later on outside of your condition in line 2770: https://github.com/mellamoSimon/remind2/blob/fix-emissions-inconsistency/R/reportEmi.R#L2770

So it crashes with

Error in intersect(emi.vars.wBunkers, emi.vars.wNonEn) : 
  object 'emi.vars.wNonEn' not found

So you just have to make sure that emi.vars.wNonEn is defined with reasonable values under any condition. Or you avoid using this variable when creating emi.vars.wBunkers.wNonEn

@mellamoSimon
Copy link
Contributor Author

ok, will do, thank you! For the record: I didn't realize that the mapping tests can be skipped and buildLibrary still is successful when running locally (which is what had happened here)

@mellamoSimon mellamoSimon marked this pull request as ready for review February 6, 2024 17:21
R/reportEmi.R Outdated
Comment on lines 509 to 510
setNames(dimSums(vm_feedstockEmiUnknownFate, dim=3)* GtC_2_MtCO2,
setNames((dimSums(vm_feedstockEmiUnknownFate, dim=3))* GtC_2_MtCO2,
"Emi|CO2|Energy|Waste|+|Feedstocks unknown fate (Mt CO2/yr)"),
setNames(dimSums(vm_incinerationEmi, dim=3)* GtC_2_MtCO2,
setNames((dimSums(vm_incinerationEmi, dim=3))* GtC_2_MtCO2,

Choose a reason for hiding this comment

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

What is up with those brackets?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ups, I was trying something and forgot to delete those. Now I did.

@mellamoSimon mellamoSimon changed the title Restore condition for emissions reporting in Ariadne Restore condition for project-specific emissions reporting Feb 7, 2024
@mellamoSimon
Copy link
Contributor Author

I ran all the mapping tests manually and they all passed (with warnings of missing variables for some and the gaps in the summation checks, as expected)

@0UmfHxcvx5J7JoaOhFSs5mncnisTJJ6q
Copy link
Member

:shipit:

@mellamoSimon mellamoSimon merged commit fd4cd7c into pik-piam:master Feb 8, 2024
4 checks passed
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.

3 participants