Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:remindmodel/remind into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
dklein-pik committed Sep 12, 2024
2 parents 04c3500 + 32112a8 commit e2f87ca
Show file tree
Hide file tree
Showing 13 changed files with 158 additions and 94 deletions.
9 changes: 7 additions & 2 deletions .zenodo.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"affiliation": "Potsdam Institute for Climate Impact Research"
},
{
"name": "Dietrich, Jan",
"name": "Dietrich, Jan Philipp",
"affiliation": "Potsdam Institute for Climate Impact Research",
"orcid": "0000-0002-4309-6431"
},
Expand Down Expand Up @@ -180,7 +180,8 @@
},
{
"name": "Pehl, Michaja",
"affiliation": "Potsdam Institute for Climate Impact Research"
"affiliation": "Potsdam Institute for Climate Impact Research",
"orcid": "0000-0003-2349-6515"
},
{
"name": "Pflüger, Mika",
Expand Down Expand Up @@ -215,6 +216,10 @@
"name": "Rottoli, Marianna",
"affiliation": "Potsdam Institute for Climate Impact Research"
},
{
"name": "Rüter, Tonn",
"affiliation": "Potsdam Institute for Climate Impact Research"
},
{
"name": "Schmidt, Eva"
},
Expand Down
11 changes: 8 additions & 3 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ authors:
affiliation: "Potsdam Institute for Climate Impact Research"

- family-names: "Dietrich"
given-names: "Jan"
given-names: "Jan Philipp"
orcid: https://orcid.org/0000-0002-4309-6431
affiliation: "Potsdam Institute for Climate Impact Research"

Expand Down Expand Up @@ -186,6 +186,7 @@ authors:

- family-names: "Pehl"
given-names: "Michaja"
orcid: https://orcid.org/0000-0003-2349-6515
affiliation: "Potsdam Institute for Climate Impact Research"

- family-names: "Pflüger"
Expand Down Expand Up @@ -221,6 +222,10 @@ authors:
given-names: "Marianna"
affiliation: "Potsdam Institute for Climate Impact Research"

- family-names: "Rüter"
given-names: "Tonn"
affiliation: "Potsdam Institute for Climate Impact Research"

- family-names: "Schmidt"
given-names: "Eva"

Expand Down Expand Up @@ -266,8 +271,8 @@ abstract: REMIND (REgional Model of Investment and Development) is a numerical
technology, policy and climate constraints. It also accounts for regional trade
characteristics on goods, energy fuels, and emissions allowances. All greenhouse
gas emissions due to human activities are represented in the model.
version: "3.3.2.dev553"
date-released: 2024-09-10
version: "3.3.2.dev574"
date-released: 2024-09-12
repository-code: https://github.com/remindmodel/remind
keywords:
- energy
Expand Down
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ Imports:
magclass,
magpie4 (>= 2.3.10),
magpiesets,
mip (>= 0.149.3),
mip (>= 0.150.0),
modelstats,
mrremind,
mrvalidation,
ncdf4,
nleqslv,
optparse,
piamenv (>= 0.4.0),
piamInterfaces (>= 0.27.0),
piamInterfaces (>= 0.27.2),
piamPlotComparison (>= 0.0.10),
piamutils,
plotly,
Expand Down
2 changes: 1 addition & 1 deletion config/default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ cfg$validationmodel_name <- "VALIDATIONREMIND"

#### model version of the overall model (used for run statistics only).
# automatically generated for development versions, updated by hand for releases
cfg$model_version <- "3.3.2.dev553"
cfg$model_version <- "3.3.2.dev574"

#### settings ####
cfg$gms <- list()
Expand Down
15 changes: 5 additions & 10 deletions modules/05_initialCap/on/preloop.gms
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ q05_eedemini(regi,enty)..
+ sum(tePrc2opmoPrc(tePrc,opmoPrc)$(pm_specFeDem("2005",regi,enty,tePrc,opmoPrc) gt 0.),
pm_specFeDem("2005",regi,enty,tePrc,opmoPrc)
*
pm_outflowPrcIni(regi,tePrc,opmoPrc)
pm_outflowPrcHist("2005",regi,tePrc,opmoPrc)
)$(entyFeStat(enty))
) * s05_inic_switch
!! Transformation pathways that consume this enty:
Expand Down Expand Up @@ -121,14 +121,9 @@ display v05_INIdemEn0.l, v05_INIcap0.l;

p05_cap0(regi,te) = v05_INIcap0.l(regi,te);

