Hi
I am getting different errors, but anyway, here are my comments:
In your Gams file you read over and over again the same parameters (e.g. FIXC) from different sheets in the same gdx-file. However, this would mean that you would overwrite these values each time you call gdxxrw.
As you have everything hardcoded now, I would proceed as follows:
[-] Check your reading over the first block (there are at the moment dimensionality errors). You can do this easily by slightly adjusting your code and using $exit to stop further compilation:
Code: Select all
$onecho > Pakdata.txt
par=FixC rng=S2018!b120:c184
par=VarC rng=S2018!f120:g184
par=GrsC rng=S2018!j120:k184
par=CapF rng=S2018!n120:o184
par=FC rng=S2018!b2:e56
par=VC rng=S2018!i2:l56
par=GC rng=S2018!p2:s56
par=CF rng=S2018!w2:z56
par=FuelExi rng=S2018!w60:z114
par=HRExi rng=S2018!p60:s114
par=CO2 rng=S2018!b60:e114
par=FCost rng=S2018!b188:d228
par=VCost rng=S2018!h188:j228
par=GCap rng=S2018!n188:p228
par=CFac rng=S2018!t188:v228
par=CapC rng=S2018!b279:d319
par=CO2new rng=S2018!b233:d273
par=HRNew rng=S2018!n233:p273
par=FuelNew rng=S2018!t233:v273
$offecho
$CALL GDXXRW.EXE Pakdata.xlsx o=2018.gdx @Pakdata.txt
$GDXIN Pakdata.gdx
$LOAD FixC, VarC, GrsC, CapF, FC, VC, GC, CF, FuelExi, HRExi, CO2, FCost, VCost, Gcap, CFac, CapC, CO2new, HRNew, FuelNew
$GDXIN
$exit
[-] If that is error-free, you can add delete the the lines from $LOAD to $exit and add after each block the following lines
Code: Select all
$offecho
$CALL GDXXRW.EXE Pakdata.xlsx o=2018.gdx @Pakdata.txt
* And for the next block the same
..
par=FuelNew rng=S2019!t233:v273
$offecho
$CALL GDXXRW.EXE Pakdata.xlsx o=2019.gdx @Pakdata.txt
... etc.
Note the different name for the gdx file.
[-] Run all this code in a separate file (e.g. readdata.gms).
[-] use the gdxmerge command to merge all these files which will result in your parameters with the additional index of the year (in fact the name of your gdx file). e.g. FixC(year, ....).
[-] Now read the newly built parameters into your model file and adjust code for the additional index.
I hope this helps
Cheers
Renger