Skip to content
Open
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ runtime.rds
# ignore RStudio project files
/*.Rproj

# ignore VS Code workspace files
/.vscode/

# Main Python virtual environment
.venv/

Expand Down
2 changes: 1 addition & 1 deletion config/default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ cfg$extramappings_historic <- ""
cfg$inputRevision <- "7.68"

#### Current CES parameter and GDX revision (commit hash) ####
cfg$CESandGDXversion <- "55be413db9147c127b5c384044a40bd4209adac9"
cfg$CESandGDXversion <- "175199a7fa5adc633e1decf70598c11ef04cf8eb"

#### Path to a renv.lock file to restore a project's dependencies from. If NULL, all R packages in their currently installed version will be used.
cfg$UseThisRenvLock <- NULL
Expand Down
224 changes: 219 additions & 5 deletions core/datainput.gms
Original file line number Diff line number Diff line change
Expand Up @@ -739,12 +739,50 @@ pm_cf(ttot,regi,"tdsynhos") = 0.6;
pm_cf(ttot,regi,"tdsynpet") = 0.7;
pm_cf(ttot,regi,"tdsyndie") = 0.7;
*** eternal short-term fix for process-based industry
$ifthen.cm_subsec_model_chemicals "%cm_subsec_model_chemicals%" == "processes"
pm_cf(ttot,regi,"chemOld") = 0.8;
pm_cf(ttot,regi,"chemElec") = 0.8;
pm_cf(ttot,regi,"chemH2") = 0.8;

pm_cf(ttot,regi,"stCrNg") = 0.8;
pm_cf(ttot,regi,"stCrLiq") = 0.8;
pm_cf(ttot,regi,"stCrChemRe") = 0.8;

pm_cf(ttot,regi,"mechRe") = 0.8;

pm_cf(ttot,regi,"meSySol") = 0.8;
pm_cf(ttot,regi,"meSyNg") = 0.8;
pm_cf(ttot,regi,"meSyLiq") = 0.8;
pm_cf(ttot,regi,"meSySol_cc") = 0.8;
pm_cf(ttot,regi,"meSyNg_cc") = 0.8;
pm_cf(ttot,regi,"meSyLiq_cc") = 0.8;
pm_cf(ttot,regi,"meSyH2") = 0.8;
pm_cf(ttot,regi,"meSyChemRe") = 0.8;

pm_cf(ttot,regi,"amSyCoal") = 0.8;
pm_cf(ttot,regi,"amSyNG") = 0.8;
pm_cf(ttot,regi,"amSyLiq") = 0.8;
pm_cf(ttot,regi,"amSyCoal_cc") = 0.8;
pm_cf(ttot,regi,"amSyNG_cc") = 0.8;
pm_cf(ttot,regi,"amSyLiq_cc") = 0.8;
pm_cf(ttot,regi,"amSyH2") = 0.8;

pm_cf(ttot,regi,"mtoMta") = 0.8;
pm_cf(ttot,regi,"mtoMtaH2") = 0.8;
pm_cf(ttot,regi,"fertProd") = 0.8;
pm_cf(ttot,regi,"fertProdH2") = 0.8;
pm_cf(ttot,regi,"meToFinal") = 0.8;
pm_cf(ttot,regi,"amToFinal") = 0.8;

$endif.cm_subsec_model_chemicals
$ifthen.cm_subsec_model_steel "%cm_subsec_model_steel%" == "processes"
pm_cf(ttot,regi,"bf") = 0.8;
pm_cf(ttot,regi,"eaf") = 0.8;
pm_cf(ttot,regi,"bof") = 0.8;
pm_cf(ttot,regi,"idr") = 0.8;
pm_cf(ttot,regi,"idrcc") = 1.0; !! capex is derived from numbers per ton of CO2, where cf = 1 is assumed in conversion
pm_cf(ttot,regi,"bfcc") = 1.0; !! capex is derived from numbers per ton of CO2, where cf = 1 is assumed in conversion
$endif.cm_subsec_model_steel

*RP* phasing down the ngt cf to "peak load" cf of 5%
pm_cf(ttot,regi,"ngt")$(ttot.val eq 2025) = 0.9 * pm_cf(ttot,regi,"ngt");
Expand All @@ -756,6 +794,65 @@ pm_cf(ttot,regi,"ngt")$(ttot.val ge 2040) = 0.6 * pm_cf(ttot,regi,"ngt");
pm_cf(ttot,regi,"h2turb")$(ttot.val ge 2025) = pm_cf(ttot,regi,"ngt");
pm_cf(ttot,regi,"h2turbVRE")$(ttot.val ge 2025) = pm_cf(ttot,regi,"ngt");


*CG* phasing down pc cf to "peak load" cf for CHA
$ifthen.chaPOpolicy "%cm_chaCoalPOSpeed%" == "base"
pm_cf(ttot,"CHA","pc")$(ttot.val le 2035) = 1 * pm_cf("2020","CHA","pc");
pm_cf(ttot,"CHA","pc")$(ttot.val ge 2040) = 0.8 * pm_cf("2020","CHA","pc");
$endif.chaPOpolicy

*CG* phasing down pc cf to "peak load" cf for CHA
$ifthen.chaPOpolicy "%cm_chaCoalPOSpeed%" == "plateau30"
pm_cf(ttot,"CHA","pc")$(ttot.val le 2025) = 1.1 * pm_cf("2020","CHA","pc");
pm_cf(ttot,"CHA","pc")$(ttot.val eq 2030) = 0.99 * pm_cf("2020","CHA","pc");
pm_cf(ttot,"CHA","pc")$(ttot.val eq 2035) = 0.75 * pm_cf("2020","CHA","pc");
pm_cf(ttot,"CHA","pc")$(ttot.val eq 2040) = 0.55 * pm_cf("2020","CHA","pc");
pm_cf(ttot,"CHA","pc")$(ttot.val ge 2045) = 0.35 * pm_cf("2020","CHA","pc");
pm_cf(ttot,"CHA","pc")$(ttot.val ge 2050) = 0.15 * pm_cf("2020","CHA","pc");
$endif.chaPOpolicy

$ifthen.chaPOpolicy "%cm_chaCoalPOSpeed%" == "plateau25"
pm_cf(ttot,"CHA","pc")$(ttot.val le 2025) = 1.1 * pm_cf("2020","CHA","pc");
pm_cf(ttot,"CHA","pc")$(ttot.val eq 2030) = 0.7 * pm_cf("2020","CHA","pc");
pm_cf(ttot,"CHA","pc")$(ttot.val eq 2035) = 0.55 * pm_cf("2020","CHA","pc");
pm_cf(ttot,"CHA","pc")$(ttot.val eq 2040) = 0.35 * pm_cf("2020","CHA","pc");
pm_cf(ttot,"CHA","pc")$(ttot.val ge 2045) = 0.15 * pm_cf("2020","CHA","pc");
$endif.chaPOpolicy

$ifthen.chaPOpolicy "%cm_chaCoalPOSpeed%" == "fast"
pm_cf(ttot,"CHA","pc")$(ttot.val le 2025) = 0.95 * pm_cf("2020","CHA","pc");
pm_cf(ttot,"CHA","pc")$(ttot.val eq 2030) = 0.6 * pm_cf("2020","CHA","pc");
pm_cf(ttot,"CHA","pc")$(ttot.val eq 2035) = 0.3 * pm_cf("2020","CHA","pc");
pm_cf(ttot,"CHA","pc")$(ttot.val eq 2040) = 0.1 * pm_cf("2020","CHA","pc");
pm_cf(ttot,"CHA","pc")$(ttot.val ge 2045) = 0.1 * pm_cf("2020","CHA","pc");
$endif.chaPOpolicy

$ifthen.chaPOpolicy "%cm_chaCoalPOSpeed%" == "medium"
pm_cf(ttot,"CHA","pc")$(ttot.val le 2025) = 1.1 * pm_cf("2020","CHA","pc");
pm_cf(ttot,"CHA","pc")$(ttot.val eq 2030) = 0.8 * pm_cf("2020","CHA","pc");
pm_cf(ttot,"CHA","pc")$(ttot.val eq 2035) = 0.65 * pm_cf("2020","CHA","pc");
pm_cf(ttot,"CHA","pc")$(ttot.val eq 2040) = 0.5 * pm_cf("2020","CHA","pc");
pm_cf(ttot,"CHA","pc")$(ttot.val ge 2045) = 0.3 * pm_cf("2020","CHA","pc");
$endif.chaPOpolicy

$ifthen.chaPOpolicy "%cm_chaCoalPOSpeed%" == "slow"
pm_cf(ttot,"CHA","pc")$(ttot.val le 2025) = 1.08 * pm_cf("2020","CHA","pc");
pm_cf(ttot,"CHA","pc")$(ttot.val eq 2030) = 0.85 * pm_cf("2020","CHA","pc");
pm_cf(ttot,"CHA","pc")$(ttot.val eq 2035) = 0.8 * pm_cf("2020","CHA","pc");
pm_cf(ttot,"CHA","pc")$(ttot.val eq 2040) = 0.7 * pm_cf("2020","CHA","pc");
pm_cf(ttot,"CHA","pc")$(ttot.val ge 2045) = 0.6 * pm_cf("2020","CHA","pc");
pm_cf(ttot,"CHA","pc")$(ttot.val ge 2050) = 0.5 * pm_cf("2020","CHA","pc");
pm_cf(ttot,"CHA","pc")$(ttot.val gt 2050) = 0.5 * pm_cf("2020","CHA","pc");
$endif.chaPOpolicy

$ifthen.chaPOpolicy "%cm_chaPcCost%" == "on"
p_inco0(t,"CHA","pc")$((t.val ge 2015) and (t.val le 2040)) = 500;
p_inco0(t,"CHA","igccc")$((t.val ge 2015) and (t.val le 2060)) = 500 * 1.24;
$endif.chaPOpolicy

** CG: update on nuclear plant capacity factor in China (http://static.sse.com.cn/disclosure/listedinfo/announcement/c/new/2022-04-28/601985_20220428_5_yMPns6pY.pdf)
f_cf(ttot,"CHA","tnrs") = 0.9227;

*** FS: set CF of additional t&d H2 for buildings and industry to t&d H2 stationary value
pm_cf(ttot,regi,"tdh2b") = pm_cf(ttot,regi,"tdh2s");
pm_cf(ttot,regi,"tdh2i") = pm_cf(ttot,regi,"tdh2s");
Expand Down Expand Up @@ -795,6 +892,57 @@ $endif.Base_Cprice

display pm_regiEarlyRetiRate;

*CG* CHA-specific pc rate
*$ontext
$ifthen.chaPOpolicy "%cm_chaCoalPOSpeed%" == "plateau30"
*** Allow first slow then fast phase-out cap
pm_regiEarlyRetiRate(t,"CHA","pc")$(t.val le 2025) = 0;
pm_regiEarlyRetiRate(t,"CHA","pc")$(t.val eq 2030) = 0;
pm_regiEarlyRetiRate(t,"CHA","pc")$(t.val eq 2035) = 0.02;
pm_regiEarlyRetiRate(t,"CHA","pc")$(t.val eq 2040) = 0.03;
pm_regiEarlyRetiRate(t,"CHA","pc")$(t.val ge 2045) = 0.05;
pm_regiEarlyRetiRate(t,"CHA","pc")$(t.val ge 2050) = 0.07;
$endif.chaPOpolicy

$ifthen.chaPOpolicy "%cm_chaCoalPOSpeed%" == "plateau25"
*** Allow first slow then fast phase-out cap
pm_regiEarlyRetiRate(t,"CHA","pc")$(t.val le 2025) = 0;
pm_regiEarlyRetiRate(t,"CHA","pc")$(t.val eq 2030) = 0.02;
pm_regiEarlyRetiRate(t,"CHA","pc")$(t.val eq 2035) = 0.04;
pm_regiEarlyRetiRate(t,"CHA","pc")$(t.val eq 2040) = 0.05;
pm_regiEarlyRetiRate(t,"CHA","pc")$(t.val ge 2045) = 0.07;
$endif.chaPOpolicy

$ifthen.chaPOpolicy "%cm_chaCoalPOSpeed%" == "fast"
*** Allow first slow then fast phase-out cap
pm_regiEarlyRetiRate(t,"CHA","pc")$(t.val le 2025) = 0.1;
pm_regiEarlyRetiRate(t,"CHA","pc")$(t.val eq 2030) = 0.05;
pm_regiEarlyRetiRate(t,"CHA","pc")$(t.val eq 2035) = 0.07;
pm_regiEarlyRetiRate(t,"CHA","pc")$(t.val eq 2040) = 0.09;
pm_regiEarlyRetiRate(t,"CHA","pc")$(t.val ge 2045) = 0.09;
$endif.chaPOpolicy

$ifthen.chaPOpolicy "%cm_chaCoalPOSpeed%" == "medium"
*** Allow first slow then fast phase-out cap
pm_regiEarlyRetiRate(t,"CHA","pc")$(t.val le 2025) = 0;
pm_regiEarlyRetiRate(t,"CHA","pc")$(t.val eq 2030) = 0.02;
pm_regiEarlyRetiRate(t,"CHA","pc")$(t.val eq 2035) = 0.035;
pm_regiEarlyRetiRate(t,"CHA","pc")$(t.val eq 2040) = 0.06;
pm_regiEarlyRetiRate(t,"CHA","pc")$(t.val ge 2045) = 0.09;
$endif.chaPOpolicy

$ifthen.chaPOpolicy "%cm_chaCoalPOSpeed%" == "slow"
*** Allow first slow then fast phase-out cap
pm_regiEarlyRetiRate(t,"CHA","pc")$(t.val le 2025) = 0.005;
pm_regiEarlyRetiRate(t,"CHA","pc")$(t.val eq 2030) = 0.01;
pm_regiEarlyRetiRate(t,"CHA","pc")$(t.val eq 2035) = 0.02;
pm_regiEarlyRetiRate(t,"CHA","pc")$(t.val eq 2040) = 0.035;
pm_regiEarlyRetiRate(t,"CHA","pc")$(t.val eq 2045) = 0.05;
pm_regiEarlyRetiRate(t,"CHA","pc")$(t.val ge 2050) = 0.06;
$endif.chaPOpolicy

*$offtext

***---------------------------------------------------------------------------
*** Calculate lifetime parameters (omeg and opTimeYr2te)
***---------------------------------------------------------------------------
Expand All @@ -817,7 +965,7 @@ pm_omeg(regi,opTimeYr,te) = max(0, 1 - ((opTimeYr.val - 0.5) / p_lifetime_max(re

*** Map each technology with its possible age
opTimeYr2te(te,opTimeYr) $ sum(regi $ (pm_omeg(regi,opTimeYr,te) > 0), 1) = yes;
*** Map each model timestep with the possible age of technologies
*** Map each model timestep with the possible age of technologies
tsu2opTimeYr(ttot,"1") = yes;
loop((ttot,ttot2) $ (ord(ttot2) le ord(ttot)),
loop(opTimeYr $ (opTimeYr.val = pm_ttot_val(ttot) - pm_ttot_val(ttot2) + 1),
Expand Down Expand Up @@ -968,9 +1116,9 @@ $offdelim
p_abatparam_CH4(tall,all_regi,all_enty,steps)$(ord(steps) gt 201) = p_abatparam_CH4(tall,all_regi,all_enty,"201");
p_abatparam_N2O(tall,all_regi,all_enty,steps)$(ord(steps) gt 201) = p_abatparam_N2O(tall,all_regi,all_enty,"201");

*** Read methane emissions from fossil fuel extraction for calculating emission factors.
*** Read methane emissions from fossil fuel extraction for calculating emission factors.
*** The base year determines whether the data comes from CEDS or EDGAR
$ifthen %cm_emifacs_baseyear% == "2005"
$ifthen %cm_emifacs_baseyear% == "2005"
parameter p_emiFossilFuelExtr(all_regi,all_enty) "methane emissions in 2005 [Mt CH4], needed for the calculation of p_efFossilFuelExtr"
/
$ondelim
Expand Down Expand Up @@ -1219,6 +1367,33 @@ loop(ttot$(ttot.val ge 2005),
p_adj_seed_te(ttot,regi,'dac') = 0.25;
p_adj_seed_te(ttot,regi,'oae_ng') = 0.25;
p_adj_seed_te(ttot,regi,'oae_el') = 0.25;
$ifthen.cm_subsec_model_chemicals "%cm_subsec_model_chemicals%" == "processes"
!! not all existing tech are used in all regions
!! Low seeds for these prevent switching between exisitng tech
!! High seeds for new tech like H2 makes ist easy to switch to that.
!! Seeds have little/no effect on tech with large exisitng cap in a region
!!p_adj_seed_te(ttot,regi,"chemElec") = 0.50;
!!p_adj_seed_te(ttot,regi,"chemH2") = 0.50;
p_adj_seed_te(ttot,regi,"meSySol") = 0.0001;
p_adj_seed_te(ttot,regi,"meSyNg") = 0.0001;
p_adj_seed_te(ttot,regi,"meSyLiq") = 0.0001;
p_adj_seed_te(ttot,regi,"meSySol_cc") = 0.0001;
p_adj_seed_te(ttot,regi,"meSyNg_cc") = 0.0001;
p_adj_seed_te(ttot,regi,"meSyLiq_cc") = 0.0001;
p_adj_seed_te(ttot,regi,"meSyH2") = 0.25;
p_adj_seed_te(ttot,regi,"amSyCoal") = 0.0001;
p_adj_seed_te(ttot,regi,"amSyNG") = 0.0001;
p_adj_seed_te(ttot,regi,"amSyLiq") = 0.0001;
p_adj_seed_te(ttot,regi,"amSyCoal_cc") = 0.0001;
p_adj_seed_te(ttot,regi,"amSyNG_cc") = 0.0001;
p_adj_seed_te(ttot,regi,"amSyLiq_cc") = 0.0001;
p_adj_seed_te(ttot,regi,"amSyH2") = 2.0;
p_adj_seed_te(ttot,regi,"stCrLiq") = 0.0001;
p_adj_seed_te(ttot,regi,"stCrNg") = 0.0001;
p_adj_seed_te(ttot,regi,"mtoMta") = 0.0001;
p_adj_seed_te(ttot,regi,"mtoMtaH2") = 0.25;
p_adj_seed_te(ttot,regi,"fertProdH2") = 2.0;
$endif.cm_subsec_model_chemicals
$ifthen.cm_subsec_model_steel "%cm_subsec_model_steel%" == "processes"
*** steel technologies
p_adj_seed_te(ttot,regi,"bfcc") = 0.05;
Expand Down Expand Up @@ -1273,6 +1448,32 @@ $endif.cm_subsec_model_steel
p_adj_coeff(ttot,regi,"dac") = 0.8;
p_adj_coeff(ttot,regi,'oae_ng') = 0.8;
p_adj_coeff(ttot,regi,'oae_el') = 0.8;
$ifthen.cm_subsec_model_chemicals "%cm_subsec_model_chemicals%" == "processes"
!! scaling factor for adjustment costs
!! old technologies have high costs, new technologies have low costs
!! default = 0.25
!!p_adj_coeff(ttot,regi,"chemElec") = 0.25;
!!p_adj_coeff(ttot,regi,"chemH2") = 1.0;
p_adj_coeff(ttot,regi,"meSySol") = 3.0;
p_adj_coeff(ttot,regi,"meSyNg") = 3.0;
p_adj_coeff(ttot,regi,"meSyLiq") = 3.0;
p_adj_coeff(ttot,regi,"meSySol_cc") = 3.0;
p_adj_coeff(ttot,regi,"meSyNg_cc") = 3.0;
p_adj_coeff(ttot,regi,"meSyLiq_cc") = 3.0;
p_adj_coeff(ttot,regi,"meSyH2") = 0.8;
p_adj_coeff(ttot,regi,"amSyCoal") = 3.0;
p_adj_coeff(ttot,regi,"amSyNG") = 3.0;
p_adj_coeff(ttot,regi,"amSyLiq") = 3.0;
p_adj_coeff(ttot,regi,"amSyCoal_cc") = 3.0;
p_adj_coeff(ttot,regi,"amSyNG_cc") = 3.0;
p_adj_coeff(ttot,regi,"amSyLiq_cc") = 3.0;
p_adj_coeff(ttot,regi,"amSyH2") = 0.1;
p_adj_coeff(ttot,regi,"stCrLiq") = 3.0;
p_adj_coeff(ttot,regi,"stCrNg") = 3.0;
p_adj_coeff(ttot,regi,"mtoMta") = 1.0;
p_adj_coeff(ttot,regi,"mtoMtaH2") = 0.8;
p_adj_coeff(ttot,regi,"fertProdH2") = 0.1;
$endif.cm_subsec_model_chemicals
$ifthen.cm_subsec_model_steel "%cm_subsec_model_steel%" == "processes"
*** steel technologies
p_adj_coeff(ttot,regi,"bfcc") = 1.0;
Expand Down Expand Up @@ -1452,7 +1653,7 @@ $offdelim
parameter p_macBaseIMAGE(tall,all_regi,all_enty) "baseline emissions of N2O from transport, adipic acid production, and nitric acid production based on data from van Vuuren"
/
$ondelim
$ifthen %cm_emifacs_baseyear% == "2005"
$ifthen %cm_emifacs_baseyear% == "2005"
$include "./core/input/p_macBaseVanv.cs4r"
$else
$include "./core/input/p_macBaseHarmsen2022.cs4r"
Expand Down Expand Up @@ -1551,12 +1752,25 @@ pm_emifacNonEnergy(ttot,regi,"segafos", "fegas","indst","co2") = f_nechem_emissi

***------ Read in projections for incineration rates of plastic waste---
*** "incineration rates [fraction]"

parameter f_incinerationShares(ttot,all_regi) "incineration rate of plastic waste"

$ifthen.PlasticMFA "%cm_PlasticMFA%" == "on"
/
$ondelim
$include "./core/input/f_incinerationSharesMFA.cs4r"
$offdelim
/;
$endif.PlasticMFA

$ifthen.PlasticMFA "%cm_PlasticMFA%" == "off"
/
$ondelim
$include "./core/input/f_incinerationShares.cs4r"
$offdelim
/;
$endif.PlasticMFA

pm_incinerationRate(ttot,all_regi)=f_incinerationShares(ttot,all_regi);

*** some balances are not matching by small amounts;
Expand Down Expand Up @@ -1633,7 +1847,7 @@ execute_load "input_ref.gdx", p_prodSeReference = vm_prodSe.l;
execute_load "input_ref.gdx", pm_prodFEReference = vm_prodFe.l;
execute_load "input_ref.gdx", p_prodUeReference = v_prodUe.l;
execute_load "input_ref.gdx", p_co2CCSReference = vm_co2CCS.l;
*' load MAC costs from reference gdx. Values for t (i.e. after cm_start_year) will be overwritten in core/presolve.gms
*' load MAC costs from reference gdx. Values for t (i.e. after cm_start_year) will be overwritten in core/presolve.gms
execute_load "input_ref.gdx" pm_macCost;
);

Expand Down
Loading