$ifthen.cm_subsec_model_steel "%cm_subsec_model_steel%" == "processes"
p05_cap0(regi,'bof') = pm_outflowPrcIni(regi,'bof','unheated') / pm_cf("2005",regi,'bof');
p05_cap0(regi,'bf') = pm_outflowPrcIni(regi,'bf','standard') / pm_cf("2005",regi,'bf');
p05_cap0(regi,'eaf') = pm_outflowPrcIni(regi,'eaf','sec') / pm_cf("2005",regi,'eaf');
p05_cap0(regi,'idr') = 0.;
p05_cap0(regi,"bfcc") =0.;
p05_cap0(regi,"idrcc") =0.;
$endif.cm_subsec_model_steel
loop(tePrc,
p05_cap0(regi,tePrc) = sum(tePrc2opmoPrc(tePrc,opmoPrc), pm_outflowPrcHist("2005",regi,tePrc,opmoPrc)) / pm_cf("2005",regi,tePrc);
);

*RP keep energy demand for the Kyoto target calibration
pm_EN_demand_from_initialcap2(regi,enty) = v05_INIdemEn0.l(regi,enty);
Expand Down Expand Up @@ -543,7 +538,7 @@ if (cm_startyear gt 2005,
*** Only the eta values of chp technologies have been adapted by initialCap script above.
*** This is to avoid overwriting all of pm_data and make sure that scenario switches which adapt pm_data before this module work as intended.
Execute_Loadpoint 'input_ref' p05_pmdata_ref = pm_data;
pm_data(regi,char,te)$( (sameas(te,"coalchp")
pm_data(regi,char,te)$( (sameas(te,"coalchp")
OR sameas(te,"gaschp")
OR sameas(te,"biochp") )
AND sameas(char,"eta") ) = p05_pmdata_ref(regi,char,te);
Expand Down
2 changes: 1 addition & 1 deletion modules/37_industry/fixed_shares/not_used.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pm_emifacNonEnergy, parameter, not needed
pm_exogDemScen, input, added by codeCheck
pm_fedemand, parameter, not needed
pm_incinerationRate, parameter, not needed
pm_outflowPrcIni, parameter, not needed
pm_outflowPrcHist, parameter, not needed
pm_secBioShare, parameter, not needed
pm_specFeDem, parameter, not needed
pm_tau_ces_tax, input, questionnaire
Expand Down
20 changes: 5 additions & 15 deletions modules/37_industry/subsectors/bounds.gms
Original file line number Diff line number Diff line change
Expand Up @@ -133,25 +133,15 @@ $ifthen.policy_scenario "%cm_indstExogScen_set%" == "YES"
$endif.policy_scenario
$drop cm_indstExogScen_set

v37_regionalWasteIncinerationCCSshare.lo(t,regi) = 0.;
v37_regionalWasteIncinerationCCSshare.up(t,regi) = p37_regionalWasteIncinerationCCSMaxShare(t,regi);

$ifthen.cm_subsec_model_steel "%cm_subsec_model_steel%" == "processes"
!! fix processes procudction in historic years
if (cm_startyear eq 2005,
loop(regi,
loop(tePrc2opmoPrc(tePrc,opmoPrc),
vm_outflowPrc.fx("2005",regi,tePrc,opmoPrc) = pm_outflowPrcIni(regi,tePrc,opmoPrc);
loop((ttot,regi,tePrc2opmoPrc(tePrc,opmoPrc))$(ttot.val ge 2005 AND ttot.val le 2020),
vm_outflowPrc.fx(ttot,regi,tePrc,opmoPrc) = pm_outflowPrcHist(ttot,regi,tePrc,opmoPrc);
);
);

loop(regi,
loop(ttot$(ttot.val ge 2005 AND ttot.val le 2020),
vm_outflowPrc.fx(ttot,regi,"eaf","pri") = 0.;
vm_outflowPrc.fx(ttot,regi,"idr","ng") = 0.;
vm_outflowPrc.fx(ttot,regi,"idr","h2") = 0.;
vm_outflowPrc.fx(ttot,regi,"bfcc","standard") = 0.;
vm_outflowPrc.fx(ttot,regi,"idrcc","ng") = 0.;
);
);
);

!! Switch to turn off steel CCS
Expand All @@ -173,7 +163,7 @@ $endif.fixedUE_scenario

*** fix plastic waste to zero until 2010, and possible to reference scenario
*** values between 2015 and cm_startyear
v37_plasticWaste.fx(t,regi,entySe,entyFe,emiMkt)$(
v37_plasticWaste.fx(t,regi,entySe,entyFe,emiMkt)$(
t.val lt max(2015, cm_startyear)
AND sefe(entySe,entyFe)
AND entyFE2sector2emiMkt_NonEn(entyFe,"indst",emiMkt) )
Expand Down
130 changes: 88 additions & 42 deletions modules/37_industry/subsectors/datainput.gms
Original file line number Diff line number Diff line change
Expand Up @@ -566,11 +566,11 @@ execute_load "input_ref.gdx", vm_demFeSector_afterTax;

* Define carbon capture and storage share in waste incineration emissions
* capture rate increases linearly from zero in 2025 to value the set in the switch for the defined year, and it is kept constant for years afterwards
p37_regionalWasteIncinerationCCSshare(ttot,all_regi) = 0;
p37_regionalWasteIncinerationCCSMaxShare(ttot,all_regi) = 0;
$ifthen.cm_wasteIncinerationCCSshare not "%cm_wasteIncinerationCCSshare%" == "off"
loop((ttot,ext_regi)$p37_wasteIncinerationCCSshare(ttot,ext_regi),
loop((ttot,ext_regi)$p37_wasteIncinerationCCSMaxShare(ttot,ext_regi),
loop(regi$regi_groupExt(ext_regi,regi),
p37_regionalWasteIncinerationCCSshare(t,regi)$((t.val gt 2025)) = min(p37_wasteIncinerationCCSshare(ttot,ext_regi), (p37_wasteIncinerationCCSshare(ttot,ext_regi)/(ttot.val - 2025))*(t.val-2025));
p37_regionalWasteIncinerationCCSMaxShare(t,regi)$((t.val gt 2025)) = min(p37_wasteIncinerationCCSMaxShare(ttot,ext_regi), (p37_wasteIncinerationCCSMaxShare(ttot,ext_regi)/(ttot.val - 2025))*(t.val-2025));
);
);
$endIf.cm_wasteIncinerationCCSshare
Expand Down Expand Up @@ -647,6 +647,38 @@ $endif.cm_subsec_model_steel

*** --------------------------------

p37_ue_share(all_enty,all_in) = 0.;
$ifthen.cm_subsec_model_steel "%cm_subsec_model_steel%" == "processes"
p37_ue_share("sesteel","ue_steel_secondary") = 1.;
p37_ue_share("prsteel","ue_steel_primary") = 1.;
$endif.cm_subsec_model_steel
loop(ppfUePrc(in),
if(abs(sum(mat,p37_ue_share(mat,in))-1.) gt sm_eps,
display p37_ue_share;
abort "p37_ue_share must add to one for each ue";
);
);

*** --------------------------------
p37_teMatShareHist(tePrc,opmoPrc,mat) = 0.;
$ifthen.cm_subsec_model_steel "%cm_subsec_model_steel%" == "processes"
p37_teMatShareHist("bof","unheated","prsteel") = 1.;
p37_teMatShareHist("eaf","sec","sesteel") = 1.;
$endif.cm_subsec_model_steel
loop(matFin(mat),
if(abs(sum((tePrc,opmoPrc),p37_teMatShareHist(tePrc,opmoPrc,mat))-1.) gt sm_eps,
display p37_teMatShareHist;
abort "p37_teMatShareHist must add to one for each matFin";
);
);
if(sum((tePrc,opmoPrc,mat)$(not matFin(mat)), p37_teMatShareHist(tePrc,opmoPrc,mat)) gt sm_eps,
display p37_teMatShareHist;
abort "p37_teMatShareHist must only be non-zero for matFin";
);
*** --------------------------------
s37_shareHistFeDemPenalty = 0.6;
*** --------------------------------

p37_captureRate(all_te) = 0.;
p37_selfCaptureRate(all_te) = 0.;
$ifthen.cm_subsec_model_steel "%cm_subsec_model_steel%" == "processes"
Expand All @@ -673,63 +705,77 @@ $endif.cm_subsec_model_steel
*** --------------------------------

pm_specFeDem(tall,all_regi,all_enty,all_te,opmoPrc) = 0.;
pm_outflowPrcIni(all_regi,all_te,opmoPrc) = 0.;
$ifthen.cm_subsec_model_steel "%cm_subsec_model_steel%" == "processes"
pm_outflowPrcHist(tall,all_regi,all_te,opmoPrc) = 0.;
p37_matFlowHist(tall,all_regi,mat) = 0.;
if (cm_startyear eq 2005,
pm_outflowPrcIni(regi,"bof","unheated") = pm_fedemand("2005",regi,"ue_steel_primary");
pm_outflowPrcIni(regi,"bf","standard") = p37_specMatDem("pigiron","bof","unheated") * pm_outflowPrcIni(regi,"bof","unheated");
pm_outflowPrcIni(regi,"eaf","sec") = pm_fedemand("2005",regi,"ue_steel_secondary");
pm_outflowPrcIni(regi,"eaf","pri") = 0.;
pm_outflowPrcIni(regi,"idr","ng") = 0.;
pm_outflowPrcIni(regi,"idr","h2") = 0.;
pm_outflowPrcIni(regi,"bfcc","standard") = 0.;
pm_outflowPrcIni(regi,"idrcc","ng") = 0.;

loop(ttot$(ttot.val ge 2005 AND ttot.val le 2020),
pm_specFeDem(ttot,regi,"feh2s","idr","h2") = p37_specFeDemTarget("feh2s","idr","h2");
pm_specFeDem(ttot,regi,"feels","idr","h2") = p37_specFeDemTarget("feels","idr","h2");

pm_specFeDem(ttot,regi,"fegas","idr","ng") = p37_specFeDemTarget("fegas","idr","ng");
pm_specFeDem(ttot,regi,"feels","idr","ng") = p37_specFeDemTarget("feels","idr","ng");
!! 2nd stage tech
loop(mat2ue(mat,in),
p37_matFlowHist(ttot,regi,mat) = pm_fedemand(ttot,regi,in) / p37_mat2ue(mat,in) * p37_ue_share(mat,in);
loop(tePrc2matOut(tePrc,opmoPrc,mat),
pm_outflowPrcHist(ttot,regi,tePrc,opmoPrc) = p37_matFlowHist(ttot,regi,mat) * p37_teMatShareHist(tePrc,opmoPrc,mat);
);
);

pm_specFeDem(ttot,regi,"fegas","bfcc","standard") = p37_specFeDemTarget("fegas","bfcc","standard");
pm_specFeDem(ttot,regi,"feels","bfcc","standard") = p37_specFeDemTarget("feels","bfcc","standard");
!! 1st stage tech
!! TODO: simply do this loop several times to fill more than two stages?
loop((tePrc1,opmoPrc1,mat)$(
sum((tePrc2,opmoPrc2), tePrc2matIn(tePrc2,opmoPrc2,mat))
AND tePrc2matOut(tePrc1,opmoPrc1,mat)),
p37_matFlowHist(ttot,regi,mat)
= sum((tePrc2matOut(tePrc1,opmoPrc1,mat),
tePrc2matIn(tePrc2,opmoPrc2,mat)),
!!TODO: enable p37_teMatShareHist here, too (has to be defined, though)
p37_specMatDem(mat,tePrc2,opmoPrc2) * pm_outflowPrcHist(ttot,regi,tePrc2,opmoPrc2) );
pm_outflowPrcHist(ttot,regi,tePrc1,opmoPrc1) = p37_matFlowHist(ttot,regi,mat);
);

pm_specFeDem(ttot,regi,"fegas","idrcc","ng") = p37_specFeDemTarget("fegas","idrcc","ng");
pm_specFeDem(ttot,regi,"feels","idrcc","ng") = p37_specFeDemTarget("feels","idrcc","ng");
loop((entyFe,ppfUePrc),
p37_demFeTarget(ttot,regi,entyFe,ppfUePrc) = sum(tePrc2ue(tePrc,opmoPrc,ppfUePrc), pm_outflowPrcHist(ttot,regi,tePrc,opmoPrc) * p37_specFeDemTarget(entyFe,tePrc,opmoPrc));
p37_demFeActual(ttot,regi,entyFe,ppfUePrc) = sum((fe2ppfen_no_ces_use(entyFe,all_in),ue2ppfenPrc(ppfUePrc,all_in)), pm_fedemand(ttot,regi,all_in) * sm_EJ_2_TWa);
);

pm_specFeDem(ttot,regi,"fesos","bf","standard") = pm_fedemand(ttot,regi,"feso_steel") * sm_EJ_2_TWa / ( p37_specMatDem("pigiron","bof","unheated") * pm_fedemand(ttot,regi,"ue_steel_primary") );
pm_specFeDem(ttot,regi,"fehos","bf","standard") = pm_fedemand(ttot,regi,"feli_steel") * sm_EJ_2_TWa / ( p37_specMatDem("pigiron","bof","unheated") * pm_fedemand(ttot,regi,"ue_steel_primary") );
pm_specFeDem(ttot,regi,"fegas","bf","standard") = pm_fedemand(ttot,regi,"fega_steel") * sm_EJ_2_TWa / ( p37_specMatDem("pigiron","bof","unheated") * pm_fedemand(ttot,regi,"ue_steel_primary") );
pm_specFeDem(ttot,regi,"feels","bf","standard") = pm_fedemand(ttot,regi,"feel_steel_primary") * sm_EJ_2_TWa / ( p37_specMatDem("pigiron","bof","unheated") * pm_fedemand(ttot,regi,"ue_steel_primary") );
p37_demFeRatio(ttot,regi,ppfUePrc) = sum(entyFe,p37_demFeActual(ttot,regi,entyFe,ppfUePrc)) / sum(entyFe,p37_demFeTarget(ttot,regi,entyFe,ppfUePrc));

loop((tePrc2opmoPrc(tePrc,opmoPrc),regi,entyFe)$(p37_specFeDemTarget(entyFe,tePrc,opmoPrc) gt 0.01*sm_eps),
if((pm_outflowPrcHist(ttot,regi,tePrc,opmoPrc) gt sm_eps),
pm_specFeDem(ttot,regi,entyFe,tePrc,opmoPrc)
= p37_specFeDemTarget(entyFe,tePrc,opmoPrc)
* sum(tePrc2ue(tePrc,opmoPrc,in),
p37_demFeActual(ttot,regi,entyFe,in)
/ p37_demFeTarget(ttot,regi,entyFe,in));
else
pm_specFeDem(ttot,regi,entyFe,tePrc,opmoPrc)
= p37_specFeDemTarget(entyFe,tePrc,opmoPrc)
* (1.
+ s37_shareHistFeDemPenalty
* (sum(tePrc2ue(tePrc,opmoPrc,ppfUePrc), p37_demFeRatio(ttot,regi,ppfUePrc))
-1.));
);
);

pm_specFeDem(ttot,regi,"feels","eaf","sec") = pm_fedemand(ttot,regi,"feel_steel_secondary") * sm_EJ_2_TWa / pm_fedemand(ttot,regi,"ue_steel_secondary");
pm_specFeDem(ttot,regi,"feels","eaf","pri") = pm_specFeDem(ttot,regi,"feels","eaf","sec");
);

!! loop over other years and blend
loop(entyFeStat(all_enty),
loop(tePrc(all_te),
loop(opmoPrc,
if( (p37_specFeDemTarget(all_enty,all_te,opmoPrc) gt 0.),
loop(ttot$(ttot.val > 2020),
!! fedemand in excess of BAT halves until 2055
!! gams cannot handle float exponents, so pre-compute 0.5^(1/(2055-2020)) = 0.9804
pm_specFeDem(ttot,regi,all_enty,all_te,opmoPrc)
= p37_specFeDemTarget(all_enty,all_te,opmoPrc)
+ (pm_specFeDem("2020",regi,all_enty,all_te,opmoPrc) - p37_specFeDemTarget(all_enty,all_te,opmoPrc))
* power(0.9804, ttot.val - 2020) ;
);
);
loop((entyFeStat(all_enty), tePrc(all_te), opmoPrc),
if( (p37_specFeDemTarget(all_enty,all_te,opmoPrc) gt 0.),
loop(ttot$(ttot.val > 2020),
!! fedemand in excess of BAT halves until 2055
!! gams cannot handle float exponents, so pre-compute 0.5^(1/(2055-2020)) = 0.9804
pm_specFeDem(ttot,regi,all_enty,all_te,opmoPrc)
= p37_specFeDemTarget(all_enty,all_te,opmoPrc)
+ (pm_specFeDem("2020",regi,all_enty,all_te,opmoPrc) - p37_specFeDemTarget(all_enty,all_te,opmoPrc))
* power(0.9804, ttot.val - 2020) ;
);
);
);

);

if (cm_startyear gt 2005,
Execute_Loadpoint "input_ref" pm_specFeDem = pm_specFeDem;
);
$endif.cm_subsec_model_steel

if (cm_startyear gt 2005,
execute_load "input_ref.gdx" v37_plasticWaste.l = v37_plasticWaste.l;
Expand Down
Loading

0 comments on commit e2f87ca

Please sign in to comment.