Model/_compile_stages.gms

Compile the model stages and abort before execution to quickly check for compilation errors without having to execute the model stages via 0_executbatch.gms.

Instead of chaining the numbered stages via restart files, this script includes them in-sequence to reproduce the same compile-time state transfer between stages as done via chained restart files.

Note: first run the pre-compilation of the Data folder to ensure that all expected $include and $gdxin files in Model/finaldata are available.

Note: when the compilation succeeds and execution commences, this script aborts with an execution error. That is expected.

You can prevent GAMS from attempting to execute this script after compilation using the C (compile) value of the action command line option as shown below:

gams _compile_stages.gms action=C

or by compiling this script via Shift+F9 in GAMS Studio.

This script can also be used as input for the parse action of the GAMS trace static analysis tool.

Similarly, you can generate a reference file using:

gams _compile_stages.gms action=C rf=default

and use the reference file viewer to examine the resulting _compile_stages.ref file in GAMS Studio.

Includes