Skip to content

Commit

Permalink
Merge pull request #1941 from fbenke-pik/refactor
Browse files Browse the repository at this point in the history
Remove industry/fixed_shares
  • Loading branch information
fbenke-pik authored Jan 23, 2025
2 parents 7cc3250 + 48c78eb commit 20afc76
Show file tree
Hide file tree
Showing 44 changed files with 221 additions and 1,524 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
-

### removed
-
- **37_industry** removed superseded realization fixed_shares [[#1941]](https://github.com/remindmodel/remind/pull/1941)

### fixed
-
Expand Down
2 changes: 1 addition & 1 deletion config/default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ cfg$regionmapping <- "config/regionmappingH12.csv"
cfg$extramappings_historic <- ""

#### Current input data revision (<mainrevision>.<subrevision>) ####
cfg$inputRevision <- "7.21"
cfg$inputRevision <- "7.22"

#### Current CES parameter and GDX revision (commit hash) ####
cfg$CESandGDXversion <- "6ae8dd43a7707867df312d16f7e1b6b784cf6614"
Expand Down
2 changes: 1 addition & 1 deletion config/tests/scenario_config_quick.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
title;start;cm_nash_mode;cm_iteration_max;optimization;results_folder;output;cm_quick_mode;force_replace;slurmConfig
testOneRegi;1;1;1;testOneRegi;output/testOneRegi;reportingREMIND2MAgPIE;on;TRUE;--qos=priority --nodes=1 --tasks-per-node=1 --mem=8000 --time=60 --wait
testOneRegi;1;1;1;testOneRegi;output/testOneRegi;reportingREMIND2MAgPIE;off;TRUE;--qos=priority --nodes=1 --tasks-per-node=1 --mem=8000 --time=60 --wait
22 changes: 0 additions & 22 deletions core/bounds.gms
Original file line number Diff line number Diff line change
Expand Up @@ -509,28 +509,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
45 changes: 17 additions & 28 deletions core/datainput.gms
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ pm_shGasLiq_fe_lo(ttot,regi,sector)=0;
*------------------------------------------------------------------------------------
*** Technology data input read-in and manipulation START
*------------------------------------------------------------------------------------
*** In module 5 there are more cost manipulation after initial capacities are calculated,
*** In module 5 there are more cost manipulation after initial capacities are calculated,
*** be aware those can overwrite your technology values for policy runs if you set them here in the core
***---------------------------------------------------------------------------
*** Reading in and initializing global data
Expand All @@ -143,8 +143,8 @@ $include "./core/input/generisdata_tech.prn"
$include "./core/input/generisdata_trade.prn"
;

*** CG warning: some of the SSP1 and SSP5 costs are not consistent with the story line (e.g. under SSP1 blue H2 and some fossil fuel CCS technologies have lower costs than in SSP2).
*** This is to be fixed in the future when new SSP storylines are implemented, unclear when (29-1-2024).
*** CG warning: some of the SSP1 and SSP5 costs are not consistent with the story line (e.g. under SSP1 blue H2 and some fossil fuel CCS technologies have lower costs than in SSP2).
*** This is to be fixed in the future when new SSP storylines are implemented, unclear when (29-1-2024).
*** In the future, SSP1 and SSP5 data should be implemented as switches to avoid errors
table f_dataglob_SSP1(char,all_te) "Techno-economic assumptions consistent with SSP1"
$include "./core/input/generisdata_tech_SSP1.prn"
Expand Down Expand Up @@ -237,7 +237,7 @@ $offdelim
;

*** windoffshore-todo
*** allow input data with either "wind" or "windon" until mrremind is updated
*** allow input data with either "wind" or "windon" until mrremind is updated
p_inco0(ttot,all_regi,"windon") $ (p_inco0(ttot,all_regi,"windon") eq 0) = p_inco0(ttot,all_regi,"wind");
p_inco0(ttot,all_regi,"wind") = 0;

Expand Down Expand Up @@ -516,13 +516,6 @@ $offdelim
/
;

parameter pm_share_ind_fehos(tall,all_regi) "Share of heating oil used in the industry (rest is residential)"
/
$ondelim
$include "./core/input/p_share_ind_fehos.cs4r"
$offdelim
/
;
*** initialize pm_share_trans with the global value, will be updated after each negishi/nash iteration
pm_share_trans("2005",regi) = 0.617;
pm_share_trans("2010",regi) = 0.625;
Expand Down Expand Up @@ -685,8 +678,8 @@ $offdelim
;
$Onlisting

*** windoffshore-todo
*** allow input data with either "wind" or "windon" until mrremind is updated
*** windoffshore-todo
*** allow input data with either "wind" or "windon" until mrremind is updated
pm_histCap(tall,all_regi,"windon") $ (pm_histCap(tall,all_regi,"windon") eq 0) = pm_histCap(tall,all_regi,"wind");
pm_histCap(tall,all_regi,"wind") = 0;

Expand Down Expand Up @@ -714,8 +707,8 @@ $Onlisting


*CG* setting wind offshore capacity factor to be the same as onshore here (later adjusting it in vm_capFac)
*** windoffshore-todo
*** allow input data with either "wind" or "windon" until mrremind is updated
*** windoffshore-todo
*** allow input data with either "wind" or "windon" until mrremind is updated
f_cf(ttot,regi,"windon") $ (f_cf(ttot,regi,"windon") eq 0) = f_cf(ttot,regi,"wind");
f_cf(ttot,regi,"storwindon") $ (f_cf(ttot,regi,"storwindon") eq 0) = f_cf(ttot,regi,"storwind");
f_cf(ttot,regi,"gridwindon") $ (f_cf(ttot,regi,"gridwindon") eq 0) = f_cf(ttot,regi,"gridwind");
Expand Down Expand Up @@ -1073,7 +1066,7 @@ loop(regi,
if(s_aux_cap_remaining > 0,
p_aux_capThisGrade(regi,te,rlf) = min(
s_aux_cap_remaining,
0.8 * pm_dataren(regi,"maxprod",rlf,te) / pm_dataren(regi,"nur",rlf,te)); !! installedCapacity = maxprod / capacityFactor
0.8 * pm_dataren(regi,"maxprod",rlf,te) / pm_dataren(regi,"nur",rlf,te)); !! installedCapacity = maxprod / capacityFactor
s_aux_cap_remaining = s_aux_cap_remaining - p_aux_capThisGrade(regi,te,rlf);
);
); !! teRe2rlfDetail
Expand All @@ -1083,7 +1076,7 @@ loop(regi,
p_avCapFac2015(regi,te) =
sum(teRe2rlfDetail(te,rlf),
p_aux_capThisGrade(regi,te,rlf) * pm_dataren(regi,"nur",rlf,te))
/
/
(sum(teRe2rlfDetail(te,rlf), p_aux_capThisGrade(regi,te,rlf))
+ 1e-10)
); !! teReNoBio
Expand All @@ -1102,7 +1095,7 @@ $offdelim
;

*** windoffshore-todo
*** allow input data with either "wind" or "windon" until mrremind is updated
*** allow input data with either "wind" or "windon" until mrremind is updated
p_histCapFac(tall,all_regi,"windon") $ (p_histCapFac(tall,all_regi,"windon") eq 0) = p_histCapFac(tall,all_regi,"wind");
p_histCapFac(tall,all_regi,"wind") = 0;

Expand All @@ -1121,7 +1114,7 @@ loop(t $ (t.val ge 2015 AND t.val lt 2030),
pm_cf(t,regi,teVRE) !! always 1 for VRE in f_cf, but could be modified by modules
* ( (2030 - pm_ttot_val(t)) * p_aux_capacityFactorHistOverREMIND(regi,teVRE)
+ (pm_ttot_val(t) - 2015)
) / (2030 - 2015)
) / (2030 - 2015)
);

