Commit 585b4182 authored by Erkka Rinne's avatar Erkka Rinne
Browse files

Use GAMS builtin `execError` for counting execution errors and stop looping

Removed now obsolete scalar `errorcount`.

Solves #102

(cherry picked from commit f9c5de45)
parent b9d04dfe
......@@ -128,7 +128,7 @@ $include '%input_dir%/modelsInit.gms'
* === Simulation ==============================================================
$include 'inc/3a_periodicInit.gms' // Initialize modelling loop
loop(modelSolves(mSolve, tSolve),
loop(modelSolves(mSolve, tSolve)$(execError = 0),
solveCount = solveCount + 1;
$$include 'inc/3b_periodicLoop.gms' // Update modelling loop
$$include 'inc/3c_inputsLoop.gms' // Read input data that is updated within the loop
......@@ -167,5 +167,5 @@ execute_unload '%output_dir%/results.gdx',
$ife %debug%>0
execute_unload '%output_dir%/debug.gdx';
if(errorcount > 0, abort errorcount);
if(execError, abort execError);
* === THE END =================================================================
......@@ -11,6 +11,7 @@ All notable changes to this project will be documented in this file.
### Changed
- Updated tool defintions for Sceleton Titan and Spine Toolbox
- The program will now stop looping in case of execution errors.
### Fixed
- Removed hard-coded `elec grids` from *setVariableLimits* and *rampSched files*
......
......@@ -17,7 +17,6 @@ $offtext
* --- Internal counters -------------------------------------------------------
Scalars
errorcount /0/
solveCount /0/
tSolveFirst "counter (ord) for the first t in the solve"
tSolveLast "counter for the last t in the solve"
......
......@@ -31,7 +31,7 @@ set metadata(*) /
'GAMS system' '%system.gstring%'
$include 'version'
/;
if(errorcount > 0, metadata('FAILED') = yes);
if(execError > 0, metadata('FAILED') = yes);
put f_info
put ""/;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment