Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extend industry/subsectors to explicitly track FE by SE origin #1620

Merged
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [Unreleased]

### changed
- **37_industry** changed industry to have subsector-specific shares of SE
origins in FE carriers[[#1620]](https://github.com/remindmodel/remind/pull/1620)

### added
- **config** regex tests for many parameters [[#1356](https://github.com/remindmodel/remind/pull/1356)]
- **scripts** add script to check fixing of runs to reference run
Expand Down
54 changes: 28 additions & 26 deletions core/sets.gms
Original file line number Diff line number Diff line change
Expand Up @@ -344,62 +344,64 @@ $ENDIF.WindOff

all_enty "all types of quantities"
/
pecoal "PE coal"
peoil "PE oil"
pegas "PE gas"
pecoal "PE coal"
peur "PE uranium"
pegeo "PE geothermal"
pehyd "PE hydropower"
pegeo "PE geothermal"
pewin "PE wind"
pesol "PE solar"
pebiolc "PE biomass lignocellulosic"
pebios "PE biomass sugar and starch"
pebioil "PE biomass sunflowers, palm oil, etc"

all_seso "all to SE solids"
sesofos "SE solids from fossil pe"
sesobio "SE solids from biomass"
all_seliq "all to SE liquids"
seliqbio "SE liquids from biomass (ex. ethanol)"
seliqfos "SE liquids from fossil pe (ex. petrol and diesel)"
seliqbio "SE liquids from biomass (ex. ethanol)"
seliqsyn "SE synthetic liquids from H2 (ex. petrol and diesel)"
all_seso "all to SE solids"
sesobio "SE solids from biomass"
sesofos "SE solids from fossil pe"
seel "SE electricity"
seh2 "SE hydrogen"
all_sega "all to SE gas"
segabio "SE gas from biomass"
segafos "SE gas from fossil pe"
segabio "SE gas from biomass"
segasyn "SE synthetic gas from H2"
seh2 "SE hydrogen"
sehe "SE district heating and heat pumps"
seel "SE electricity"

feso
fesos "FE solids stationary"
fesob
fesoi
fehos "FE heating oil stationary"
fehob
fehoi
fega
fegas "FE gas stationary"
fegab
fegai
fegat
fega
fehos "FE heating oil stationary"
fehob
fehoi
fesos "FE solids stationary"
feso
fesoi
fesob
feh2s "FE hydrogen stationary"
feh2t "FE hydrogen transport"
fehes "FE district heating (including combined heat and power), and heat pumps stationary"
feheg
fehei
feheb
fehe
feel
feels "FE electricity stationary"
feelb
feelcb "buildings use of conventional electricity (all but space heating)"
feelhpb "buildings use of electricity for space heating with heat pumps"
feelrhb "buildings use of electricity for space heating with resistive heating"
feeli
feel
fehes "FE district heating (including combined heat and power), and heat pumps stationary"
feheg
fehei
feheb
fehe
feh2s "FE hydrogen stationary"
feelt "final energy electricity for transport"
fepet "FE petrol transport"
fedie "FE diesel transport"
felit "FE liquids for transport (includes diesel and petrol)"
fetf "FE transport fuels"
feh2t "FE hydrogen transport"
feelt "final energy electricity for transport"
fehoi_cs "final energy in industry diesel - carbon stored"
fegai_cs "final energy in industry natural gas - carbon stored "
entydummy "dummy fe for process based industry implementation"
Expand Down
2 changes: 2 additions & 0 deletions main.gms
Original file line number Diff line number Diff line change
Expand Up @@ -1315,6 +1315,8 @@ $setglobal c_CES_calibration_new_structure 0 !! def = 0 !! regexp = 0|1
$setglobal c_CES_calibration_write_prices 0 !! def = 0 !! regexp = 0|1
*** cm_CES_calibration_default_prices <- 0.01 # def <- 0.01 lower value if input factors get negative shares (xi), CES prices in the first calibration iteration
$setglobal cm_CES_calibration_default_prices 0.01 !! def = 0.01
*** cm_in_limit_price_change sets production factors that have their price changes limited to a factor of two during calibration"
$setglobal cm_in_limit_price_change "ue_steel_primary, kap_steel_primary" !! def = ""
*** cm_calibration_string "def = off, else = additional string to include in the calibration name to be used" label for your calibration run to keep calibration files with different setups apart (e.g. with low elasticities, high elasticities)
$setglobal cm_calibration_string off !! def = off
*** cm_techcosts - use regionalized or globally homogenous technology costs for certain technologies
Expand Down
68 changes: 65 additions & 3 deletions modules/29_CES_parameters/calibrate/preloop.gms
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,37 @@ if (smin((t,regi_dyn29(regi),ppf_29(in)), pm_cesdata(t,regi,in,"price")) le 0,
abort "Some ppf prices are <= 0. Check ./modules/29_CES_parameters/calibrate/input/pm_cesdata_price_XXX.inc!";
);

*** Limit changes in prices for susceptible pf
if (sum((t,regi_dyn29(regi),in_limit_price_change_29(ppf_29(in))),
(pm_cesdata(t,regi,in,"price") > 2 * p29_cesdata_load(t,regi,in,"price"))
+ (pm_cesdata(t,regi,in,"price") < 0.5 * p29_cesdata_load(t,regi,in,"price"))
),
put logfile, " " / "limiting pf price changes" /;
loop ((t,regi_dyn29(regi),in_limit_price_change_29(ppf_29(in))),
sm_tmp
= pm_cesdata(t,regi,in,"price")
/ p29_cesdata_load(t,regi,in,"price");

if (sm_tmp < 0.5 OR 2 < sm_tmp,
put pm_cesdata.tn(t,regi,in,"price"), " [",
p29_cesdata_load(t,regi,in,"price"), " -> ",
pm_cesdata(t,regi,in,"price"), "] -> ";

pm_cesdata(t,regi,in,"price")
= min(
max(
pm_cesdata(t,regi,in,"price"),
0.5 * p29_cesdata_load(t,regi,in,"price")
),
2 * p29_cesdata_load(t,regi,in,"price")
);

put pm_cesdata(t,regi,in,"price") /;
);
);
putclose logfile, " " /;
);

*** Write prices to file
if (sm_CES_calibration_iteration eq 1, !! first CES calibration iteration
put file_CES_calibration;
Expand Down Expand Up @@ -325,8 +356,8 @@ loop (ttot$( ttot.val ge 2005 AND ttot.val lt 2020),
loop (ttot$( ttot.val ge 2005),
pm_cesdata(ttot,regi_dyn29(regi),in_29,"price")$( ppf_29(in_29) AND (NOT sameas(in_29,"entrp_frgt_lo")) )
= max(
( 1e-2$( NOT in_industry_dyn37(in_29) )
+ 1e-4$( in_industry_dyn37(in_29) )
( 1e-2$( NOT (in_buildings_dyn36(in_29) OR in_industry_dyn37(in_29)) )
+ 1e-4$( (in_buildings_dyn36(in_29) OR in_industry_dyn37(in_29)) )
),
pm_cesdata(ttot,regi,in_29,"price")
);
Expand Down Expand Up @@ -890,7 +921,38 @@ $ifthen.industry_FE_target "%c_CES_calibration_industry_FE_target%" == "1"
*** c_CES_calibration_industry_FE_target == 1 means that
*** industry ppfen input prices are scaled to make the Euler identity hold

*** Abort if any industry EEK value is lower than subsector output quantity
*** Limit changes in prices for industry EEK
if (sum((t,regi_dyn29(regi),in_limit_price_change_29(ppfKap_industry_dyn37(in))),
(pm_cesdata(t,regi,in,"price") > 2 * p29_cesdata_load(t,regi,in,"price"))
+ (pm_cesdata(t,regi,in,"price") < 0.5 * p29_cesdata_load(t,regi,in,"price"))
),
put logfile, " " / "limiting pf price changes" /;
loop ((t,regi_dyn29(regi),in_limit_price_change_29(ppfKap_industry_dyn37(in))),
sm_tmp
= pm_cesdata(t,regi,in,"price")
/ p29_cesdata_load(t,regi,in,"price");

if (sm_tmp < 0.5 OR 2 < sm_tmp,
put pm_cesdata.tn(t,regi,in,"price"), " [",
p29_cesdata_load(t,regi,in,"price"), " -> ",
pm_cesdata(t,regi,in,"price"), "] -> ";

pm_cesdata(t,regi,in,"price")
= min(
max(
pm_cesdata(t,regi,in,"price"),
0.5 * p29_cesdata_load(t,regi,in,"price")
),
2 * p29_cesdata_load(t,regi,in,"price")
);

put pm_cesdata(t,regi,in,"price") /;
);
);
putclose logfile, " " /;
);

*** Abort if any industry EEK value is higher than subsector output quantity
sm_tmp = smin((t,regi_dyn29(regi),
cesOut2cesIn(ue_industry_dyn37(out),ppfKap(in))
),
Expand Down
5 changes: 5 additions & 0 deletions modules/29_CES_parameters/calibrate/sets.gms
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ eff_scale_par "parameters for scaling certain efficiencies during calibration"
CES_tp(all_in) "CES tree traversal pending nodes"
CES_ts(all_in) "CES tree traversal swap node"
/ /

in_limit_price_change_29(all_in) "production factors that have their price changes limited to a factor of two during calibration"
/
%cm_in_limit_price_change%
/
;

alias(cesOut2cesIn_below,cesOut2cesIn_below2);
Expand Down
2 changes: 1 addition & 1 deletion modules/29_CES_parameters/load/datainput.gms
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*** Load CES parameters based on current model configuration
*** ATTENTION the file name is replaced by the function start_run()
*##################### R SECTION START (CES INPUT) ##########################
$include "./modules/29_CES_parameters/load/input/indu_subsectorspbs-buil_simple-tran_edge_esm-POP_pop_SSP2EU-GDP_gdp_SSP2EU-En_gdp_SSP2EU-Kap_debt_limit-Reg_62eff8f7.inc"
$include "./modules/29_CES_parameters/load/input/indu_subsectors-buil_simple-tran_edge_esm-POP_pop_SSP2EU-GDP_gdp_SSP2EU-En_gdp_SSP2EU-Kap_debt_limit-Reg_62eff8f7.inc"
*###################### R SECTION END (CES INPUT) ###########################

option pm_cesdata:8:3:1;
Expand Down
1 change: 0 additions & 1 deletion modules/37_industry/fixed_shares/not_used.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,3 @@ vm_costMatPrc, variable, not needed
pm_emifacNonEnergy, parameter, not needed
pm_incinerationRate, parameter, not needed
cm_emiscen, parameter, not needed
vm_demFeSector, variable, not needed
33 changes: 28 additions & 5 deletions modules/37_industry/subsectors/bounds.gms
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ loop (in$( sameas(in,"feel_steel_secondary") ),
( 0.01
* smax(ttot$( vm_cesIO.lo(ttot,regi,in) gt sm_eps),
vm_cesIO.lo(ttot,regi,in)
)
)
),
abs(pm_cesdata(t,regi,in,"offset_quantity"))
);
Expand All @@ -114,12 +114,12 @@ vm_cesIO.lo(t,regi_dyn29(regi),in_industry_dyn37(in))$(
0 eq vm_cesIO.lo(t,regi,in) )
= max(sm_eps, abs(pm_cesdata(t,regi,in,"offset_quantity")));

*' Limit biomass solids use in industry to 25% (or historic shares, if they are higher)
*' of baseline solids
*' Limit biomass solids use in industry to 25% (or historic shares, if they are
*' higher) of baseline solids
*' Cement CCS might otherwise become a compelling BioCCS option under very high
*' carbon prices due to missing adjustment costs.
if (cm_startyear gt 2005, !! not a scenario, starting in 2005 (e.g. baseline or NPi)
vm_demFeSector.up(t,regi,"sesobio","fesos","indst","ETS")
if (cm_startyear gt 2005, !! not a baeline or NPi scenario
vm_demFeSector_afterTax.up(t,regi,"sesobio","fesos","indst","ETS")
= max(0.25 , smax(t2, pm_secBioShare(t2,regi,"fesos","indst") ) )
* p37_BAU_industry_ETS_solids(t,regi);
);
Expand Down Expand Up @@ -160,4 +160,27 @@ if (cm_CCS_steel ne 1 OR cm_IndCCSscen ne 1,
);
$endif.cm_subsec_model_steel

*** Populate values for v37_demFeIndst to ease introduction of new variale. Can
*** be removed once the variable is established.
v37_demFeIndst.l(t,regi,entySe,entyFe,out,emiMkt) = 0;
loop ((t,regi,entySe,entyFe,out,emiMkt,secInd37,in)$(
sefe(entySe,entyFe)
AND sector2emiMkt("indst",emiMkt)
AND secInd37_emiMkt(secInd37,emiMkt)
AND secInd37_2_pf(secInd37,out)
AND ue_industry_2_pf(out,in)
AND fe2ppfEn37(entyFe,in)
AND sum(se2fe(entySe,entyFe,te),
vm_demFeSector_afterTax.l(t,regi,entySe,entyFe,"indst",emiMkt)
) ),
v37_demFeIndst.l(t,regi,entySe,entyFe,out,emiMkt)
= sum((fe2ppfEn37_2(entyFe,in),ue_industry_2_pf(out,in)),
vm_cesIO.l(t,regi,in)
+ pm_cesdata(t,regi,in,"offset_quantity")
)
* vm_demFeSector_afterTax.l(t,regi,entySe,entyFe,"indst",emiMkt)
/ sum(se2fe(entySe2,entyFe,te),
vm_demFeSector_afterTax.l(t,regi,entySe2,entyFe,"indst",emiMkt)
);
);
*** EOF ./modules/37_industry/subsectors/bounds.gms
4 changes: 2 additions & 2 deletions modules/37_industry/subsectors/datainput.gms
Original file line number Diff line number Diff line change
Expand Up @@ -543,10 +543,10 @@ $offdelim

*' load baseline industry ETS solids demand
if (cm_startyear ne 2005, !! not a BAU scenario
execute_load "input_ref.gdx", vm_demFeSector;
execute_load "input_ref.gdx", vm_demFeSector_afterTax;
p37_BAU_industry_ETS_solids(t,regi)
= sum(se2fe(entySe,"fesos",te),
vm_demFeSector.l(t,regi,entySe,"fesos","indst","ETS")
vm_demFeSector_afterTax.l(t,regi,entySe,"fesos","indst","ETS")
);
);

Expand Down
Loading
Loading