@@ -106,18 +106,33 @@ def add_methanol_share_calculations(rep: message_ix.Reporter, mode: str = "feeds
106
106
if mode == "fuel" :
107
107
t_filter2 .update ({"l" : ["primary" ]})
108
108
109
- rep .add ("out::methanol" , "select" , "out:nl-t-ya-m-c-l" , t_filter2 )
110
- rep .add ("out::methanol-by-tec" , "group_sum" , "out::methanol" , group = "t" , sum = "c" )
109
+ rep .add ("out::methanol-prod" , "select" , "out:nl-t-ya-m-c-l" , t_filter2 )
111
110
rep .add (
112
- "out::methanol-total" , "group_sum" , "out::methanol" , group = ["nl" , "ya" ], sum = "t"
111
+ "out::methanol-prod-by-tec" ,
112
+ "group_sum" ,
113
+ "out::methanol-prod" ,
114
+ group = "t" ,
115
+ sum = "c" ,
116
+ )
117
+ rep .add (
118
+ "out::methanol-prod-total" ,
119
+ "group_sum" ,
120
+ "out::methanol-prod" ,
121
+ group = ["nl" , "ya" ],
122
+ sum = "t" ,
123
+ )
124
+ rep .add (
125
+ "share::methanol-prod-by-tec" ,
126
+ "div" ,
127
+ "out::methanol-prod-by-tec" ,
128
+ "out::methanol-prod-total" ,
113
129
)
114
- rep .add ("share::methanol" , "div" , "out::methanol-by-tec" , "out::methanol-total" )
115
130
for comm , tecs in comm_tec_map .items ():
116
131
rep .add (
117
- f"share::{ comm } methanol" ,
132
+ f"share::{ comm } - methanol-prod " ,
118
133
"aggregate" ,
119
- "share::methanol" ,
120
- groups = {"t" : {f"{ comm } methanol" : tecs }},
134
+ "share::methanol-prod-by-tec " ,
135
+ groups = {"t" : {f"{ comm } - methanol" : tecs }},
121
136
keep = False ,
122
137
)
123
138
@@ -136,10 +151,8 @@ def add_meth_export_calculations(rep: message_ix.Reporter, mode: str = "feedstoc
136
151
----------
137
152
rep
138
153
"""
154
+ add_methanol_share_calculations (rep , mode = mode )
139
155
for comm in comm_tec_map .keys ():
140
- if f"share::{ comm } methanol" not in rep .keys ():
141
- add_methanol_share_calculations (rep , mode = mode )
142
-
143
156
t_filter2 = {"t" : "meth_exp" , "m" : mode }
144
157
rep .add ("out::methanol-export" , "select" , "out:nl-t-ya-m" , t_filter2 )
145
158
rep .add (
@@ -153,7 +166,7 @@ def add_meth_export_calculations(rep: message_ix.Reporter, mode: str = "feedstoc
153
166
f"out::{ comm } methanol-export" ,
154
167
"mul" ,
155
168
"out::methanol-export" ,
156
- f"share::{ comm } methanol" ,
169
+ f"share::{ comm } - methanol-prod " ,
157
170
)
158
171
159
172
@@ -174,10 +187,9 @@ def add_meth_import_calculations(rep: message_ix.Reporter, mode: str = "feedstoc
174
187
----------
175
188
rep
176
189
"""
177
- for comm in comm_tec_map .keys ():
178
- if "out::{comm}methanol-export" not in rep .keys ():
179
- add_meth_export_calculations (rep , mode = mode )
180
190
191
+ add_meth_export_calculations (rep , mode = mode )
192
+ for comm in comm_tec_map .keys ():
181
193
t_filter2 = {"t" : "meth_imp" , "m" : mode }
182
194
rep .add ("out::methanol-import" , "select" , "out:nl-t-ya-m" , t_filter2 )
183
195
@@ -205,7 +217,7 @@ def add_meth_import_calculations(rep: message_ix.Reporter, mode: str = "feedstoc
205
217
f"share::{ comm } methanol-import" ,
206
218
"div" ,
207
219
f"out::{ comm } methanol-import" ,
208
- "out::methanol-total" ,
220
+ "out::methanol-prod- total" ,
209
221
)
210
222
211
223
@@ -220,17 +232,27 @@ def add_biometh_final_share(rep: message_ix.Reporter, mode: str = "feedstock"):
220
232
----------
221
233
rep
222
234
"""
235
+ add_meth_import_calculations (rep , mode = mode )
236
+ if mode == "feedstock" :
237
+ t_filter2 = {
238
+ "t" : ["meth_t_d" ],
239
+ "m" : [mode ],
240
+ }
241
+ else :
242
+ t_filter2 = {
243
+ "t" : ["meth_t_d" , "furnace_methanol_refining" ],
244
+ "m" : [mode , "high_temp" ],
245
+ }
223
246
for comm in comm_tec_map .keys ():
224
- if f"out::{ comm } methanol-import" not in rep .keys ():
225
- add_meth_import_calculations (rep , mode = mode )
226
-
227
- t_filter2 = {"t" : "meth_t_d" , "m" : mode }
228
- rep .add ("in::methanol-final" , "select" , "in:nl-t-ya-m" , t_filter2 )
247
+ rep .add ("in::methanol-final0" , "select" , "in:nl-t-ya-m" , t_filter2 )
248
+ rep .add (
249
+ "in::methanol-final" , "sum" , "in::methanol-final0" , dimensions = ["t" , "m" ]
250
+ )
229
251
rep .add (
230
252
f"out::{ comm } methanol-prod" ,
231
253
"mul" ,
232
- "out::methanol-total" ,
233
- f"share::{ comm } methanol" ,
254
+ "out::methanol-prod- total" ,
255
+ f"share::{ comm } - methanol-prod " ,
234
256
)
235
257
rep .add (
236
258
f"out::{ comm } methanol-final" ,
0 commit comments