diff --git a/CHANGELOG.md b/CHANGELOG.md index 04750a9657..fc5ddd12d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). [[#2332](https://github.com/remindmodel/remind/pull/2332)] - **scripts** Use `quitte::write.gdx` in `climateAssessmentInterimRun.R` to dump climate assessment results to gdx [[#2334](https://github.com/remindmodel/remind/pull/2354)] +- **inputdata** Split final energy demands into buildings and industry specific parameters + [[#2329](https://github.com/remindmodel/remind/pull/2329/)] ### added - diff --git a/config/default.cfg b/config/default.cfg index 60b62ad7f9..5ea3737970 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -28,7 +28,7 @@ cfg$regionmapping <- "config/regionmappingH12.csv" cfg$extramappings_historic <- "" #### Current input data revision (.) #### -cfg$inputRevision <- "7.94" +cfg$inputRevision <- "7.95" #### Current CES parameter and GDX revision (commit hash) #### cfg$CESandGDXversion <- "dec24b712ce59db95bb4385ba71ec9a4cd921041" diff --git a/core/datainput.gms b/core/datainput.gms index 5c75a75ffb..c58f2ec223 100644 --- a/core/datainput.gms +++ b/core/datainput.gms @@ -1635,41 +1635,37 @@ loop(te, *** ---- FE demand trajectories for calibration ------------------------------- -*** also used for limiting secondary steel demand in baseline and policy -*** scenarios + Parameter -f_fedemand(tall,all_regi,all_demScen,all_in) "final energy demand" +f_fedemandInd(tall,all_regi,all_demScen,all_in) "final energy demand in industry" / $ondelim -$include "./core/input/f_fedemand.cs4r" +$include "./core/input/f_fedemandInd.cs4r" $offdelim /; -*** use cm_demScen for Industry and Buildings -*** cm_GDPpopScen will be used for Transport (EDGE-T) (see p29_trpdemand) -pm_fedemand(tall,all_regi,in) = f_fedemand(tall,all_regi,"%cm_demScen%",in); -*** data input for industry FE that is no part of the CES tree -pm_fedemand(tall,all_regi,ppfen_no_ces_use) = f_fedemand(tall,all_regi,"%cm_demScen%",ppfen_no_ces_use); +pm_fedemandInd(t,regi,in) = f_fedemandInd(t,regi,"%cm_demScen%",in); +*** data input for industry FE that is no part of the CES tree +*** needed for process-based steel implementation, where these items are not part of "in" +pm_fedemandInd(t,regi,ppfen_no_ces_use) = f_fedemandInd(t,regi,"%cm_demScen%",ppfen_no_ces_use); *** RCP-dependent demands in buildings (climate impact) -$ifthen.cm_rcp_scen_build not "%cm_rcp_scen_build%" == "none" -Parameter f_fedemand_build(tall,all_regi,all_demScen,all_rcp_scen,all_in) "RCP-dependent final energy demand in buildings" +Parameter +f_fedemandBuild(tall,all_regi,all_demScen,all_rcp_scen,all_in) "RCP-dependent final energy demand in buildings" / $ondelim -$include "./core/input/f_fedemand_build.cs4r" +$include "./core/input/f_fedemandBuild.cs4r" $offdelim /; - -pm_fedemand(t,regi,cal_ppf_buildings_dyn36) = f_fedemand_build(t,regi,"%cm_demScen%","%cm_rcp_scen_build%",cal_ppf_buildings_dyn36); -$endif.cm_rcp_scen_build - +pm_fedemandBuild(t,regi,cal_ppf_buildings_dyn36) = f_fedemandBuild(t,regi,"%cm_demScen%","%cm_rcp_scen_build%",cal_ppf_buildings_dyn36); *** Scale FE demand across industry and building sectors $ifthen.scaleDemand not "%cm_scaleDemand%" == "off" loop((tall,tall2,all_regi) $ pm_scaleDemand(tall,tall2,all_regi), *FL* rescaled demand = normal demand * [ scaling factor + (1-scaling factor) * remaining phase-in, between zero and one ] - pm_fedemand(t,all_regi,all_in) = pm_fedemand(t,all_regi,all_in) * ( pm_scaleDemand(tall,tall2,all_regi) + (1-pm_scaleDemand(tall,tall2,all_regi)) * min(1, max(0, tall2.val-t.val) / (tall2.val-tall.val)) ); + pm_fedemandInd(t,all_regi,all_in) = pm_fedemandInd(t,all_regi,all_in) * ( pm_scaleDemand(tall,tall2,all_regi) + (1-pm_scaleDemand(tall,tall2,all_regi)) * min(1, max(0, tall2.val-t.val) / (tall2.val-tall.val)) ); + pm_fedemandBuild(t,all_regi,all_in) = pm_fedemandBuild(t,all_regi,all_in) * ( pm_scaleDemand(tall,tall2,all_regi) + (1-pm_scaleDemand(tall,tall2,all_regi)) * min(1, max(0, tall2.val-t.val) / (tall2.val-tall.val)) ); ); $endif.scaleDemand @@ -1695,7 +1691,7 @@ pm_scaleDemandBuildTable(t,regi) $ ( pm_scaleDemandBuildTable(t,regi) le 0) = 1; pm_scaleDemandBuildTable(t,regi) $ (t.val > 2100 ) = pm_scaleDemandBuildTable("2100",regi); !! continue 2100 multiplier until end of time loop( (t,regi,in) $ in_buildings_dyn36(in) , - pm_fedemand(t,regi,in) = pm_fedemand(t,regi,in) * pm_scaleDemandBuildTable(t,regi) + pm_fedemandBuild(t,regi,in) = pm_fedemandBuild(t,regi,in) * pm_scaleDemandBuildTable(t,regi) ); $endif.scaleDemandBuildTable @@ -1720,7 +1716,7 @@ p_scaleDemandIndTable(t,regi) $ ( p_scaleDemandIndTable(t,regi) le 0) = 1; !! I p_scaleDemandIndTable(t,regi) $ (t.val > 2100 ) = p_scaleDemandIndTable("2100",regi); !! continue 2100 multiplier until end of time loop( (t,regi,in) $ in_industry_dyn37(in) , - pm_fedemand(t,regi,in) = pm_fedemand(t,regi,in) * p_scaleDemandIndTable(t,regi) + pm_fedemandInd(t,regi,in) = pm_fedemandInd(t,regi,in) * p_scaleDemandIndTable(t,regi) ); $endif.scaleDemandIndTable diff --git a/core/declarations.gms b/core/declarations.gms index f74a293585..24a9ed7cee 100644 --- a/core/declarations.gms +++ b/core/declarations.gms @@ -300,7 +300,8 @@ p_co2CCSReference(ttot,all_regi,all_enty,all_enty,all_te,rlf) "Captured CO2 put p_prodAllReference(ttot,all_regi,all_te) "Sum of the above in the reference run. As each technology has only one type of output, the differing units should not be a problem" *** CES calibration tarjectories industry and buildings -pm_fedemand(tall,all_regi,all_in) "read-in parameter for final energy and production trajectories used for the CES parameter calibration in industry and buildings [TWa]" +pm_fedemandInd(tall,all_regi,all_in) "read-in parameter for final energy and production trajectories used for the CES parameter calibration in industry [EJ, ue_primary_steel, ue_secondary_steel: Gt, ue_otherInd: $tn]" +pm_fedemandBuild(tall,all_regi,all_in) "read-in parameter for final energy and production trajectories used for the CES parameter calibration in buildings [EJ]" *** parameters for setting final energy shares pm_shfe_up(ttot,all_regi,all_enty,emi_sectors) "Final energy shares exogenous upper bounds per sector [share]" diff --git a/core/input/files b/core/input/files index 94d7b198ce..7afb3656b3 100644 --- a/core/input/files +++ b/core/input/files @@ -40,8 +40,8 @@ p_boundCapCCS.cs4r p_CapacityBounds.cs4r p_boundCapBiochar.cs4r f_geoStorPot.cs3r -f_fedemand.cs4r -f_fedemand_build.cs4r +f_fedemandBuild.cs4r +f_fedemandInd.cs4r pm_NuclearConstraint.cs4r pm_risk_premium.cs4r pm_shPPPMER.cs4r diff --git a/core/loop.gms b/core/loop.gms index 7b2d541658..6d73bd3ec8 100644 --- a/core/loop.gms +++ b/core/loop.gms @@ -20,11 +20,9 @@ option solprint = off; o_modelstat = 100; $ifthen.calibrate "%CES_parameters%" == "calibrate" !! CES_parameters -$ifthen.subsectors "%industry%" == "subsectors" !! industry !! Calibrating industry/subsectors lead to random infeasibilities on the order !! of 1e-15. Relaxing this attribute a little solves this problem. hybrid.tolinfeas = 1e-14; -$endif.subsectors $endif.calibrate ***------------------------------------------------------------------- diff --git a/modules/04_PE_FE_parameters/iea2014/datainput.gms b/modules/04_PE_FE_parameters/iea2014/datainput.gms index f9d940c06b..7475fe08ae 100644 --- a/modules/04_PE_FE_parameters/iea2014/datainput.gms +++ b/modules/04_PE_FE_parameters/iea2014/datainput.gms @@ -83,12 +83,12 @@ p04_IO_output_beforeFix_Total(t,regi,"fehob") = p04_IO_output_beforeFix(t,regi," + p04_IO_output_beforeFix(t,regi,"seliqfos","fehob","tdfoshob"); *** adjust buildings solids -f04_IO_output("2005",regi,"sesobio","fesob","tdbiosob")$(p04_IO_output_beforeFix_Total("2005",regi,"fesob")) = p04_IO_output_beforeFix("2005",regi,"sesobio","fesob","tdbiosob") * pm_fedemand("2005",regi,"fesob")/p04_IO_output_beforeFix_Total("2005",regi,"fesob"); -f04_IO_output("2005",regi,"sesofos","fesob","tdfossob")$(p04_IO_output_beforeFix_Total("2005",regi,"fesob")) = p04_IO_output_beforeFix("2005",regi,"sesofos","fesob","tdfossob") * pm_fedemand("2005",regi,"fesob")/p04_IO_output_beforeFix_Total("2005",regi,"fesob"); +f04_IO_output("2005",regi,"sesobio","fesob","tdbiosob")$(p04_IO_output_beforeFix_Total("2005",regi,"fesob")) = p04_IO_output_beforeFix("2005",regi,"sesobio","fesob","tdbiosob") * pm_fedemandBuild("2005",regi,"fesob")/p04_IO_output_beforeFix_Total("2005",regi,"fesob"); +f04_IO_output("2005",regi,"sesofos","fesob","tdfossob")$(p04_IO_output_beforeFix_Total("2005",regi,"fesob")) = p04_IO_output_beforeFix("2005",regi,"sesofos","fesob","tdfossob") * pm_fedemandBuild("2005",regi,"fesob")/p04_IO_output_beforeFix_Total("2005",regi,"fesob"); *** adjust buildings liquids -f04_IO_output("2005",regi,"seliqbio","fehob","tdbiohob")$(p04_IO_output_beforeFix_Total("2005",regi,"fehob")) = p04_IO_output_beforeFix("2005",regi,"seliqbio","fehob","tdbiohob") * pm_fedemand("2005",regi,"fehob")/p04_IO_output_beforeFix_Total("2005",regi,"fehob"); -f04_IO_output("2005",regi,"seliqfos","fehob","tdfoshob")$(p04_IO_output_beforeFix_Total("2005",regi,"fehob")) = p04_IO_output_beforeFix("2005",regi,"seliqfos","fehob","tdfoshob") * pm_fedemand("2005",regi,"fehob")/p04_IO_output_beforeFix_Total("2005",regi,"fehob"); +f04_IO_output("2005",regi,"seliqbio","fehob","tdbiohob")$(p04_IO_output_beforeFix_Total("2005",regi,"fehob")) = p04_IO_output_beforeFix("2005",regi,"seliqbio","fehob","tdbiohob") * pm_fedemandBuild("2005",regi,"fehob")/p04_IO_output_beforeFix_Total("2005",regi,"fehob"); +f04_IO_output("2005",regi,"seliqfos","fehob","tdfoshob")$(p04_IO_output_beforeFix_Total("2005",regi,"fehob")) = p04_IO_output_beforeFix("2005",regi,"seliqfos","fehob","tdfoshob") * pm_fedemandBuild("2005",regi,"fehob")/p04_IO_output_beforeFix_Total("2005",regi,"fehob"); *** industry solids @@ -97,18 +97,18 @@ p04_IO_output_beforeFix_Total(t,regi,"fesoi") = p04_IO_output_beforeFix(t,regi," f04_IO_output("2005",regi,"sesobio","fesoi","tdbiosoi")$(p04_IO_output_beforeFix_Total("2005",regi,"fesoi")) = p04_IO_output_beforeFix("2005",regi,"sesobio","fesoi","tdbiosoi") - * ( pm_fedemand("2005",regi,"feso_otherInd") - + pm_fedemand("2005",regi,"feso_cement") - + pm_fedemand("2005",regi,"feso_steel") - + pm_fedemand("2005",regi,"feso_chemicals")) + * ( pm_fedemandInd("2005",regi,"feso_otherInd") + + pm_fedemandInd("2005",regi,"feso_cement") + + pm_fedemandInd("2005",regi,"feso_steel") + + pm_fedemandInd("2005",regi,"feso_chemicals")) / p04_IO_output_beforeFix_Total("2005",regi,"fesoi"); f04_IO_output("2005",regi,"sesofos","fesoi","tdfossoi")$(p04_IO_output_beforeFix_Total("2005",regi,"fesoi")) = p04_IO_output_beforeFix("2005",regi,"sesofos","fesoi","tdfossoi") - * ( pm_fedemand("2005",regi,"feso_otherInd") - + pm_fedemand("2005",regi,"feso_cement") - + pm_fedemand("2005",regi,"feso_steel") - + pm_fedemand("2005",regi,"feso_chemicals")) + * ( pm_fedemandInd("2005",regi,"feso_otherInd") + + pm_fedemandInd("2005",regi,"feso_cement") + + pm_fedemandInd("2005",regi,"feso_steel") + + pm_fedemandInd("2005",regi,"feso_chemicals")) / p04_IO_output_beforeFix_Total("2005",regi,"fesoi"); *** industry liquids @@ -117,18 +117,18 @@ p04_IO_output_beforeFix_Total(t,regi,"fehoi") = p04_IO_output_beforeFix(t,regi," f04_IO_output("2005",regi,"seliqbio","fehoi","tdbiohoi")$(p04_IO_output_beforeFix_Total("2005",regi,"fehoi")) = p04_IO_output_beforeFix("2005",regi,"seliqbio","fehoi","tdbiohoi") - * ( pm_fedemand("2005",regi,"feli_otherInd") - + pm_fedemand("2005",regi,"feli_cement") - + pm_fedemand("2005",regi,"feli_steel") - + pm_fedemand("2005",regi,"feli_chemicals")) + * ( pm_fedemandInd("2005",regi,"feli_otherInd") + + pm_fedemandInd("2005",regi,"feli_cement") + + pm_fedemandInd("2005",regi,"feli_steel") + + pm_fedemandInd("2005",regi,"feli_chemicals")) / p04_IO_output_beforeFix_Total("2005",regi,"fehoi"); f04_IO_output("2005",regi,"seliqfos","fehoi","tdfoshoi")$(p04_IO_output_beforeFix_Total("2005",regi,"fehoi")) = p04_IO_output_beforeFix("2005",regi,"seliqfos","fehoi","tdfoshoi") - * ( pm_fedemand("2005",regi,"feli_otherInd") - + pm_fedemand("2005",regi,"feli_cement") - + pm_fedemand("2005",regi,"feli_steel") - + pm_fedemand("2005",regi,"feli_chemicals")) + * ( pm_fedemandInd("2005",regi,"feli_otherInd") + + pm_fedemandInd("2005",regi,"feli_cement") + + pm_fedemandInd("2005",regi,"feli_steel") + + pm_fedemandInd("2005",regi,"feli_chemicals")) / p04_IO_output_beforeFix_Total("2005",regi,"fehoi"); *** industry gases @@ -137,18 +137,18 @@ p04_IO_output_beforeFix_Total(t,regi,"fegai") = p04_IO_output_beforeFix(t,regi," f04_IO_output("2005",regi,"segabio","fegai","tdbiogai")$(p04_IO_output_beforeFix_Total("2005",regi,"fegai")) = p04_IO_output_beforeFix("2005",regi,"segabio","fegai","tdbiogai") - * ( pm_fedemand("2005",regi,"fega_otherInd") - + pm_fedemand("2005",regi,"fega_cement") - + pm_fedemand("2005",regi,"fega_steel") - + pm_fedemand("2005",regi,"fega_chemicals")) + * ( pm_fedemandInd("2005",regi,"fega_otherInd") + + pm_fedemandInd("2005",regi,"fega_cement") + + pm_fedemandInd("2005",regi,"fega_steel") + + pm_fedemandInd("2005",regi,"fega_chemicals")) / p04_IO_output_beforeFix_Total("2005",regi,"fegai"); f04_IO_output("2005",regi,"segafos","fegai","tdfosgai")$(p04_IO_output_beforeFix_Total("2005",regi,"fegai")) = p04_IO_output_beforeFix("2005",regi,"segafos","fegai","tdfosgai") - * ( pm_fedemand("2005",regi,"fega_otherInd") - + pm_fedemand("2005",regi,"fega_cement") - + pm_fedemand("2005",regi,"fega_steel") - + pm_fedemand("2005",regi,"fega_chemicals")) + * ( pm_fedemandInd("2005",regi,"fega_otherInd") + + pm_fedemandInd("2005",regi,"fega_cement") + + pm_fedemandInd("2005",regi,"fega_steel") + + pm_fedemandInd("2005",regi,"fega_chemicals")) / p04_IO_output_beforeFix_Total("2005",regi,"fegai"); @@ -158,7 +158,7 @@ p04_IO_output_beforeFix_Total(t,regi,"fehei") = p04_IO_output_beforeFix(t,regi," f04_IO_output("2005",regi,"sehe","fehei","tdhei")$(p04_IO_output_beforeFix_Total("2005",regi,"fehei")) = p04_IO_output_beforeFix("2005",regi,"sehe","fehei","tdhei") - * ( pm_fedemand("2005",regi,"fehe_otherInd") + * ( pm_fedemandInd("2005",regi,"fehe_otherInd") ) / p04_IO_output_beforeFix_Total("2005",regi,"fehei"); diff --git a/modules/04_PE_FE_parameters/iea2014/declarations.gms b/modules/04_PE_FE_parameters/iea2014/declarations.gms index fc903823eb..8422706070 100644 --- a/modules/04_PE_FE_parameters/iea2014/declarations.gms +++ b/modules/04_PE_FE_parameters/iea2014/declarations.gms @@ -7,7 +7,7 @@ *** SOF ./modules/04_PE_FE_parameters/iea2014/declarations.gms parameter -pm_IO_input(all_regi,all_enty,all_enty,all_te) "Energy input based on IEA data" +pm_IO_input(all_regi,all_enty,all_enty,all_te) "Energy input based on IEA data [TWa]" pm_IO_output(tall,all_regi,all_enty,all_enty,all_te) "Historical energy output per technology based on IEA data [TWa]" p04_IO_output(all_regi,all_enty,all_enty,all_te) "Energy output based on IEA data" p04_x_enty2te_dyn04(all_regi,all_enty,all_enty,all_te,all_te) "parameter for the allocation of energy flow to technologies" diff --git a/modules/29_CES_parameters/calibrate/datainput.gms b/modules/29_CES_parameters/calibrate/datainput.gms index 361ab61eb7..b2dfdcbfad 100644 --- a/modules/29_CES_parameters/calibrate/datainput.gms +++ b/modules/29_CES_parameters/calibrate/datainput.gms @@ -144,7 +144,7 @@ ipf_beyond_last(out) = YES; *** End of Sets calculation Parameter -p29_trpdemand "transport demand" +p29_fedemandTransp "transport demand" / $ondelim $include "./modules/29_CES_parameters/calibrate/input/f29_trpdemand.cs4r" @@ -178,7 +178,8 @@ loop ((ttot,regi,ppfKap_industry_dyn37(in))$( t(ttot-1) AND t(ttot+1) ), ); ); -display pm_fedemand; +display pm_fedemandInd; +display pm_fedemandBuild; *** Change PPP for MER. p29_capitalQuantity(tall,all_regi,all_in) @@ -213,28 +214,29 @@ Execute_Loadpoint 'input' vm_deltaCap; *** Load exogenous Labour, GDP pm_cesdata(t,regi,"inco","quantity") = pm_gdp(t,regi); pm_cesdata(t,regi,"lab","quantity") = pm_lab(t,regi); -*** Load exogenous FE trajectories -*** Change EJ to TWa - -pm_cesdata(t,regi,in,"quantity")$(pm_fedemand(t,regi,in)) = -$ifthen.industry_subsectors "%industry%" == "subsectors" - pm_fedemand(t,regi,in)$(industry_ue_calibration_target_dyn37(in)) - + - sm_EJ_2_TWa * pm_fedemand(t,regi,in)$(NOT industry_ue_calibration_target_dyn37(in)); -$else.industry_subsectors - sm_EJ_2_TWa * pm_fedemand(t,regi,in) -$endif.industry_subsectors + +*** Load exogenous FE trajectories for buildings and industry +*** Convert EJ to TWa + +pm_cesdata(t,regi,in,"quantity")$(pm_fedemandBuild(t,regi,in)) = sm_EJ_2_TWa * pm_fedemandBuild(t,regi,in); + + +*** Only convert FEs from EJ to TWa, for UEs keep original units +pm_cesdata(t,regi,in,"quantity")$(pm_fedemandInd(t,regi,in)) = + pm_fedemandInd(t,regi,in)$(industry_ue_calibration_target_dyn37(in)) + + sm_EJ_2_TWa * pm_fedemandInd(t,regi,in)$(NOT industry_ue_calibration_target_dyn37(in)); *** Load exogenous transport demand - required for the EDGE transport module -$ifthen.edgesm %transport% == "edge_esm" -pm_cesdata(t,regi,in,"quantity") $ p29_trpdemand(t,regi,"%cm_GDPpopScen%","%cm_demScen%","%cm_EDGEtr_scen%", in) - = p29_trpdemand(t,regi,"%cm_GDPpopScen%","%cm_demScen%","%cm_EDGEtr_scen%", in); -$endif.edgesm +pm_cesdata(t,regi,in,"quantity")$p29_fedemandTransp(t,regi,"%cm_GDPpopScen%","%cm_demScen%","%cm_EDGEtr_scen%", in) + = p29_fedemandTransp(t,regi,"%cm_GDPpopScen%","%cm_demScen%","%cm_EDGEtr_scen%", in); *** Load capital quantities pm_cesdata(t,regi,ppfKap,"quantity") = p29_capitalQuantity(t,regi,ppfKap); -$ifthen.subsectors "%industry%" == "subsectors" + +*** TODO: move to input data generation +*** TODO: unify handling of offset_quantity accross all sectors? + *** Assume fehe_otherInd at 0.1% of fega_otherInd for regions with zero *** fehe_otherInd in historic periods (IND, LAM, MEA, SSA) loop ((t_29hist(t),regi_dyn29(regi))$( @@ -272,15 +274,8 @@ loop (pf_quantity_shares_37(in,in2), pm_cesdata(t,regi,in,"offset_quantity") eq 0 ) = -pm_cesdata(t,regi,in,"quantity"); ); -$endif.subsectors -$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 -*loop ((t,regi)$(pm_cesdata(t,regi,"feh2b","quantity") lt (0.05 *pm_cesdata(t,regi,"fegab","quantity"))), -* pm_cesdata(t,regi,"feh2b","offset_quantity") = - (0.05 * pm_cesdata(t,regi,"fegab","quantity") - pm_cesdata(t,regi,"feh2b","quantity")); -* pm_cesdata(t,regi,"feh2b","quantity") = 0.05 * pm_cesdata(t,regi,"fegab","quantity"); -*); *** RK: feh2b offset scaled from 1% in 2025 to 50% in 2050 of fegab quantity pm_cesdata(t,regi,"feh2b","offset_quantity")$(t.val gt cm_H2InBuildOnlyAfter) = @@ -291,11 +286,14 @@ pm_cesdata(t,regi,"feh2b","quantity")$(t.val gt cm_H2InBuildOnlyAfter) = (0.05 + 0.45 * min(1, max(0, (t.val - 2025) / (2050 - 2025)))) * pm_cesdata(t,regi,"fegab","quantity"); + +*** end TODO + + *** for the years that H2 buildings is fixed to zero, set offset to the exact value of the calibrated quantity to ignore it after calibration pm_cesdata(t,regi,"feh2b","quantity")$(t.val le cm_H2InBuildOnlyAfter) = 1e-6; pm_cesdata(t,regi,"feh2b","offset_quantity")$(t.val le cm_H2InBuildOnlyAfter) = - pm_cesdata(t,regi,"feh2b","quantity"); -$endif.build_H2_offset *** Add an epsilon to the values which are 0 so that they can fit in the CES *** function. And withdraw this epsilon when going to the ESM side diff --git a/modules/29_CES_parameters/calibrate/declarations.gms b/modules/29_CES_parameters/calibrate/declarations.gms index 7620151661..b6609db80e 100644 --- a/modules/29_CES_parameters/calibrate/declarations.gms +++ b/modules/29_CES_parameters/calibrate/declarations.gms @@ -13,23 +13,23 @@ Scalars Parameters p29_CESderivative(tall,all_regi,all_in,all_in) "derivative of the CES function for calculating prices" - p29_alpha(all_regi,all_in) "XXX" - p29_beta(all_regi,all_in) "XXX" + p29_alpha(all_regi,all_in) "XXX" + p29_beta(all_regi,all_in) "XXX" p29_cesdata_load(tall,all_regi,all_in,cesParameter) "pm_cesdata from the gdx file" - p29_cesIO_load(tall,all_regi,all_in) "production factor vm_cesIO from input.gdx" - p29_effGr(tall,all_regi,all_in) "growth of factor efficiency from input.gdx" - p29_trpdemand(tall,all_regi,all_GDPpopScen,all_demScen,EDGE_scenario_all,all_in) "transport demand for the edge_esm transport module, unit: trillion passenger/ton km" - p29_efficiency_growth(tall,all_regi,all_in) "efficency level paths for ppf beyond calibration" + p29_cesIO_load(tall,all_regi,all_in) "production factor vm_cesIO from input.gdx" + p29_effGr(tall,all_regi,all_in) "growth of factor efficiency from input.gdx" + p29_fedemandTransp(tall,all_regi,all_GDPpopScen,all_demScen,EDGE_scenario_all,all_in) "transport demand for the edge_esm transport module [trillion passenger/ton km]" + p29_efficiency_growth(tall,all_regi,all_in) "efficency level paths for ppf beyond calibration" p29_capitalQuantity(tall,all_regi,all_in) "capital quantities" - p29_capitalPrice(tall,all_regi) "capital prices" + p29_capitalPrice(tall,all_regi) "capital prices" - p29_test_CES_recursive(tall,all_regi,all_in) "test the technological consistency of pm_cesdata" + p29_test_CES_recursive(tall,all_regi,all_in) "test the technological consistency of pm_cesdata" - p29_esubGrowth "long term growth of the elasticity of substitution" + p29_esubGrowth "long term growth of the elasticity of substitution" - p29_t_tmp(tall) "tmp value for calculations over t" + p29_t_tmp(tall) "tmp value for calculations over t" - p29_share_H2HTH_traj_indst(ttot,all_regi,all_in) "H2 and electricity HTH baseline trajectories as share of gas (for H2) and low-temperature electricity (for HTH electricity) trajectories in industry" + p29_share_H2HTH_traj_indst(ttot,all_regi,all_in) "H2 and electricity HTH baseline trajectories as share of gas (for H2) and low-temperature electricity (for HTH electricity) trajectories in industry" ; *** Load calibration iteration number from environment variable diff --git a/modules/29_CES_parameters/calibrate/preloop.gms b/modules/29_CES_parameters/calibrate/preloop.gms index b74642df9f..9eb0e335f5 100644 --- a/modules/29_CES_parameters/calibrate/preloop.gms +++ b/modules/29_CES_parameters/calibrate/preloop.gms @@ -312,7 +312,6 @@ Display p29_alpha, p29_beta; *** for entrp_frgt_lo (energy transport - freight transport - long distance) *** pass on to pm_cesdata and ensure the resulting price is positive -$ifthen.edge_esm %transport% == "edge_esm" loop (ttot$( ttot.val ge 2005 AND ttot.val lt 2020 ), pm_cesdata(ttot,regi_dyn29(regi),"entrp_frgt_lo","price") @@ -337,8 +336,6 @@ loop (ttot$( ttot.val ge 2005), display "after entrp_frgt_lo smoothening", pm_cesdata; -$endif.edge_esm - *** for all other modes *** pass on to pm_cesdata and ensure the resulting price is positive loop (ttot$( ttot.val ge 2005 AND ttot.val lt 2020), @@ -399,7 +396,6 @@ if (sm_CES_calibration_iteration eq 1, !! first CES calibration iteration put pm_cesdata(t,regi,in,"quantity") /; ); -$ifthen.subsectors "%industry%" == "subsectors" $ifthen.industry_FE_target "%c_CES_calibration_industry_FE_target%" == "1" loop((t_29scen(t),regi_dyn29(regi),in)$( ppfen_industry_dyn37(in) OR ppfKap_industry_dyn37(in) ), @@ -407,7 +403,6 @@ $ifthen.industry_FE_target "%c_CES_calibration_industry_FE_target%" == "1" put pm_cesdata(t,regi,in,"quantity") /; ); $endif.industry_FE_target -$endif.subsectors putclose file_CES_calibration; ); @@ -723,13 +718,11 @@ if (card(ppf_beyondcalib_29) >= 1, !! if there are any nodes in beyond calib = p29_CESderivative(t,regi,out,in); ); -$ifthen.subsectors "%industry%" == "subsectors" $ifthen.FE_target "%c_CES_calibration_industry_FE_target%" == "1" !! c_CES_calibration_industry_FE_target !! set minimum price on ppf_industry pm_cesdata(t,regi_dyn29(regi),ppf_industry_dyn37(in),"price")$(NOT ue_industry_dyn37(in)) = max(pm_cesdata(t,regi,in,"price"), 1e-5); $endif.FE_target -$endif.subsectors !! smooth historical prices pm_cesdata(t_29hist(t),regi_dyn29(regi),in,"price")$( @@ -915,7 +908,6 @@ loop ((t_29hist_last(t2),regi_dyn29(regi),cesOut2cesIn(out,in))$( ***_____________________________ START OF: BEYOND CALIBRATION PART II ________________________________________ -$ifthen.subsectors "%industry%" == "subsectors" $ifthen.industry_FE_target "%c_CES_calibration_industry_FE_target%" == "1" *** c_CES_calibration_industry_FE_target == 1 means that @@ -1123,7 +1115,7 @@ loop (cesOut2cesIn(in_industry_dyn37(out),in)$( ); ); $endif.industry_FE_target -$endif.subsectors + ***_____________________________ END OF: BEYOND CALIBRATION PART II ________________________________________ @@ -1294,7 +1286,6 @@ loop ((ttot(t),regi_dyn29(regi),industry_ue_calibration_target_dyn37(out))$( ); ); -$ifthen.subsectors "%industry%" == "subsectors" !! subsectors if (sm_tmp eq 1, put logfile, "Assertion of industry energy limits failed: " /; loop ((regi_dyn29(regi),ttot(t),industry_ue_calibration_target_dyn37(out))$( @@ -1318,6 +1309,5 @@ if (sm_tmp eq 1, execute_unload "abort.gdx"; abort "Assertion of industry energy limits failed. See .log file for details."; ); -$endif.subsectors *** EOF ./modules/29_CES_parameters/calibrate/preloop.gms diff --git a/modules/29_CES_parameters/load/not_used.txt b/modules/29_CES_parameters/load/not_used.txt index c5a27b58b4..50214f04db 100644 --- a/modules/29_CES_parameters/load/not_used.txt +++ b/modules/29_CES_parameters/load/not_used.txt @@ -19,8 +19,9 @@ sm_tmp2,input,questionnaire pm_ttot_val,input,questionnaire pm_ue_eff_target,parameter,not needed pm_calibrate_eff_scale,parameter,not needed -pm_fedemand,parameter,not needed +pm_fedemandInd,parameter,not needed +pm_fedemandBuild,parameter,not needed pm_energy_limit,, sm_CES_calibration_iteration,scalar,only applicable during calibration cm_H2InBuildOnlyAfter,parameter,??? -p29_building_relaxed_bounds_dyn,set,not needed \ No newline at end of file +p29_building_relaxed_bounds_dyn,set,not needed diff --git a/modules/36_buildings/simple/input/files b/modules/36_buildings/simple/input/files index 8b218bfc09..6a2fd313d3 100644 --- a/modules/36_buildings/simple/input/files +++ b/modules/36_buildings/simple/input/files @@ -1,3 +1,2 @@ f36_floorspace_scen.cs4r f36_uedemand_build.cs4r -f_fedemand_build.cs4r diff --git a/modules/37_industry/subsectors/bounds.gms b/modules/37_industry/subsectors/bounds.gms index a79cea8242..2d3e1a1292 100755 --- a/modules/37_industry/subsectors/bounds.gms +++ b/modules/37_industry/subsectors/bounds.gms @@ -28,13 +28,13 @@ $ifthen.rcp_scen "%cm_rcp_scen%" == "none" !! available for increased production. vm_cesIO.up(t,regi,"ue_steel_secondary") = ( ( p37_cesIO_up_steel_secondary(t,regi,"%cm_GDPpopScen%") - / pm_fedemand(t,regi,"ue_steel_secondary") + / pm_fedemandInd(t,regi,"ue_steel_secondary") - 1 ) / 10 + 1 ) - * pm_fedemand(t,regi,"ue_steel_secondary"); + * pm_fedemandInd(t,regi,"ue_steel_secondary"); $elseif.rcp_scen "%cm_rcp_scen%" == "rcp85" !! In no-policy scenarios, tight bounds representing usual scrap recycling !! rates apply. Only 10% of the difference between projected secondary @@ -42,13 +42,13 @@ $elseif.rcp_scen "%cm_rcp_scen%" == "rcp85" !! available for increased production. vm_cesIO.up(t,regi,"ue_steel_secondary") = ( ( p37_cesIO_up_steel_secondary(t,regi,"%cm_GDPpopScen%") - / pm_fedemand(t,regi,"ue_steel_secondary") + / pm_fedemandInd(t,regi,"ue_steel_secondary") - 1 ) / 10 + 1 ) - * pm_fedemand(t,regi,"ue_steel_secondary"); + * pm_fedemandInd(t,regi,"ue_steel_secondary"); $elseif.rcp_scen "%cm_rcp_scen%" == "rcp60" !! In no-policy scenarios, tight bounds representing usual scrap recycling !! rates apply. Only 10% of the difference between projected secondary @@ -56,13 +56,13 @@ $elseif.rcp_scen "%cm_rcp_scen%" == "rcp60" !! available for increased production. vm_cesIO.up(t,regi,"ue_steel_secondary") = ( ( p37_cesIO_up_steel_secondary(t,regi,"%cm_GDPpopScen%") - / pm_fedemand(t,regi,"ue_steel_secondary") + / pm_fedemandInd(t,regi,"ue_steel_secondary") - 1 ) / 10 + 1 ) - * pm_fedemand(t,regi,"ue_steel_secondary"); + * pm_fedemandInd(t,regi,"ue_steel_secondary"); $elseif.rcp_scen "%cm_rcp_scen%" == "rcp45" !! In no-policy scenarios, tight bounds representing usual scrap recycling !! rates apply. Only 10% of the difference between projected secondary @@ -70,13 +70,13 @@ $elseif.rcp_scen "%cm_rcp_scen%" == "rcp45" !! available for increased production. vm_cesIO.up(t,regi,"ue_steel_secondary") = ( ( p37_cesIO_up_steel_secondary(t,regi,"%cm_GDPpopScen%") - / pm_fedemand(t,regi,"ue_steel_secondary") + / pm_fedemandInd(t,regi,"ue_steel_secondary") - 1 ) / 10 + 1 ) - * pm_fedemand(t,regi,"ue_steel_secondary"); + * pm_fedemandInd(t,regi,"ue_steel_secondary"); $else.rcp_scen !! In policy scenarios, secondary steel production can be increased up to the !! limit of theoretical scrap availability. diff --git a/modules/37_industry/subsectors/datainput.gms b/modules/37_industry/subsectors/datainput.gms index 846c997526..d4b12db7d0 100644 --- a/modules/37_industry/subsectors/datainput.gms +++ b/modules/37_industry/subsectors/datainput.gms @@ -276,7 +276,7 @@ emiMac2mac("co2otherInd","co2otherInd") = NO; *** data on maximum secondary steel production *** The steel recycling rate limit is assumed to increase from 90 to 99 %. p37_cesIO_up_steel_secondary(tall,all_regi,all_GDPpopScen) - = pm_fedemand(tall,all_regi,"ue_steel_secondary") + = pm_fedemandInd(tall,all_regi,"ue_steel_secondary") / 0.9 * 0.99; @@ -803,7 +803,7 @@ if (cm_startyear eq 2005, !! 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); + p37_matFlowHist(ttot,regi,mat) = pm_fedemandInd(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); ); @@ -824,7 +824,7 @@ if (cm_startyear eq 2005, 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); + p37_demFeActual(ttot,regi,entyFe,ppfUePrc) = sum((fe2ppfen_no_ces_use(entyFe,all_in),ue2ppfenPrc(ppfUePrc,all_in)), pm_fedemandInd(ttot,regi,all_in) * sm_EJ_2_TWa); ); p37_demFeRatio(ttot,regi,ppfUePrc) = sum(entyFe,p37_demFeActual(ttot,regi,entyFe,ppfUePrc)) / sum(entyFe,p37_demFeTarget(ttot,regi,entyFe,ppfUePrc)); diff --git a/modules/37_industry/subsectors/realization.gms b/modules/37_industry/subsectors/realization.gms index bd620d73e9..0620415ab8 100644 --- a/modules/37_industry/subsectors/realization.gms +++ b/modules/37_industry/subsectors/realization.gms @@ -29,7 +29,7 @@ *' q_costOM; techno-economic data is input via generisdata_tech.prn *' - Specific FE demands (arbitrary number of inputs) are used instead of one efficiency eta *' - For historically exisitng tech, specific energy demand follows exogenous convergence from -*' historical values (via pm_fedemand) to the best available technology (BAT) +*' historical values (via pm_fedemandInd) to the best available technology (BAT) *' - For "new" tech, temporally constant BAT values are assumed for energy efficiency *' - Technologies have specific material demands. Materials can be model-external (e.g. iron ore) *' or outputs of other processes (e.g. DRI); This allows to have process routes consiting of diff --git a/modules/37_industry/subsectors/sets.gms b/modules/37_industry/subsectors/sets.gms index 85fc3c3195..c95bb5d113 100644 --- a/modules/37_industry/subsectors/sets.gms +++ b/modules/37_industry/subsectors/sets.gms @@ -448,7 +448,7 @@ $ifthen.cm_subsec_model_steel "%cm_subsec_model_steel%" == "processes" $endif.cm_subsec_model_steel / -ppfen_no_ces_use(all_in) "FE nodes of all_in that are not part of the CES tree in the process-based industry model; Needed for pm_fedemand data input" +ppfen_no_ces_use(all_in) "FE nodes of all_in that are not part of the CES tree in the process-based industry model; Needed for pm_fedemandInd data input" / $ifthen.cm_subsec_model_steel "%cm_subsec_model_steel%" == "processes" feso_steel diff --git a/tutorials/12_Calibrating_CES_Parameters.md b/tutorials/12_Calibrating_CES_Parameters.md index 6b1da20070..379c5f2e90 100644 --- a/tutorials/12_Calibrating_CES_Parameters.md +++ b/tutorials/12_Calibrating_CES_Parameters.md @@ -76,7 +76,8 @@ For the calibration process to work, we need both: - `./core/input/f_gdp.cs3r` - `./core/input/f_pop.cs3r` - `./modules/29_CES_parameters/calibrate/input/f29_capitalQuantity.cs4r` - - `./core/input/f_fedemand.cs4r` + - `./core/input/f_fedemandBuild.cs4r` + - `./core/input/f_fedemandInd.cs4r` 2. Prices of `ppf` at the previous iteration. They are calculated using the `input.gdx` provided to the calibration run. User intervention is only required when prices cannot be derived from the `.gdx` @@ -214,8 +215,9 @@ observed problems and suggested solutions. This can happen in new or modified scenario (`GDPscen`, `POPscen`) where the data is missing entirely. Otherwise, check the input files (`./core/input/f_gdp.cs3r`, `./core/input/f_pop.cs3r`, - `./modules/29_CES_parameters/calibrate/input/f29_capitalQuantity.cs4r`, and - `./core/input/f_fedemand.cs4r`) to figure out which data is missing and fix it. + `./modules/29_CES_parameters/calibrate/input/f29_capitalQuantity.cs4r`, + `./core/input/f_fedemandBuild.cs4r` and `./core/input/f_fedemandInd.cs4r`) to + figure out which data is missing and fix it. #### $\xi \lt 0$ This error (_assertion xi gt 0 failed, see .log file for details_) should not