Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
fbenke-pik committed Jan 7, 2025
1 parent 9786326 commit 0627776
Show file tree
Hide file tree
Showing 27 changed files with 13 additions and 1,156 deletions.
22 changes: 0 additions & 22 deletions core/bounds.gms
Original file line number Diff line number Diff line change
Expand Up @@ -505,28 +505,6 @@ vm_emiFgas.fx(ttot,all_regi,all_enty) = f_emiFgas(ttot,all_regi,"%c_SSP_forcing_
display vm_emiFgas.L;


*** Bugfix. For some reason the model cannot reduce the production of district heating to 0
*** where it should be 0. Not fixings can account for this
*** Fixing vm_prodSe to 0 avoids the problem
loop ((in,in2) $ (sameAs(in,"feheb") and sameAs(in2,"fehei")),
loop ((t, regi) $ ( (sameAs(t,"2010") OR sameAs(t,"2015"))
AND
((pm_cesdata(t,regi,in,"quantity") + pm_cesdata(t,regi,in,"offset_quantity")
+ pm_cesdata(t,regi,in2,"quantity") + pm_cesdata(t,regi,in2,"offset_quantity")
) eq 0)
AND
(sum(ttot$(ttot.val lt 2005), vm_deltaCap.up(ttot,regi,"biochp","1")) eq 0)) ,
vm_prodSe.up(t,regi,"pegas" ,"seel","gaschp") = 0;
vm_prodSe.up(t,regi,"pecoal" ,"seel","coalchp") = 0;
vm_prodSe.up(t,regi,"pecoal" ,"sehe","coalhp") = 0;
vm_prodSe.up(t,regi,"pegeo" ,"sehe","geohe") = 0;
vm_prodSe.up(t,regi,"pesol" ,"sehe","solhe") = 0;
vm_prodSe.up(t,regi,"pebiolc","seel","biochp") = 0;
vm_prodSe.up(t,regi,"pebiolc","sehe","biohp") = 0;
vm_prodSe.up(t,regi,"pegas","sehe","gashp") = 0;
);
);

***----------------------------------------------------------------------------
*** lower bound on share of green hydrogen starting from 2030 (c_greenH2)
***----------------------------------------------------------------------------
Expand Down
21 changes: 0 additions & 21 deletions core/presolve.gms
Original file line number Diff line number Diff line change
Expand Up @@ -171,28 +171,7 @@ vm_macBase.fx(ttot,regi,"n2owaste")$(ttot.val ge 2005) = p_emineg_econometric(re


vm_macBase.lo(ttot,regi,"co2cement_process")$( ttot.val ge 2005 ) = 0;
$ifthen.fixed_shares "%industry%" == "fixed_shares"
vm_macBase.fx(ttot,regi,"co2cement_process")$( ttot.val ge 2005 )
= ( pm_pop(ttot,regi)
* ( (1 - p_switch_cement(ttot,regi))
* p_emineg_econometric(regi,"co2cement_process","p1")
* ( (1000
* p_inv_gdx(ttot,regi)
/ ( pm_pop(ttot,regi)
* pm_shPPPMER(regi)
)
) ** p_emineg_econometric(regi,"co2cement_process","p2")
)
+ ( p_switch_cement(ttot,regi)
* p_emineg_econometric(regi,"co2cement_process","p3")
)
)
)$(p_inv_gdx(ttot,regi) ne 0)
;

vm_emiIndBase.fx(ttot,regi,"co2cement_process","cement")$( ttot.val ge 2005 )
= vm_macBase.lo(ttot,regi,"co2cement_process");
$endif.fixed_shares

* *** Reduction of cement demand due to CO2 price markups *** *
if ( NOT (cm_IndCCSscen eq 1 AND cm_CCS_cement eq 1),
Expand Down
56 changes: 0 additions & 56 deletions core/sets.gms
Original file line number Diff line number Diff line change
Expand Up @@ -379,20 +379,16 @@ all_enty "all types of quantities"
feso
fesos "FE solids stationary"
fesob
fesoi
fehos "FE heating oil stationary"
fehob
fehoi
fega
fegas "FE gas stationary"
fegab
fegai
fegat
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
Expand All @@ -401,20 +397,13 @@ all_enty "all types of quantities"
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
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"
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"

ueHDVt "transport useful energy heavy duty vehicles"
ueLDVt "transport useful energy light duty vehicles"
ueelTt "transport useful energy for electric trains"

!! materials, feedstock, and industrial goods
prsteel "Primary steel"
sesteel "Secondary steel"
Expand Down Expand Up @@ -589,12 +578,6 @@ all_in "all inputs and outputs of the CES function"
eni "industry energy use"
enhi "industry heat energy use"
enhgai "industry heat gaseous energy use (fegab and feh2b)"
fesoi "industry use of solid energy carriers"
fehoi "industry use of liquid energy carriers"
fegai "industry use of gaseous energy carriers"
feh2i "industry use of hydrogen"
fehei "industry use of district heat"
feeli "industry use of electricity"

fehcsob "buildings heating and cooking solids final energy"
fehcelb "buildings heating and cooking electricity final energy"
Expand Down Expand Up @@ -629,10 +612,7 @@ all_in "all inputs and outputs of the CES function"
*** FIXME this should be reworked with Robert when revising the transport module
entrp "transport energy use"
fetf "transport fuel use"
ueLDVt "transport useful energy light duty vehicles"
ueHDVt "transport useful energy heavy duty vehicles"
feh2t "transport hydrogen use"
ueelTt "transport useful energy for electric trains"

entrp_pass "passenger transport"
entrp_frgt "freight transport"
Expand Down Expand Up @@ -2032,53 +2012,17 @@ entyFe2Sector(all_enty,emi_sectors) "final energy (stationary and transportation
fedie.cdr
/

ppfEn2Sector(all_in,emi_sectors) "primary energy production factors mapping to sectors"
/
fegab.build
fegai.indst
fehob.build
fehoi.indst
fesob.build
fesoi.indst
feelb.build
feeli.indst
feheb.build
fehei.indst
feh2b.build
feh2i.indst
ueHDVt.trans
ueLDVt.trans
ueelTt.trans
feeli.cdr
fehei.cdr
feh2i.cdr
fegai.cdr
/

entyFeSec2entyFeDetail(all_enty,emi_sectors,all_enty) "final energy and sector mapping to detailed final energy enty split in IO"
/
fegas.build.fegab
fegas.indst.fegai
fehos.build.fehob
fehos.indst.fehoi
fesos.build.fesob
fesos.indst.fesoi
feels.build.feelb
feels.indst.feeli
fehes.build.feheb
fehes.indst.fehei
*** feh2s.build.feh2b
*** feh2s.indst.feh2i
fepet.trans.fepet
fedie.trans.fedie
*** feh2t.trans
feelt.trans.feelt
fegat.trans.fegat
*** feels.cdr
*** fehes.cdr
*** fegas.cdr
*** feh2s.cdr
*** fedie.cdr
/

all_emiMkt "emission markets"
Expand Down
17 changes: 3 additions & 14 deletions main.gms
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,6 @@ $setglobal transport edge_esm !! def = edge_esm
$setglobal buildings simple !! def = simple
*'--------------------- 37_industry ----------------------------------
*'
*' * (fixed_shares): fixed shares of industry sub-sectors (cement, chemicals,
*' steel, other) in industry FE use
*' * (subsectors): models industry subsectors explicitly with individual CES nests
*' for cement, chemicals, steel, and otherInd production.
$setglobal industry subsectors !! def = subsectors
Expand Down Expand Up @@ -1551,14 +1549,6 @@ $setGLobal cm_exogDem_scen off !! def off !! regexp = off|ariadne_(bal|ensec|hi
$setGlobal cm_Ger_Pol off !! def off
*** cm_altFeEmiFac <- "off" # def <- "off", regions that should use alternative data from "umweltbundesamt" on emission factors for final energy carriers (ex. "EUR_regi, NEU_regi")
$setGlobal cm_altFeEmiFac off !! def = off
*** cm_eni "multiplicative factor applied to industry energy (eni) elasticity parameter sigma used in fixed_shares realization. [factor]"
*** def <- "off" = no change for industry energy elasticity (eni);
*** or number (ex. 2) = multiply by 2 the default value used in REMIND.
$setglobal cm_eni off !! def = off
*** cm_enb "multiplicative factor applied to building energy (enb) elasticity parameter sigma used in fixed_shares realization. [factor]"
*** def <- "off" = no change for buildings energy elasticity (eni);
*** or number (ex. 2) = multiply by 2 the default value used in REMIND.
$setglobal cm_enb off !! def = off
*** cm_incolearn "change floor investment cost value"
*** Example on how to use:
*** cm_incolearn "windon=1600,spv=5160,csp=9500"
Expand Down Expand Up @@ -1653,7 +1643,6 @@ $setGlobal cm_CESMkup_build standard !! def = standard
***
*** realisation | ppfen | markup
*** -------------+----------------------+-------------
*** fixed_shares | feeli | 57 $/MWh(el)
*** subsectors | feelhth_chemicals | 100 $/MWh(el)
*** subsectors | feel_steel_secondary | 100 $/MWh(el)
*** subsectors | feelhth_otherInd | 300 $/MWh(el)
Expand All @@ -1663,9 +1652,9 @@ $setGlobal cm_CESMkup_build standard !! def = standard
*** subsectors | feh2_otherInd | 50 $/MWh(th)
***
*** To change them to any specific value, either define a new setting besides
*** "standard" in ./modules/37_industry/(fixed_shares|subsectors)/datainput.gms,
*** or use the setting "manual" and set cm_CESMkup_ind_data to e.g. "feeli 0.8".
*** This would apply a cost markup of 0.8 $tr/TWa (91 $/MWh(el)) to the feeli
*** "standard" in ./modules/37_industry/subsectors/datainput.gms,
*** or use the setting "manual" and set cm_CESMkup_ind_data to e.g. "feelhth_chemicals 0.8".
*** This would apply a cost markup of 0.8 $tr/TWa (100 $/MWh(el)) to the feelhth_chemicals
*** CES node. Standard markup costs are not effected unless specifically
*** addressed in cm_CESMkup_ind_data.
$setGlobal cm_CESMkup_ind standard !! def = standard
Expand Down
3 changes: 1 addition & 2 deletions modules/02_welfare/ineqLognormal/equations.gms
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,7 @@ q02_inconvPenCoalSolids(t,regi)$(t.val > 2005)..
v02_inconvPenCoalSolids(t,regi)
=g=
*' local air pollution for coal: inconvinienve penalty applies only for buildings use; slack variable ensures that v02_inconvPen can stay > 0
p02_inconvpen_lap(t,regi,"coaltr") * (vm_prodSe(t,regi,"pecoal","sesofos","coaltr")
- vm_cesIO(t,regi,"fesoi"))
p02_inconvpen_lap(t,regi,"coaltr") * vm_prodSe(t,regi,"pecoal","sesofos","coaltr")
+ v02_sesoInconvPenSlack(t,regi)
;
$ENDIF.INCONV
Expand Down
3 changes: 1 addition & 2 deletions modules/02_welfare/utilitarian/equations.gms
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ q02_inconvPenCoalSolids(t,regi)$(t.val > 2005)..
v02_inconvPenCoalSolids(t,regi)
=g=
*' local air pollution for coal: inconvinience penalty applies only for buildings use; slack variable ensures that v02_inconvPen can stay > 0
p02_inconvpen_lap(t,regi,"coaltr") * (vm_prodSe(t,regi,"pecoal","sesofos","coaltr")
- (vm_cesIO(t,regi,"fesoi") + pm_cesdata(t,regi,"fesoi","offset_quantity")))
p02_inconvpen_lap(t,regi,"coaltr") * vm_prodSe(t,regi,"pecoal","sesofos","coaltr")
+ v02_sesoInconvPenSlack(t,regi)
;
$ENDIF.INCONV
Expand Down
20 changes: 1 addition & 19 deletions modules/11_aerosols/exoGAINS/datainput.gms
Original file line number Diff line number Diff line change
Expand Up @@ -97,24 +97,6 @@ pm_emiExog(t,regi,"OC") = p11_emiAPexo(t,regi,"OC","AgWasteBurning")
display p11_emiFacAP;
display pm_emiExog;

$IFTHEN.sectorshares %CES_structure% == "stationary_transport"
*** Define sector shares
p11_share_sector(ttot,sectorEndoEmi2te(enty,enty2,te,sectorEndoEmi),regi) = 1.0;
p11_share_sector(ttot,"seliqfos","fehos","tdfoshos","indst",regi) = pm_share_ind_fehos(ttot,regi);
p11_share_sector(ttot,"seliqfos","fehos","tdfoshos","res",regi) = 1-pm_share_ind_fehos(ttot,regi);
p11_share_sector(ttot,"pebiolc","sesobio","biotr","indst",regi) = pm_share_ind_fesos_bio(ttot,regi);
p11_share_sector(ttot,"pebiolc","sesobio","biotr","res",regi) = 1-pm_share_ind_fesos_bio(ttot,regi);
p11_share_sector(ttot,"pecoal","sesofos","coaltr","indst",regi) = pm_share_ind_fesos(ttot,regi);
p11_share_sector(ttot,"pecoal","sesofos","coaltr","res",regi) = 1-pm_share_ind_fesos(ttot,regi);
p11_share_sector(ttot,"pegas","segafos","gastr","indst",regi) = pm_share_ind_fehos(ttot,regi);
p11_share_sector(ttot,"pegas","segafos","gastr","res",regi) = 1-pm_share_ind_fehos(ttot,regi);
p11_share_sector(ttot,"peoil","seliqfos","refliq","trans",regi) = pm_share_trans(ttot,regi);
p11_share_sector(ttot,"peoil","seliqfos","refliq","indst",regi) = (1-pm_share_trans(ttot,regi))*pm_share_ind_fehos(ttot,regi);
p11_share_sector(ttot,"peoil","seliqfos","refliq","res",regi) = (1-pm_share_trans(ttot,regi))*(1-pm_share_ind_fehos(ttot,regi));

$ELSE.sectorshares


if (cm_startyear eq 2005,
Execute_Loadpoint 'input' p11_cesIO = vm_cesIO.l;
else
Expand Down Expand Up @@ -193,7 +175,7 @@ loop ((t,regi)$( t.val ge 2005 ),
p11_share_sector(t,"pegas","segafos","gastr","res",regi)
= 1 - p11_share_sector(t,"pegas","segafos","gastr","indst",regi);
);
$ENDIF.sectorshares


display p11_share_sector;

Expand Down
23 changes: 0 additions & 23 deletions modules/29_CES_parameters/calibrate/datainput.gms
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,6 @@ loop ((ttot,regi,ppfKap_industry_dyn37(in))$( t(ttot-1) AND t(ttot+1) ),

display pm_fedemand;

*** setting feh2i equal to 1% of fegai
$ifthen.indst_H2_penetration "%industry%" == "fixed_shares"
pm_fedemand(t,regi,"feh2i")$(t.val ge 2010) = 0.01*pm_fedemand(t,regi,"fegai");
$endif.indst_H2_penetration

display pm_fedemand;

*** Change PPP for MER.
p29_capitalQuantity(tall,all_regi,all_in)
= p29_capitalQuantity(tall,all_regi,all_in)
Expand Down Expand Up @@ -281,21 +274,6 @@ loop (pf_quantity_shares_37(in,in2),
);
$endif.subsectors

$ifthen.indst_H2_offset "%industry%" == "fixed_shares"

*** Assuming feh2i minimun levels as 1% of fegai to avoid CES numerical calibration issues and allow more aligned efficiencies between gas and h2
loop ((t,regi)$(pm_cesdata(t,regi,"feh2i","quantity") lt (0.01 * pm_cesdata(t,regi,"fegai","quantity"))),
pm_cesdata(t,regi,"feh2i","offset_quantity") = - (0.01 * pm_cesdata(t,regi,"fegai","quantity") - pm_cesdata(t,regi,"feh2i","quantity"));
pm_cesdata(t,regi,"feh2i","quantity") = 0.01 * pm_cesdata(t,regi,"fegai","quantity");
);

*** Special treatment for fehei, which is part of ppfen_industry_dyn37, yet
*** needs an offset value for some regions under fixed_shares
loop ((t,regi)$(pm_cesdata(t,regi,"fehei","quantity") lt 1e-5 ),
pm_cesdata(t,regi,"fehei","offset_quantity") = pm_cesdata(t,regi,"fehei","quantity") - 1e-5;
pm_cesdata(t,regi,"fehei","quantity") = 1e-5;
);
$endif.indst_H2_offset

$ifthen.build_H2_offset "%buildings%" == "simple"
*** Assuming feh2b minimun levels as 5% of fegab to avoid CES numerical calibration issues and allow more aligned efficiencies between gas and h2
Expand Down Expand Up @@ -325,7 +303,6 @@ loop((t,regi,in)$( (ppf(in) OR ppf_29(in))
AND pm_cesdata(t,regi,in,"quantity") lt 1e-5
AND NOT ppfen_industry_dyn37(in)
AND NOT ppfKap_industry_dyn37(in)
AND NOT SAMEAS(in,"feh2i")
AND NOT SAMEAS(in,"feh2b") ),
pm_cesdata(t,regi,in,"offset_quantity") = pm_cesdata(t,regi,in,"quantity") - 1e-5;
pm_cesdata(t,regi,in,"quantity") = 1e-5;
Expand Down
14 changes: 0 additions & 14 deletions modules/36_buildings/simple/datainput.gms
Original file line number Diff line number Diff line change
Expand Up @@ -68,20 +68,6 @@ $ifthen.scaleDemand not "%cm_scaleDemand%" == "off"
$endif.scaleDemand


*** scale default elasticity of substitution on enb level
$IFTHEN.cm_enb not "%cm_enb%" == "off"
pm_cesdata_sigma(ttot,"enb")$pm_cesdata_sigma(ttot,"enb") =
pm_cesdata_sigma(ttot,"enb") * %cm_enb%;
*** avoid the elasticity of substitution parameter to be too close to one, which could cause undesired numerical behavior: if the resulting scaled parameter is between 0.8 and 1, make it 0.8; if it is between 1 and 1.2, make it 1.2.
pm_cesdata_sigma(ttot,"enb")$(pm_cesdata_sigma(ttot,"enb") gt 0.8
AND pm_cesdata_sigma(ttot,"enb") lt 1) =
0.8;
pm_cesdata_sigma(ttot,"enb")$(pm_cesdata_sigma(ttot,"enb") ge 1
AND pm_cesdata_sigma(ttot,"enb") lt 1.2) =
1.2;
$ENDIF.cm_enb


***-----------------------------------------------------------------------------
* FE Share Bounds
***-----------------------------------------------------------------------------
Expand Down
31 changes: 0 additions & 31 deletions modules/37_industry/fixed_shares/bounds.gms

This file was deleted.

Loading

0 comments on commit 0627776

Please sign in to comment.