Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions modules/47_regipol/module.gms
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,22 @@
*' These bounds either serve to align REMIND with historic and near-term data in specific regions or represent regional policies (like national coal phase-out plans) that can be activated via switches.
*' Finally, there are some regional adjustments in the datainput file that modify input data for specific regions for cases which have not been generalized for all REMIND regions yet.
*'
*' ## Glossary of Carbon Price Rescaling Terms
*'
*' * **Target Deviation**: The fractional difference between current iteration emissions and the specified emissions target, normalized by a reference year's emissions. The algorithm drives this deviation toward zero (within a specified tolerance band) by adjusting the carbon tax.
*' * **Rescale Factor**: The multiplicative factor applied to the regional carbon tax at the end of each outer (Nash) iteration. A value of 1.0 means no change; > 1 raises the tax; < 1 lowers it.
*' * **Rescale Slope**: The estimated marginal sensitivity of regional emissions to the carbon tax in a given emission market (change in emissions / change in price). Expected to be negative (higher price leads to lower emissions). Computed from the current iteration and a baseline reference iteration.
*' * **Slope Reference Iteration**: The baseline outer iteration used to compute the Rescale Slope. It is reset when the target changes, when the slope window is exceeded, or when a degenerate slope is detected to ensure the computed slope reflects the local abatement cost curve.
*' * **Slope Window**: The maximum allowed number of iterations between the current outer iteration and the Slope Reference Iteration. If the reference becomes older than this threshold, it is forced to reset.
*' * **SquareDev Fallback**: A robust fallback method that bypasses the Rescale Slope entirely and computes the tax rescale factor quadratically as `(1 + target_deviation)^2`. Used when reliable slope information is unavailable or degenerate.
*' * **Degenerate Slope**: A condition where the change in emissions (slope numerator) is negligibly small relative to the reference year's emissions (e.g., in near-net-zero scenarios). Triggers a SquareDev Fallback and resets the reference iteration.
*' * **Positive Slope**: An anomalous scenario where the computed Rescale Slope is positive, falsely implying that a higher carbon tax increased emissions. Addressed by either repeating a valid historical slope or triggering a SquareDev Fallback.
*' * **Slope Clamp**: Hard bounds applied to the Rescale Slope before it is used. Prevents a single iteration from making an extreme price adjustment due to noisy slope estimates.
*' * **Upper Clamp Bound**: The maximum (least-negative) permitted value for the Rescale Slope (default: -0.3). Prevents the algorithm from over-adjusting when the slope is too flat.
*' * **Lower Clamp Bound**: The minimum (most-negative) permitted value for the Rescale Slope (default: -5). Prevents extreme tax jumps when the slope is too steep.
*' * **Adaptive Upper Clamp Bound**: An extension of the Upper Clamp Bound that halves the limit when the clamp triggers in consecutive outer iterations, indicating persistent flat-slope behavior. Resets to the default when the clamp is no longer triggered.
*' * **Oscillation Dampener**: A safeguard that fires when the Rescale Factor alternates between > 1 and < 1 for three consecutive outer iterations. When triggered, the factor's adjustment distance from 1.0 is halved to dampen volatility.
*'
*' @authors Renato Rodrigues, Felix Schreyer

*###################### R SECTION START (MODULETYPES) ##########################
Expand Down
9 changes: 8 additions & 1 deletion modules/47_regipol/regiCarbonPrice/datainput.gms
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,15 @@ pm_emiMktTarget_dev(ttot,ttot2,ext_regi,emiMktExt) = 0;
***--------------------------------------------------
$IFTHEN.emiMkt not "%cm_emiMktTarget%" == "off"

*** slope calculation algorithm parameters
s47_slopeDegenerateThreshold = 1e-2; !! minimum emission change (fraction of 2005 emissions) for a reliable slope numerator
s47_slopeMaxWindow = 5; !! maximum iterations between reference and current; beyond this the reference is reset to stay local on the abatement cost curve

*** 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
p47_slopeUpperClampBound(ttot,ttot2,ext_regi,emiMktExt) = -0.3; !! initialize upper clamp bound for rescale slope
);

*** Calculating set containing regions that should be controlled by a given regional emission target.
Expand Down Expand Up @@ -106,6 +111,8 @@ p47_taxemiMkt_init(ttot,regi,emiMkt)$(p47_taxCO2eq_ref(ttot,regi) and (NOT(p47_t
p47_factorRescaleSlope_iter("1","2020","2030",ext_regi,emiMktExt) = 0;
*** initialize required parameter for cm_emiMktTarget rescale oscillation dampening.
p47_factorRescaleemiMktCO2Tax_iter("1","2020","2030",ext_regi,emiMktExt) = 0;
*** initialize required parameter to track if the upper slope clamp fired.
p47_upperClampActive_iter("1","2020","2030",ext_regi,emiMktExt) = 0;

$ENDIF.emiMkt

Expand Down
5 changes: 5 additions & 0 deletions modules/47_regipol/regiCarbonPrice/declarations.gms
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
Parameter
s47_firstFreeYear "value of first free year for the carbon price trajectory"
s47_prefreeYear "value of the last non-free year for the carbon price trajectory"
s47_slopeDegenerateThreshold "minimum emission change percentage relative to 2005 emissions required for a reliable slope; below this the slope numerator is treated as degenerate [fraction]"
s47_slopeMaxWindow "maximum number of iterations between the reference iteration and the current iteration for slope calculation; beyond this the reference is reset to force a local slope [#]"
pm_emiLULUCF_GrassiShift(ttot,all_regi) "difference between Magpie land-use change emissions and UNFCCC emissions in 2015 to correct for national accounting in emissions targets [GtC]"
pm_emiMktTarget_dev(ttot,ttot2,ext_regi,emiMktExt) "deviation of emissions of current iteration from target emissions, for budget target this is the difference normalized by target emissions, while for year targets this is the difference normalized by 2005 emissions [%]"
pm_taxemiMkt(ttot,all_regi,all_emiMkt) "CO2 tax path per region and emissions market [T$/GtC]"
Expand Down Expand Up @@ -62,6 +64,9 @@ $endif.emiMktTargetType
p47_factorRescaleemiMktCO2Tax_iter(iteration,ttot,ttot2,ext_regi,emiMktExt) "parameter to save rescale factor across iterations for debugging purposes [%]"
p47_clampedRescaleSlope_iter(iteration,ttot,ttot2,ext_regi,emiMktExt) "auxiliary parameter to save the slope value before clamping. Useful for debugging purposes [#]"
p47_dampedFactorRescaleemiMktCO2Tax_iter(iteration,ttot,ttot2,ext_regi,emiMktExt) "auxiliary parameter to save the rescale factor value before dampening. Useful for debugging purposes [#]"
p47_slopeUpperClampBound(ttot,ttot2,ext_regi,emiMktExt) "adaptive upper clamp bound for rescale slope; starts at -0.3 and halves after two consecutive triggers at the same level [#]"
p47_slopeUpperClampBound_iter(iteration,ttot,ttot2,ext_regi,emiMktExt) "adaptive upper clamp bound per iteration for debugging [#]"
p47_upperClampActive_iter(iteration,ttot,ttot2,ext_regi,emiMktExt) "1 if the upper slope clamp fired in this iteration, 0 otherwise [0 or 1]"

*** Parameters necessary to define the CO2 tax curve shape
p47_targetConverged(ttot,ext_regi) "boolean to store if emission target has converged [0 or 1]"
Expand Down
Loading