From 1a26e6c0439dd8187a66c984e93fb0ff11f779d7 Mon Sep 17 00:00:00 2001 From: Florian Maczek Date: Thu, 7 Nov 2024 12:57:26 +0100 Subject: [PATCH] Extend and rename variable mappings --- .../material/reporting/ch4_emi_reporting.yaml | 4 +- .../fe_methanol_ammonia_reporting.yaml | 23 +++-- .../data/material/reporting/fe_reporting.yaml | 48 ++++++++-- .../reporting/fe_reporting_aggregates.yaml | 87 ++++++++++++++++--- .../fe_solar_reporting_aggregates.yaml | 19 ++++ .../material/reporting/fs1_reporting.yaml | 12 ++- .../material/reporting/prod_reporting.yaml | 4 +- .../reporting/prod_reporting_aggregates.yaml | 10 ++- .../model/material/report/run_reporting.py | 9 +- 9 files changed, 176 insertions(+), 40 deletions(-) create mode 100644 message_ix_models/data/material/reporting/fe_solar_reporting_aggregates.yaml diff --git a/message_ix_models/data/material/reporting/ch4_emi_reporting.yaml b/message_ix_models/data/material/reporting/ch4_emi_reporting.yaml index 404b827bf7..891a7f9fdd 100644 --- a/message_ix_models/data/material/reporting/ch4_emi_reporting.yaml +++ b/message_ix_models/data/material/reporting/ch4_emi_reporting.yaml @@ -41,13 +41,13 @@ vars: # aluminum - Industrial Processes|Non-Ferrous Metals|Aluminum: + Industrial Processes|Non-Ferrous Metals|Aluminium: filter: { technology: [prebake_aluminum, soderberg_aluminum], mode: M1} short: emi_ch4_ind_proc_alu - Energy|Demand|Industry|Non-Ferrous Metals|Aluminum: + Energy|Demand|Industry|Non-Ferrous Metals|Aluminium: filter: { technology: [furnace_coal_aluminum, furnace_gas_aluminum, furnace_biomass_aluminum, furnace_foil_aluminum], mode: [high_temp, low_temp] } short: diff --git a/message_ix_models/data/material/reporting/fe_methanol_ammonia_reporting.yaml b/message_ix_models/data/material/reporting/fe_methanol_ammonia_reporting.yaml index 88d4c6e4f4..495d34e99e 100644 --- a/message_ix_models/data/material/reporting/fe_methanol_ammonia_reporting.yaml +++ b/message_ix_models/data/material/reporting/fe_methanol_ammonia_reporting.yaml @@ -12,26 +12,35 @@ common: unit: GWa vars: - Chemicals|Ammonia|Solids|Coal: + Chemicals|Ammonia|Electricity: filter: - { technology: [ coal_NH3, coal_NH3_ccs ], mode: M1, commodity: coal, level: secondary } - short: fe_nh3_coal + { technology: [biomass_NH3, biomass_NH3_ccs, coal_NH3, coal_NH3_ccs, + electr_NH3, fueloil_NH3, fueloil_NH3_ccs, gas_NH3, gas_NH3_ccs ], + mode: M1, + commodity: electr, level: secondary } + short: + fe_pe_nh3_el Chemicals|Ammonia|Solids|Biomass: filter: { technology: [ biomass_NH3, biomass_NH3_ccs ], mode: M1, commodity: biomass, level: primary } short: fe_nh3_bio - Chemicals|Ammonia|Gases|Gas: + Chemicals|Ammonia|Solids|Coal: filter: - { technology: [ gas_NH3, gas_NH3_ccs ], mode: M1, commodity: gas, level: secondary } - short: fe_nh3_gas + { technology: [ coal_NH3, coal_NH3_ccs ], mode: M1, commodity: coal, level: secondary } + short: fe_nh3_coal Chemicals|Ammonia|Liquids|Oil: filter: { technology: [ fueloil_NH3, fueloil_NH3_ccs ], mode: M1, commodity: fueloil, level: secondary } short: fe_nh3_oil + Chemicals|Ammonia|Gases|Gas: + filter: + { technology: [ gas_NH3, gas_NH3_ccs ], mode: M1, commodity: gas, level: secondary } + short: fe_nh3_gas + Chemicals|Methanol|Solids|Coal: filter: @@ -50,5 +59,5 @@ vars: Chemicals|Methanol|Hydrogen: filter: - {technology: meth_h2, mode: feedstock, commodity: [hydrogen, ht_heat], level: secondary} + {technology: meth_h2, mode: feedstock, commodity: hydrogen, level: secondary} short: fe_meth_h2 diff --git a/message_ix_models/data/material/reporting/fe_reporting.yaml b/message_ix_models/data/material/reporting/fe_reporting.yaml index dfca4df35b..332cb1242e 100644 --- a/message_ix_models/data/material/reporting/fe_reporting.yaml +++ b/message_ix_models/data/material/reporting/fe_reporting.yaml @@ -45,18 +45,45 @@ vars: Chemicals|Resins|Electricity: filter: - { technology: CH2O_to_resin, mode: M1, commodity: electr, level: final } + { technology: [CH2O_to_resin, furnace_elec_resins], mode: M1, commodity: electr, level: final } short: fe_pe_resin_el - - Chemicals|Ammonia|Electricity: + Chemicals|Resins|Solids|Coal: filter: - { technology: [biomass_NH3, biomass_NH3_ccs, coal_NH3, coal_NH3_ccs, - electr_NH3, fueloil_NH3, fueloil_NH3_ccs, gas_NH3, gas_NH3_ccs ], - mode: M1, - commodity: electr, level: secondary } + { technology: furnace_coal_resins, mode: M1, commodity: coal, level: final } short: - fe_pe_nh3_el + fe_pe_resin_coal + Chemicals|Resins|Solids|Biomass: + filter: + { technology: furnace_biomass_resins, mode: M1, commodity: biomass, level: final } + short: + fe_pe_resin_bio + Chemicals|Resins|Liquids|Oil: + filter: + { technology: [furnace_foil_resins, furnace_loil_resins], mode: M1, commodity: [fueloil, lightoil], level: final } + short: + fe_pe_resin_oil + Chemicals|Resins|Liquids|Biomass: + filter: + { technology: [ furnace_ethanol_resins ], mode: M1, commodity: [ ethanol ], level: final } + short: + fe_pe_resin_eth + Chemicals|Resins|Gases|Gas: + filter: + { technology: furnace_gas_resins, mode: M1, commodity: gas, level: final } + short: + fe_pe_resin_gas + Chemicals|Resins|Hydrogen: + filter: + { technology: [furnace_h2_resins, fc_h2_resins], mode: M1, commodity: hydrogen, level: final } + short: + fe_pe_resin_h2 + Chemicals|Resins|Liquids|Other: + filter: + { technology: [ furnace_methanol_resins ], mode: M1, commodity: methanol, level: final } + short: + fe_pe_resin_meth + Chemicals|High-Value Chemicals|Liquids|Oil|Light: filter: @@ -112,6 +139,11 @@ vars: short: fe_pe_hvc_coke + Chemicals|Methanol|Electricity: + filter: + { technology: [meth_h2, meth_ng_ccs], mode: feedstock, commodity: electr, level: secondary } + short: + fe_pe_meth_el # cement Non-Metallic Minerals|Cement|Heat: diff --git a/message_ix_models/data/material/reporting/fe_reporting_aggregates.yaml b/message_ix_models/data/material/reporting/fe_reporting_aggregates.yaml index ab46a8a572..5feff5bf20 100644 --- a/message_ix_models/data/material/reporting/fe_reporting_aggregates.yaml +++ b/message_ix_models/data/material/reporting/fe_reporting_aggregates.yaml @@ -22,13 +22,13 @@ level_2: components: [ fe_pe_ch_el, fe_pe_cement_el, fe_pe_aluminum_el, fe_pe_steel_el, fe_pe_other_el ] Gases|Gas: - short: fe_pe_el + short: fe_pe_gas components: [ fe_pe_hvc_gas, fe_pe_cement_gas, fe_pe_aluminum_gas, fe_pe_steel_gas, fe_pe_other_gas ] Gases: - short: fe_pe_el + short: fe_pe_gases components: - [ fe_pe_hvc_gas, fe_pe_cement_gas, fe_pe_aluminum_gas, fe_pe_steel_gas, fe_pe_other_gas ] + [ fe_pe_hvc_gases, fe_pe_cement_gases, fe_pe_aluminum_gases, fe_pe_steel_gases, fe_pe_other_gases ] Liquids|Biomass: short: fe_pe_oil components: @@ -61,11 +61,11 @@ level_2: short: fe_pe_bio components: [ fe_pe_hvc_bio, fe_pe_cement_bio, fe_pe_aluminum_bio, fe_pe_other_bio ] + Hydrogen: + short: fe_pe_h2 + components: + [ fe_pe_hvc_h2, fe_pe_cement_h2, fe_pe_aluminum_h2, fe_pe_steel_h2, fe_pe_other_h2 ] -# Chemicals: -# short: fe_pe_chem -# components: -# [ fe_pe_hvc_el, fe_pe_hvc_oil, fe_pe_hvc_liq, fe_pe_hvc_solids ] Non-Metallic Minerals|Cement: short: fe_pe_cement @@ -80,13 +80,19 @@ level_2: Iron and Steel: short: fe_pe_steel components: - [ fe_pe_steel_el, fe_pe_steel_liq, fe_pe_steel_sol, fe_pe_steel_gas, fe_pe_steel_h2 ] + [ fe_pe_steel_el, fe_pe_steel_liq, fe_pe_steel_sol, fe_pe_steel_gases, fe_pe_steel_h2 ] Other Sector: short: fe_pe_oth components: - [ fe_pe_other_el, fe_pe_other_liq, fe_pe_other_sol, fe_pe_other_gas, fe_pe_other_h2 ] + [ fe_pe_other_el, fe_pe_other_liq, fe_pe_other_sol, fe_pe_other_gases, fe_pe_other_h2 ] + Chemicals|Other Sector: + short: fe_pe_chem_other + components: + [ fe_pe_resin_el, fe_pe_chem_other_gas, fe_pe_chem_other_oil, + fe_pe_chem_other_eth, fe_pe_chem_other_bio, fe_pe_chem_other_coal, + fe_pe_chem_other_h2 ] level_1: Chemicals|High-Value Chemicals|Electricity: @@ -105,11 +111,59 @@ level_1: short: fe_pe_hvc_solids components: [ fe_pe_hvc_bio, fe_pe_hvc_coal, fe_pe_hvc_coke] - Chemicals|Liquids|Other: short: fe_pe_chem_oth components: [ fe_pe_hvc_oth ] + Chemicals|Liquids|Gases: + short: fe_pe_hvc_gases + components: + [ fe_pe_hvc_gas ] + + Chemicals|Other Sector|Electricity: + short: fe_pe_chem_other_el + components: + [ fe_pe_resin_el ] + Chemicals|Other Sector|Gases|Gas: + short: fe_pe_chem_other_gas + components: + [ fe_pe_resin_gas ] + Chemicals|Other Sector|Gases: + short: fe_pe_chem_other_gases + components: + [ fe_pe_resin_gas ] + Chemicals|Other Sector|Liquids|Oil: + short: fe_pe_chem_other_oil + components: + [ fe_pe_resin_oil ] + Chemicals|Other Sector|Liquids|Biomass: + short: fe_pe_chem_other_eth + components: + [ fe_pe_resin_eth ] + Chemicals|Other Sector|Liquids|Other: + short: fe_pe_chem_other_meth + components: + [ fe_pe_resin_meth ] + Chemicals|Other Sector|Liquids: + short: fe_pe_chem_other_liq + components: + [ fe_pe_resin_eth, fe_pe_resin_oil ] + Chemicals|Other Sector|Solids|Biomass: + short: fe_pe_chem_other_bio + components: + [ fe_pe_resin_bio ] + Chemicals|Other Sector|Solids|Coal: + short: fe_pe_chem_other_coal + components: + [ fe_pe_resin_coal ] + Chemicals|Other Sector|Solids: + short: fe_pe_chem_other_sol + components: + [ fe_pe_resin_coal, fe_pe_resin_bio ] + Chemicals|Other Sector|Hydrogen: + short: fe_pe_chem_other_h2 + components: + [ fe_pe_resin_h2 ] # cement Non-Metallic Minerals|Cement|Electricity: @@ -128,7 +182,10 @@ level_1: short: fe_pe_cement_solids components: [ fe_pe_cement_bio, fe_pe_cement_coal, fe_pe_cement_coke ] - + Non-Metallic Minerals|Cement|Gases: + short: fe_pe_cement_gases + components: + [ fe_pe_cement_gas ] # aluminum Non-Ferrous Metals|Aluminium|Electricity: @@ -151,7 +208,10 @@ level_1: short: fe_pe_aluminum_bio_tot components: [ fe_pe_aluminum_bio, fe_pe_aluminum_bio_eth ] - + Non-Ferrous Metals|Aluminium|Gases: + short: fe_pe_aluminum_gases + components: + [ fe_pe_aluminum_gas ] # TODO: Electricity could be further differentiated by process in fe_reporting.yaml # iron and steel @@ -163,7 +223,7 @@ level_1: # short: # fe_pe_steel_el Iron and Steel|Gases: - short: fe_pe_steel_gas + short: fe_pe_steel_gases components: [ fe_pe_steel_gas, fe_pe_steel_gases_coal ] Iron and Steel|Liquids: @@ -214,4 +274,3 @@ level_1: components: [ fe_pe_other_coal, fe_pe_other_bio ] - diff --git a/message_ix_models/data/material/reporting/fe_solar_reporting_aggregates.yaml b/message_ix_models/data/material/reporting/fe_solar_reporting_aggregates.yaml new file mode 100644 index 0000000000..e1bef90167 --- /dev/null +++ b/message_ix_models/data/material/reporting/fe_solar_reporting_aggregates.yaml @@ -0,0 +1,19 @@ +# collection of industry specific final energy reporting variables +# grouped by sector +# each variable specifies a list of filter + +var: + out + +iamc_prefix: + Final Energy|Industry| + +common: + unit: GWa + + +level_1: + Solar: + short: fe_pe_solar + components: + [ fe_pe_other_solar ] \ No newline at end of file diff --git a/message_ix_models/data/material/reporting/fs1_reporting.yaml b/message_ix_models/data/material/reporting/fs1_reporting.yaml index 692cecf221..f997d9c915 100644 --- a/message_ix_models/data/material/reporting/fs1_reporting.yaml +++ b/message_ix_models/data/material/reporting/fs1_reporting.yaml @@ -14,11 +14,11 @@ common: vars: # ammonia - Chemicals|Ammonia|Solids|Coal: + Chemicals|Ammonia|Electricity: filter: - { technology: [ coal_NH3, coal_NH3_ccs ], mode: M1, commodity: NH3, level: secondary_material } + { technology: [ electr_NH3 ], mode: M1, commodity: NH3, level: secondary_material } short: - fe_fs_nh3_coal + fe_fs_nh3_el Chemicals|Ammonia|Solids|Biomass: filter: @@ -26,6 +26,12 @@ vars: short: fe_fs_nh3_bio + Chemicals|Ammonia|Solids|Coal: + filter: + { technology: [ coal_NH3, coal_NH3_ccs ], mode: M1, commodity: NH3, level: secondary_material } + short: + fe_fs_nh3_coal + Chemicals|Ammonia|Liquids|Oil: filter: { technology: fueloil_NH3, mode: M1, commodity: NH3, level: secondary_material } diff --git a/message_ix_models/data/material/reporting/prod_reporting.yaml b/message_ix_models/data/material/reporting/prod_reporting.yaml index 25894cbbf2..e746e91988 100644 --- a/message_ix_models/data/material/reporting/prod_reporting.yaml +++ b/message_ix_models/data/material/reporting/prod_reporting.yaml @@ -272,13 +272,13 @@ vars: # aluminum - Non-Ferrous Metals|Aluminum|Primary: + Non-Ferrous Metals|Aluminium|Primary: filter: { technology: [prebake_aluminum, soderberg_aluminum], mode: M1, commodity: aluminum, level: final_material } short: prod_alu_sec - Non-Ferrous Metals|Aluminum|Secondary: + Non-Ferrous Metals|Aluminium|Secondary: filter: { technology: [secondary_aluminum], mode: M1, commodity: aluminum, level: final_material } short: diff --git a/message_ix_models/data/material/reporting/prod_reporting_aggregates.yaml b/message_ix_models/data/material/reporting/prod_reporting_aggregates.yaml index fe61d34b32..ba2071daf5 100644 --- a/message_ix_models/data/material/reporting/prod_reporting_aggregates.yaml +++ b/message_ix_models/data/material/reporting/prod_reporting_aggregates.yaml @@ -11,13 +11,18 @@ iamc_prefix: common: unit: Mt/yr +level_4: + Chemicals: + short: prod_chem + components: + [ prod_hvc, prod_nh3, prod_meth ] + level_3: Chemicals|High-Value Chemicals: short: prod_hvc components: [ prod_ethy, prod_propy, prod_btx] - level_2: Chemicals|Ammonia: short: prod_nh3 @@ -40,7 +45,6 @@ level_2: components: [ prod_btx_sc, prod_btx_ref] - level_1: Chemicals|Ammonia|Gases: short: prod_nh3_gas_tot @@ -88,7 +92,7 @@ level_1: [ prod_clinker_wet, prod_clinker_dry ] # aluminum - Non-Ferrous Metals|Aluminum: + Non-Ferrous Metals|Aluminium: short: prod_alu components: [ prod_alu_prim, prod_alu_sec ] diff --git a/message_ix_models/model/material/report/run_reporting.py b/message_ix_models/model/material/report/run_reporting.py index 4f2cc4e5f8..320b5f1099 100644 --- a/message_ix_models/model/material/report/run_reporting.py +++ b/message_ix_models/model/material/report/run_reporting.py @@ -326,6 +326,11 @@ def add_chemicals_to_final_energy_variables( "Chemicals|Methanol|Solids|Coal", "Chemicals|High-Value Chemicals|Solids|Coal", ], + "Chemicals|Hydrogen": [ + "Chemicals|Ammonia|Hydrogen", + "Chemicals|Methanol|Hydrogen", + "Chemicals|High-Value Chemicals|Hydrogen", + ], } prefix = "Final Energy|Industry|" fe_aggs = {prefix + k: [prefix + i for i in v] for k, v in chem_aggs.items()} @@ -334,6 +339,7 @@ def add_chemicals_to_final_energy_variables( updated_fe_totals = [] for comm in [ + "Electricity", "Liquids", "Liquids|Oil", "Solids", @@ -341,13 +347,14 @@ def add_chemicals_to_final_energy_variables( "Solids|Coal", "Gases", "Gases|Gas", + "Hydrogen", ]: updated_fe_totals.append( py_df_all.add( prefix + comm, prefix + f"Chemicals|{comm}", prefix + comm, - # ignore_units=True, + ignore_units=True, ) ) py_df_updates = pyam.concat(updated_fe_totals)