pik-piam / remind2

The remind2 package contains the REMIND-specific routines for data and model output manipulation.
0 stars 40 forks source link

Restore condition for project-specific emissions reporting #523

Closed mellamoSimon closed 7 months ago

mellamoSimon commented 7 months ago

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: https://github.com/pik-piam/remind2/pull/530 .

fbenke-pik commented 7 months ago

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 commented 7 months ago

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 commented 7 months ago

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 commented 7 months ago

:shipit: