|
20 | 20 | # selections
|
21 | 21 | sel_scen = "LED"
|
22 | 22 | scen_suffix = "g05_e9"
|
23 |
| -# scen_vers = 1 |
24 | 23 | rem_bof_steel = True
|
25 | 24 | mod_growth_steel = True
|
26 | 25 | mod_initial_steel = True
|
|
41 | 40 | 0,
|
42 | 41 | ]
|
43 | 42 |
|
44 |
| -# model and scenario names |
45 |
| -path_ue = package_data_path("ue-shares") |
46 |
| -path_ue_file = os.path.join(path_ue, file_ue) |
| 43 | +# scenario names |
47 | 44 | snames = {"SSP1": "SSP1 - Very Low Emissions", "LED": "SSP2 - Very Low Emissions"}
|
48 | 45 | svers = {"SSP1": 1, "LED": 2}
|
49 | 46 | model_orig = "SSP_" + sel_scen + "_v1.0"
|
50 | 47 | scenario_orig = snames[sel_scen]
|
51 | 48 |
|
52 |
| -# add scen_suffic depending on remove_bof_steel, modify_lc_steel, |
53 |
| -# steel_scalar, and add_steel_target |
54 | 49 | if rem_bof_steel:
|
55 | 50 | scen_suffix += "_bof"
|
56 | 51 | if mod_growth_steel:
|
57 |
| - scen_suffix += "_growth" # + str(steel_growth) |
| 52 | + scen_suffix += "_growth" |
58 | 53 | if mod_initial_steel:
|
59 |
| - scen_suffix += "_initial" # + str(steel_inital) |
| 54 | + scen_suffix += "_initial" |
60 | 55 | if add_steel_target:
|
61 | 56 | scen_suffix += "_nzsteel"
|
62 | 57 |
|
| 58 | +# read UE share file |
| 59 | +path_ue = package_data_path("ue-shares") |
| 60 | +path_ue_file = os.path.join(path_ue, file_ue) |
| 61 | + |
| 62 | +# target scenario |
63 | 63 | model_target = "MM_ScenarioMIP"
|
64 |
| -scenario_target = "VL_" + sel_scen + "_" + scen_suffix # + "_v" + str(scen_vers) |
| 64 | +scenario_target = "VL_" + sel_scen + "_" + scen_suffix |
65 | 65 |
|
| 66 | +# connect to database |
66 | 67 | mp = ixmp.Platform("ixmp_dev")
|
| 68 | + |
| 69 | +# load scenario |
67 | 70 | s_orig = message_ix.Scenario(
|
68 | 71 | mp, model=model_orig, scenario=scenario_orig, version=svers[sel_scen]
|
69 | 72 | )
|
| 73 | + |
| 74 | +# clone scenario |
70 | 75 | s_tar = s_orig.clone(model_target, scenario_target, keep_solution=False)
|
71 | 76 | s_tar.set_as_default()
|
72 | 77 |
|
73 |
| - |
74 | 78 | # modify bounds for some fuels in residential and commercial sector
|
75 | 79 | modify_rc_bounds(s_orig, s_tar, rc_years)
|
76 | 80 |
|
|
114 | 118 | # add balance equality
|
115 | 119 | add_balance_equality(s_tar)
|
116 | 120 |
|
117 |
| -# solve parameters |
118 |
| -# message_ix.models.DEFAULT_CPLEX_OPTIONS = { |
119 |
| -# "advind": 0, |
120 |
| -# "lpmethod": 4, |
121 |
| -# "threads": 4, |
122 |
| -# "epopt": 1e-6, |
123 |
| -# "scaind": -1, |
124 |
| -# } |
125 |
| - |
| 121 | +# solve |
126 | 122 | solve_typ = "MESSAGE-MACRO"
|
127 | 123 | solve_args = dict(model=solve_typ)
|
128 | 124 | s_tar.solve(**solve_args)
|
|
0 commit comments