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

adapt emissions reporting to fixing and restructuring of industry feedstock equations #684

Merged
merged 22 commits into from
Jan 30, 2025

Conversation

fschreyer
Copy link
Contributor

@fschreyer fschreyer commented Jan 13, 2025

These are the reporting changes required for remindmodel/remind#1829.

@fschreyer
Copy link
Contributor Author

fschreyer commented Jan 28, 2025

Uargh, this was again more complicated and annoying than I expected. I receive no more summation errors with the GDXs of my test runs and carbon accounting in feedstocks should be correctly represented.

This should ideally be merged tmrw, I think, because I will be gone after Friday and I still have to do some adjustments to the project mappings after this. My proposal forward would be

1.)

  • I will run a last test setting cm_nonPlasticFeedstockEmiShare = 0.6 as proposed.
  • @JakobBD: could you merge my REMIND changes into restructure chemical feedstock emissions balancing remindmodel/remind#1829 and check everything again that it is ready to be merged. You would need to install this remind2 branch.
  • @fbenke-pik: We will need to merge this PR together with the REMIND PR. Could you replace the test GDX for remind2 with one I am going to provide to you (or let me know how to change it).

2.)

Once the REMIND PR is ready to merge -> we replace the remind2 test GDX -> we merge this PR -> we adapt the REMIND PR to require the new remind2 version -> we merge the REMIND PR

3.)

I will prepare a PR to the mappings in piaminterfaces.

@fschreyer
Copy link
Contributor Author

also tagging @amerfort to make the CarMa team aware

@fschreyer
Copy link
Contributor Author

I also wrote some more general explanation on the changes here.

What changes in terms of CDR / carbon management variables?

  • non-fossil waste incineration CCS is now also accounted under Emi|CO2|CDR|BECCS and Emi|CO2|CDR|Synthetic Fuels CCS

  • non-fossil non-plastics landfilling is now accounted under Emi|CO2|CDR|Materials|+|Non-Plastics

  • I also added a tree of Carbon Management|Feedstocks|Emitted/Stored|+|Fossil/Biomass ... variables to track carbon input and output of the feedstocks. This was mainly for diagnostics to verify that we account it correctly and is not necessary to report anywhere. I tested that all waste emissions correspond to the sum emitted fossil and stored negative non-fossil carbon:

Emi|CO2|+|Waste
+ Emi|CO2|Energy|Waste
=
Carbon Management|Feedstocks|Emitted|+|Fossil
- Carbon Management|Feedstocks|Stored|+|Biomass
- Carbon Management|Feedstocks|Stored|+|Synthetic

@JakobBD
Copy link
Contributor

JakobBD commented Jan 28, 2025

@JakobBD: could you merge my REMIND changes into remindmodel/remind#1829 and check everything again that it is ready to be merged. You would need to install this remind2 branch.

I did. I also merged the current develop branch. Had to rebase, strangely.
Ran with your remind2 branch.
Got errors that seem to be unrelated to the changes here, but someone else messing up REMIND. Will try again in a few days, I guess? Runs are here: /p/tmp/jakobdu/remind_dev2/output/SSP2-NPi_2025-01-28_15.52.56.

@fschreyer fschreyer requested a review from amerfort January 28, 2025 15:31
@fschreyer fschreyer marked this pull request as ready for review January 28, 2025 15:31
@fschreyer
Copy link
Contributor Author

fschreyer commented Jan 28, 2025

Got errors that seem to be unrelated to the changes here, but someone else messing up REMIND

Update: Found the issue. A demScen was by accident removed today.
remindmodel/remind#1965
Hope this is fixed tomorrow.

Copy link
Contributor

@amerfort amerfort left a comment

Choose a reason for hiding this comment

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

I didn't spot any flaws and I appreciate all your work.
As we discussed the changes earlier today, I fully support it conceptually. When all tests succeed, I gladly approve the PR.

@JakobBD
Copy link
Contributor

JakobBD commented Jan 29, 2025

make test and H12 NPi both working now. From my side, ready to do buildLibrary and merge!
See /p/tmp/jakobdu/remind_dev2/output/SSP2-NPi_2025-01-29_12.59.37.
Thanks for all the effort.

@fschreyer
Copy link
Contributor Author

ok, cool. @fbenke-pik can you upload /p/tmp/jakobdu/remind_dev2/output/SSP2-NPi_2025-01-29_12.59.37 to the RSE repo for the remind2 tests such that I can run buildlibrary?

@fbenke-pik
Copy link
Contributor

fbenke-pik commented Jan 30, 2025

ok, cool. @fbenke-pik can you upload /p/tmp/jakobdu/remind_dev2/output/SSP2-NPi_2025-01-29_12.59.37 to the RSE repo for the remind2 tests such that I can run buildlibrary?

Seems like we need two gdx files in a peculiar format.
https://github.com/pik-piam/remind2/blob/master/tests/testthat/test-convGDX2mif.R#L17-L18

@orichters can you let us know what the procedure is to generate test gdxes for the remind2 test case?

Looks like we need to start two different runs to get specific gdxes?

@fschreyer
Copy link
Contributor Author

fschreyer commented Jan 30, 2025

Ok, so the tests require a H12 Npi run and a Policy EU21 run. I remember that we introduced this to cover different cases of GDXs that arrive. Generally, that is useful. However, we have to finish this by tmrw and I fear we won't get there if we wait for these runs to finish. So I'd propose a shortcut:

Could we set the tests only to this Npi GDX for now?

@JakobBD Can you set up a EU21 Npi + PkBudg cascade? I would take the fulldata.gdx of the 2nd or 3rd iteration after an hour or so and test against the reporting. If this works, I would built and merge.

We should merge everything today so that I have a chance to adapt the mappings tmrw and respond to potential issues.

Also, Falk could you maybe write down a procedure in remind2 for future people if they want to introduce changes to the library that need new test GDXs?

@orichters
Copy link
Contributor

orichters commented Jan 30, 2025 via email

@fschreyer
Copy link
Contributor Author

Due to time pressure, I agreed with @fbenke-pik that I will merge now and he will take care of a (technical) backwards compatibility to the release version GDXs. Thanks!

@fschreyer fschreyer merged commit ab3b7a3 into pik-piam:master Jan 30, 2025
1 check 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.

5 participants