-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathinitsys.mod
187 lines (163 loc) · 7.81 KB
/
initsys.mod
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
$TITLE TIMES -- VERSION 4.8.6
*==========================================================================================*
* INITSYS.MOD has all the fixed system declarations for ETSAP TIMES *
*==========================================================================================*
$ onlisting ontext
*===========================================================================================
* Copyright (C) 2000-2025 IEA Energy Technology Systems Analysis Programme (IEA-ETSAP).
* This software (ETSAP TIMES) is open source: you can redistribute it and/or modify it
* under the terms of the GNU General Public License v3.0 (see file NOTICE-GPLv3.txt).
* For further information, visit: <https://www.gnu.org/licenses/gpl-3.0.html>.
*
* This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*===========================================================================================
$ offtext
$ offlisting
$ SET TMP Restart
$ IF %SYSTEM.LICENSELEVEL%==2 $SET TMP Runtime
$ IF SET RunTimes $TITLE %SYSTEM.TITLE% -- %TMP% (v%RunTimes%)
$ PHANTOM EMPTY
$ ONEMPTY
$ ONMULTI
* TIME - SET ALL_TS ordering is crucial, since the order of time-slices within a TSLVL is used in EQ_STGTSS.
* Therefore, declare ALL_TS first, before the call to INITSYS.MOD. Example:
*
* SET ALL_TS 'Time-slices '
* / ANNUAL 'Annual '
* I 'Intermediate'
* S 'Summer '
* W 'Winter '
* / ;
ALIAS(*,ITEM);
* Defaults for the some total spans available in the model:
$IF NOT SET BOTIME $SETGLOBAL BOTIME 1850
$IF NOT SET EOTIME $SETGLOBAL EOTIME 2200
$IF NOT %SHELL%==ANSWER
$IF SET MAXSOW SET ITEM /BOH, 1*%EOTIME%/;
SET BOHYEAR 'BOH + years' / BOH, %BOTIME%*%EOTIME% /
SET ALLYEAR 'All Years' / %BOTIME%*%EOTIME% /
PARAMETER YEARVAL(ALLYEAR) 'Value of each year';
YEARVAL(ALLYEAR) = %BOTIME% + ORD(ALLYEAR)-1;
SET EOHYEAR "'BOH/EOH' + years" / SET.BOHYEAR, EOH /
Parameter BEOH(*) 'BOH / EOH offset' / BOH +1, EOH -1 /;
SET PERIODYR(ALLYEAR,ALLYEAR) 'All years in each period' //;
SET ALL_TS 'The universe for time-slices' / ANNUAL /
SET ANNUAL(ALL_TS) 'Annual identifier' / ANNUAL /
SET TSLVL 'Timeslice levels' / ANNUAL, SEASON, WEEKLY, DAYNITE /;
PARAMETER TSLVLNUM(TSLVL) 'Timeslice level values'
/ ANNUAL 1
SEASON 2
WEEKLY 3
DAYNITE 4 /;
* SET SEASON(REG,ALL_TS) 'Seasons' //;
* SET WEEK(REG,ALL_TS) 'Week Sub-divisions ' //;
* SET DAYNITE(REG,ALL_TS) 'Daily Sub-divisions' //;
ALIAS(ALLYEAR,YEAR,LL);
* topology
SET IMPEXP 'Imports/Exports' / IMP, EXP /
SET IMP 'Imports' / IMP /
SET XPT 'Exports' / EXP /
SET IN_OUT 'Input/Output' / IN, OUT /
ALIAS(IMPEXP,IE);
ALIAS(IN_OUT,IO);
* limits
SET LIM 'Limit Types' / LO, FX, UP, N /
SET BND_TYPE(LIM) 'Bound Types' / LO, FX, UP /
ALIAS(LIM,L,LIM_TYPE);
ALIAS(BND_TYPE,BD);
* Start-up types
SET UPT 'Start-up types' / COLD, WARM, HOT /
* Numbered sets
SET ALLYEAR / 0 /;
SET AGE 'Age for SHAPEing' / 1*200 /
SET J 'Supply/demand steps 1*COM_STEP and SHAPE/MULTI' / 1*999 /
ALIAS(J,JJ);
* Master Set declarations
SET ALL_REG(*) 'External + Internal Regions' //
SET REG(ALL_REG) 'Region' //
ALIAS(ALL_REG,ALL_R);
ALIAS(REG,R);
SET COM_GRP 'Commodities & Groups'
/ DEM 'Demands',
NRG 'Energy',
MAT 'Material',
ENV 'Environmental Indicators',
FIN 'Financial' /;
ALIAS(COM_GRP,CG,CG1,CG2);
SET COM(COM_GRP) 'Commodities' //
ALIAS(COM,C,COM1,COM2);
SET PRC(*) 'Processes' //
ALIAS(PRC,P);
SET CUR(*) 'Currencies = c$' //
ALIAS(CUR,CURR);
* Stochastics
$ SETGLOBAL MAXSOW 96
SET ALLSOW 'State-of-the-World' / 1*%MAXSOW% /
SET SOW(ALLSOW) 'State-of-the-World' //
ALIAS(SOW,W);
*-------------------------------------------------------------------------------
* UC facility - fixed sets and controls for user-constraints
*-------------------------------------------------------------------------------
SET SIDE 'LHS and RHS of an equation' / LHS, RHS /
PARAMETER UC_SIGN(SIDE) 'Sign of LHS and RHS expression' / LHS 1, RHS -1 /;
SETS COM_VAR / NET, PRD /, COV_MAP / NET.COMNET, PRD.COMPRD /;
* List of parameters that can be used in user-constraints
SET UC_NAME 'Allowed parameters in user-constraints'
/ COST, DELIV, TAX, SUB
EFF, NET, N
GROWTH, PERIOD, PERDISC, BUILDUP
CUMSUM, CUM+, SYNC, YES
CAPACT, CAPFLO, NEWFLO, ONLINE
ANNUL, INVCOST, INVTAX, INVSUB
FLO_COST, FLO_DELIV, FLO_SUB, FLO_TAX
NCAP_COST, NCAP_ITAX, NCAP_ISUB
/;
SET UC_COST(UC_NAME) 'UC cost attributes'
/ COST, DELIV, TAX, SUB, ANNUL /;
SET UC_MAPCOST(UC_COST,UC_NAME) 'Compatibility map for cost attributes'
/ COST.(FLO_COST,NCAP_COST)
DELIV.FLO_DELIV
ANNUL.(INVCOST,INVTAX,INVSUB)
TAX.(FLO_TAX,NCAP_ITAX)
SUB.(FLO_SUB,NCAP_ISUB) /;
SET UC_ANNUL(UC_NAME) / INVCOST, INVTAX, INVSUB /;
SET UC_DYNT(UC_NAME) / N, CUMSUM, CUM+, SYNC /;
SET UC_NUMBER 'Determines way of handling REG,T and TS'
/ SEVERAL, SUCC, EACH, DYNAMIC /;
SET UC_PERDS(UC_NAME) / PERIOD, NEWFLO /;
SET UC_NEWFLO(UC_NAME) / NEWFLO /;
SET UC_GRPTYPE 'Type of components within UC_GRP'
/ ACT, FLO, IRE, CAP, NCAP, COMNET, COMPRD, COMCON, UCN /;
SET COSTAGG 'Types of cost aggregations'
/ INV, INVTAX, INVSUB, FOM, FOMTAX, FOMSUB, COMTAX, COMSUB, FLOTAX, FLOSUB,
INVTAXSUB, INVALL, FOMTAXSUB, FOMALL, FIX, FIXTAX, FIXSUB, FIXTAXSUB, FIXALL,
COMTAXSUB, FLOTAXSUB, ALLTAX, ALLSUB, ALLTAXSUB /;
ALIAS (COSTAGG,COSTCAT)
ALIAS (UC_COST,COSTYPE)
*-------------------------------------------------------------------------------
* control sets
* - expected in *.RUN file
* - throw switch other way in *.RUN to change
*-------------------------------------------------------------------------------
* user should provide name in *.RUN
$ SET MODEL_NAME TIMES
$ SET RUN_NAME TEST
* control of whether all 0 lines are dumped in *.PUT files; user provides 0 to NOT print lines with all 0s (or empty)
SCALAR DUMP0 /1/, OPTFILEID /1/;
* user set to 'YES' to activate
$ SET DEBUG NO
$ SET DUMPSOL NO
$ SET SOLANS NO
* user set to 'NO' to not abort when error condition fails
$ SET ERR_ABORT YES
* user sets to 'WWW' to activate
$ SET GAMS_CGI NO
* user sets to 'NO' if only want to compile
$ SET SOLVE_NOW YES
* get list of default units
$ BATINCLUDE units.def
* get list of default mapping group lists
$ BATINCLUDE maplists.def
* get defalut global scalars and parameters
$ BATINCLUDE globals.def