From bd2f3a3b959ec4bb08d79b4a2ce54ace03304bcd Mon Sep 17 00:00:00 2001 From: Renato-Rodrigues Date: Tue, 11 Jun 2024 16:42:56 +0200 Subject: [PATCH 01/14] adding support for defining exogenous CO2 prices based on the reference gdx values --- .../regiCarbonPrice/declarations.gms | 5 +++- .../47_regipol/regiCarbonPrice/postsolve.gms | 23 +++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/modules/47_regipol/regiCarbonPrice/declarations.gms b/modules/47_regipol/regiCarbonPrice/declarations.gms index 61d36f93a..7b16bfe49 100644 --- a/modules/47_regipol/regiCarbonPrice/declarations.gms +++ b/modules/47_regipol/regiCarbonPrice/declarations.gms @@ -233,10 +233,13 @@ $endIf.cm_CCSmaxBound *** Exogenous CO2 tax level: ***--------------------------------------------------------------------------- $ifThen.regiExoPrice not "%cm_regiExoPrice%" == "off" + +$ifThen.regiExoPriceType not "%cm_regiExoPrice%" == "gdx" Parameter p47_exoCo2tax(ext_regi,ttot) "Exogenous CO2 tax level. Overrides carbon prices in pm_taxCO2eq, only if explicitly defined. Regions and region groups allowed. Format: '. , . ' or '.( , '). [$/tCO2]" / %cm_regiExoPrice% / ; -$endIf.regiExoPrice +$endIf.regiExoPriceType +$endIf.regiExoPrice *** EOF ./modules/47_regipol/regiCarbonPrice/declarations.gms diff --git a/modules/47_regipol/regiCarbonPrice/postsolve.gms b/modules/47_regipol/regiCarbonPrice/postsolve.gms index f97bcdd17..a377c841e 100644 --- a/modules/47_regipol/regiCarbonPrice/postsolve.gms +++ b/modules/47_regipol/regiCarbonPrice/postsolve.gms @@ -879,6 +879,28 @@ $endIf.cm_implicitPePriceTarget ***--------------------------------------------------------------------------- $ifThen.regiExoPrice not "%cm_regiExoPrice%" == "off" + +*** setting exogenous CO2 prices from the reference gdx +$ifThen.regiExoPriceType "%cm_regiExoPrice%" == "gdx" + Execute_Loadpoint 'input_ref' pm_taxCO2eq = pm_taxCO2eq; + Execute_Loadpoint 'input_ref' pm_taxemiMkt = pm_taxemiMkt; +*** Removing additional co2 tax parameters + pm_taxCO2eqRegi(t,regi) = 0; + pm_taxCO2eqSCC(t,regi) = 0; + pm_taxrevGHG0(t,regi) = 0; + pm_taxrevCO2Sector0(t,regi,emi_sectors) = 0; + pm_taxrevCO2LUC0(t,regi) = 0; + pm_taxrevNetNegEmi0(t,regi) = 0; +*** Removing economy wide co2 tax parameters for regions within the emiMKt controlled targets (this is necessary here to remove any calculation made in other modules after the last run in the postsolve) + loop((ttot,regi,emiMkt)$pm_taxemiMkt(ttot,regi,emiMkt), + pm_taxCO2eq(ttot,regi) = 0; + ); +*** Redefining the pm_taxCO2eqSum parameter + pm_taxCO2eqSum(ttot,regi)$(regi_group(ext_regi,regi) and (ttot.val ge cm_startyear)) = pm_taxCO2eq(ttot,regi); +display 'update of CO2 prices to exogenously given CO2 prices defined in the reference gdx', pm_taxCO2eq, pm_taxemiMkt; + +*** setting exogenous CO2 prices from switch cm_regiExoPrice +$else.regiExoPriceType loop((ttot,ext_regi)$p47_exoCo2tax(ext_regi,ttot), *** Removing the existent co2 tax parameters for regions with exogenous set prices pm_taxCO2eqSum(ttot,regi)$(regi_group(ext_regi,regi) and (ttot.val ge cm_startyear)) = 0; @@ -898,6 +920,7 @@ loop((ttot,ext_regi)$p47_exoCo2tax(ext_regi,ttot), pm_taxCO2eqSum(ttot,regi)$(regi_group(ext_regi,regi) and (ttot.val ge cm_startyear)) = pm_taxCO2eq(ttot,regi); ); display 'update of CO2 prices due to exogenously given CO2 prices in p47_exoCo2tax', pm_taxCO2eq; +$endIf.regiExoPriceType $endIf.regiExoPrice *** EOF ./modules/47_regipol/regiCarbonPrice/postsolve.gms From 7c08e7956762040c84dccbf30fd9db7368b80abc Mon Sep 17 00:00:00 2001 From: Renato-Rodrigues Date: Tue, 11 Jun 2024 16:50:46 +0200 Subject: [PATCH 02/14] improve description --- main.gms | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.gms b/main.gms index 15c85d043..9c80d6623 100755 --- a/main.gms +++ b/main.gms @@ -1254,7 +1254,11 @@ $setglobal c_ccsinjecrateRegi off !! def = "off" *** ("forcing_SSP2") settings consistent with SSP 2 *** ("forcing_SSP5") settings consistent with SSP 5 $setglobal c_SSP_forcing_adjust forcing_SSP2 !! def = forcing_SSP2 !! regexp = forcing_SSP(1|2|5) -*** cm_regiExoPrice "set exogenous co2 tax path for specific regions using a switch, require regipol module to be set to regiCarbonPrice (e.g. GLO.(2025 38,2030 49,2035 63,2040 80,2045 102,2050 130,2055 166,2060 212,2070 346,2080 563,2090 917,2100 1494,2110 1494,2130 1494,2150 1494) )" +*** cm_regiExoPrice "set exogenous co2 tax path for specific regions using a switch or load the values from a reference gdx. This feature requires regipol module to be set to regiCarbonPrice. +*** ("gdx") CO2 prices will be exogenously fixed to the values found in the reference gdx, both for pm_taxCO2eq and pm_taxemiMkt parameters. +*** (". , . " or ".( , ") CO2 prices will be exogenously defined +*** only for the regions, periods and values defined in the switch cm_regiExoPrice +*** e.g. "GLO.(2025 38,2030 49,2035 63,2040 80,2045 102,2050 130,2055 166,2060 212,2070 346,2080 563,2090 917,2100 1494,2110 1494,2130 1494,2150 1494)" $setGlobal cm_regiExoPrice off !! def = off *** cm_emiMktTarget "set a budget or year emission target, for all (all) or specific emission markets (ETS, ESD or other), and specific regions (e.g. DEU) or region groups (e.g. EU27)" *** Example on how to use: From 5279ec44b2babf31aaa30f1358079af2e2101577 Mon Sep 17 00:00:00 2001 From: Renato-Rodrigues Date: Tue, 11 Jun 2024 17:05:15 +0200 Subject: [PATCH 03/14] removing unecessary dimensions --- .../47_regipol/regiCarbonPrice/postsolve.gms | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/modules/47_regipol/regiCarbonPrice/postsolve.gms b/modules/47_regipol/regiCarbonPrice/postsolve.gms index a377c841e..7e51440da 100644 --- a/modules/47_regipol/regiCarbonPrice/postsolve.gms +++ b/modules/47_regipol/regiCarbonPrice/postsolve.gms @@ -892,32 +892,34 @@ $ifThen.regiExoPriceType "%cm_regiExoPrice%" == "gdx" pm_taxrevCO2LUC0(t,regi) = 0; pm_taxrevNetNegEmi0(t,regi) = 0; *** Removing economy wide co2 tax parameters for regions within the emiMKt controlled targets (this is necessary here to remove any calculation made in other modules after the last run in the postsolve) - loop((ttot,regi,emiMkt)$pm_taxemiMkt(ttot,regi,emiMkt), - pm_taxCO2eq(ttot,regi) = 0; + loop((t,regi,emiMkt)$pm_taxemiMkt(t,regi,emiMkt), + pm_taxCO2eq(t,regi) = 0; ); *** Redefining the pm_taxCO2eqSum parameter - pm_taxCO2eqSum(ttot,regi)$(regi_group(ext_regi,regi) and (ttot.val ge cm_startyear)) = pm_taxCO2eq(ttot,regi); + pm_taxCO2eqSum(t,regi) = pm_taxCO2eq(t,regi); display 'update of CO2 prices to exogenously given CO2 prices defined in the reference gdx', pm_taxCO2eq, pm_taxemiMkt; *** setting exogenous CO2 prices from switch cm_regiExoPrice $else.regiExoPriceType -loop((ttot,ext_regi)$p47_exoCo2tax(ext_regi,ttot), +loop((t,ext_regi)$p47_exoCo2tax(ext_regi,t), + loop(regi$regi_group(ext_regi,regi), *** Removing the existent co2 tax parameters for regions with exogenous set prices - pm_taxCO2eqSum(ttot,regi)$(regi_group(ext_regi,regi) and (ttot.val ge cm_startyear)) = 0; - pm_taxCO2eq(ttot,regi)$(regi_group(ext_regi,regi) and (ttot.val ge cm_startyear)) = 0; - pm_taxCO2eqRegi(ttot,regi)$(regi_group(ext_regi,regi) and (ttot.val ge cm_startyear)) = 0; - pm_taxCO2eqSCC(ttot,regi)$(regi_group(ext_regi,regi) and (ttot.val ge cm_startyear)) = 0; + pm_taxCO2eqSum(t,regi) = 0; + pm_taxCO2eq(t,regi) = 0; + pm_taxCO2eqRegi(t,regi) = 0; + pm_taxCO2eqSCC(t,regi) = 0; - pm_taxrevGHG0(ttot,regi)$(regi_group(ext_regi,regi) and (ttot.val ge cm_startyear)) = 0; - pm_taxrevCO2Sector0(ttot,regi,emi_sectors)$(regi_group(ext_regi,regi) and (ttot.val ge cm_startyear)) = 0; - pm_taxrevCO2LUC0(ttot,regi)$(regi_group(ext_regi,regi) and (ttot.val ge cm_startyear)) = 0; - pm_taxrevNetNegEmi0(ttot,regi)$(regi_group(ext_regi,regi) and (ttot.val ge cm_startyear)) = 0; + pm_taxrevGHG0(t,regi) = 0; + pm_taxrevCO2Sector0(t,regi,emi_sectors) = 0; + pm_taxrevCO2LUC0(t,regi) = 0; + pm_taxrevNetNegEmi0(t,regi) = 0; - pm_taxemiMkt(ttot,regi,emiMkt)$(regi_group(ext_regi,regi) and (ttot.val ge cm_startyear)) = 0; + pm_taxemiMkt(t,regi,emiMkt) = 0; *** setting exogenous CO2 prices - pm_taxCO2eq(ttot,regi)$(regi_group(ext_regi,regi) and (ttot.val ge cm_startyear)) = p47_exoCo2tax(ext_regi,ttot)*sm_DptCO2_2_TDpGtC; - pm_taxCO2eqSum(ttot,regi)$(regi_group(ext_regi,regi) and (ttot.val ge cm_startyear)) = pm_taxCO2eq(ttot,regi); + pm_taxCO2eq(t,regi) = p47_exoCo2tax(ext_regi,t)*sm_DptCO2_2_TDpGtC; + pm_taxCO2eqSum(t,regi) = pm_taxCO2eq(t,regi); + ); ); display 'update of CO2 prices due to exogenously given CO2 prices in p47_exoCo2tax', pm_taxCO2eq; $endIf.regiExoPriceType From 9c2e1ffc71611acbe6adef32ccbf3adc9b15909b Mon Sep 17 00:00:00 2001 From: Renato-Rodrigues Date: Tue, 11 Jun 2024 17:15:18 +0200 Subject: [PATCH 04/14] avoiding multiple load gdx calls and initializing CO2 tax in first iteration --- .../47_regipol/regiCarbonPrice/postsolve.gms | 16 +++--- .../47_regipol/regiCarbonPrice/preloop.gms | 52 +++++++++++++++++++ 2 files changed, 60 insertions(+), 8 deletions(-) diff --git a/modules/47_regipol/regiCarbonPrice/postsolve.gms b/modules/47_regipol/regiCarbonPrice/postsolve.gms index 7e51440da..c393768d3 100644 --- a/modules/47_regipol/regiCarbonPrice/postsolve.gms +++ b/modules/47_regipol/regiCarbonPrice/postsolve.gms @@ -882,8 +882,14 @@ $ifThen.regiExoPrice not "%cm_regiExoPrice%" == "off" *** setting exogenous CO2 prices from the reference gdx $ifThen.regiExoPriceType "%cm_regiExoPrice%" == "gdx" - Execute_Loadpoint 'input_ref' pm_taxCO2eq = pm_taxCO2eq; - Execute_Loadpoint 'input_ref' pm_taxemiMkt = pm_taxemiMkt; + p47_taxemiMkt(t,regi,emiMkt) = p47_taxemiMkt_init(t,regi,emiMkt); + pm_taxCO2eq(t,regi) = p47_taxCO2eq_ref(t,regi); +*** Removing economy wide co2 tax parameters for regions within the emiMKt controlled targets (this is necessary here to remove any calculation made in other modules after the last run in the postsolve) + loop((t,regi,emiMkt)$pm_taxemiMkt(t,regi,emiMkt), + pm_taxCO2eq(t,regi) = 0; + ); +*** Redefining the pm_taxCO2eqSum parameter + pm_taxCO2eqSum(t,regi) = pm_taxCO2eq(t,regi); *** Removing additional co2 tax parameters pm_taxCO2eqRegi(t,regi) = 0; pm_taxCO2eqSCC(t,regi) = 0; @@ -891,12 +897,6 @@ $ifThen.regiExoPriceType "%cm_regiExoPrice%" == "gdx" pm_taxrevCO2Sector0(t,regi,emi_sectors) = 0; pm_taxrevCO2LUC0(t,regi) = 0; pm_taxrevNetNegEmi0(t,regi) = 0; -*** Removing economy wide co2 tax parameters for regions within the emiMKt controlled targets (this is necessary here to remove any calculation made in other modules after the last run in the postsolve) - loop((t,regi,emiMkt)$pm_taxemiMkt(t,regi,emiMkt), - pm_taxCO2eq(t,regi) = 0; - ); -*** Redefining the pm_taxCO2eqSum parameter - pm_taxCO2eqSum(t,regi) = pm_taxCO2eq(t,regi); display 'update of CO2 prices to exogenously given CO2 prices defined in the reference gdx', pm_taxCO2eq, pm_taxemiMkt; *** setting exogenous CO2 prices from switch cm_regiExoPrice diff --git a/modules/47_regipol/regiCarbonPrice/preloop.gms b/modules/47_regipol/regiCarbonPrice/preloop.gms index 7ef388bbd..b41948810 100644 --- a/modules/47_regipol/regiCarbonPrice/preloop.gms +++ b/modules/47_regipol/regiCarbonPrice/preloop.gms @@ -120,5 +120,57 @@ pm_eta_conv("2010",regi,"tdsyngas")$(sameAs(regi,"DEU")) = 0.949; pm_eta_conv("2015",regi,"tdsyngas")$(sameAs(regi,"DEU")) = 0.962; pm_eta_conv(t,regi,"tdsyngas")$(sameAs(regi,"DEU") and t.val ge 2020) = 0.975; +***--------------------------------------------------------------------------- +*** Exogenous CO2 tax level: +***--------------------------------------------------------------------------- + +*** initialize exogenous CO2 prices +$ifThen.regiExoPrice not "%cm_regiExoPrice%" == "off" + +*** setting exogenous CO2 prices from the reference gdx +$ifThen.regiExoPriceType "%cm_regiExoPrice%" == "gdx" + p47_taxemiMkt(t,regi,emiMkt) = p47_taxemiMkt_init(t,regi,emiMkt); + pm_taxCO2eq(t,regi) = p47_taxCO2eq_ref(t,regi); +*** Removing economy wide co2 tax parameters for regions within the emiMKt controlled targets (this is necessary here to remove any calculation made in other modules after the last run in the postsolve) + loop((t,regi,emiMkt)$pm_taxemiMkt(t,regi,emiMkt), + pm_taxCO2eq(t,regi) = 0; + ); +*** Redefining the pm_taxCO2eqSum parameter + pm_taxCO2eqSum(t,regi) = pm_taxCO2eq(t,regi); +*** Removing additional co2 tax parameters + pm_taxCO2eqRegi(t,regi) = 0; + pm_taxCO2eqSCC(t,regi) = 0; + pm_taxrevGHG0(t,regi) = 0; + pm_taxrevCO2Sector0(t,regi,emi_sectors) = 0; + pm_taxrevCO2LUC0(t,regi) = 0; + pm_taxrevNetNegEmi0(t,regi) = 0; +display 'update of CO2 prices to exogenously given CO2 prices defined in the reference gdx', pm_taxCO2eq, pm_taxemiMkt; + +*** setting exogenous CO2 prices from switch cm_regiExoPrice +$else.regiExoPriceType +loop((t,ext_regi)$p47_exoCo2tax(ext_regi,t), + loop(regi$regi_group(ext_regi,regi), +*** Removing the existent co2 tax parameters for regions with exogenous set prices + pm_taxCO2eqSum(t,regi) = 0; + pm_taxCO2eq(t,regi) = 0; + pm_taxCO2eqRegi(t,regi) = 0; + pm_taxCO2eqSCC(t,regi) = 0; + + pm_taxrevGHG0(t,regi) = 0; + pm_taxrevCO2Sector0(t,regi,emi_sectors) = 0; + pm_taxrevCO2LUC0(t,regi) = 0; + pm_taxrevNetNegEmi0(t,regi) = 0; + + pm_taxemiMkt(t,regi,emiMkt) = 0; + +*** setting exogenous CO2 prices + pm_taxCO2eq(t,regi) = p47_exoCo2tax(ext_regi,t)*sm_DptCO2_2_TDpGtC; + pm_taxCO2eqSum(t,regi) = pm_taxCO2eq(t,regi); + ); +); +display 'update of CO2 prices due to exogenously given CO2 prices in p47_exoCo2tax', pm_taxCO2eq; +$endIf.regiExoPriceType +$endIf.regiExoPrice + *** EOF ./modules/47_regipol/regiCarbonPrice/preloop.gms From 2fc395b2e753e769a05f2330266aea97524e80b1 Mon Sep 17 00:00:00 2001 From: Renato-Rodrigues Date: Tue, 11 Jun 2024 17:49:10 +0200 Subject: [PATCH 05/14] using the input gdx file for setting exogenous prices --- main.gms | 4 ++-- modules/21_tax/on/declarations.gms | 2 +- modules/21_tax/on/preloop.gms | 6 +++--- modules/47_regipol/regiCarbonPrice/datainput.gms | 3 +++ modules/47_regipol/regiCarbonPrice/declarations.gms | 1 + modules/47_regipol/regiCarbonPrice/postsolve.gms | 6 +++--- modules/47_regipol/regiCarbonPrice/preloop.gms | 6 +++--- 7 files changed, 16 insertions(+), 12 deletions(-) diff --git a/main.gms b/main.gms index 9c80d6623..019e615be 100755 --- a/main.gms +++ b/main.gms @@ -1254,8 +1254,8 @@ $setglobal c_ccsinjecrateRegi off !! def = "off" *** ("forcing_SSP2") settings consistent with SSP 2 *** ("forcing_SSP5") settings consistent with SSP 5 $setglobal c_SSP_forcing_adjust forcing_SSP2 !! def = forcing_SSP2 !! regexp = forcing_SSP(1|2|5) -*** cm_regiExoPrice "set exogenous co2 tax path for specific regions using a switch or load the values from a reference gdx. This feature requires regipol module to be set to regiCarbonPrice. -*** ("gdx") CO2 prices will be exogenously fixed to the values found in the reference gdx, both for pm_taxCO2eq and pm_taxemiMkt parameters. +*** cm_regiExoPrice "set exogenous co2 tax path for specific regions using a switch or load the values from the input gdx. This feature requires regipol module to be set to regiCarbonPrice. +*** ("gdx") CO2 prices will be exogenously fixed to the values found in the input gdx, both for pm_taxCO2eq and pm_taxemiMkt parameters. *** (". , . " or ".( , ") CO2 prices will be exogenously defined *** only for the regions, periods and values defined in the switch cm_regiExoPrice *** e.g. "GLO.(2025 38,2030 49,2035 63,2040 80,2045 102,2050 130,2055 166,2060 212,2070 346,2080 563,2090 917,2100 1494,2110 1494,2130 1494,2150 1494)" diff --git a/modules/21_tax/on/declarations.gms b/modules/21_tax/on/declarations.gms index 5af9aa774..ea6293a50 100644 --- a/modules/21_tax/on/declarations.gms +++ b/modules/21_tax/on/declarations.gms @@ -63,7 +63,7 @@ p21_CO2TaxSectorMarkup(ttot,all_regi,emi_sectors) "CO2 tax markup in bu p21_deltarev(iteration,all_regi) "convergence criteria for iteration on tax revenue recycling" -p21_tau_CO2_tax_gdx(ttot,all_regi) "tax path from gdx, may overwrite default values" +pm_tau_CO2_tax_gdx(ttot,all_regi) "tax path from gdx, may overwrite default values" p21_tau_CO2_tax_gdx_bau(ttot,all_regi) "tax path from gdx, may overwrite default values" p21_implicitDiscRateMarg(ttot,all_regi,all_in) "Difference between the normal discount rate and the implicit discount rate" diff --git a/modules/21_tax/on/preloop.gms b/modules/21_tax/on/preloop.gms index b2cbe5b9a..924b4d098 100644 --- a/modules/21_tax/on/preloop.gms +++ b/modules/21_tax/on/preloop.gms @@ -17,11 +17,11 @@ pm_taxCO2eq("2010",regi)=0; ***------------------------------------------------------------------- *** overwrite default targets with gdx values ***------------------------------------------------------------------- -Execute_Loadpoint 'input' p21_tau_CO2_tax_gdx = pm_taxCO2eq; +Execute_Loadpoint 'input' pm_tau_CO2_tax_gdx = pm_taxCO2eq; if (cm_gdximport_target eq 1, *** only if tax rates not all equal to zero -if (smax((t,regi),p21_tau_CO2_tax_gdx(t,regi)$(t.val gt 2030)) gt 0, -pm_taxCO2eq(t,regi) = p21_tau_CO2_tax_gdx(t,regi); +if (smax((t,regi),pm_tau_CO2_tax_gdx(t,regi)$(t.val gt 2030)) gt 0, +pm_taxCO2eq(t,regi) = pm_tau_CO2_tax_gdx(t,regi); ); ); if (cm_emiscen ne 9, diff --git a/modules/47_regipol/regiCarbonPrice/datainput.gms b/modules/47_regipol/regiCarbonPrice/datainput.gms index acafda76e..5396f8089 100644 --- a/modules/47_regipol/regiCarbonPrice/datainput.gms +++ b/modules/47_regipol/regiCarbonPrice/datainput.gms @@ -63,6 +63,9 @@ $IFTHEN.emiMkt not "%cm_emiMktTarget%" == "off" ); ); +*** load emiMkt CO2eq prices from input gdx +Execute_Loadpoint 'input' p47_tau_taxemiMkt = pm_taxemiMkt; + *** initialize carbon taxes based on reference runs *** p47_taxemiMkt_init saves information from reference runs about pm_taxCO2eq (carbon price defined on the carbonprice module) and/or *** pm_taxemiMkt (regipol carbon price) so the carbon tax can be initialized for regions with CO2 tax controlled by cm_emiMktTarget diff --git a/modules/47_regipol/regiCarbonPrice/declarations.gms b/modules/47_regipol/regiCarbonPrice/declarations.gms index 7b16bfe49..a01c6d77e 100644 --- a/modules/47_regipol/regiCarbonPrice/declarations.gms +++ b/modules/47_regipol/regiCarbonPrice/declarations.gms @@ -45,6 +45,7 @@ $else.emiMktTargetType $endif.emiMktTargetType *** Initialization parameters (load data from the gdx) + p47_tau_taxemiMkt(ttot,all_regi,emiMkt) "emiMkt CO2eq prices loaded from input gdx, in T$/GtC = $/kgC. To get $/tCO2, multiply with 272 [T$/GtC]" p47_taxemiMkt_init(ttot,all_regi,emiMkt) "emiMkt CO2eq prices loaded from ref gdx, in T$/GtC = $/kgC. To get $/tCO2, multiply with 272 [T$/GtC]" p47_taxCO2eq_ref(ttot,all_regi) "CO2eq prices loaded from ref gdx, in T$/GtC = $/kgC. To get $/tCO2, multiply with 272 [T$/GtC]" diff --git a/modules/47_regipol/regiCarbonPrice/postsolve.gms b/modules/47_regipol/regiCarbonPrice/postsolve.gms index c393768d3..de31a8817 100644 --- a/modules/47_regipol/regiCarbonPrice/postsolve.gms +++ b/modules/47_regipol/regiCarbonPrice/postsolve.gms @@ -880,10 +880,10 @@ $endIf.cm_implicitPePriceTarget $ifThen.regiExoPrice not "%cm_regiExoPrice%" == "off" -*** setting exogenous CO2 prices from the reference gdx +*** setting exogenous CO2 prices from the input gdx $ifThen.regiExoPriceType "%cm_regiExoPrice%" == "gdx" - p47_taxemiMkt(t,regi,emiMkt) = p47_taxemiMkt_init(t,regi,emiMkt); - pm_taxCO2eq(t,regi) = p47_taxCO2eq_ref(t,regi); + p47_taxemiMkt(t,regi,emiMkt) = p47_tau_taxemiMkt(t,regi,emiMkt); + pm_taxCO2eq(t,regi) = pm_tau_CO2_tax_gdx(t,regi); *** Removing economy wide co2 tax parameters for regions within the emiMKt controlled targets (this is necessary here to remove any calculation made in other modules after the last run in the postsolve) loop((t,regi,emiMkt)$pm_taxemiMkt(t,regi,emiMkt), pm_taxCO2eq(t,regi) = 0; diff --git a/modules/47_regipol/regiCarbonPrice/preloop.gms b/modules/47_regipol/regiCarbonPrice/preloop.gms index b41948810..85ec2efe1 100644 --- a/modules/47_regipol/regiCarbonPrice/preloop.gms +++ b/modules/47_regipol/regiCarbonPrice/preloop.gms @@ -127,10 +127,10 @@ pm_eta_conv(t,regi,"tdsyngas")$(sameAs(regi,"DEU") and t.val ge 2020) = 0.975; *** initialize exogenous CO2 prices $ifThen.regiExoPrice not "%cm_regiExoPrice%" == "off" -*** setting exogenous CO2 prices from the reference gdx +*** setting exogenous CO2 prices from the input gdx $ifThen.regiExoPriceType "%cm_regiExoPrice%" == "gdx" - p47_taxemiMkt(t,regi,emiMkt) = p47_taxemiMkt_init(t,regi,emiMkt); - pm_taxCO2eq(t,regi) = p47_taxCO2eq_ref(t,regi); + p47_taxemiMkt(t,regi,emiMkt) = p47_tau_taxemiMkt(t,regi,emiMkt); + pm_taxCO2eq(t,regi) = pm_tau_CO2_tax_gdx(t,regi); *** Removing economy wide co2 tax parameters for regions within the emiMKt controlled targets (this is necessary here to remove any calculation made in other modules after the last run in the postsolve) loop((t,regi,emiMkt)$pm_taxemiMkt(t,regi,emiMkt), pm_taxCO2eq(t,regi) = 0; From 70e7c53cada68ac8e12d4f8d1d699ea6d689257c Mon Sep 17 00:00:00 2001 From: Renato-Rodrigues Date: Tue, 11 Jun 2024 17:54:29 +0200 Subject: [PATCH 06/14] code check compliance --- modules/21_tax/off/not_used.txt | 1 + modules/47_regipol/none/not_used.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/modules/21_tax/off/not_used.txt b/modules/21_tax/off/not_used.txt index 3dd1c8623..31b15d8d8 100644 --- a/modules/21_tax/off/not_used.txt +++ b/modules/21_tax/off/not_used.txt @@ -72,3 +72,4 @@ pm_gdp,input,only needed if tax is on pm_cf,input,only needed if tax is on vm_shDemSeel,input,only needed if tax is on pm_teAnnuity,input,only needed if tax is on +pm_tau_CO2_tax_gdx,input,questionnaire diff --git a/modules/47_regipol/none/not_used.txt b/modules/47_regipol/none/not_used.txt index dc411e381..65b379b9b 100644 --- a/modules/47_regipol/none/not_used.txt +++ b/modules/47_regipol/none/not_used.txt @@ -75,3 +75,4 @@ vm_emiTeMkt,input,added by codeCheck cm_emiMktTarget_tolerance,switch,not needed sm_globalBudget_dev,input,questionnaire pm_allTargetsConverged,input,questionnaire +pm_tau_CO2_tax_gdx,input,questionnaire From a77965259a76e696989a8a6c35be8784a43ccd9d Mon Sep 17 00:00:00 2001 From: Renato-Rodrigues Date: Tue, 11 Jun 2024 19:19:52 +0200 Subject: [PATCH 07/14] update changelog --- CHANGELOG.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 38c3236be..1f759019a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,7 +20,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts** enhance output script `reportCEScalib` to include additional plot formats [[#1671](https://github.com/remindmodel/remind/pull/1671) ### added -- **24_trade** add optinal trade scenario for EUR hydrogen and e-liquids imports [[#1666](https://github.com/remindmodel/remind/pull/1666)] +- **24_trade** add optional trade scenario for EUR hydrogen and e-liquids imports [[#1666](https://github.com/remindmodel/remind/pull/1666)] +- **24_trade** add optional trade scenario for EUR bio-fuels imports [[#1678](https://github.com/remindmodel/remind/pull/1678)] +- **47_regipol** add support for scenario based regional emission targets and add net-zero pledges scenario [[#1674](https://github.com/remindmodel/remind/pull/1674)] +- **47_regipol** add support for loading exogenous CO2 price from the input gdx [[#1698](https://github.com/remindmodel/remind/pull/1698)] ## [3.3.0] - 2024-03-28 From bfa2d4373df14ff0a0afdd95bf3c62b383830c64 Mon Sep 17 00:00:00 2001 From: Renato-Rodrigues Date: Tue, 11 Jun 2024 19:26:13 +0200 Subject: [PATCH 08/14] avoiding cm_emiMktTarget dependance --- modules/47_regipol/regiCarbonPrice/datainput.gms | 12 +++++++++--- modules/47_regipol/regiCarbonPrice/declarations.gms | 7 ++++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/modules/47_regipol/regiCarbonPrice/datainput.gms b/modules/47_regipol/regiCarbonPrice/datainput.gms index 5396f8089..1243cbe08 100644 --- a/modules/47_regipol/regiCarbonPrice/datainput.gms +++ b/modules/47_regipol/regiCarbonPrice/datainput.gms @@ -63,9 +63,6 @@ $IFTHEN.emiMkt not "%cm_emiMktTarget%" == "off" ); ); -*** load emiMkt CO2eq prices from input gdx -Execute_Loadpoint 'input' p47_tau_taxemiMkt = pm_taxemiMkt; - *** initialize carbon taxes based on reference runs *** p47_taxemiMkt_init saves information from reference runs about pm_taxCO2eq (carbon price defined on the carbonprice module) and/or *** pm_taxemiMkt (regipol carbon price) so the carbon tax can be initialized for regions with CO2 tax controlled by cm_emiMktTarget @@ -324,5 +321,14 @@ $offdelim $endif.exogDemScen +***--------------------------------------------------------------------------- +*** Exogenous CO2 tax level: +***--------------------------------------------------------------------------- +$ifThen.regiExoPriceType "%cm_regiExoPrice%" == "gdx" +*** load emiMkt CO2eq prices from input gdx +Execute_Loadpoint 'input' p47_tau_taxemiMkt = pm_taxemiMkt; +$endIf.regiExoPriceType + + *** EOF ./modules/47_regipol/regiCarbonPrice/datainput.gms diff --git a/modules/47_regipol/regiCarbonPrice/declarations.gms b/modules/47_regipol/regiCarbonPrice/declarations.gms index a01c6d77e..6c63a5e6b 100644 --- a/modules/47_regipol/regiCarbonPrice/declarations.gms +++ b/modules/47_regipol/regiCarbonPrice/declarations.gms @@ -45,7 +45,6 @@ $else.emiMktTargetType $endif.emiMktTargetType *** Initialization parameters (load data from the gdx) - p47_tau_taxemiMkt(ttot,all_regi,emiMkt) "emiMkt CO2eq prices loaded from input gdx, in T$/GtC = $/kgC. To get $/tCO2, multiply with 272 [T$/GtC]" p47_taxemiMkt_init(ttot,all_regi,emiMkt) "emiMkt CO2eq prices loaded from ref gdx, in T$/GtC = $/kgC. To get $/tCO2, multiply with 272 [T$/GtC]" p47_taxCO2eq_ref(ttot,all_regi) "CO2eq prices loaded from ref gdx, in T$/GtC = $/kgC. To get $/tCO2, multiply with 272 [T$/GtC]" @@ -235,11 +234,13 @@ $endIf.cm_CCSmaxBound ***--------------------------------------------------------------------------- $ifThen.regiExoPrice not "%cm_regiExoPrice%" == "off" -$ifThen.regiExoPriceType not "%cm_regiExoPrice%" == "gdx" Parameter +$ifThen.regiExoPriceType "%cm_regiExoPrice%" == "gdx" + p47_tau_taxemiMkt(ttot,all_regi,emiMkt) "emiMkt CO2eq prices loaded from input gdx, in T$/GtC = $/kgC. To get $/tCO2, multiply with 272 [T$/GtC]" +$else.regiExoPriceType p47_exoCo2tax(ext_regi,ttot) "Exogenous CO2 tax level. Overrides carbon prices in pm_taxCO2eq, only if explicitly defined. Regions and region groups allowed. Format: '. , . ' or '.( , '). [$/tCO2]" / %cm_regiExoPrice% / -; $endIf.regiExoPriceType +; $endIf.regiExoPrice From 1320f4732304eb7375edf007292c2a4562df592d Mon Sep 17 00:00:00 2001 From: Renato-Rodrigues Date: Tue, 11 Jun 2024 19:34:17 +0200 Subject: [PATCH 09/14] fixing typo in parameter name --- modules/47_regipol/regiCarbonPrice/postsolve.gms | 2 +- modules/47_regipol/regiCarbonPrice/preloop.gms | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/47_regipol/regiCarbonPrice/postsolve.gms b/modules/47_regipol/regiCarbonPrice/postsolve.gms index de31a8817..09d6a291f 100644 --- a/modules/47_regipol/regiCarbonPrice/postsolve.gms +++ b/modules/47_regipol/regiCarbonPrice/postsolve.gms @@ -882,7 +882,7 @@ $ifThen.regiExoPrice not "%cm_regiExoPrice%" == "off" *** setting exogenous CO2 prices from the input gdx $ifThen.regiExoPriceType "%cm_regiExoPrice%" == "gdx" - p47_taxemiMkt(t,regi,emiMkt) = p47_tau_taxemiMkt(t,regi,emiMkt); + pm_taxemiMkt(t,regi,emiMkt) = p47_tau_taxemiMkt(t,regi,emiMkt); pm_taxCO2eq(t,regi) = pm_tau_CO2_tax_gdx(t,regi); *** Removing economy wide co2 tax parameters for regions within the emiMKt controlled targets (this is necessary here to remove any calculation made in other modules after the last run in the postsolve) loop((t,regi,emiMkt)$pm_taxemiMkt(t,regi,emiMkt), diff --git a/modules/47_regipol/regiCarbonPrice/preloop.gms b/modules/47_regipol/regiCarbonPrice/preloop.gms index 85ec2efe1..635b77fb6 100644 --- a/modules/47_regipol/regiCarbonPrice/preloop.gms +++ b/modules/47_regipol/regiCarbonPrice/preloop.gms @@ -129,7 +129,7 @@ $ifThen.regiExoPrice not "%cm_regiExoPrice%" == "off" *** setting exogenous CO2 prices from the input gdx $ifThen.regiExoPriceType "%cm_regiExoPrice%" == "gdx" - p47_taxemiMkt(t,regi,emiMkt) = p47_tau_taxemiMkt(t,regi,emiMkt); + pm_taxemiMkt(t,regi,emiMkt) = p47_tau_taxemiMkt(t,regi,emiMkt); pm_taxCO2eq(t,regi) = pm_tau_CO2_tax_gdx(t,regi); *** Removing economy wide co2 tax parameters for regions within the emiMKt controlled targets (this is necessary here to remove any calculation made in other modules after the last run in the postsolve) loop((t,regi,emiMkt)$pm_taxemiMkt(t,regi,emiMkt), From c20da9ee0c7ec704d0952c2515410ae6c19b3988 Mon Sep 17 00:00:00 2001 From: Renato-Rodrigues Date: Tue, 11 Jun 2024 20:44:57 +0200 Subject: [PATCH 10/14] removing unecessary parameter reinitialization --- modules/47_regipol/regiCarbonPrice/postsolve.gms | 5 ----- modules/47_regipol/regiCarbonPrice/preloop.gms | 5 ----- 2 files changed, 10 deletions(-) diff --git a/modules/47_regipol/regiCarbonPrice/postsolve.gms b/modules/47_regipol/regiCarbonPrice/postsolve.gms index 09d6a291f..b0f948956 100644 --- a/modules/47_regipol/regiCarbonPrice/postsolve.gms +++ b/modules/47_regipol/regiCarbonPrice/postsolve.gms @@ -884,11 +884,6 @@ $ifThen.regiExoPrice not "%cm_regiExoPrice%" == "off" $ifThen.regiExoPriceType "%cm_regiExoPrice%" == "gdx" pm_taxemiMkt(t,regi,emiMkt) = p47_tau_taxemiMkt(t,regi,emiMkt); pm_taxCO2eq(t,regi) = pm_tau_CO2_tax_gdx(t,regi); -*** Removing economy wide co2 tax parameters for regions within the emiMKt controlled targets (this is necessary here to remove any calculation made in other modules after the last run in the postsolve) - loop((t,regi,emiMkt)$pm_taxemiMkt(t,regi,emiMkt), - pm_taxCO2eq(t,regi) = 0; - ); -*** Redefining the pm_taxCO2eqSum parameter pm_taxCO2eqSum(t,regi) = pm_taxCO2eq(t,regi); *** Removing additional co2 tax parameters pm_taxCO2eqRegi(t,regi) = 0; diff --git a/modules/47_regipol/regiCarbonPrice/preloop.gms b/modules/47_regipol/regiCarbonPrice/preloop.gms index 635b77fb6..b40f9fac6 100644 --- a/modules/47_regipol/regiCarbonPrice/preloop.gms +++ b/modules/47_regipol/regiCarbonPrice/preloop.gms @@ -131,11 +131,6 @@ $ifThen.regiExoPrice not "%cm_regiExoPrice%" == "off" $ifThen.regiExoPriceType "%cm_regiExoPrice%" == "gdx" pm_taxemiMkt(t,regi,emiMkt) = p47_tau_taxemiMkt(t,regi,emiMkt); pm_taxCO2eq(t,regi) = pm_tau_CO2_tax_gdx(t,regi); -*** Removing economy wide co2 tax parameters for regions within the emiMKt controlled targets (this is necessary here to remove any calculation made in other modules after the last run in the postsolve) - loop((t,regi,emiMkt)$pm_taxemiMkt(t,regi,emiMkt), - pm_taxCO2eq(t,regi) = 0; - ); -*** Redefining the pm_taxCO2eqSum parameter pm_taxCO2eqSum(t,regi) = pm_taxCO2eq(t,regi); *** Removing additional co2 tax parameters pm_taxCO2eqRegi(t,regi) = 0; From 9814741d3012401247941ac7c9bab5c8c2cbb728 Mon Sep 17 00:00:00 2001 From: Renato-Rodrigues Date: Wed, 12 Jun 2024 16:19:48 +0200 Subject: [PATCH 11/14] fix gdx reference in comment --- modules/47_regipol/regiCarbonPrice/postsolve.gms | 2 +- modules/47_regipol/regiCarbonPrice/preloop.gms | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/47_regipol/regiCarbonPrice/postsolve.gms b/modules/47_regipol/regiCarbonPrice/postsolve.gms index b0f948956..40ee2cd42 100644 --- a/modules/47_regipol/regiCarbonPrice/postsolve.gms +++ b/modules/47_regipol/regiCarbonPrice/postsolve.gms @@ -892,7 +892,7 @@ $ifThen.regiExoPriceType "%cm_regiExoPrice%" == "gdx" pm_taxrevCO2Sector0(t,regi,emi_sectors) = 0; pm_taxrevCO2LUC0(t,regi) = 0; pm_taxrevNetNegEmi0(t,regi) = 0; -display 'update of CO2 prices to exogenously given CO2 prices defined in the reference gdx', pm_taxCO2eq, pm_taxemiMkt; +display 'update of CO2 prices to exogenously given CO2 prices defined in the input gdx', pm_taxCO2eq, pm_taxemiMkt; *** setting exogenous CO2 prices from switch cm_regiExoPrice $else.regiExoPriceType diff --git a/modules/47_regipol/regiCarbonPrice/preloop.gms b/modules/47_regipol/regiCarbonPrice/preloop.gms index b40f9fac6..38ee261ba 100644 --- a/modules/47_regipol/regiCarbonPrice/preloop.gms +++ b/modules/47_regipol/regiCarbonPrice/preloop.gms @@ -139,7 +139,7 @@ $ifThen.regiExoPriceType "%cm_regiExoPrice%" == "gdx" pm_taxrevCO2Sector0(t,regi,emi_sectors) = 0; pm_taxrevCO2LUC0(t,regi) = 0; pm_taxrevNetNegEmi0(t,regi) = 0; -display 'update of CO2 prices to exogenously given CO2 prices defined in the reference gdx', pm_taxCO2eq, pm_taxemiMkt; +display 'update of CO2 prices to exogenously given CO2 prices defined in the input gdx', pm_taxCO2eq, pm_taxemiMkt; *** setting exogenous CO2 prices from switch cm_regiExoPrice $else.regiExoPriceType From 1bc26581ba09702e5d76d5157b2179d8fe8a8bb3 Mon Sep 17 00:00:00 2001 From: Renato-Rodrigues Date: Tue, 18 Jun 2024 17:52:55 +0200 Subject: [PATCH 12/14] Making sure exogenous CO2 prices are applied to mac curves --- core/presolve.gms | 20 ++++++++--------- .../47_regipol/regiCarbonPrice/datainput.gms | 19 +++++++++++++++- .../47_regipol/regiCarbonPrice/postsolve.gms | 22 +++++++++---------- modules/47_regipol/regiCarbonPrice/sets.gms | 1 + 4 files changed, 38 insertions(+), 24 deletions(-) diff --git a/core/presolve.gms b/core/presolve.gms index 1f20fc765..447150040 100644 --- a/core/presolve.gms +++ b/core/presolve.gms @@ -125,20 +125,18 @@ loop((enty,enty2)$emiMac2mac(enty,enty2), !! make sure that both mac sectors and *** Redefine the MAC price for regions with emission tax defined by the regipol module $IFTHEN.emiMkt not "%cm_emiMktTarget%" == "off" - loop(ext_regi$regiEmiMktTarget(ext_regi), - loop(regi$regi_groupExt(ext_regi,regi), + loop(regi$regiNativeEmiMktTarget(regi), *** average CO2 price aggregated by FE - p_priceCO2(t,regi) = ( (sum(emiMkt, pm_taxemiMkt(t,regi,emiMkt) * sum((entySe,entyFe,sector)$(sefe(entySe,entyFe) AND entyFe2Sector(entyFe,sector) AND sector2emiMkt(sector,emiMkt)),vm_demFeSector.l(t,regi,entySe,entyFe,sector,emiMkt)))) / (sum((entySe,entyFe,sector,emiMkt)$(sefe(entySe,entyFe) AND entyFe2Sector(entyFe,sector) AND sector2emiMkt(sector,emiMkt)),vm_demFeSector.l(t,regi,entySe,entyFe,sector,emiMkt))) )*1000; - loop((enty,emiMkt)$(macSector2emiMkt(enty,emiMkt)), - loop(enty2$emiMac2mac(enty,enty2), !! make sure that both mac sectors and mac curves have prices asigned as both sets are used in calculations below - pm_priceCO2forMAC(t,regi,enty) = pm_taxemiMkt(t,regi,emiMkt)* 1000; - pm_priceCO2forMAC(t,regi,enty2) = pm_taxemiMkt(t,regi,emiMkt)* 1000; - pm_priceCO2forMAC(t,regi,"co2chemicals") = pm_taxemiMkt(t,regi,"ETS")* 1000; - pm_priceCO2forMAC(t,regi,"co2steel") = pm_taxemiMkt(t,regi,"ETS")* 1000; - ); + p_priceCO2(t,regi) = ( (sum(emiMkt, pm_taxemiMkt(t,regi,emiMkt) * sum((entySe,entyFe,sector)$(sefe(entySe,entyFe) AND entyFe2Sector(entyFe,sector) AND sector2emiMkt(sector,emiMkt)),vm_demFeSector.l(t,regi,entySe,entyFe,sector,emiMkt)))) / (sum((entySe,entyFe,sector,emiMkt)$(sefe(entySe,entyFe) AND entyFe2Sector(entyFe,sector) AND sector2emiMkt(sector,emiMkt)),vm_demFeSector.l(t,regi,entySe,entyFe,sector,emiMkt))) )*1000; + loop((enty,emiMkt)$(macSector2emiMkt(enty,emiMkt)), + loop(enty2$emiMac2mac(enty,enty2), !! make sure that both mac sectors and mac curves have prices asigned as both sets are used in calculations below + pm_priceCO2forMAC(t,regi,enty) = pm_taxemiMkt(t,regi,emiMkt)* 1000; + pm_priceCO2forMAC(t,regi,enty2) = pm_taxemiMkt(t,regi,emiMkt)* 1000; + pm_priceCO2forMAC(t,regi,"co2chemicals") = pm_taxemiMkt(t,regi,"ETS")* 1000; + pm_priceCO2forMAC(t,regi,"co2steel") = pm_taxemiMkt(t,regi,"ETS")* 1000; ); ); - ); +); $ENDIF.emiMkt *** The co2 price for land-use entities needs to be reduced by the same factor as in MAgPIE. diff --git a/modules/47_regipol/regiCarbonPrice/datainput.gms b/modules/47_regipol/regiCarbonPrice/datainput.gms index 1243cbe08..007ca22c8 100644 --- a/modules/47_regipol/regiCarbonPrice/datainput.gms +++ b/modules/47_regipol/regiCarbonPrice/datainput.gms @@ -38,7 +38,10 @@ $IFTHEN.emiMkt not "%cm_emiMktTarget%" == "off" *** Auxiliar parameters based on emission targets information loop((ttot,ttot2,ext_regi,emiMktExt,target_type_47,emi_type_47)$pm_emiMktTarget(ttot,ttot2,ext_regi,emiMktExt,target_type_47,emi_type_47), !!calculated sets that depends on data parameter regiEmiMktTarget(ext_regi) = yes; !! assigning values to set containing extended regions that have regional emission targets - regiANDperiodEmiMktTarget_47(ttot2,ext_regi) = yes; !! assigning values to set containing extended regions and terminal years of regional emission targets + regiANDperiodEmiMktTarget_47(ttot2,ext_regi) = yes; !! assigning values to set containing extended regions and terminal years of regional emission targets + loop(regi$regi_groupExt(ext_regi,regi), + regiNativeEmiMktTarget(regi) = yes; !! assigning values to set containing native regions that have regional emission targets + ); ); *** Calculating set containing regions that should be controlled by a given regional emission target. @@ -324,10 +327,24 @@ $endif.exogDemScen ***--------------------------------------------------------------------------- *** Exogenous CO2 tax level: ***--------------------------------------------------------------------------- +$ifThen.regiExoPrice not "%cm_regiExoPrice%" == "off" $ifThen.regiExoPriceType "%cm_regiExoPrice%" == "gdx" *** load emiMkt CO2eq prices from input gdx Execute_Loadpoint 'input' p47_tau_taxemiMkt = pm_taxemiMkt; +*** assigning values to set containing native regions that have exogenously fixed emission market co2 prices +loop((t,regi,emiMkt)$p47_tau_taxemiMkt(t,regi,emiMkt), + regiNativeEmiMktTarget(regi) = yes; +); +$else.regiExoPriceType +*** assigning values to set containing native regions that have exogenously fixed emission market co2 prices +loop((t,ext_regi)$p47_exoCo2tax(ext_regi,t), + loop(regi$regi_group(ext_regi,regi), + regiNativeEmiMktTarget(regi) = yes; + ); +); $endIf.regiExoPriceType +$endIf.regiExoPrice + diff --git a/modules/47_regipol/regiCarbonPrice/postsolve.gms b/modules/47_regipol/regiCarbonPrice/postsolve.gms index 40ee2cd42..83f499221 100644 --- a/modules/47_regipol/regiCarbonPrice/postsolve.gms +++ b/modules/47_regipol/regiCarbonPrice/postsolve.gms @@ -145,19 +145,17 @@ p47_emiTargetMkt_iter(iteration,ttot,regi, emiMktExt,emi_type_47) = p47_emiTarge $IFTHEN.emiMkt not "%cm_emiMktTarget%" == "off" *** Removing economy wide co2 tax parameters for regions within the emiMKt controlled targets (this is necessary here to remove any calculation made in other modules after the last run in the postsolve) - loop(ext_regi$regiEmiMktTarget(ext_regi), - loop(regi$regi_groupExt(ext_regi,regi), + loop(regi$regiNativeEmiMktTarget(regi), *** Removing the economy wide co2 tax parameters for regions within the ETS markets - pm_taxCO2eqSum(t,regi) = 0; - pm_taxCO2eq(t,regi) = 0; - pm_taxCO2eqRegi(t,regi) = 0; - pm_taxCO2eqSCC(t,regi) = 0; - - pm_taxrevGHG0(t,regi) = 0; - pm_taxrevCO2Sector0(t,regi,emi_sectors) = 0; - pm_taxrevCO2LUC0(t,regi) = 0; - pm_taxrevNetNegEmi0(t,regi) = 0; - ); + pm_taxCO2eqSum(t,regi) = 0; + pm_taxCO2eq(t,regi) = 0; + pm_taxCO2eqRegi(t,regi) = 0; + pm_taxCO2eqSCC(t,regi) = 0; + + pm_taxrevGHG0(t,regi) = 0; + pm_taxrevCO2Sector0(t,regi,emi_sectors) = 0; + pm_taxrevCO2LUC0(t,regi) = 0; + pm_taxrevNetNegEmi0(t,regi) = 0; ); *** Calculating the current emission levels... diff --git a/modules/47_regipol/regiCarbonPrice/sets.gms b/modules/47_regipol/regiCarbonPrice/sets.gms index bdf2ba983..21bd84292 100644 --- a/modules/47_regipol/regiCarbonPrice/sets.gms +++ b/modules/47_regipol/regiCarbonPrice/sets.gms @@ -19,6 +19,7 @@ emi_type_47 "emission type used in regional target" *** Emission markets $ifThen.emiMkt not "%cm_emiMktTarget%" == "off" regiEmiMktTarget(ext_regi) "regions with emiMkt targets" / / + regiNativeEmiMktTarget(all_regi) "native regions with emiMkt targets" / / regiANDperiodEmiMktTarget_47(ttot,ext_regi) "regions and periods with emiMkt targets" / / regiEmiMktTarget2regi_47(ext_regi,all_regi) "regions controlled by emiMkt market set to ext_regi" / / rescaleType "carbon price scaling types" / "squareDev_firstIteration", "squareDev_perfectMatch", "squareDev_smallChange", "squareDev_noChange", "slope_prevIteration", "slope_firstIteration"/ From 6d4764f993249f52298a6d22f017c9210ad248eb Mon Sep 17 00:00:00 2001 From: Renato-Rodrigues Date: Tue, 18 Jun 2024 18:26:01 +0200 Subject: [PATCH 13/14] move set decalration outside condition so it can be used both in cm_emiMktTarget and exoPrice cases --- modules/47_regipol/regiCarbonPrice/sets.gms | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/47_regipol/regiCarbonPrice/sets.gms b/modules/47_regipol/regiCarbonPrice/sets.gms index 21bd84292..6cb5be178 100644 --- a/modules/47_regipol/regiCarbonPrice/sets.gms +++ b/modules/47_regipol/regiCarbonPrice/sets.gms @@ -15,11 +15,11 @@ emi_type_47 "emission type used in regional target" netGHG, netGHG_noBunkers, netGHG_noLULUCF_noBunkers, netGHG_LULUCFGrassi, netGHG_LULUCFGrassi_noBunkers, netGHG_LULUCFGrassi_intraRegBunker, netGHG_noLULUCF, grossEnCO2_noBunkers / - +regiNativeEmiMktTarget(all_regi) "native regions with emiMkt targets" / / + *** Emission markets $ifThen.emiMkt not "%cm_emiMktTarget%" == "off" regiEmiMktTarget(ext_regi) "regions with emiMkt targets" / / - regiNativeEmiMktTarget(all_regi) "native regions with emiMkt targets" / / regiANDperiodEmiMktTarget_47(ttot,ext_regi) "regions and periods with emiMkt targets" / / regiEmiMktTarget2regi_47(ext_regi,all_regi) "regions controlled by emiMkt market set to ext_regi" / / rescaleType "carbon price scaling types" / "squareDev_firstIteration", "squareDev_perfectMatch", "squareDev_smallChange", "squareDev_noChange", "slope_prevIteration", "slope_firstIteration"/ From 3991b477e59c7bbcc3858619e3a21dff33467e43 Mon Sep 17 00:00:00 2001 From: Renato-Rodrigues Date: Wed, 19 Jun 2024 15:47:22 +0200 Subject: [PATCH 14/14] fixing wrong set condition --- core/presolve.gms | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/presolve.gms b/core/presolve.gms index 447150040..20b1f77d1 100644 --- a/core/presolve.gms +++ b/core/presolve.gms @@ -124,7 +124,7 @@ loop((enty,enty2)$emiMac2mac(enty,enty2), !! make sure that both mac sectors and ); *** Redefine the MAC price for regions with emission tax defined by the regipol module -$IFTHEN.emiMkt not "%cm_emiMktTarget%" == "off" +$IFTHEN.emiMkt not "%regipol%" == "none" loop(regi$regiNativeEmiMktTarget(regi), *** average CO2 price aggregated by FE p_priceCO2(t,regi) = ( (sum(emiMkt, pm_taxemiMkt(t,regi,emiMkt) * sum((entySe,entyFe,sector)$(sefe(entySe,entyFe) AND entyFe2Sector(entyFe,sector) AND sector2emiMkt(sector,emiMkt)),vm_demFeSector.l(t,regi,entySe,entyFe,sector,emiMkt)))) / (sum((entySe,entyFe,sector,emiMkt)$(sefe(entySe,entyFe) AND entyFe2Sector(entyFe,sector) AND sector2emiMkt(sector,emiMkt)),vm_demFeSector.l(t,regi,entySe,entyFe,sector,emiMkt))) )*1000;