pik-piam / remind2

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

reportLCOE() breaks on testOneRegi gdxes #595

Closed 0UmfHxcvx5J7JoaOhFSs5mncnisTJJ6q closed 1 month ago

0UmfHxcvx5J7JoaOhFSs5mncnisTJJ6q commented 2 months ago

This https://github.com/pik-piam/remind2/blob/abc388346a481ae45eda06e5388797071d75cbe1/R/reportLCOE.R#L285-L286 results in

$ grep -A 4 'start generation of LCOE reporting' /p/projects/remind/modeltests/remind/output/testOneRegi-Base-AMT_2024-05-03_22.06.58/log.txt
### start generation of LCOE reporting at 2024-05-03 22:25:44
Error in x@.Data[i, j, k] <- value : 
  number of items to replace is not a multiple of replacement length
In addition: There were 50 or more warnings (use warnings() to see the first 50)
### end generation of LCOE reporting at 2024-05-03 22:31:30

because it assumes Fuel.Price to have the same regions as the other factors, which it does not if the marginal of the budget equation is zero for an entire region

$ dumpgdx /p/projects/remind/modeltests/remind/output/testOneRegi-Base-AMT_2024-05-03_22.06.58/input.gdx qm_budget "SSA,M"
2005  SSA  M  Eps
2010  SSA  M  Eps
2015  SSA  M  Eps
2020  SSA  M  Eps
2025  SSA  M  Eps
2030  SSA  M  Eps
2035  SSA  M  Eps
2040  SSA  M  Eps
2045  SSA  M  Eps
2050  SSA  M  Eps
2055  SSA  M  Eps
2060  SSA  M  Eps
2070  SSA  M  Eps
2080  SSA  M  Eps
2090  SSA  M  Eps
2100  SSA  M  Eps
2110  SSA  M  Eps
2130  SSA  M  Eps
2150  SSA  M  Eps

A task for matchDim().

fbenke-pik commented 2 months ago

Should be fixed with this: https://github.com/pik-piam/remind2/pull/597

tabeado commented 2 months ago

thanks @fbenke-pik and sorry for breaking it!