pik-piam / remind2

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

Infinite CCS potential for DEU reported #561

Closed 0UmfHxcvx5J7JoaOhFSs5mncnisTJJ6q closed 1 week ago

0UmfHxcvx5J7JoaOhFSs5mncnisTJJ6q commented 6 months ago

This https://github.com/pik-piam/remind2/blob/ee372c4431f0b6f9e7d6789b1fae05f64d288a19/R/reportEmi.R#L1634-L1635 does not work for DEU (and by extension EUR, EU27, and World). For an example see /p/projects/remind/modeltests/remind/output/SSP2EU-EU21-NPi-AMT_2024-03-01_22.12.41/REMIND_generic_SSP2EU-EU21-NPi-AMT_withoutPlus.mif

$ sed -n '1 p; /Carbon Management|Storage|Maximum annual CO2 storage potential/ p' /p/projects/remind/modeltests/remind/output/SSP2EU-EU21-NPi-AMT_2024-03-01_22.12.41/REMIND_generic_SSP2EU-EU21-NPi-AMT_withoutPlus.mi
f | cut -d ';' -f -12 | column -ts ';'
Model   Scenario             Region  Variable                                                        Unit       2005  2010  2015  2020        2025        2030          2035
REMIND  SSP2EU-EU21-NPi-AMT  CAZ     Carbon Management|Storage|Maximum annual CO2 storage potential  Mt CO2/yr  0     0     0     18.4999833  18.4999833  1515.6069293  1515.6069293
REMIND  SSP2EU-EU21-NPi-AMT  CHA     Carbon Management|Storage|Maximum annual CO2 storage potential  Mt CO2/yr  0     0     0     9.4099867   9.4099867   1837.0965745  1837.0965745
REMIND  SSP2EU-EU21-NPi-AMT  DEU     Carbon Management|Storage|Maximum annual CO2 storage potential  Mt CO2/yr  Inf   Inf   Inf   Inf         Inf         Inf           110
REMIND  SSP2EU-EU21-NPi-AMT  ECE     Carbon Management|Storage|Maximum annual CO2 storage potential  Mt CO2/yr  0     0     0     0           0           29.75         29.75
REMIND  SSP2EU-EU21-NPi-AMT  ECS     Carbon Management|Storage|Maximum annual CO2 storage potential  Mt CO2/yr  0     0     0     0           0           73.645        73.645
REMIND  SSP2EU-EU21-NPi-AMT  ENC     Carbon Management|Storage|Maximum annual CO2 storage potential  Mt CO2/yr  0     0     0     0           0           55            55
REMIND  SSP2EU-EU21-NPi-AMT  ESC     Carbon Management|Storage|Maximum annual CO2 storage potential  Mt CO2/yr  0     0     0     0           0           34.0199999    34.0199999
REMIND  SSP2EU-EU21-NPi-AMT  ESW     Carbon Management|Storage|Maximum annual CO2 storage potential  Mt CO2/yr  0     0     0     0           0           70.895        70.895
REMIND  SSP2EU-EU21-NPi-AMT  EU27    Carbon Management|Storage|Maximum annual CO2 storage potential  Mt CO2/yr  Inf   Inf   Inf   Inf         Inf         Inf           556.6433332
REMIND  SSP2EU-EU21-NPi-AMT  EUR     Carbon Management|Storage|Maximum annual CO2 storage potential  Mt CO2/yr  Inf   Inf   Inf   Inf         Inf         Inf           739.9766666
REMIND  SSP2EU-EU21-NPi-AMT  EWN     Carbon Management|Storage|Maximum annual CO2 storage potential  Mt CO2/yr  0     0     0     0           0           91.6666667    91.6666667
REMIND  SSP2EU-EU21-NPi-AMT  FRA     Carbon Management|Storage|Maximum annual CO2 storage potential  Mt CO2/yr  0     0     0     0           0           91.6666667    91.6666667
REMIND  SSP2EU-EU21-NPi-AMT  IND     Carbon Management|Storage|Maximum annual CO2 storage potential  Mt CO2/yr  0     0     0     0           0           916.6666667   916.6666667
REMIND  SSP2EU-EU21-NPi-AMT  JPN     Carbon Management|Storage|Maximum annual CO2 storage potential  Mt CO2/yr  0     0     0     0           0           343.75        343.75
REMIND  SSP2EU-EU21-NPi-AMT  LAM     Carbon Management|Storage|Maximum annual CO2 storage potential  Mt CO2/yr  0     0     0     1.00001     1.00001     2752.1713186  2752.1713186
REMIND  SSP2EU-EU21-NPi-AMT  MEA     Carbon Management|Storage|Maximum annual CO2 storage potential  Mt CO2/yr  0     0     0     1.5999867   1.5999867   1763.4501751  1763.4501751
REMIND  SSP2EU-EU21-NPi-AMT  NEN     Carbon Management|Storage|Maximum annual CO2 storage potential  Mt CO2/yr  0     0     0     2.9000033   2.9000033   128.3333333   128.3333333
REMIND  SSP2EU-EU21-NPi-AMT  NES     Carbon Management|Storage|Maximum annual CO2 storage potential  Mt CO2/yr  0     0     0     0           0           3.59          3.59
REMIND  SSP2EU-EU21-NPi-AMT  NEU     Carbon Management|Storage|Maximum annual CO2 storage potential  Mt CO2/yr  0     0     0     2.9000033   2.9000033   131.9233333   131.9233333
REMIND  SSP2EU-EU21-NPi-AMT  OAS     Carbon Management|Storage|Maximum annual CO2 storage potential  Mt CO2/yr  0     0     0     1.9999833   1.9999833   912.9034255   912.9034255
REMIND  SSP2EU-EU21-NPi-AMT  REF     Carbon Management|Storage|Maximum annual CO2 storage potential  Mt CO2/yr  0     0     0     0           0           5280.3695241  5280.3695241
REMIND  SSP2EU-EU21-NPi-AMT  SSA     Carbon Management|Storage|Maximum annual CO2 storage potential  Mt CO2/yr  0     0     0     0           0           1160.8644197  1160.8644197
REMIND  SSP2EU-EU21-NPi-AMT  UKI     Carbon Management|Storage|Maximum annual CO2 storage potential  Mt CO2/yr  0     0     0     3.7999867   3.7999867   183.3333333   183.3333333
REMIND  SSP2EU-EU21-NPi-AMT  USA     Carbon Management|Storage|Maximum annual CO2 storage potential  Mt CO2/yr  0     0     0     28.1000133  28.1000133  2289.4953481  2289.4953481
REMIND  SSP2EU-EU21-NPi-AMT  World   Carbon Management|Storage|Maximum annual CO2 storage potential  Mt CO2/yr  Inf   Inf   Inf   Inf         Inf         Inf           19644.2743814

For some reason, vm_co2ccs.up(DEU,pcc) and vm_co2ccs.up(DEU,pco) are Inf, which of course sums up to Inf. Either figure out why that is on the REMIND/GAMS side, or here

max_geolStorage[is.infinite(max_geolStorage)] <- NA
tabeado commented 6 months ago

@orichters pointed towards these lines (thank you!): https://github.com/remindmodel/remind/blob/854dfea96f49906db764b6b1f3dcf7e3fdf59c06/modules/47_regipol/none/bounds.gms#L24 https://github.com/remindmodel/remind/blob/854dfea96f49906db764b6b1f3dcf7e3fdf59c06/modules/47_regipol/regiCarbonPrice/bounds.gms#L54

@amerfort and @fschreyer: Is this line still required given the update of the near-term CCS bounds? I believe the DEU limit is no longer envisioned to be 0 in 2030? If this should still be an option for different scenarios, we might want to change it to a switch?

fschreyer commented 6 months ago

If Germany is covered by the new CCS bounds, which I think is the case, this can be removed.

orichters commented 6 months ago

@tabeado Can we fix that before the release, probably just removing those two lines?

tabeado commented 5 months ago

Summary of a brief discussion with Felix:

Felix takes it to the REMIND-EU meeting to make a decision.

0UmfHxcvx5J7JoaOhFSs5mncnisTJJ6q commented 1 month ago

Felix takes it to the REMIND-EU meeting to make a decision.

Was any decision made?

SSP2-EU21-NPi-AMT_2024-08-16_22.12.58/REMIND_generic_SSP2-EU21-NPi-AMT_withoutPlus.mif

Model   Scenario           Region  Variable                                                        Unit       2005  2010  2015  2020  2025  2030
REMIND  SSP2-EU21-NPi-AMT  DEU     Carbon Management|Storage|Maximum annual CO2 storage potential  Mt CO2/yr  Inf   Inf   Inf   Inf   Inf   Inf
REMIND  SSP2-EU21-NPi-AMT  EU27    Carbon Management|Storage|Maximum annual CO2 storage potential  Mt CO2/yr  Inf   Inf   Inf   Inf   Inf   Inf
REMIND  SSP2-EU21-NPi-AMT  EUR     Carbon Management|Storage|Maximum annual CO2 storage potential  Mt CO2/yr  Inf   Inf   Inf   Inf   Inf   Inf
REMIND  SSP2-EU21-NPi-AMT  World   Carbon Management|Storage|Maximum annual CO2 storage potential  Mt CO2/yr  Inf   Inf   Inf   Inf   Inf   Inf
fschreyer commented 1 month ago

I don't see how it relates to this line. The run you show does not have it anymore.

Shouldn't summing over all elements of an upper bounds always give INF because this is what an upper bound is by default? Without looking deeper, I don't quite get why it only occurs for Germany. I would say that we should just assign elements of cco2.ico2.ccsinje.1 in this line as this is what is used as CCS potential and that should do it.

orichters commented 1 month ago

In core/bounds.gms, we have

vm_co2CCS.up(t,regi,"cco2","ico2","ccsinje","1")

In modules/47_regipol/none/bounds.gms and earlier in regipol, the assignment was

vm_co2CCS.up(t,regi,"cco2","ico2",te,rlf)

This added values to many more te and rlf instead of just ccsinje and 1, and then this sum resulted in Inf. I agree, just use ccsinje.1 in reportEmi. I would still remove the line in modules/47_regipol/none/bounds.gms as well.

tabeado commented 1 month ago

Hi, thanks for picking this up again, I somehow had thought it was solved. Unfortunately I can make the adjustment only after I return from my vacation in 2 weeks. If you want it fixed before that, please go ahead.

tabeado commented 2 weeks ago

Thanks for figuring out the bug, Felix and Oli! It only occurred for NPis.

I changed the reportEmi in this PR: https://github.com/pik-piam/remind2/pull/654

When accepted, I think we can close this issue.