*CG* set storage and grid of windoff to be the same as windon
Expand Down Expand Up @@ -1176,7 +1169,7 @@ $offdelim
p_adj_deltacapoffset("2015",regi,"tnrs")= 1;

*** windoffshore-todo
*** allow input data with either "wind" or "windon" until mrremind is updated
*** allow input data with either "wind" or "windon" until mrremind is updated
p_adj_deltacapoffset(t,regi,"windon") $ (p_adj_deltacapoffset(t,regi,"windon") eq 0) = p_adj_deltacapoffset(t,regi,"wind");
p_adj_deltacapoffset(t,regi,"windoff")= p_adj_deltacapoffset(t,regi,"windon");
p_adj_deltacapoffset(t,regi,"wind") = 0;
Expand Down Expand Up @@ -1244,7 +1237,7 @@ $endif.cm_subsec_model_steel
p_adj_coeff(ttot,regi,'oae_el') = 0.8;
p_adj_coeff(ttot,regi,teGrid) = 0.3;
p_adj_coeff(ttot,regi,teStor) = 0.05;

p_adj_coeff(ttot,regi,"MeOH") = 0.5;
p_adj_coeff(ttot,regi,"h22ch4") = 0.5;

Expand Down Expand Up @@ -1384,18 +1377,14 @@ $if %cm_MAgPIE_coupling% == "off" pm_macSwitch("co2luc") = 0;
*** The tiny fraction n2ofertsom of total land use n2o can get slightly negative in some cases. Ignore MAC for n2ofertsom by default.
$if %cm_MAgPIE_coupling% == "off" pm_macSwitch("n2ofertsom") = 0;

