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

reportCosts fails on industry set mismatches #575

Closed
orichters opened this issue Mar 25, 2024 · 1 comment · Fixed by #577
Closed

reportCosts fails on industry set mismatches #575

orichters opened this issue Mar 25, 2024 · 1 comment · Fixed by #577
Assignees

Comments

@orichters
Copy link
Contributor

  • In the new runs by @LaviniaBaumstark, the following problem occurs while running the reporting, see /p/projects/remind/runs/REMIND_2024_03_24/remind/output/SSP2EU-PkBudg650_2024-03-24_20.02.18/log.txt:
running reportCosts...
Error in .dimextract(x, k, 3, pmatch = pmatch, invert = invert) :
  subscript out of bounds ("sesofos.fesos.ETS", "sesofos.fesos.ES", "sesobio.fesos.ETS", "sesobio.fesos.ES", "seliqfos.fehos.ES", "seliqbio.fehos.ETS", "seliqbio.fehos.ES", "seliqsyn.fehos.ETS", "seliqsyn.fehos.ES", "segafos.fegas.ETS", "segafos.fegas.ES", "segabio.fegas.ETS", "segabio.fegas.ES", "segasyn.fegas.ETS", "segasyn.fegas.ES", "seh2.feh2s.ETS", "seh2.feh2s.ES", "sehe.fehes.ETS", "sehe.fehes.ES", "seel.feels.ETS", "seel.feels.ES", "seliqfos.fehos.ETS")

You can reproduce the error with:

library(remind2); library(gdx)
gdx <- "/p/projects/remind/runs/REMIND_2024_03_24/remind/output/SSP2EU-PkBudg650_2024-03-24_20.02.18/fulldata.gdx"
demFeIndst.m   <- readGDX(gdx,name=c("q37_demFeIndst"),types="equations",restore_zeros=FALSE,field="m",format="first_found")
budget.m       <- readGDX(gdx,name='qm_budget', types="equations",field="m",format="first_found") # alternative: calcPrice
pm_conv_TWa_EJ <- 31.536
vm_demFeSector <- readGDX(gdx,name=c("vm_demFeSector"),field="l",restore_zeros=FALSE,format="first_found")
price_fe_indst_emiMkt <- abs(demFeIndst.m/(budget.m+1e-10)) * 1000 / pm_conv_TWa_EJ
quant_fe_indst_emiMkt <- dimSums(dimSums(vm_demFeSector[,,"indst"],dim=c(3.1),na.rm=T),dim=c(3.2),na.rm=T)[,,getNames(price_fe_indst_emiMkt)]

It might be that the dimSums are not working as intended, not sure whether that is related to #541, but as you, @0UmfHxcvx5J7JoaOhFSs5mncnisTJJ6q, are also the industry expert, maybe you can have a look or at least assign someone suitable.

I suspect the underlying reason are the different sets used in q37_demFeIndst for subsectors and fixed_shares realization.

fixed_shares:   q37_demFeIndst(ttot,all_regi,all_enty,all_emiMkt)           "industry final energy demand (per emission market)"
subsectors:     q37_demFeIndst(ttot,all_regi,all_enty,all_enty,all_emiMkt)  "industry final energy demand (per emission market)"
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 a pull request may close this issue.

2 participants