/
run-file-template.erb
109 lines (91 loc) · 2.79 KB
/
run-file-template.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
$TITLE TIMES -- VERSION 4.1.0
OPTION RESLIM=50000, PROFILE=1, SOLVEOPT=REPLACE;
OPTION ITERLIM=999999, LIMROW=0, LIMCOL=0, SOLPRINT=OFF;
option LP=cplex;
*--If you want to use an optimizer other than cplex/xpress, enter it here:
*OPTION LP=MyOptimizer;
$OFFLISTING
*$ONLISTING
* activate validation to force VAR_CAP/COMPRD
$SET VALIDATE 'NO'
* reduction of equation system
$SET REDUCE 'YES'
*--------------------------------------------------------------*
* BATINCLUDE calls should all be with lower case file names!!! *
*--------------------------------------------------------------*
* initialize the environment variables
$ SET DSCAUTO YES
$ SET VDA YES
$ SET DEBUG 'NO'
$ SET DUMPSOL 'NO'
$ SET SOLVE_NOW 'YES'
$ SET MODEL_NAME 'TIMES'
$ IF DECLARED REG $SET STARTRUN 'RESTART'
$ IF NOT DECLARED REG $SET STARTRUN 'SCRATCH'
$SET XTQA YES
* VAR_UC being set so that non-binding constraints appear in results
$SET VAR_UC YES
OPTION BRATIO=1;
$ SET OBJ AUTO
$SET DAMAGE NO
$ SET TIMESED NO
$ SET STAGES NO
$SET SOLVEDA 'YES'
* Tom Counsell I think that, by setting this, more of the input parameters appear in the output GDX file
* Which is handy so that we can track what went into a particualr scenario
* SET MEMCLEAN 'NO'
SET MEMCLEAN 'YES'
* merge declarations & data
$ ONMULTI
* the times-slices MUST come 1st to ensure ordering OK
* This is an addition by Tom Counsell
* Just add the time slices directly to avoid uninteligable error messages
SET ALL_TS
/
ANNUAL
P
S
A
W
PD
PP
PE
PN
SD
SP
SE
SN
AD
AP
AE
AN
WD
WP
WE
WN
/;
* perform fixed declarations
$SET BOTIME 1970
$BATINCLUDE initsys.mod
* declare the (system/user) empties
$ BATINCLUDE initmty.mod
*$ BATINCLUDE initmty.mod DSC
$IF NOT DECLARED REG_BNDCST $Abort "You need to use TIMES v2.3.1 or higher"
<%= list_of_dd_files %>
* This is a new addition by Tom Counsell
* It is used so that we can extract the names of the scenarios
* Used in this run from the GDX file at the end
SET scenarios
/<% list_of_scenarios.each do |scenario_name| %>
<%= scenario_name %><% end %>
/;
SET MILESTONYR /2010,2011,2012,2015,2020,2025,2030,2035,2040,2045,2050,2055,2060/;
$SET RUN_NAME 'UKTM_BASE'
* JonTecwyn Feb 2017 - SHORT TERM Fixes to numerical problems based on suggestions by Antti Lehtila - need longer term solution
NCAP_AF(R,LL,P,S,BD)$((NCAP_AF(R,LL,P,S,BD)<1E-7)$NCAP_AF(R,LL,P,S,BD))=eps;
VDA_EMCB(R,LL,C,COM)$((ABS(VDA_EMCB(R,LL,C,COM))<1E-8)$VDA_EMCB(R,LL,C,COM))=eps;
COM_BNDNET(R,LL,C,S,'LO')$((COM_BNDNET(R,LL,C,S,'LO')<-1E6)$COM_BNDNET(R,LL,C,S,'LO'))=-INF;
FLO_EMIS(R,LL,P,COM,C,S)$((NOT SUM(TOP(R,P,COM,IO),1))$TOP(R,P,'ELC-E-EU','OUT')$COM_TMAP(R,'ENV',COM)) = 0;
$ SET VEDAVDD 'YES'
* do the rest
$ BATINCLUDE maindrv.mod mod