pm_macCostSwitch(enty)=pm_macSwitch(enty);
p_macCostSwitch(enty)=pm_macSwitch(enty);
pm_macSwitch("co2cement_process") =0 ;
pm_macCostSwitch("co2cement_process") =0 ;
p_macCostSwitch("co2cement_process") =0 ;

*** load econometric emission data
*** read in p3 and p4
table p_emineg_econometric(all_regi,all_enty,p) "parameters for ch4 and n2o emissions from waste baseline and co2 emissions from cement production"
$ondelim
$include "./core/input/p_emineg_econometric.cs3r"
$offdelim
parameter p_emineg_econometric(all_regi,all_enty,p) "parameters for ch4 and n2o emissions from waste baseline and co2 emissions from cement production"
;
p_emineg_econometric(regi,"co2cement_process","p4")$(p_emineg_econometric(regi,"co2cement_process","p4") eq 0) = sm_eps;
p_emineg_econometric(regi,enty,"p1") = 0;
p_emineg_econometric(regi,enty,"p2") = 0;
*** p2 is calculated in presolve
Expand Down
20 changes: 9 additions & 11 deletions core/declarations.gms
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ p_developmentState(tall,all_regi) "level of development based
f_lab(tall,all_regi,all_POPscen) "labour data for all possible scenarios"
pm_lab(tall,all_regi) "data for labour [bn people]"
pm_esCapCost(tall,all_regi,all_teEs) "Capital energy cost per unit of consumption for end-use capital (energy service layer)"
*** If elasticities of substitution (sigma) is below 1, the smaller it is the less the substitution replacement effect between different CES nodes.
*** The products become more and more complementary in the production, meaning that the more one product is used, the more the other one is demanded as well.
*** If elasticities of substitution (sigma) is below 1, the smaller it is the less the substitution replacement effect between different CES nodes.
*** The products become more and more complementary in the production, meaning that the more one product is used, the more the other one is demanded as well.
*** If sigma is larger than 1, the more one product is used, the less the others are used, i.e. the products are substitutes"
pm_cesdata_sigma(ttot,all_in) "elasticities of substitution."
pm_cesdata_sigma(ttot,all_in) "elasticities of substitution."
p_r(ttot,all_regi) "calculating capital interest rate"

***----------------------------------------------------------------------------------------
Expand All @@ -66,19 +66,17 @@ p_macLevFree(tall,all_regi,all_enty) "Phase in of zero-cost MAC
pm_macCost(tall,all_regi,all_enty) "abatement costs for all emissions subject to MACCs (type emiMacSector) []"
pm_macStep(tall,all_regi,all_enty) "step number of abatement level [integer]"
pm_macSwitch(all_enty) "switch to include mac option in the code"
pm_macCostSwitch(all_enty) "switch to include mac costs in the code (e.g. in coupled scenarios, we want to include the costs in REMIND, but MAC effects on emissions are calculated in MAgPIE)"
p_macCostSwitch(all_enty) "switch to include mac costs in the code (e.g. in coupled scenarios, we want to include the costs in REMIND, but MAC effects on emissions are calculated in MAgPIE)"
p_priceCO2(tall,all_regi) "carbon price [$/tC]"
pm_priceCO2forMAC(tall,all_regi,all_enty) "carbon price defined for MAC gases [$/tC]"
p_priceCO2forMAC(tall,all_regi,all_enty) "carbon price defined for MAC gases [$/tC]"
p_priceGas(tall,all_regi) "gas price for ch4gas MAC [$/tCeq]"
pm_ResidualCementDemand(tall,all_regi) "reduction in cemend demand (and thus process emissions) due to climate policy [0...1]"
pm_CementAbatementPrice(ttot,all_regi) "CO2 price used during calculation of cement demand reduction [$/tCO2]"
pm_CementDemandReductionCost(tall,all_regi) "cost of reducing cement demand [tn$2005]"
p_ResidualCementDemand(tall,all_regi) "reduction in cemend demand (and thus process emissions) due to climate policy [0...1]"
p_CementAbatementPrice(ttot,all_regi) "CO2 price used during calculation of cement demand reduction [$/tCO2]"
p_macPE(ttot,all_regi,all_enty) "pe from MACs"
pm_shPerm(tall, all_regi) "emission permit shares"
pm_emicapglob(tall) "global emission cap"
p_adj_coeff(ttot,all_regi,all_te) "coefficient for adjustment costs"
p_adj_coeff_glob(all_te) "coefficient for adjustment costs - global scale"
p_switch_cement(ttot,all_regi) "describes an s-curve to provide a smooth switching from the short-term behavior (depending on per capita capital investments) to the long-term behavior (constant per capita emissions) of CO2 emissions from cement production"
p_cint(all_regi,all_enty,all_enty,rlf) "additional emissions of GHG from mining, on top of emissions from combustion"

