-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain_3stage_h8760.gms
584 lines (511 loc) · 28.1 KB
/
Main_3stage_h8760.gms
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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
$offOrder
$Include Define_sets_and_parameters.gms
Scalars
interest_rate /0.09/
discount_rate /0.02/
ccurt_renew /0/
ccurt_load /10000/
grid_loss /0.01/
indicator_partload /0/
indicator_ramping /0/
indicator_chp /1/
indicator_chp_trimmed /1/
indicator_countryefficiency /1/
indicator_countryavail /1/
indicator_varomcost /1/
indicator_coalphaseout /1/
indicator_divestment /1/
indicator_futurechp /1/
indicator_fuelprice_countryfactor /0/
indicator_dailyntc /1/
;
Parameter yearnumber(year_all);
yearnumber('2017') = 2017;
yearnumber('2020') = 2020;
yearnumber('2022') = 2022;
yearnumber('2024') = 2024;
yearnumber('2025') = 2025;
yearnumber('2026') = 2026;
yearnumber('2028') = 2028;
yearnumber('2030') = 2030;
yearnumber('2032') = 2032;
yearnumber('2034') = 2034;
yearnumber('2036') = 2036;
yearnumber('2038') = 2038;
yearnumber('2040') = 2040;
yearnumber('2045') = 2045;
yearnumber('2050') = 2050;
yearnumber('2070') = 2070;
$onUNDF
$gdxin Input\Input_h8760.gdx
$load country_all
$load hour_all
$gdxin
$offUNDF
*Display country_all;
$onUNDF
$gdxin Input\Input_hour_reduced_Every25hour_2ExtremeDays.gdx
*$gdxin Input\Input_hour_reduced_Every25hour_2ExtremeDays_Load110.gdx
$load hour
$load load_structure
$load capfactor_solar
$load capfactor_windonshore
$load capfactor_windoffshore
$load capfactor_runofriver
$load capfactor_reservoir_max
$load capfactor_reservoir_min
$load chp_structure
$load chp_trimmed_structure
$load peakind
$load borderflow
$load map_hourmonth
$load map_hourday
$load first_hour
$load last_hour
$load step_hour
$gdxin
$offUNDF
*yearly data
$onUNDF
*$gdxin Input\Input_yearly_TYNDP_GA.gdx
*$gdxin Input\Input_yearly_oldworldFederalGovernment_constantFuelprices.gdx
*$gdxin Input\Input_yearly_oldworldMarketPrices_constantFuelprices.gdx
$gdxin Input\Input_yearly_newworldMarketPrices_constantFuelprices.gdx
$load fuel_conv
$load fuel_renew
$load conv
$load convgrouped
$load renew
$load stor
$load map_convfuel
$load map_convgrouped
$load map_renewfuel
$load load_year
$load ntc_year
$load ntc_year_month
$load ntc_year_day
$load carbonprice_year
$load country_collection
$load inputdata_conv
$load cap_conv_add_forbidden
$load cap_conv_install_old
$load cap_conv_install_old_phaseout
$load eff_conv_old
$load eff_conv_old_phaseout
$load gen_conv_old
$load gen_CHP_conv_old
$load outages_conv
$load avail_month_structure
$load avail_month_structure_nuclear
$load carboncontent_conv
$load fuelprice_conv_year
$load fuelprice_countryfactor
$load inputdata_renew
$load covernight_renew
$load cap_renew_install_exogen_year
$load gen_renew_all_year
$load gen_renew_main_year
$load gen_renew_structure_monthly_exogen
$load gen_CHP_renew_all
$load gen_CHP_renew_main
$load fuelprice_renew
$load carboncontent_renew
$load inputdata_stor
$load covernight_kW_stor
$load covernight_kWh_stor
$load cap_stor_install_exogen_year
$load gen_stor_exogen
$gdxin
$offUNDF
Option Profile=2;
Option Profiletol=0.01;
Option limrow=500;
Option limcol=500;
Option reslim=5000000;
Option LP=cplex;
*############################################################################
*
* stage 1:
* - investment and dispatch for Europe
* - without part-load and startup costs
* - lower hourly resolution (representative hours)
*
*############################################################################
$Include Declare_sets_and_parameters.gms
*Display ntc,ntc_hour;
$Include Model.gms
Investment.bratio = 1;
indicator_partload = 0;
indicator_ramping = 0;
indicator_partload_country(country) = indicator_partload;
indicator_ramping_country(country) = indicator_ramping;
*##################################
* Limitation of solution space
load_max(country) = smax((hour_all,year)$(hour(year,hour_all)), load(country,year,hour_all));
Loop(convgrouped,
Loop(conv$( map_convgrouped(conv,convgrouped) AND ( convyear_lo(conv) ge 2020 ) ),
cap_conv_add_up(country,conv,year) = load_max(country)*1.5;
);
);
*investment in coal and ccs is allowed
cap_conv_add_forbidden(country,'lignite_ccs_new') = 0;
cap_conv_add_forbidden(country,'hardcoal_ccs_new') = 0;
cap_conv_add_forbidden(country,'ccgt_ccs_new') = 0;
cap_conv_add_forbidden(country,'ocgt_ccs_new') = 0;
cap_conv_add_forbidden(country,'lignite_new') = 0;
cap_conv_add_forbidden(country,'hardcoal_new') = 0;
cap_conv_install_up(country,conv)$(convyear_lo(conv) lt 2020 ) = smax(year, cap_conv_install_old(country,conv,year));
cap_conv_install_up(country,conv)$(convyear_lo(conv) ge 2020 ) = 0$(cap_conv_add_forbidden(country,conv) eq 1) + INF$(cap_conv_add_forbidden(country,conv) eq 0);
*Display cap_conv_add_up,cap_conv_install_up;
indicator_loadcurt(country) = 0;
Option threads=1;
Solve Investment using LP minimizing COST;
*Display RES_CAP_CONV_ADD_up.M;
*Statistcs for stage 1
output_performance('modelStat','run1') = Investment.modelStat;
output_performance('solveStat','run1') = Investment.solveStat;
output_performance('resGen','run1') = Investment.resGen;
output_performance('resUsd','run1') = Investment.resUsd;
output_performance('etAlg','run1') = Investment.etAlg;
output_performance('etSolve','run1') = Investment.etSolve;
output_performance('etSolver','run1') = Investment.etSolver;
output_performance('numEqu','run1') = Investment.numEqu;
output_performance('numVar','run1') = Investment.numVar;
output_performance('ObjVal','run1') = Investment.ObjVal;
output_configuration('#technologies','run1') = sum(conv$( convyear_lo(conv) le ( sum(year$(ord(year) eq card(year)), yearnumber(year)) ) ), 1);
output_configuration('#countries','run1') = card(country);
output_configuration('#years','run1') = sum(year, 1);
output_configuration('#hours','run1') = sum(hour_all$(hour('2020',hour_all)), 1);
output_configuration('partload','run1') = indicator_partload + EPS;
output_configuration('ramping','run1') = indicator_ramping + EPS;
output_configuration('chp','run1') = indicator_chp + EPS;
output_configuration('chp_trimmed','run1') = indicator_chp_trimmed + EPS;
output_configuration('countryefficiency','run1') = indicator_countryefficiency + EPS;
output_configuration('countryavailability','run1') = indicator_countryavail + EPS;
output_configuration('varomcost','run1') = indicator_varomcost + EPS;
output_configuration('coalphaseout','run1') = indicator_coalphaseout + EPS;
output_configuration('divestment','run1') = indicator_divestment + EPS;
output_configuration('futurechp','run1') = indicator_futurechp + EPS;
output_configuration('fuelprice_countryfactor','run1') = indicator_fuelprice_countryfactor + EPS;
$Include Output_declaration.gms
$onecho > Output\Output_all_stage1.tmp
epsout = 0
par=output_year rng=year!A4 rdim=1 cdim=1
par=output_DE_year rng=DE_year!A4 rdim=1 cdim=1
par=output_DE_hour rng=DE_hour!A4 rdim=2 cdim=1
par=output_DE_export_year rng=DE_export_year!A4 rdim=2 cdim=1
par=output_DE_export_hour rng=DE_export_hour!A4 rdim=2 cdim=2
$offecho
put_utility 'gdxout' / 'Output\Output_all_stage1';
execute_unload output_year,output_DE_year,output_DE_hour,output_DE_export_year,output_DE_export_hour;
put_utility 'exec' /'gdxxrw.exe I=Output\Output_all_stage1.gdx O=Output\3stage\Output_all_stage1.xlsx @Output\Output_all_stage1.tmp';
*############################################################################
*
* stage 2:
* - dispatch for Europe
* - without part-load and startup costs
* - high hourly resolution
*
*############################################################################
hour(year_all,hour_all) = NO;
Option Clear = load;
Option Clear = netexport_border;
Option Clear = availability_conv;
Option Clear = chp_structure_hour;
Option Clear = availability_renew;
Option Clear = capfactor_renew_max;
Option Clear = capfactor_renew_min;
Option Clear = ntc_hour;
Option Clear = output_DE_hour;
Option Clear = output_AT_hour;
Option Clear = output_BE_hour;
Option Clear = output_CH_hour;
Option Clear = output_CZ_hour;
Option Clear = output_DK_hour;
Option Clear = output_FR_hour;
Option Clear = output_NL_hour;
Option Clear = output_PL_hour;
Option Clear = output_SE_hour;
Option Clear = output_DE_export_hour;
Option Clear = output_AT_export_hour;
Option Clear = output_BE_export_hour;
Option Clear = output_CH_export_hour;
Option Clear = output_CZ_export_hour;
Option Clear = output_DK_export_hour;
Option Clear = output_FR_export_hour;
Option Clear = output_NL_export_hour;
Option Clear = output_PL_export_hour;
Option Clear = output_SE_export_hour;
Option Clear = output_BALT_hour;
Option Clear = output_BG_hour;
Option Clear = output_FI_hour;
Option Clear = output_GB_hour;
Option Clear = output_GR_hour;
Option Clear = output_HR_hour;
Option Clear = output_HU_hour;
Option Clear = output_IBER_hour;
Option Clear = output_IRIS_hour;
Option Clear = output_IT_hour;
Option Clear = output_MT_hour;
Option Clear = output_NO_hour;
Option Clear = output_RO_hour;
Option Clear = output_SI_hour;
Option Clear = output_SK_hour;
Option Clear = output_BALT_export_hour;
Option Clear = output_BG_export_hour;
Option Clear = output_FI_export_hour;
Option Clear = output_GB_export_hour;
Option Clear = output_GR_export_hour;
Option Clear = output_HR_export_hour;
Option Clear = output_HU_export_hour;
Option Clear = output_IBER_export_hour;
Option Clear = output_IRIS_export_hour;
Option Clear = output_IT_export_hour;
Option Clear = output_MT_export_hour;
Option Clear = output_NO_export_hour;
Option Clear = output_RO_export_hour;
Option Clear = output_SI_export_hour;
Option Clear = output_SK_export_hour;
Option Clear = output_DE_hour_conv;
*Load hourly data in higher hourly resolution
put_utility 'gdxin' / 'Input\Input_h8760.gdx';
execute_load load_structure,capfactor_reservoir_max,capfactor_reservoir_min,capfactor_runofriver,capfactor_solar,capfactor_windonshore,
capfactor_windoffshore,chp_structure,chp_trimmed_structure,peakind,borderflow,map_hourmonth,map_hourday;
$Include Declare_sets_and_parameters_h8760.gms
*Display ntc,ntc_hour;
*Fix investment and divestment decisions => dispatch problem
CAP_CONV_INSTALL.FX(country,conv,year) = CAP_CONV_INSTALL.L(country,conv,year);
CAP_CONV_ADD.FX(country,conv,year) = CAP_CONV_ADD.L(country,conv,year);
CAP_CONV_SUB.FX(country,conv,year) = CAP_CONV_SUB.L(country,conv,year);
indicator_loadcurt(country) = 1;
Solve Investment using LP minimizing COST;
*Statistcs for stage 2
output_performance('modelStat','run2') = Investment.modelStat;
output_performance('solveStat','run2') = Investment.solveStat;
output_performance('resGen','run2') = Investment.resGen;
output_performance('resUsd','run2') = Investment.resUsd;
output_performance('etAlg','run2') = Investment.etAlg;
output_performance('etSolve','run2') = Investment.etSolve;
output_performance('etSolver','run2') = Investment.etSolver;
output_performance('numEqu','run2') = Investment.numEqu;
output_performance('numVar','run2') = Investment.numVar;
output_performance('ObjVal','run2') = Investment.ObjVal;
output_configuration('#technologies','run2') = sum(conv$( convyear_lo(conv) le ( sum(year$(ord(year) eq card(year)), yearnumber(year)) ) ), 1);
output_configuration('#countries','run2') = card(country);
output_configuration('#years','run2') = sum(year, 1);
output_configuration('#hours','run2') = sum(hour_all$(hour('2020',hour_all)), 1);
output_configuration('partload','run2') = indicator_partload + EPS;
output_configuration('ramping','run2') = indicator_ramping + EPS;
output_configuration('chp','run2') = indicator_chp + EPS;
output_configuration('chp_trimmed','run2') = indicator_chp_trimmed + EPS;
output_configuration('countryefficiency','run2') = indicator_countryefficiency + EPS;
output_configuration('countryavailability','run2') = indicator_countryavail + EPS;
output_configuration('varomcost','run2') = indicator_varomcost + EPS;
output_configuration('coalphaseout','run2') = indicator_coalphaseout + EPS;
output_configuration('divestment','run2') = indicator_divestment + EPS;
output_configuration('futurechp','run2') = indicator_futurechp + EPS;
output_configuration('fuelprice_countryfactor','run2') = indicator_fuelprice_countryfactor + EPS;
*Save output of stage 2, in order to have solution values for Europe countries (not considered in stage 3)
$Include Output_declaration.gms
*###############################################################################
*
* stage 3:
* - investment and dispatch for Germany (and Luxembourg)
* - with part-load and startup costs
* - high hourly resolution
* - import and exports to neighbours are fixed with solution of stage 2
*
*###############################################################################
Option Clear = netexport_border;
netexport_border('DE+LU',year,hour_all)$(hour(year,hour_all)) = sum(country2, FLOW.L('DE+LU',country2,year,hour_all) - FLOW.L(country2,'DE+LU',year,hour_all));
country(country_all) = NO;
country('DE+LU') = YES;
*Unfix investment and divestment decisions
CAP_CONV_INSTALL.LO(country,conv,year) = 0;
CAP_CONV_ADD.LO(country,conv,year) = 0;
CAP_CONV_SUB.LO(country,conv,year) = 0;
CAP_CONV_INSTALL.UP(country,conv,year) = INF;
CAP_CONV_ADD.UP(country,conv,year) = INF;
CAP_CONV_SUB.UP(country,conv,year) = INF;
indicator_partload = 1;
indicator_ramping = 1;
indicator_partload_country(country) = indicator_partload;
indicator_ramping_country(country) = indicator_ramping;
indicator_loadcurt(country) = 0;
Option threads=10;
Solve Investment using LP minimizing COST;
Display RES_CAP_CONV_ADD_up.M;
*Statistcs for stage 3
output_performance('modelStat','run3') = Investment.modelStat;
output_performance('solveStat','run3') = Investment.solveStat;
output_performance('resGen','run3') = Investment.resGen;
output_performance('resUsd','run3') = Investment.resUsd;
output_performance('etAlg','run3') = Investment.etAlg;
output_performance('etSolve','run3') = Investment.etSolve;
output_performance('etSolver','run3') = Investment.etSolver;
output_performance('numEqu','run3') = Investment.numEqu;
output_performance('numVar','run3') = Investment.numVar;
output_performance('ObjVal','run3') = Investment.ObjVal;
output_configuration('#technologies','run3') = sum(conv$( convyear_lo(conv) le ( sum(year$(ord(year) eq card(year)), yearnumber(year)) ) ), 1);
output_configuration('#countries','run3') = card(country);
output_configuration('#years','run3') = sum(year, 1);
output_configuration('#hours','run3') = sum(hour_all$(hour('2020',hour_all)), 1);
output_configuration('partload','run3') = indicator_partload + EPS;
output_configuration('ramping','run3') = indicator_ramping + EPS;
output_configuration('chp','run3') = indicator_chp + EPS;
output_configuration('chp_trimmed','run3') = indicator_chp_trimmed + EPS;
output_configuration('countryefficiency','run3') = indicator_countryefficiency + EPS;
output_configuration('countryavailability','run3') = indicator_countryavail + EPS;
output_configuration('varomcost','run3') = indicator_varomcost + EPS;
output_configuration('coalphaseout','run3') = indicator_coalphaseout + EPS;
output_configuration('divestment','run3') = indicator_divestment + EPS;
output_configuration('futurechp','run3') = indicator_futurechp + EPS;
output_configuration('fuelprice_countryfactor','run3') = indicator_fuelprice_countryfactor + EPS;
*Save output of stage 3, i.e. solution for Germany (its solution of stage 2 is overwritten)
$Include Output_declaration.gms
output_DE_hour(year,hour_all,'export_sum')$(hour(year,hour_all)) = sum(country_all$(ntc('DE+LU',country_all,year) gt 0), output_DE_export_hour(year,hour_all,'export',country_all)) + EPS;
output_DE_hour(year,hour_all,'import_sum')$(hour(year,hour_all)) = sum(country_all$(ntc(country_all,'DE+LU',year) gt 0), output_DE_export_hour(year,hour_all,'import',country_all)) + EPS;
output_DE_year(year,'export_sum') = sum(country_all$(ntc('DE+LU',country_all,year) gt 0), output_DE_export_year(year,'export',country_all)) + EPS;
output_DE_year(year,'import_sum') = sum(country_all$(ntc(country_all,'DE+LU',year) gt 0), output_DE_export_year(year,'import',country_all)) + EPS;
*###############################################################################
*Export output to excel file
$onecho > Output\Output_all_3stage_DE+neighbors.tmp
epsout = 0
par=output_configuration rng=configuration!A4 rdim=1 cdim=1
par=output_performance rng=performance!A4 rdim=1 cdim=1
par=output_year rng=year!A4 rdim=1 cdim=1
par=output_DE_year rng=DE_year!A4 rdim=1 cdim=1
par=output_AT_year rng=AT_year!A4 rdim=1 cdim=1
par=output_BE_year rng=BE_year!A4 rdim=1 cdim=1
par=output_CH_year rng=CH_year!A4 rdim=1 cdim=1
par=output_CZ_year rng=CZ_year!A4 rdim=1 cdim=1
par=output_DK_year rng=DK_year!A4 rdim=1 cdim=1
par=output_FR_year rng=FR_year!A4 rdim=1 cdim=1
par=output_NL_year rng=NL_year!A4 rdim=1 cdim=1
par=output_PL_year rng=PL_year!A4 rdim=1 cdim=1
par=output_SE_year rng=SE_year!A4 rdim=1 cdim=1
par=output_DE_export_year rng=DE_export_year!A4 rdim=2 cdim=1
par=output_AT_export_year rng=AT_export_year!A4 rdim=2 cdim=1
par=output_BE_export_year rng=BE_export_year!A4 rdim=2 cdim=1
par=output_CH_export_year rng=CH_export_year!A4 rdim=2 cdim=1
par=output_CZ_export_year rng=CZ_export_year!A4 rdim=2 cdim=1
par=output_DK_export_year rng=DK_export_year!A4 rdim=2 cdim=1
par=output_FR_export_year rng=FR_export_year!A4 rdim=2 cdim=1
par=output_NL_export_year rng=NL_export_year!A4 rdim=2 cdim=1
par=output_PL_export_year rng=PL_export_year!A4 rdim=2 cdim=1
par=output_SE_export_year rng=SE_export_year!A4 rdim=2 cdim=1
par=output_DE_hour rng=DE_hour!A4 rdim=2 cdim=1
par=output_AT_hour rng=AT_hour!A4 rdim=2 cdim=1
par=output_BE_hour rng=BE_hour!A4 rdim=2 cdim=1
par=output_CH_hour rng=CH_hour!A4 rdim=2 cdim=1
par=output_CZ_hour rng=CZ_hour!A4 rdim=2 cdim=1
par=output_DK_hour rng=DK_hour!A4 rdim=2 cdim=1
par=output_FR_hour rng=FR_hour!A4 rdim=2 cdim=1
par=output_NL_hour rng=NL_hour!A4 rdim=2 cdim=1
par=output_PL_hour rng=PL_hour!A4 rdim=2 cdim=1
par=output_SE_hour rng=SE_hour!A4 rdim=2 cdim=1
par=output_DE_export_hour rng=DE_export_hour!A4 rdim=2 cdim=2
par=output_AT_export_hour rng=AT_export_hour!A4 rdim=2 cdim=2
par=output_BE_export_hour rng=BE_export_hour!A4 rdim=2 cdim=2
par=output_CH_export_hour rng=CH_export_hour!A4 rdim=2 cdim=2
par=output_CZ_export_hour rng=CZ_export_hour!A4 rdim=2 cdim=2
par=output_DK_export_hour rng=DK_export_hour!A4 rdim=2 cdim=2
par=output_FR_export_hour rng=FR_export_hour!A4 rdim=2 cdim=2
par=output_NL_export_hour rng=NL_export_hour!A4 rdim=2 cdim=2
par=output_PL_export_hour rng=PL_export_hour!A4 rdim=2 cdim=2
par=output_SE_export_hour rng=SE_export_hour!A4 rdim=2 cdim=2
par=output_DE_hour_conv rng=DE_hour_conv!A4 rdim=2 cdim=2
par=output_DE_year_conv rng=DE_year_conv!A4 rdim=2 cdim=1
par=output_nuclear_hour rng=nuclear_hour!A4 rdim=2 cdim=2
par=output_country_year_conv rng=country_year_conv!A4 rdim=3 cdim=1
$offecho
*Export output to excel file
$onecho > Output\Output_all_3stage_outside.tmp
epsout = 0
par=output_BALT_year rng=BALT_year!A4 rdim=1 cdim=1
par=output_BG_year rng=BG_year!A4 rdim=1 cdim=1
par=output_FI_year rng=FI_year!A4 rdim=1 cdim=1
par=output_GB_year rng=GB_year!A4 rdim=1 cdim=1
par=output_GR_year rng=GR_year!A4 rdim=1 cdim=1
par=output_HR_year rng=HR_year!A4 rdim=1 cdim=1
par=output_HU_year rng=HU_year!A4 rdim=1 cdim=1
par=output_IBER_year rng=IBER_year!A4 rdim=1 cdim=1
par=output_IRIS_year rng=IRIS_year!A4 rdim=1 cdim=1
par=output_IT_year rng=IT_year!A4 rdim=1 cdim=1
par=output_MT_year rng=MT_year!A4 rdim=1 cdim=1
par=output_NO_year rng=NO_year!A4 rdim=1 cdim=1
par=output_RO_year rng=RO_year!A4 rdim=1 cdim=1
par=output_SI_year rng=SI_year!A4 rdim=1 cdim=1
par=output_SK_year rng=SK_year!A4 rdim=1 cdim=1
par=output_BALT_export_year rng=BALT_export_year!A4 rdim=2 cdim=1
par=output_BG_export_year rng=BG_export_year!A4 rdim=2 cdim=1
par=output_FI_export_year rng=FI_export_year!A4 rdim=2 cdim=1
par=output_GB_export_year rng=GB_export_year!A4 rdim=2 cdim=1
par=output_GR_export_year rng=GR_export_year!A4 rdim=2 cdim=1
par=output_HR_export_year rng=HR_export_year!A4 rdim=2 cdim=1
par=output_HU_export_year rng=HU_export_year!A4 rdim=2 cdim=1
par=output_IBER_export_year rng=IBER_export_year!A4 rdim=2 cdim=1
par=output_IRIS_export_year rng=IRIS_export_year!A4 rdim=2 cdim=1
par=output_MT_export_year rng=MT_export_year!A4 rdim=2 cdim=1
par=output_NO_export_year rng=NO_export_year!A4 rdim=2 cdim=1
par=output_RO_export_year rng=RO_export_year!A4 rdim=2 cdim=1
par=output_SI_export_year rng=SI_export_year!A4 rdim=2 cdim=1
par=output_SK_export_year rng=SK_export_year!A4 rdim=2 cdim=1
par=output_BALT_hour rng=BALT_hour!A4 rdim=2 cdim=1
par=output_BG_hour rng=BG_hour!A4 rdim=2 cdim=1
par=output_FI_hour rng=FI_hour!A4 rdim=2 cdim=1
par=output_GB_hour rng=GB_hour!A4 rdim=2 cdim=1
par=output_GR_hour rng=GR_hour!A4 rdim=2 cdim=1
par=output_HR_hour rng=HR_hour!A4 rdim=2 cdim=1
par=output_HU_hour rng=HU_hour!A4 rdim=2 cdim=1
par=output_IBER_hour rng=IBER_hour!A4 rdim=2 cdim=1
par=output_IRIS_hour rng=IRIS_hour!A4 rdim=2 cdim=1
par=output_IT_hour rng=IT_hour!A4 rdim=2 cdim=1
par=output_MT_hour rng=MT_hour!A4 rdim=2 cdim=1
par=output_NO_hour rng=NO_hour!A4 rdim=2 cdim=1
par=output_RO_hour rng=RO_hour!A4 rdim=2 cdim=1
par=output_SI_hour rng=SI_hour!A4 rdim=2 cdim=1
par=output_SK_hour rng=SK_hour!A4 rdim=2 cdim=1
par=output_BALT_export_hour rng=BALT_export_hour!A4 rdim=2 cdim=2
par=output_BG_export_hour rng=BG_export_hour!A4 rdim=2 cdim=2
par=output_FI_export_hour rng=FI_export_hour!A4 rdim=2 cdim=2
par=output_GB_export_hour rng=GB_export_hour!A4 rdim=2 cdim=2
par=output_GR_export_hour rng=GR_export_hour!A4 rdim=2 cdim=2
par=output_HR_export_hour rng=HR_export_hour!A4 rdim=2 cdim=2
par=output_HU_export_hour rng=HU_export_hour!A4 rdim=2 cdim=2
par=output_IBER_export_hour rng=IBER_export_hour!A4 rdim=2 cdim=2
par=output_IRIS_export_hour rng=IRIS_export_hour!A4 rdim=2 cdim=2
par=output_IT_export_hour rng=IT_export_hour!A4 rdim=2 cdim=2
par=output_MT_export_hour rng=MT_export_hour!A4 rdim=2 cdim=2
par=output_NO_export_hour rng=NO_export_hour!A4 rdim=2 cdim=2
par=output_RO_export_hour rng=RO_export_hour!A4 rdim=2 cdim=2
par=output_SI_export_hour rng=SI_export_hour!A4 rdim=2 cdim=2
par=output_SK_export_hour rng=SK_export_hour!A4 rdim=2 cdim=2
$offecho
put_utility 'gdxout' / 'Output\Output_all_3stage_DE+neighbors';
execute_unload output_configuration,output_performance,output_year,
output_DE_year,output_AT_year,output_BE_year,output_CH_year,output_CZ_year,
output_DK_year,output_FR_year,output_NL_year,output_PL_year,output_SE_year,
output_DE_export_year,output_AT_export_year,output_BE_export_year,output_CH_export_year,output_CZ_export_year,
output_DK_export_year,output_FR_export_year,output_NL_export_year,output_PL_export_year,output_SE_export_year,
output_DE_hour,output_AT_hour,output_BE_hour,output_CH_hour,output_CZ_hour,
output_DK_hour,output_FR_hour,output_NL_hour,output_PL_hour,output_SE_hour,
output_DE_export_hour,output_AT_export_hour,output_BE_export_hour,output_CH_export_hour,output_CZ_export_hour,
output_DK_export_hour,output_FR_export_hour,output_NL_export_hour,output_PL_export_hour,output_SE_export_hour,
output_DE_hour_conv,output_DE_year_conv,
output_nuclear_hour,output_country_year_conv;
put_utility 'exec' /'gdxxrw.exe I=Output\Output_all_3stage_DE+neighbors.gdx O=Output\3stage\Output_all_3stage_DE+neighbors.xlsx @Output\Output_all_3stage_DE+neighbors.tmp';
put_utility 'gdxout' / 'Output\Output_all_3stage_outside';
execute_unload output_BALT_year,output_BG_year,output_FI_year,output_GB_year,output_GR_year,
output_HR_year,output_HU_year,output_IBER_year,output_IRIS_year,output_IT_year,
output_MT_year,output_NO_year,output_RO_year,output_SI_year,output_SK_year,
output_BALT_export_year,output_BG_export_year,output_FI_export_year,output_GB_export_year,output_GR_export_year,
output_HR_export_year,output_HU_export_year,output_IBER_export_year,output_IRIS_export_year,output_IT_export_year,
output_MT_export_year,output_NO_export_year,output_RO_export_year,output_SI_export_year,output_SK_export_year,
output_BALT_hour,output_BG_hour,output_FI_hour,output_GB_hour,output_GR_hour,
output_HR_hour,output_HU_hour,output_IBER_hour,output_IRIS_hour,output_IT_hour,
output_MT_hour,output_NO_hour,output_RO_hour,output_SI_hour,output_SK_hour,
output_BALT_export_hour,output_BG_export_hour,output_FI_export_hour,output_GB_export_hour,output_GR_export_hour,
output_HR_export_hour,output_HU_export_hour,output_IBER_export_hour,output_IRIS_export_hour,output_IT_export_hour,
output_MT_export_hour,output_NO_export_hour,output_RO_export_hour,output_SI_export_hour,output_SK_export_hour;
put_utility 'exec' /'gdxxrw.exe I=Output\Output_all_3stage_outside.gdx O=Output\3stage\Output_all_3stage_outside.xlsx @Output\Output_all_3stage_outside.tmp';