pik-piam / remind2

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

CDR = "off" lets LCOE reporting fail #236

Closed orichters closed 2 years ago

orichters commented 2 years ago

With CDR = off in REMIND, so not the default DAC, the LCOE reporting fails:

[1] "start generation of LCOE reporting"
Joining, by = "tech"
Joining, by = c("region", "tech", "rlf")
Joining, by = c("region", "tech")
Error in .dimextract(x, k, 3, pmatch = pmatch, invert = invert) :
  subscript out of bounds ("dac")
In addition: There were 40 warnings (use warnings() to see them)
[1] "end generation of LCOE reporting"

Would be great if this was changed. I'm tagging the authors of reportLCOE.R.

robertpietzcker commented 2 years ago

I think this is the same problem as before - simply add dac to te2rlf, and then it will likely work. I don't understand why dac should not be included in te2rlf?!

orichters commented 2 years ago

should then be fixed together with https://github.com/remindmodel/remind/issues/771

robertpietzcker commented 2 years ago

Actually, I am now confused. after a comment from Kasha, I realized that dac is only in all_te and not in te when CDR is off. so I don't understand why reportLCOE sees dac in te at all?

katarkow commented 2 years ago

The error is thrown here, because p_teAnnuity is defined over te, where dac is not included.

Another problem with no CDR, a few lines below, is that the energy demand for DAC (p33_dac_fedem_el and p33_dac_fedem_heat) is not defined.

robertpietzcker commented 2 years ago

ok, so the problem is that there are specific calculations for dac which then break when dac is turned off and (currently) not included in the sets.

you could make this part of the reporting module-dependent, like the FE reporting is for transport/buildings/industry. Or add dac to te (and provide all necessary inputs) and force it to 0. I don't have a strong opinion which way is better

orichters commented 2 years ago

Personally, I would opt for letting it in the reporting, because if you run some scenarios with DAC and others without, you would rather have these number be set to zero than not have them in the reporting.

fschreyer commented 2 years ago

Hi all,

well this is a general problem of reportLCOE that it is not routinely tested when people make changes to REMIND or the reporting. So far, I think I was the only person using that script and I always solved compatibility issues from parameter/variable renamings etc. when I needed the script but not regularly.

katarkow commented 2 years ago

@fschreyer, thanks for reviewing my changes!