pik-piam / lucode2

A collection of tools which allow to manipulate and analyze code.
Other
0 stars 16 forks source link

manipulateConfig: doesn't handle GAMS unquoted comments that include "=" sign properly #203

Closed cchrisgong closed 3 months ago

cchrisgong commented 4 months ago

I have some unquoted comments in main.gms and it looks like this

*** cm_fxIndUe "switch for fixing UE demand in industry to baseline level - no endogenous demand adjustment"
*' * default cm_fxIndUe = off -> endogenous demand, cm_fxIndUe = on -> exogenous demand fixed to baseline/NPi level (read in from input_ref.gdx)
*' * cm_fxIndUeReg indicates the regions under which the industry demand will be fixed 
*' * for example, cm_fxIndUe = on and cm_fxIndUeReg = SSA,NEU,CHA,IND,OAS,MEA,LAM gives a scenario where all non global north (non-OECD) industry demand is fixed to baseline
*' * cm_fxIndUeReg = GLO fixes industry demand to baseline level everywhere
$setGlobal cm_fxIndUe        off  !! def = off
$setGlobal cm_fxIndUeReg     ""       !! def = ""

However, I have been missing words from the comment in the full.lst

1509
1510  *** cm_fxIndUe "switch for fixing UE demand in industry to baseline level - no endogenous demand adjustment"
1511  *' * default cm_fxIndUe = on' * cm_fxIndUeReg indicates the regions under which the industry demand will be fixed
1512  *' * for example, cm_fxIndUe = on' * cm_fxIndUeReg = CHA""
***

example path: /p/tmp/chengong/efc/remind/output/SSP2-EFC-NDC_cpol_230_delayed_fast_2024-07-24_12.15.16

This looks similar to the slash issue existed before here: https://github.com/pik-piam/lucode2/issues/121

The text after the first "=" is eaten off, until the next "=", then printing "on", only to proceed to abandon everything including and after "->", then carrying on to the next line. The first "=" was followed by on, but then skipped again. Not sure what happens to the two lines $setGlobal cm_fxIndUe off !! def = off $setGlobal cm_fxIndUeReg "" !! def = ""

since they are not printed in full.lst. But in the end, these switches are also not properly functioning, so I assume they also might not have been transcribed at all or skipped.