$IFTHEN.agricult_base_shift not "%c_agricult_base_shift%" == "off"
Expand Down Expand Up @@ -321,7 +319,7 @@ vm_costSubsidizeLearning(ttot,all_regi) "regional cost of subsidy f
vm_dummyBudget(ttot,all_regi) "auxiliary variable that helps to meet permit allocation equation in nash case"
***----------------------------------------------------------------------------------------
***-------------------------------------------------ESM module-----------------------------
vm_macBase(ttot,all_regi,all_enty) "baseline emissions for all emissions subject to MACCs (type emismac)"
v_macBase(ttot,all_regi,all_enty) "baseline emissions for all emissions subject to MACCs (type emismac)"
vm_emiCO2Sector(ttot,all_regi,emi_sectors) "total CO2 emissions from individual sectors [GtC]"
vm_emiTeDetail(ttot,all_regi,all_enty,all_enty,all_te,all_enty) "energy-related emissions per region and technology"
vm_emiTe(ttot,all_regi,all_enty) "total energy-related emissions of each region. [GtC, Mt CH4, Mt N]"
Expand Down Expand Up @@ -429,7 +427,7 @@ vm_changeProdStartyearCost(ttot,all_regi,all_te) "Costs for changing output
vm_demFeForEs(ttot,all_regi,all_enty,all_esty,all_teEs) "Final energy which will be used in the ES layer."

vm_prodEs(ttot,all_regi,all_enty,all_esty,all_teEs) "Energy services (unit determined by conversion factor pm_fe2es)."
vm_transpGDPscale(ttot,all_regi) "dampening factor to align edge-t non-energy transportation costs with historical GDP data"
vm_transpGDPscale(ttot,all_regi) "dampening factor to align edge-t non-energy transportation costs with historical GDP data"

$ifthen.seFeSectorShareDev not "%cm_seFeSectorShareDevMethod%" == "off"
v_penSeFeSectorShare(ttot,all_regi,all_enty,all_enty,emi_sectors,all_emiMkt) "penalty cost for secondary energy share deviation between sectors, for each sector/emiMarket combination"
Expand Down
7 changes: 3 additions & 4 deletions core/equations.gms
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ q_balSe(t,regi,enty2)$( entySe(enty2) AND (NOT (sameas(enty2,"seel"))) )..
*** add (reused gas from waste landfills) to segas to not account for CO2
*** emissions - it comes from biomass
+ ( s_MtCH4_2_TWa
* ( vm_macBase(t,regi,"ch4wstl")
* ( v_macBase(t,regi,"ch4wstl")
- vm_emiMacSector(t,regi,"ch4wstl")
)
)$( sameas(enty2,"segabio") AND t.val gt 2005 )
Expand Down Expand Up @@ -730,7 +730,7 @@ vm_emiCO2Sector(t,regi,sector)
*' The endogenous baselines of non-energy emissions are calculated in the following equation:
***------------------------------------------------------
q_macBase(t,regi,enty)$( emiFuEx(enty) OR sameas(enty,"n2ofertin") ) ..
vm_macBase(t,regi,enty)
v_macBase(t,regi,enty)
=e=
sum(emi2fuel(enty2,enty),
p_efFossilFuelExtr(regi,enty2,enty)
Expand All @@ -749,7 +749,7 @@ q_emiMacSector(t,regi,emiMacSector(enty))..
vm_emiMacSector(t,regi,enty)
=e=

( vm_macBase(t,regi,enty)
( v_macBase(t,regi,enty)
* sum(emiMac2mac(enty,enty2),
1 - (pm_macSwitch(enty) * pm_macAbatLev(t,regi,enty2))
)
Expand Down Expand Up @@ -1003,7 +1003,6 @@ q_costEnergySys(ttot,regi)$( ttot.val ge cm_startyear ) ..
+ v_costInv(ttot,regi)
)
+ sum(emiInd37, vm_IndCCSCost(ttot,regi,emiInd37))
+ pm_CementDemandReductionCost(ttot,regi)
;


Expand Down
2 changes: 0 additions & 2 deletions core/input/files
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ p_boundEmi.cs4r
p_emiFossilFuelExtr.cs4r
f_nechem_emissionFactors.cs4r
f_incinerationShares.cs4r
p_emineg_econometric.cs3r
pm_histCap.cs3r
p_histCapFac.cs4r
p_histEmiMac.cs4r
Expand All @@ -42,7 +41,6 @@ pm_risk_premium.cs4r
pm_shPPPMER.cs4r
p_PE_histCap.cs3r
p_regi_2_MAGICC_regions.cs3r
p_share_ind_fehos.cs4r
p_share_ind_fesos_bio.cs4r
p_share_ind_fesos.cs4r
pm_taxCO2eqHist.cs4r
Loading

0 comments on commit 20afc76

Please sign in to comment.