diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a74f511e0..ee9a1b3e74 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### removed +- **31_fossil** Delete realization `MOFEX` and`cm_MOFEX` switch + [[#2538](https://github.com/remindmodel/remind/pull/2538)] - **scripts** Drop the `gdxrrw`/`gdx` R dependency from REMIND scripts; GDX writes now use `gamstransfer`-based `quitte::write.gdx` [[#2485](https://github.com/remindmodel/remind/pull/2485)] - **core** Remove switch cm_techcosts diff --git a/core/declarations.gms b/core/declarations.gms index 1f1bda9d1e..8634ec14b1 100644 --- a/core/declarations.gms +++ b/core/declarations.gms @@ -491,7 +491,7 @@ q_limitCapFe(ttot,all_regi,all_te) "capacity constraint for q_limitCapFeH2BI(ttot,all_regi,emi_sectors) "capacity limit equation for H2 infrastructure capacities of buildings and industry, needed to avoid switching behavior of H2 between both sectors" *** energy balance equations (energy supply = energy demand) -qm_fuel2pe(ttot,all_regi,all_enty) "balance of primary energy extraction, import and export and production" +q_fuel2pe(ttot,all_regi,all_enty) "balance of primary energy extraction, import and export and production" q_balPe(ttot,all_regi,all_enty) "balance of primary energy (pe)" q_balSe(ttot,all_regi,all_enty) "balance of secondary energy (se)" q_balFe(ttot,all_regi,all_enty,all_enty,all_te) "balance of final energy (fe)" diff --git a/core/equations.gms b/core/equations.gms index 42898f68a0..44f804aa79 100644 --- a/core/equations.gms +++ b/core/equations.gms @@ -376,7 +376,7 @@ qm_deltaCapCumNet(ttot,regi,teLearn)$(ord(ttot) lt card(ttot) AND pm_ttot_val(tt ***--------------------------------------------------------------------------- *ml* reasonable results only for members of peExGrade and peren2rlf30 *NB*110625 changes for transition towards grades -qm_fuel2pe(t,regi,peRicardian(enty)).. +q_fuel2pe(t,regi,peRicardian(enty)).. vm_prodPe(t,regi,enty) =e= sum(pe2rlf(enty,rlf2), vm_fuExtr(t,regi,enty,rlf2)) diff --git a/core/sets.gms b/core/sets.gms index c3c3d94116..630573bdbe 100755 --- a/core/sets.gms +++ b/core/sets.gms @@ -2775,7 +2775,7 @@ ccs2Leak(all_enty,all_enty,all_te,all_enty) "leakage along ccs chain" cco2.ico2.ccsinjeoff.co2 / -pe2rlf(all_enty,rlf) "map exhaustible energy to grades for qm_fuel2pe" +pe2rlf(all_enty,rlf) "map exhaustible energy to grades for q_fuel2pe" / peoil.(1*8) pegas.(1*6) diff --git a/main.gms b/main.gms index 77f4c69618..5696cfd37a 100755 --- a/main.gms +++ b/main.gms @@ -323,7 +323,6 @@ $setglobal biomass magpie !! def = magpie *' * (timeDepGrades): time-dependent grade structure of fossil resources (oil & gas only) *' * (grades2poly) : simplified version of the time-dependent grade realization (using polynomial functions) *' * (exogenous) : exogenous fossil extraction and costs -*' * (MOFEX) : contains the standalone version of MOFEX (Model Of Fossil EXtraction), which minimizes the discounted extraction and trade costs of fossils while balancing trade for each time step. Not to be run within a REMIND run but instead through the standalone architecture or soft-linked with REMIND (not yet implemented) $setglobal fossil grades2poly !! def = grades2poly *'--------------------- 32_power ---------------------------------------- *' @@ -2109,10 +2108,6 @@ $setglobal cm_seFeSectorShareDevMethod sqSectorAvrgShare !! def = sqSectorAvrgS *** share, "The square penalization is applied directly to the share values. This results in different-sized regions having varying relative penalization incentives, but the range of penalization values will be more consistent from the solver's perspective." *** energy, "The square penalization is applied to the share values multiplied by the energy demand. This approach scales penalizations better across different-sized regions, but there is a higher risk of the penalizations being ignored and the shares not being enforced if the value range is too small." $setglobal c_seFeSectorShareDevUnit share !! def = share !! regexp = share|energy -*** cm_MOFEX off !! def=off -*** *JH/LB* Activate MOFEX partial fossil fuel extraction cost minimization model -*** * Warning: Use a well-converged run since the model uses vm_prodPe from the input GDX -$setGlobal cm_MOFEX off !! def = off !! regexp = off|on *** cm_limitSolidsFossilRegi off !! def=off *** starting in max(2020, cm_startyear), fossil solids use in each (sector x emiMkt) has to decrease compared to the previous time step for each region included in the switch cm_limitSolidsFossilRegi *** aceptable values: any of the ext_regi set elements diff --git a/modules/31_fossil/MOFEX/bounds.gms b/modules/31_fossil/MOFEX/bounds.gms deleted file mode 100644 index 71dc21bddf..0000000000 --- a/modules/31_fossil/MOFEX/bounds.gms +++ /dev/null @@ -1,126 +0,0 @@ -*** | (C) 2006-2024 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of REMIND and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | REMIND License Exception, version 1.0 (see LICENSE file). -*** | Contact: remind@pik-potsdam.de -*** SOF ./modules/31_fossil/MOFEX/bounds.gms -*=========================================== -* MODULE.....: 31 FOSSIL -* REALISATION: MOFEX -* FILE.......: bounds.gms -*=========================================== -* Decription: This realisation activates time-dependent grade structures for -* oil, gas and coal. This enables to take into account exogenous technological -* change for example. -*=========================================== -* Authors...: SB -* History...: -* - 2019-09-10 : Creation -*=========================================== - -*------------------------------------ -*' @code -*------------------------------------ -option nlp = conopt4; !! Greatly speed up convergence process (x3~x4) - -*------------------------------------ -*' Lower bounds on fossil fuel extraction for all time steps -*' To make the model "see" all grades -*------------------------------------ -loop(regi, - loop(peFos(enty), - loop(rlf, - loop(t, -*** Set a lower bound on fuel extraction when p31_grades if non-zero - if (p31_grades(t,regi,"xi3",enty,rlf) gt 0, - vm_fuExtr.lo(t,regi,pe2rlf(enty,rlf)) = 1e-9; - ); - ); - ); - ); -); - -*------------------------------------ -*' Special case for grades declining to a zero value -*' Set lower and upper bounds to 0.0 to make the model converge. -*' p31_grades declines linearly whereas vm_fuExtr declines exponentially -*' This particular situation prevent the model from finding a solution -*' [TODO] In the future a small amount should be added to p31_grades to -*' allow for extraction from these grades -*------------------------------------ -loop(regi, - loop(peFos(enty), - loop(rlf, - if (p31_grades("2005",regi,"xi3",enty,rlf) gt 0.0 and p31_grades("2035",regi,"xi3",enty,rlf) eq 0.0, -*** For grades larger than 6 do not extract anything - vm_fuExtr.up(t,regi,pe2rlf(enty,rlf))$(rlf.val ge 6) = 0.0; - vm_fuExtr.lo(t,regi,pe2rlf(enty,rlf))$(rlf.val ge 6) = 0.0; - -*** For other grades, do the same for now - vm_fuExtr.up(t,regi,pe2rlf(enty,rlf))$(rlf.val lt 6) = 0.0; - vm_fuExtr.lo(t,regi,pe2rlf(enty,rlf))$(rlf.val lt 6) = 0.0; - ); - ); - ); -); - -if (s31_debug eq 1, - display vm_fuExtr.lo, vm_fuExtr.up; -); - - -*------------------------------------ -*** Upper bound on cumulative fossil fuel extraction -*------------------------------------ -v31_fuExtrCum.up(t,regi,peExGrade(enty),rlf) = p31_grades(t,regi,"xi3",enty,rlf); - - -*------------------------------------ -*' Upper bound on fossil fuel costs -*------------------------------------ -***Fixing resource cost upper bound to 10 $/Wa (eq. to 316 $/GJ) -vm_costFuEx.up(t,regi,peExGrade(enty)) = 10.0; - -*' @stop - -*------------------------------------ -*** [Optional] Oil retirement to allow a region to extract less than the lower bound imposed by the decline rate -*------------------------------------ - loop(enty2rlf_dec(enty,rlf)$(sameas(enty,"peoil")), -*** multiplying the total grade size by the maximum allowed decrease percentage gives the maximum possible extraction - p31_max_oil_extraction(regi,enty,rlf) = p31_grades("2020",regi,"xi3",enty,rlf) * p31_datafosdyn(regi,enty,rlf,"dec"); -*** 0.5 is an arbitrarily set upper limit that is probably never reached. - v31_fuSlack.up(t,regi,enty,rlf) = 0.5 * p31_grades(t,regi,"xi3",enty,rlf) * p31_datafosdyn(regi,enty,rlf,"dec"); - v31_fuSlack.fx("2005",regi,enty,rlf) = 0; - v31_fuSlack.fx("2010",regi,enty,rlf) = 0; - ); - v31_fuSlack.fx(t,regi,enty,rlf)$(NOT SAMEAS(enty,"peoil")) = 0; - - -*------------------------------------ -*** Specific upper bounds -*------------------------------------ - -*------------------------------------ -*** Upper bound on oil extraction -*------------------------------------ -*** Otherwise the model extracts everything from MEA, the cheapest region -*** vm_XpRes in 2005 should be equal to 1.4876897061 TWa (46.86 EJ) -*** BP statistics, 2012 says that MEA produced 1.980321 TWa in 2005 and 1.955456 TWa in 2010, however -*** there a linear fit with an average increase of 1.5% per year was found e.g 7% per 5-year period -*** Low and medium resource cases - -$ifthen.oilscen %cm_oil_scen% == "lowOil" -vm_Xport.up(t,regi,enty)$(t.val ge 2020 AND t.val le 2035 AND sameas(enty,"peoil")) = - f31_Xport(t,regi,enty,"SSP1")$(t.val ge 2020 AND t.val le 2035 AND sameas(enty,"peoil") AND f31_Xport(t,regi,enty,"SSP1") ne 0); -$elseif.oilscen %cm_oil_scen% == "medOil" -vm_Xport.up(t,regi,enty)$(t.val ge 2020 AND t.val le 2035 AND sameas(enty,"peoil")) = - f31_Xport(t,regi,enty,"SSP2")$(t.val ge 2020 AND t.val le 2035 AND sameas(enty,"peoil") AND f31_Xport(t,regi,enty,"SSP2") ne 0); -$elseif.oilscen %cm_oil_scen% == "highOil" -vm_Xport.up(t,regi,enty)$(t.val ge 2020 AND t.val le 2035 AND sameas(enty,"peoil")) = - f31_Xport(t,regi,enty,"SSP5")$(t.val ge 2020 AND t.val le 2035 AND sameas(enty,"peoil") AND f31_Xport(t,regi,enty,"SSP5") ne 0); -$endif.oilscen - - -*** EOF ./modules/31_fossil/MOFEX/bounds.gms diff --git a/modules/31_fossil/MOFEX/datainput.gms b/modules/31_fossil/MOFEX/datainput.gms deleted file mode 100644 index a9ef94ae96..0000000000 --- a/modules/31_fossil/MOFEX/datainput.gms +++ /dev/null @@ -1,137 +0,0 @@ -*** | (C) 2006-2024 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of REMIND and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | REMIND License Exception, version 1.0 (see LICENSE file). -*** | Contact: remind@pik-potsdam.de -*** SOF ./modules/31_fossil/MOFEX/datainput.gms -*=========================================== -* MODULE.....: 31 FOSSIL -* REALISATION: MOFEX -* FILE.......: datainput.gms -*=========================================== -* Decription: This realisation activates time-dependent grade structures for -* oil, gas and coal. This enables to take into account exogenous technological -* change for example. -*=========================================== -* Authors...: SB -* History...: -* - 2012-09-10 : Creation -*=========================================== - - -***---------------------------------------------------------------------- -*** Get oil gas & coal extraction cost grade data -***---------------------------------------------------------------------- -parameter f31_grades_oil(tall,all_regi,all_LU_emi_scen,xirog,rlf) "(Input) information about oil according to the grade structure concept. Unit: TWa" -/ -$ondelim -$include "./modules/31_fossil/MOFEX/input/p31_grades_oil.cs4r" -$offdelim -/ -; - -parameter f31_grades_gas(tall,all_regi,all_LU_emi_scen,xirog,rlf) "(Input) information about gas according to the grade structure concept. Unit: TWa" -/ -$ondelim -$include "./modules/31_fossil/MOFEX/input/p31_grades_gas.cs4r" -$offdelim -/ -; - -parameter f31_grades_coal(tall,all_regi,all_LU_emi_scen,xirog,rlf) "(Input) information about coal according to the grade structure concept. Unit: TWa" -/ -$ondelim -$include "./modules/31_fossil/MOFEX/input/p31_grades_coal.cs4r" -$offdelim -/ -; - -***---------------------------------------------------------------------- -*** Oil -***---------------------------------------------------------------------- -$ifthen.cm_oil_scen %cm_oil_scen% == "lowOil" -*SSP1 -p31_datafosdyn(all_regi,"peoil",rlf,"dec") = f31_grades_oil("2005",all_regi,"SSP1","dec",rlf); -p31_grades(tall,regi,xirog,"peoil",rlf) = f31_grades_oil(tall,regi,"SSP1",xirog,rlf)$(not sameas(xirog,"dec")); - -$elseif.cm_oil_scen %cm_oil_scen% == "medOil" -*SSP2 -p31_datafosdyn(all_regi,"peoil",rlf,"dec") = f31_grades_oil("2005",all_regi,"SSP2","dec",rlf); -p31_grades(tall,regi,xirog,"peoil",rlf) = f31_grades_oil(tall,regi,"SSP2",xirog,rlf)$(not sameas(xirog,"dec")); - -$elseif.cm_oil_scen %cm_oil_scen% == "highOil" -*SSP5 -p31_datafosdyn(all_regi,"peoil",rlf,"dec") = f31_grades_oil("2005",all_regi,"SSP5","dec",rlf); -p31_grades(tall,regi,xirog,"peoil",rlf) = f31_grades_oil(tall,regi,"SSP5",xirog,rlf)$(not sameas(xirog,"dec")); -$endif.cm_oil_scen - -***---------------------------------------------------------------------- -*** Gas -***---------------------------------------------------------------------- -*SSP1 -$ifthen.cm_gas_scen %cm_gas_scen% == "lowGas" -p31_datafosdyn(all_regi,"pegas",rlf,"dec") = f31_grades_gas("2005",all_regi,"SSP1","dec",rlf); -p31_grades(tall,regi,xirog,"pegas",rlf) = f31_grades_gas(tall,regi,"SSP1",xirog,rlf)$(not sameas(xirog,"dec")); -*SSP2 -$elseif.cm_gas_scen %cm_gas_scen% == "medGas" -p31_datafosdyn(all_regi,"pegas",rlf,"dec") = f31_grades_gas("2005",all_regi,"SSP2","dec",rlf); -p31_grades(tall,regi,xirog,"pegas",rlf) = f31_grades_gas(tall,regi,"SSP2",xirog,rlf)$(not sameas(xirog,"dec")); -*SSP5 -$elseif.cm_gas_scen %cm_gas_scen% == "highGas" -p31_datafosdyn(all_regi,"pegas",rlf,"dec") = f31_grades_gas("2005",all_regi,"SSP5","dec",rlf); -p31_grades(tall,regi,xirog,"pegas",rlf) = f31_grades_gas(tall,regi,"SSP5",xirog,rlf)$(not sameas(xirog,"dec")); -$endif.cm_gas_scen - - -***---------------------------------------------------------------------- -*** Coal -***---------------------------------------------------------------------- -*if(cm_coal_scen eq 0, -*$include "./modules/31_fossil/MOFEX/input/p31_grades_vlocoal.inc"; -*); -$ifthen.cm_coal_scen %cm_coal_scen% == "lowCoal" -p31_grades(tall,regi,xirog,"pecoal",rlf) = f31_grades_coal(tall,regi,"SSP1",xirog,rlf)$(not sameas(xirog,"dec")); -$elseif.cm_coal_scen %cm_coal_scen% == "medCoal" -p31_grades(tall,regi,xirog,"pecoal",rlf) = f31_grades_coal(tall,regi,"SSP2",xirog,rlf)$(not sameas(xirog,"dec")); -$elseif.cm_coal_scen %cm_coal_scen% == "highCoal" -p31_grades(tall,regi,xirog,"pecoal",rlf) = f31_grades_coal(tall,regi,"SSP5",xirog,rlf)$(not sameas(xirog,"dec")); -$endif.cm_coal_scen - -***---------------------------------------------------------------------- -*** Oil, gas and coal -***---------------------------------------------------------------------- -*NB* include data and parameters for the price elastic supply of fossil fuels -p31_fosadjco_xi5xi6(regi, "xi5", "pecoal") = 0.3; -p31_fosadjco_xi5xi6(regi, "xi6", "pecoal") = 1/1; -p31_fosadjco_xi5xi6(regi, "xi5", "peoil") = 0.3; -p31_fosadjco_xi5xi6(regi, "xi6", "peoil") = 1/1; -p31_fosadjco_xi5xi6(regi, "xi5", "pegas") = 0.3; -p31_fosadjco_xi5xi6(regi, "xi6", "pegas") = 1/1; - -*NB*110720 include data for constraints on maximum growth and decline of vm_fuExtr, and also the offsets -*SB*04022020 Hardcoded this into the preloop instead of the FFECCM input routines - -p31_datafosdyn(regi,"pegas",rlf,"alph") = 2 * p31_datafosdyn(regi,"pegas",rlf,"alph"); - -p31_extraseed(ttot,regi,enty,rlf) = 0; -*NB* extra seed value for the US gas sector to reduce initial price in EJ/yr -*SB 04/15/2020* Moved this parameter definition to moinput -parameter p31_extraseed(tall,all_regi,all_enty,rlf) "extra seed value that scales up the ramp-up potential" -/ -$ondelim -$include "./modules/31_fossil/MOFEX/input/f31_extraseed.cs4r" -$offdelim -/ -; - - -parameter f31_Xport(ttot,all_regi,all_enty,all_LU_emi_scen) "Upper bounds on exports from MEA in early timesteps [TWyr]" -/ -$ondelim -$include "./modules/31_fossil/MOFEX/input/f31_Xport.cs4r" -$offdelim -/ -; - -*** EOF ./modules/31_fossil/MOFEX/datainput.gms diff --git a/modules/31_fossil/MOFEX/declarations.gms b/modules/31_fossil/MOFEX/declarations.gms deleted file mode 100644 index 80f7258dcf..0000000000 --- a/modules/31_fossil/MOFEX/declarations.gms +++ /dev/null @@ -1,101 +0,0 @@ -*** | (C) 2006-2024 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of REMIND and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | REMIND License Exception, version 1.0 (see LICENSE file). -*** | Contact: remind@pik-potsdam.de -*** SOF ./modules/31_fossil/MOFEX/declarations.gms -*=========================================== -* MODULE.....: 31 FOSSIL -* REALISATION: MOFEX -* FILE.......: declarations.gms -*=========================================== -* Decription: This realisation activates time-dependent grade structures for -* oil, gas and coal. This enables to take into account exogenous technological -* change for example. -*=========================================== -* Authors...: JH, NB, TAC -* History...: -* - 2012-09-10 : Creation -*=========================================== - - -*------------------------------------------- -*** SCALARS -*------------------------------------------- -scalars -*** Debug -s31_debug "debugging option to display more output" /0/ -; - -*------------------------------------------- -*** PARAMETERS -*------------------------------------------- -parameter -*** MOFEX -p31_MOFEX_peprod_ref(tall,all_regi,all_enty) "Load PE production level values from reference GDX" -p31_MOFEX_Xport_ref(tall,all_regi,all_enty) "Load exports values from reference GDX" -p31_MOFEX_Mport_ref(tall,all_regi,all_enty) "Load imports values from reference GDX" -p31_MOFEX_fuelex_costMin(tall,all_regi,all_enty,rlf) "Result of MOFEX calculation: fuelex" -p31_MOFEX_cumfex_costMin(tall,all_regi,all_enty,rlf) "Result of MOFEX calculation: cumulative fuelex" -p31_MOFEX_Mport_costMin(tall,all_regi,all_enty) "Result of MOFEX calculation: imports" -p31_MOFEX_Xport_costMin(tall,all_regi,all_enty) "Result of MOFEX calculation: exports" -*** Input ------------------------------------ -p31_grades(tall,all_regi,xirog,all_enty,rlf) "(Input) information about exhaustibles according to the grade structure concept. Unit: TWa" -p31_datafosdyn(all_regi,all_enty,rlf,gradePar31) "(Input) information about exhaustibles according to the grade structure concept. Unit: " -p31_fosadjco_xi5xi6(all_regi,xirog,all_enty) "(Input) data and parameters that describe the adjustment cost function of the fossil fuel extraction. Unit:" -*** Preloop ---------------------------------- -pm_prodIni(all_regi,all_enty) "(Preloop) regional amount of primary energy that has to be produced according to 1.1*initial demand. Unit: " -p31_prodShare(all_regi,all_enty,rlf) "(Preloop) minimum amount of primary energy that can be produced given the decline rate. Unit: " -*** Output ----------------------------------- -pm_fuelex_cum(tall,all_regi,all_enty,rlf) "(Output) cumulated extraction. Unit: " -p31_costfu_detail(tall,all_regi,all_enty) "(Output) absolute fuel costs for each element of peExPol. Unit: " -*LB* reporting parameters -p31_fuel_cost_marg(tall,all_regi,all_enty) "(Output) marginal pure extraction costs, calculated by hand from Nico's elasticity equation. Unit:" -p31_fuel_cost_noadj(tall,all_regi,all_enty) "(Output) fuel cost without adjustment costs. Unit: " -p31_max_oil_extraction(all_regi,all_enty,rlf) "maximum oil extraction, calculated from the total grade size and the decline constraint. Unit: TWyr" -***BAU 2010 fixing -p31_fuel_cost(tall,all_regi,all_enty) "Pure extraction costs" -p31_sol_itr_max "parameter for maximum solves for MOFEX" -p31_extraseed(tall,all_regi,all_enty,rlf) "extra seed value that scales up the ramp-up potential" -; - -*------------------------------------------- -*** VARIABLES -*------------------------------------------- -$IFTHEN.mofex %cm_MOFEX% == "on" -variables -*** MOFEX -v31_MOFEX_costMinFuelEx "Minimization of discounted fossil fuel extraction and trade costs" -$ENDIF.mofex -; - -*------------------------------------------- -*** POSITIVE VARIABLES -*------------------------------------------- -positive variables -*** Others -v31_fuExtrCum(ttot,all_regi,all_enty,rlf) "cumulated extraction of exhaustible resources" -v31_fuSlack(ttot,all_regi,all_enty,rlf) "Amount of oil that is not extracted but put aside never to be used again. Unit: TWa/a" -; - -*------------------------------------------- -*** EQUATIONS -*------------------------------------------- -equations -*** MOFEX -$IFTHEN.mofex %cm_MOFEX% == "on" -q31_MOFEX_costMinFuelEx "Minimization of discounted fossil fuel extraction and trade costs" -q31_MOFEX_tradebal(ttot,all_enty) "New trade equation for MOFEX purposes" -$ENDIF.mofex -*** Cost -q31_costFuExGrade(ttot,all_regi,all_enty) "costs of fuels estimated step-wise by grades; exchaustible fuels (oil, gas and coal)" -*** Quantity -q31_fuExtrCum(ttot,all_regi,all_enty,rlf) "cumulated extraction of exhaustible resources" -*** Dynamic constraints on fuel extraction -q31_fuExtrDec(ttot,all_regi,all_enty,rlf) "lower bound on decline rate of fuel extraction (vm_fuExtr)" -q31_fuExtrInc(ttot,all_regi,all_enty,rlf) "upper bound on growth rate of fuel extraction (vm_fuExtr)" -q31_smoothoilphaseout(ttot,all_regi,all_enty,rlf) "limits the increase of v_fuelslack, leading to a smoother phase-out of oil" -; - -*** EOF ./modules/31_fossil/MOFEX/declarations.gms diff --git a/modules/31_fossil/MOFEX/equations.gms b/modules/31_fossil/MOFEX/equations.gms deleted file mode 100644 index 6a18d8c9f4..0000000000 --- a/modules/31_fossil/MOFEX/equations.gms +++ /dev/null @@ -1,134 +0,0 @@ -*** | (C) 2006-2024 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of REMIND and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | REMIND License Exception, version 1.0 (see LICENSE file). -*** | Contact: remind@pik-potsdam.de -*** SOF ./modules/31_fossil/MOFEX/equations.gms -*=========================================== -* MODULE.....: 31 FOSSIL -* REALISATION: MOFEX -* FILE.......: equations.gms -*=========================================== -* Decription: This realisation activates time-dependent grade structures for -* oil, gas and coal. This enables the model to take into account exogenous technological -* change for example. -*=========================================== -* Authors...: SB -* History...: -* - 2012-09-10 : Creation -*=========================================== - -*' @equations -*' MOFEX (Model of Fossil Extraction) takes fossil demand, imports and exports from a prior REMIND run as inputs, -*' and it calculates fossil extraction and trade as outputs. - - -*** Trade of resources (oil, gas and coal) -q31_MOFEX_tradebal(t,trade(peExGrade)).. - sum(regi, vm_Xport(t,regi,trade) - vm_Mport(t,regi,trade)) =e= 0; - -*** Discounted extraction and trade costs of fossil fuels -q31_MOFEX_costMinFuelEx.. - v31_MOFEX_costMinFuelEx - =e= - sum(ttot$(ttot.val ge cm_startyear), - sum(regi, - pm_ts(ttot) / ((1 + pm_prtp(regi))**(pm_ttot_val(ttot)-cm_startyear)) - * (sum(peFos(enty), vm_costFuEx(ttot,regi,enty)) - + sum(peFos(enty), pm_costsTradePeFinancial(regi,"Mport",enty) * vm_Mport(ttot,regi,enty)) - + sum(peFos(enty), - (pm_costsTradePeFinancial(regi,"Xport",enty) * vm_Xport(ttot,regi,enty)) - * (1 - + pm_costsTradePeFinancial(regi,"XportElasticity",enty) / sqr(pm_ttot_val(ttot)-pm_ttot_val(ttot-1)) - * ( vm_Xport(ttot,regi,enty) / (vm_Xport(ttot-1,regi,enty) + pm_costsTradePeFinancial(regi, "tradeFloor",enty)) - 1) - ) - ) - ) - ) - ); - -***----------------------------------------- -*** Fossil fuel extraction (grade structure) -***----------------------------------------- -*NB/LB/BB/GL/IM* fossil extraction costs as grade structure with linear increasing marginal extraction costs -***This is used for oil, gas and coal. Notice that coal supply cost curves remain constant over time - -*' Fossil fuels are represented by discrete grades based on ranges of marginal extraction costs. The total extraction cost for each time step -*' is calculated based on long-term marginal extraction costs and short-term calibrated adjustment costs which capture inertias, e.g. from infrastructure - -q31_costFuExGrade(ttot,regi,peExGrade(enty))$(ttot.val ge cm_startyear).. - vm_costFuEx(ttot,regi,enty) - =e= -*NB*111123 this is the long-term marginal extraction cost part - sum(pe2rlf(enty,rlf), - ((p31_grades(ttot,regi,"xi1",enty, rlf) + pm_costsTradePeFinancial(regi,"use",enty) - + (p31_grades(ttot,regi,"xi2",enty,rlf)-p31_grades(ttot,regi,"xi1",enty, rlf)) * v31_fuExtrCum(ttot-1,regi,enty, rlf)$(ttot.val gt 2005) / p31_grades(ttot,regi,"xi3",enty, rlf) - + (p31_grades(ttot,regi,"xi2",enty,rlf)-p31_grades(ttot,regi,"xi1",enty, rlf)) * (v31_fuExtrCum(ttot,regi,enty,rlf)-v31_fuExtrCum(ttot-1,regi,enty,rlf)$(ttot.val gt 2005)) / (2 * p31_grades(ttot,regi,"xi3",enty, rlf)) - ) -***this is the short-term adjustment cost part - * ( - (1 + - (p31_datafosdyn(regi,enty,rlf,"alph") * 1/(sqr(pm_ttot_val(ttot)-pm_ttot_val(ttot-1))) - * sqr(((vm_fuExtr(ttot,regi,enty,rlf)-vm_fuExtr(ttot-1,regi,enty,rlf))/(vm_fuExtr(ttot-1,regi,enty,rlf)+ - 0.001*p31_grades(ttot,regi,"xi3",enty,rlf) + - p31_extraseed(ttot,regi,enty,rlf) + - 1.e-9))) - )$(ttot.val gt 2005) - ) - ) - * vm_fuExtr(ttot,regi,enty,rlf) - )$(p31_grades(ttot,regi,"xi3",enty,rlf) gt 0) - ) -; - -*-------------------------------------- -*** Calculate cumulated fuel extraction -*-------------------------------------- -*' Cumulated fuel extraction (oil, gas and coal) is the sum of extraction in each time step multiplied by the time step length. -*' If early retirement of oil wells is switched on, any slack capacity from those fields is also added. - -q31_fuExtrCum(ttot,regi,pe2rlf(peEx(enty),rlf))$(ttot.val ge cm_startyear).. - v31_fuExtrCum(ttot,regi,enty,rlf) - =e= - v31_fuExtrCum(ttot-1,regi,enty,rlf)$(ttot.val gt 2005) + pm_ts(ttot)*(vm_fuExtr(ttot,regi,enty,rlf) - + v31_fuSlack(ttot,regi,enty,rlf) - ); - -*NB*110720 dynamic constraints on resource extraction -*' These dynamic constraints on the decline and increase rates of production reflect physical and technical inertias of oil, gas and coal -*** -------------------------------------- -*' Dynamic constraint on decline rate -*** -------------------------------------- -q31_fuExtrDec(ttot+1,regi,enty2rlf_dec(enty,rlf))$(pm_ttot_val(ttot+1) ge max(2010,cm_startyear)).. - vm_fuExtr(ttot+1,regi,enty,rlf) - + v31_fuSlack(ttot+1,regi,enty,rlf) - =g= - p31_datafosdyn(regi,enty,rlf,"decoffset") * p31_grades(ttot,regi,"xi3",enty,rlf) * 0.5 * ( pm_ts(ttot+1) + pm_ts(ttot) ) !! This is an (arbitrarily set) minimal amount that can simply be turned off from one time step to the next - - + (1-p31_datafosdyn(regi,enty,rlf,"dec"))**(pm_ttot_val(ttot+1)-pm_ttot_val(ttot)) * vm_fuExtr(ttot,regi,enty,rlf); - -***CG: replacing earlyreti_lim with regional early retirement rate pm_extRegiEarlyRetiRate(ext_regi) -q31_smoothoilphaseout(ttot,regi,enty2rlf_dec(enty,rlf))$( (ttot.val ge cm_startyear) AND (ttot.val lt 2120) AND (sameas(enty,"peoil")) ).. - v31_fuSlack(ttot+1,regi,enty,rlf) - =l= - v31_fuSlack(ttot,regi,enty,rlf) + (pm_ttot_val(ttot+1)-pm_ttot_val(ttot)) * sum(regi_group(ext_regi,regi), pm_extRegiEarlyRetiRate(ext_regi)) * 0.3 * p31_max_oil_extraction(regi,enty,rlf); !! 0.3 is an arbitrarily chosen number to make the retirement of oil comparable to retirement of other sectors- the "max_oil_extraction" is alsways higher than the real extraction, so some decrease of this limit makes the results smoother. -; - - -*** -------------------------------------- -*' Dynamic constraint on increase rate -*** -------------------------------------- -q31_fuExtrInc(ttot+1,regi,enty2rlf_inc(enty,rlf))$((p31_grades(ttot,regi,"xi3",enty,rlf) gt 0) AND (pm_ttot_val(ttot+1) ge max(2010,cm_startyear))).. - vm_fuExtr(ttot+1,regi,enty,rlf) - =l= - (1 + p31_datafosdyn(regi,enty,rlf,"inc"))**(pm_ttot_val(ttot+1)-pm_ttot_val(ttot)) * (vm_fuExtr(ttot,regi,enty,rlf) + p31_datafosdyn(regi,enty,rlf,"incoffset")) -$ifthen.cm_oil_scen %cm_oil_scen% == "highOil" +(10)$(cm_startyear eq 2015 AND pm_ttot_val(ttot+1) eq 2015 AND ((sameas(enty,"peoil") AND sameas(rlf,"7")) OR (sameas(enty,"pegas") AND sameas(rlf,"6")))) -$elseif.cm_oil_scen %cm_oil_scen% == "6" +(10)$(cm_startyear eq 2015 AND pm_ttot_val(ttot+1) eq 2015 AND (sameas(enty,"peoil") AND sameas(rlf,"1") AND sameas(regi,"REF"))); -$elseif.cm_oil_scen %cm_oil_scen% == "4" +(10)$(cm_startyear eq 2015 AND pm_ttot_val(ttot+1) eq 2015 AND ((sameas(enty,"peoil") AND sameas(rlf,"7")) OR (sameas(enty,"pegas") AND sameas(rlf,"6")))) -$endif.cm_oil_scen -; - -*' @stop - -*** EOF ./modules/31_fossil/MOFEX/equations.gms diff --git a/modules/31_fossil/MOFEX/not_used.txt b/modules/31_fossil/MOFEX/not_used.txt deleted file mode 100644 index eeb5c5fc60..0000000000 --- a/modules/31_fossil/MOFEX/not_used.txt +++ /dev/null @@ -1,22 +0,0 @@ -# | (C) 2006-2024 Potsdam Institute for Climate Impact Research (PIK) -# | authors, and contributors see CITATION.cff file. This file is part -# | of REMIND and licensed under AGPL-3.0-or-later. Under Section 7 of -# | AGPL-3.0, you are granted additional permissions described in the -# | REMIND License Exception, version 1.0 (see LICENSE file). -# | Contact: remind@pik-potsdam.de -name, type, reason -cm_rentdiscoil,switch,??? -cm_rentdiscoil2,switch,??? -cm_rentconvoil,switch,??? -cm_rentdiscgas,switch,??? -cm_rentdiscgas2,switch,??? -cm_rentconvgas,switch,??? -cm_rentdisccoal,switch,??? -cm_rentdisccoal2,switch,??? -cm_rentconvcoal,switch,??? - - -pm_IO_trade,input,questionnaire -pm_EN_demand_from_initialcap2,input,questionnaire -cm_nucscen,input,questionnaire -pm_ffPolyCumEx,input,questionnaire diff --git a/modules/31_fossil/MOFEX/output.gms b/modules/31_fossil/MOFEX/output.gms deleted file mode 100644 index 21024f1a19..0000000000 --- a/modules/31_fossil/MOFEX/output.gms +++ /dev/null @@ -1,103 +0,0 @@ -*** | (C) 2006-2024 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of REMIND and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | REMIND License Exception, version 1.0 (see LICENSE file). -*** | Contact: remind@pik-potsdam.de -*** SOF ./modules/31_fossil/MOFEX/output.gms -*=========================================== -* MODULE.....: 31 FOSSIL -* REALISATION: MOFEX -* FILE.......: output.gms -*=========================================== -* Decription: This realisation activates time-dependent grade structures for -* oil, gas and coal. This enables to take into account exogenous technological -* change for example. -*=========================================== -* Authors...: SB -* History...: -* - 2012-09-10 : Creation -*=========================================== - -*** Set trade, annual and cumulative extraction to MOFEX optimal values -vm_fuExtr.l(ttot,regi,pe2rlf(peExGrade(enty),rlf)) = p31_MOFEX_fuelex_costMin(ttot,regi,enty,rlf); -v31_fuExtrCum.l(ttot,regi,pe2rlf(peExGrade(enty),rlf)) = p31_MOFEX_cumfex_costMin(ttot,regi,enty,rlf); -vm_Mport.l(ttot,regi,peExGrade(trade)) = p31_MOFEX_Mport_costMin(ttot,regi,trade); -vm_Xport.l(ttot,regi,peExGrade(trade)) = p31_MOFEX_Xport_costMin(ttot,regi,trade); - -*** cumulated extraction: -pm_fuelex_cum(ttot,regi,peEx(enty),rlf) = - v31_fuExtrCum.l(ttot-1,regi,enty,rlf)$(ttot.val ge 2015) + pm_ts(ttot)*vm_fuExtr.l(ttot,regi,enty,rlf); - - -* p31_costfu_detail(ttot,regi,enty) = -* (p31_costExPoly(regi,"xi1",enty) -* + (p31_costExPoly(regi,"xi2",enty)*pm_fuelex_cum(ttot,regi,enty,"1")) -* + (p31_costExPoly(regi,"xi3",enty)*pm_fuelex_cum(ttot,regi,enty,"1")**2) -* + (p31_costExPoly(regi,"xi4",enty)*pm_fuelex_cum(ttot,regi,enty,"1")**3))$peExPol(enty); - - -* *mh fuel costs (by region): -* file res_costfu_detail; -* put res_costfu_detail; -* loop(ttot, -* loop(regi, -* loop(peEx(enty), -* put ttot.val:0:0, @15, regi.tl, @30, enty.tl, @45, p31_costfu_detail(ttot,regi,enty):15:8 /; -* ))); -* putclose res_costfu_detail; - -* loop(ttot, -* loop(regi, -* loop(peExPol(enty), -* p31_fuel_cost(ttot,regi,enty) = -* (p31_costExPoly(regi,"xi1",enty)+p31_costExPoly(regi,"xi2",enty)* -* ((sum(ttot2$(ttot2.val le ttot.val), -* pm_ts(ttot2)*vm_fuExtr.l(ttot2,regi,enty,"1")+0.0001))/(p31_costExPoly(regi,"xi3",enty)+1.e-5)** -* p31_costExPoly(regi,"xi4",enty) -* ) -* *( -* 1$(ttot.val eq 2005) + -* ((1-p31_fosadjco_xi5xi6(regi,"xi5",enty)) -* + -* p31_fosadjco_xi5xi6(regi,"xi5",enty) -* * ((vm_fuExtr.l(ttot,regi,enty,"1")+1.e-5)/(vm_fuExtr.l(ttot-1,regi,enty,"1")+1.e-5)))**p31_fosadjco_xi5xi6(regi,"xi6",enty) -* )$(ttot.val ge 2010) -* ); - -* p31_fuel_cost_marg(ttot,regi,enty) = 99; !! don't know how to calculate this at the moment ' - -* p31_fuel_cost_noadj(ttot,regi,enty) = -* (p31_costExPoly(regi,"xi1",enty)+p31_costExPoly(regi,"xi2",enty)* -* ((sum(ttot2$(ttot2.val le ttot.val),pm_ts(ttot2)*vm_fuExtr.l(ttot2,regi,enty,"1")+0.0001)) -* /(p31_costExPoly(regi,"xi3",enty)+1.e-5) -* ) ** p31_costExPoly(regi,"xi4",enty) -* ); -* ))); - -*LB save data for exogenous realization of the fossil module: -* file p31_fix_costfu_ex; -* put p31_fix_costfu_ex; -* loop(ttot$(ttot.val ge 2005), -* loop(regi, -* loop(peEx(enty), -* put 'p31_fix_costfu_ex("'ttot.val:0:0'","'regi.tl:0:0'","'enty.tl:0:0'")=',vm_costFuEx.l(ttot,regi,enty):15:12, ';'; put /; -* ); -* ) -* ); -* putclose p31_fix_costfu_ex; - -* file p31_fix_fuelex; -* put p31_fix_fuelex; -* loop(ttot$(ttot.val ge 2005), -* loop(regi, -* loop(peEx(enty), -* loop(rlf, -* put 'p31_fix_fuelex("'ttot.val:0:0'","'regi.tl:0:0'","'enty.tl:0:0'","'rlf.tl:0:0'")=',vm_fuExtr.l(ttot,regi,enty,rlf):15:12, ';'; put /; -* ); -* ); -* ) -* ); -* putclose p31_fix_fuelex; - -*** EOF ./modules/31_fossil/MOFEX/output.gms diff --git a/modules/31_fossil/MOFEX/preloop.gms b/modules/31_fossil/MOFEX/preloop.gms deleted file mode 100644 index 4ef98bd249..0000000000 --- a/modules/31_fossil/MOFEX/preloop.gms +++ /dev/null @@ -1,72 +0,0 @@ -*** | (C) 2006-2024 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of REMIND and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | REMIND License Exception, version 1.0 (see LICENSE file). -*** | Contact: remind@pik-potsdam.de -*** SOF ./modules/31_fossil/MOFEX/preloop.gms -*=========================================== -* MODULE.....: 31 FOSSIL -* REALISATION: MOFEX -* FILE.......: preloop.gms -*=========================================== -* Decription: This realisation activates time-dependent grade structures for -* oil, gas and coal. This enables to take into account exogenous technological -* change for example. -*=========================================== -* Authors...: SB -* History...: -* - 2012-09-10 : Creation -*=========================================== - -*** Decline and incline rate equation offsets from FFECCM -* Additional factor entering the decline rate equation -parameter f31_decoffset(all_regi,all_enty,rlf) "Decline rate equation offset" -/ -$ondelim -$include "./modules/31_fossil/timeDepGrades/input/f31_decoffset.cs4r" -$offdelim -/ -; -p31_datafosdyn(all_regi,all_enty,rlf,"decoffset")$(not sameas(all_enty,"pecoal")) = f31_decoffset(all_regi,all_enty,rlf); - -* Additional factor entering the increase rate equation -p31_datafosdyn(regi, "pegas", rlf, "incoffset") = 0.002 * p31_grades("2005", regi, "xi3", "pegas", rlf); -p31_datafosdyn(regi, "peoil", rlf, "incoffset") = 0.002 * p31_grades("2005", regi, "xi3", "peoil", rlf); -p31_datafosdyn(regi, "pecoal", rlf, "incoffset") = 0.002 * p31_grades("2005", regi, "xi3", "pecoal", rlf); - -* Factor for quadratic adjustment cost function -p31_datafosdyn(regi, enty, rlf, "alph") = 20; - -***-------------------------------------- -*** MOFEX -***-------------------------------------- -*** Small partial model to compute level values of fossil fuel extraction (vm_fuExtr.l) given a -*** specific demand path - -*** Get fossil fuel demand (vm_prodPe) from reference GDX (input.gdx) -p31_MOFEX_peprod_ref(ttot,regi,peExGrade(enty)) = 0; -p31_MOFEX_Xport_ref(ttot,regi,trade) = 0; -p31_MOFEX_Mport_ref(ttot,regi,trade) = 0; -Execute_Loadpoint 'input', - p31_MOFEX_peprod_ref = vm_prodPe.l, - p31_MOFEX_Xport_ref = vm_Xport.l, - p31_MOFEX_Mport_ref = vm_Mport.l; -display p31_MOFEX_peprod_ref; - -*** Fixing MOFEX fossil fuel demand to reference GDX data -vm_prodPe.fx(ttot,regi,peExGrade(enty)) = p31_MOFEX_peprod_ref(ttot,regi,enty); - -*** Apply other important bounds -v31_fuExtrCum.up(t,regi,peExGrade(enty),rlf) = p31_grades(t,regi,"xi3",enty,rlf); -vm_costFuEx.up(t,regi,peExGrade(enty)) = 10.0; -vm_Xport.fx(ttot,regi,trade)$(ttot.val lt cm_startyear) = p31_MOFEX_Xport_ref(ttot,regi,trade); !! To avoid unbounded results -vm_Mport.fx(ttot,regi,trade)$(ttot.val lt cm_startyear) = p31_MOFEX_Mport_ref(ttot,regi,trade); !! To avoid unbounded results - -display vm_prodPe.l; - -*** Model statement -model m31_MOFEX /q31_MOFEX_costMinFuelEx, q31_MOFEX_tradebal, q31_fuExtrDec, q31_fuExtrInc, - q31_fuExtrCum, q31_costFuExGrade, qm_fuel2pe/; - -*** EOF ./modules/31_fossil/MOFEX/preloop.gms diff --git a/modules/31_fossil/MOFEX/realization.gms b/modules/31_fossil/MOFEX/realization.gms deleted file mode 100644 index 197580e4be..0000000000 --- a/modules/31_fossil/MOFEX/realization.gms +++ /dev/null @@ -1,24 +0,0 @@ -*** | (C) 2006-2024 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of REMIND and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | REMIND License Exception, version 1.0 (see LICENSE file). -*** | Contact: remind@pik-potsdam.de -*** SOF ./modules/31_fossil/MOFEX/realization.gms - -*' @description This realization is dedicated to the running the standalone version of MOFEX (Model Of Fossil EXtraction), -*' which minimizes the discounted extraction and trade costs of fossils while balancing trade for each time step. -*' This is not to be run within a REMIND run but instead through the standalone architecture or in a soft-linked iteration -*' with REMIND (not yet implemented) - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "sets" $include "./modules/31_fossil/MOFEX/sets.gms" -$Ifi "%phase%" == "declarations" $include "./modules/31_fossil/MOFEX/declarations.gms" -$Ifi "%phase%" == "datainput" $include "./modules/31_fossil/MOFEX/datainput.gms" -$Ifi "%phase%" == "equations" $include "./modules/31_fossil/MOFEX/equations.gms" -$Ifi "%phase%" == "preloop" $include "./modules/31_fossil/MOFEX/preloop.gms" -$Ifi "%phase%" == "bounds" $include "./modules/31_fossil/MOFEX/bounds.gms" -$Ifi "%phase%" == "solve" $include "./modules/31_fossil/MOFEX/solve.gms" -$Ifi "%phase%" == "output" $include "./modules/31_fossil/MOFEX/output.gms" -*######################## R SECTION END (PHASES) ############################### -*** EOF ./modules/31_fossil/MOFEX/realization.gms diff --git a/modules/31_fossil/MOFEX/sets.gms b/modules/31_fossil/MOFEX/sets.gms deleted file mode 100644 index 60f9fb3877..0000000000 --- a/modules/31_fossil/MOFEX/sets.gms +++ /dev/null @@ -1,22 +0,0 @@ -*** | (C) 2006-2024 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of REMIND and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | REMIND License Exception, version 1.0 (see LICENSE file). -*** | Contact: remind@pik-potsdam.de -*** SOF ./modules/31_fossil/MOFEX/sets.gms -sets -enty2rlf_dec(all_enty,rlf) "mapping for applying constraint on decline rate of vm_fuExtr" -/ - peoil.(1*8) - pegas.(1*6) - pecoal.(1*6) -/ -enty2rlf_inc(all_enty,rlf) "mapping for applying constraint on growth rate of vm_fuExtr (see module 31_fossil)" -/ - peoil.(1*8) - pegas.(1*6) - pecoal.(1*6) -/ -; -*** EOF ./modules/31_fossil/MOFEX/sets.gms diff --git a/modules/31_fossil/MOFEX/solve.gms b/modules/31_fossil/MOFEX/solve.gms deleted file mode 100644 index 1ec9ee347a..0000000000 --- a/modules/31_fossil/MOFEX/solve.gms +++ /dev/null @@ -1,58 +0,0 @@ -*** | (C) 2006-2024 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of REMIND and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | REMIND License Exception, version 1.0 (see LICENSE file). -*** | Contact: remind@pik-potsdam.de -*** SOF ./modules/31_fossil/MOFEX/solve.gms -*=========================================== -* MODULE.....: 31 FOSSIL -* REALISATION: MOFEX -* FILE.......: solve.gms -*=========================================== -* Decription: This realisation activates time-dependent grade structures for -* oil, gas and coal. This enables to take into account exogenous technological -* change for example. -*=========================================== -* Authors...: SB -* History...: -* - 2019-09-10 : Creation -*=========================================== - -*------------------------------------ -*' @code -*------------------------------------ -option nlp = conopt4; !! Greatly speed up convergence process (x3~x4) - -*** Iteration loop -o_modelstat = 100; -option solprint=on - -*** Solve statement -if(o_modelstat ne 2, - solve m31_MOFEX using nlp minimizing v31_MOFEX_costMinFuelEx; - o_modelstat = m31_MOFEX.modelstat; -); - -* vm_prodPe.lo(ttot,regi,peExGrade(enty)) = 1.e-9; -* vm_prodPe.up(ttot,regi,peExGrade(enty)) = 1.e+2; - -*** Save fuel extraction and trade values -p31_MOFEX_fuelex_costMin(ttot,regi,enty,rlf) = vm_fuExtr.l(ttot,regi,enty,rlf); -p31_MOFEX_cumfex_costMin(ttot,regi,enty,rlf) = v31_fuExtrCum.l(ttot,regi,enty,rlf); -p31_MOFEX_Mport_costMin(ttot,regi,trade) = vm_Mport.l(ttot,regi,trade); -p31_MOFEX_Xport_costMin(ttot,regi,trade) = vm_Xport.l(ttot,regi,trade); - -*** Save values in a gdx -if(m31_MOFEX.modelstat ne 2, - Execute_Unload 'mofex'; - abort "MOFEX did not find an optimal solution. Stopping job..."; -); - -vm_prodPe.lo(ttot,regi,peExGrade(enty)) = 1.e-9; -vm_prodPe.up(ttot,regi,peExGrade(enty)) = 1.e+2; - -display p31_MOFEX_fuelex_costMin; -option nlp = %cm_conoptv%; - -*** EOF ./modules/31_fossil/MOFEX/solve.gms diff --git a/modules/31_fossil/exogenous/not_used.txt b/modules/31_fossil/exogenous/not_used.txt index ef8d71d7f4..72a02b319d 100644 --- a/modules/31_fossil/exogenous/not_used.txt +++ b/modules/31_fossil/exogenous/not_used.txt @@ -8,12 +8,9 @@ name,type,reason pm_extRegiEarlyRetiRate, parameter, ?? pm_IO_trade, parameter, ?? pm_EN_demand_from_initialcap2, parameter, ?? -vm_prodPe, variable, ?? vm_Xport, variable, ?? -vm_Mport, variable, ?? pm_ttot_val, parameter, ?? pm_ts, parameter, ?? -pm_prtp, parameter, ?? cm_startyear, switch, ??? cm_nucscen, switch, ??? cm_rentdiscoil,switch,??? @@ -26,7 +23,6 @@ cm_rentdisccoal,switch,??? cm_rentdisccoal2,switch,??? cm_rentconvcoal,switch,??? pm_costsTradePeFinancial,parameter,??? -qm_fuel2pe,equation,??? pm_ffPolyCumEx,input,questionnaire pm_fuelex_cum,input,questionnaire pm_prodIni,input,questionnaire diff --git a/modules/31_fossil/grades2poly/not_used.txt b/modules/31_fossil/grades2poly/not_used.txt index 3d54a625a3..daad1e70a3 100644 --- a/modules/31_fossil/grades2poly/not_used.txt +++ b/modules/31_fossil/grades2poly/not_used.txt @@ -6,13 +6,9 @@ # | Contact: remind@pik-potsdam.de name, type, reason pm_extRegiEarlyRetiRate, parameter, ?? -vm_prodPe, variable, ?? -vm_Mport, variable, ?? pm_IO_trade, parameter, ?? pm_EN_demand_from_initialcap2, parameter, ?? -pm_prtp, parameter, ?? pm_costsTradePeFinancial,parameter,??? -qm_fuel2pe,equation,??? vm_Xport,input,questionnaire pm_fuelex_cum,input,questionnaire pm_prodIni,input,questionnaire diff --git a/modules/31_fossil/module.gms b/modules/31_fossil/module.gms index 7f6ffc71d1..bca91c2d2a 100644 --- a/modules/31_fossil/module.gms +++ b/modules/31_fossil/module.gms @@ -13,7 +13,6 @@ *' @authors Nico Bauer, Jerome Hilaire, Robert Pietzcker, Lavinia Baumstark *###################### R SECTION START (MODULETYPES) ########################## -$Ifi "%fossil%" == "MOFEX" $include "./modules/31_fossil/MOFEX/realization.gms" $Ifi "%fossil%" == "exogenous" $include "./modules/31_fossil/exogenous/realization.gms" $Ifi "%fossil%" == "grades2poly" $include "./modules/31_fossil/grades2poly/realization.gms" $Ifi "%fossil%" == "timeDepGrades" $include "./modules/31_fossil/timeDepGrades/realization.gms" diff --git a/modules/31_fossil/timeDepGrades/bounds.gms b/modules/31_fossil/timeDepGrades/bounds.gms index d7df16be53..94a9707b57 100644 --- a/modules/31_fossil/timeDepGrades/bounds.gms +++ b/modules/31_fossil/timeDepGrades/bounds.gms @@ -106,17 +106,6 @@ if(ord(iteration) eq 1, ); ); -*------------------------------------ -*** [Optional] MOFEX -*------------------------------------ -*** If MOFEX was run, fix fossil fuel extraction, cumulative FF Ext. and trade to values computed by MOFEX -$IFTHEN.mofex %cm_MOFEX% == "on" - vm_fuExtr.l(ttot,regi,pe2rlf(peExGrade(enty),rlf)) = p31_MOFEX_fuelex_costMin(ttot,regi,enty,rlf); - v31_fuExtrCum.l(ttot,regi,pe2rlf(peExGrade(enty),rlf)) = p31_MOFEX_cumfex_costMin(ttot,regi,enty,rlf); - vm_Mport.l(ttot,regi,peExGrade(trade)) = p31_MOFEX_Mport_costMin(ttot,regi,trade); - vm_Xport.l(ttot,regi,peExGrade(trade)) = p31_MOFEX_Xport_costMin(ttot,regi,trade); -$ENDIF.mofex - ); *------------------------------------ diff --git a/modules/31_fossil/timeDepGrades/declarations.gms b/modules/31_fossil/timeDepGrades/declarations.gms index 5aa35d27c6..3dea3ac61f 100644 --- a/modules/31_fossil/timeDepGrades/declarations.gms +++ b/modules/31_fossil/timeDepGrades/declarations.gms @@ -38,16 +38,6 @@ s31_max_disp_peur "maximum amount of cumulati *** PARAMETERS *------------------------------------------- parameter -$IFTHEN.mofex %cm_MOFEX% == "on" -*** MOFEX -p31_MOFEX_peprod_ref(tall,all_regi,all_enty) "Load PE production level values from reference GDX" -p31_MOFEX_Xport_ref(tall,all_regi,all_enty) "Load exports values from reference GDX" -p31_MOFEX_Mport_ref(tall,all_regi,all_enty) "Load imports values from reference GDX" -p31_MOFEX_fuelex_costMin(tall,all_regi,all_enty,rlf) "Result of MOFEX calculation: fuelex" -p31_MOFEX_cumfex_costMin(tall,all_regi,all_enty,rlf) "Result of MOFEX calculation: cumulative fuelex" -p31_MOFEX_Mport_costMin(tall,all_regi,all_enty) "Result of MOFEX calculation: imports" -p31_MOFEX_Xport_costMin(tall,all_regi,all_enty) "Result of MOFEX calculation: exports" -$ENDIF.mofex *** Input ------------------------------------ p31_costExPoly(all_regi,xirog,all_enty) "(Input) information about exhaustibles according to Rogner's polynomial approach. Unit: " p31_grades(tall,all_regi,xirog,all_enty,rlf) "(Input) information about exhaustibles according to the grade structure concept. Unit: TWa" @@ -69,21 +59,9 @@ p31_max_oil_extraction(all_regi,all_enty,rlf) "maximum oil extraction, ca p31_fuel_cost(tall,all_regi,all_enty) "Pure extraction costs" p31_fuExtrCumMaxBound(all_regi,all_enty,rlf) "value of regional uranium extraction bound" -p31_sol_itr_max "parameter for maximum solves for MOFEX" - p31_extraseed(tall,all_regi,all_enty,rlf) "extra seed value that scales up the ramp-up potential" ; -*------------------------------------------- -*** VARIABLES -*------------------------------------------- -$IFTHEN.mofex %cm_MOFEX% == "on" -variables -*** MOFEX -v31_MOFEX_costMinFuelEx "Minimization of discounted fossil fuel extraction and trade costs" -$ENDIF.mofex -; - *------------------------------------------- *** POSITIVE VARIABLES *------------------------------------------- @@ -99,11 +77,6 @@ v31_fuSlack(ttot,all_regi,all_enty,rlf) "Amount of oil that is not e *** EQUATIONS *------------------------------------------- equations -*** MOFEX -$IFTHEN.mofex %cm_MOFEX% == "on" -q31_MOFEX_costMinFuelEx "Minimization of discounted fossil fuel extraction and trade costs" -q31_MOFEX_tradebal(ttot,all_enty) "New trade equation for MOFEX purposes" -$ENDIF.mofex *** Cost q31_costFuExPol(ttot,all_regi,all_enty) "costs of fuels estimated by polynomial; exhaustible fuels (uranium)" q31_mc_dummy(all_regi,all_enty) "marginal costs of fuels estimated by polynomial; exhaustible fuels (uranium)" diff --git a/modules/31_fossil/timeDepGrades/equations.gms b/modules/31_fossil/timeDepGrades/equations.gms index 6a11c50d98..e1a43c3f37 100644 --- a/modules/31_fossil/timeDepGrades/equations.gms +++ b/modules/31_fossil/timeDepGrades/equations.gms @@ -66,41 +66,6 @@ q31_totfuex_dummy(peExPol(enty)).. sum(regi, v31_fuExtrCumMax(regi,enty, "1")) ; -***----------------------------------------- -*** MOFEX -***----------------------------------------- -*** LB, JH - -*' MOFEX (Model of Fossil Extraction) minimizes the discounted extraction and trade costs of fossils while balancing trade for each time step. -*' The model takes fossil demand, imports and exports from a prior REMIND run as inputs, and it calculates fossil extraction and trade as outputs. -*' In this realization, the output variables are returned to the current REMIND run as starting points for the hybrid optimization. - -$IFTHEN.mofex %cm_MOFEX% == "on" -*** Trade of resources (oil, gas and coal) -q31_MOFEX_tradebal(t,trade(peExGrade)).. - sum(regi, vm_Xport(t,regi,trade) - vm_Mport(t,regi,trade)) =e= 0; - -*** Discounted extraction and trade costs of fossil fuels - q31_MOFEX_costMinFuelEx.. - v31_MOFEX_costMinFuelEx - =e= - sum(ttot$(ttot.val ge cm_startyear), - sum(regi, - pm_ts(ttot) / ((1 + pm_prtp(regi))**(pm_ttot_val(ttot)-cm_startyear)) - * (sum(peFos(enty), vm_costFuEx(ttot,regi,enty)) - + sum(peFos(enty), pm_costsTradePeFinancial(regi,"Mport",enty) * vm_Mport(ttot,regi,enty)) - + sum(peFos(enty), - (pm_costsTradePeFinancial(regi,"Xport",enty) * vm_Xport(ttot,regi,enty)) - * (1 - + pm_costsTradePeFinancial(regi,"XportElasticity",enty) / sqr(pm_ttot_val(ttot)-pm_ttot_val(ttot-1)) - * ( vm_Xport(ttot,regi,enty) / (vm_Xport(ttot-1,regi,enty) + pm_costsTradePeFinancial(regi, "tradeFloor",enty)) - 1) - ) - ) - ) - ) - ); -$ENDIF.mofex - ***----------------------------------------- *** Fossil fuel extraction (grade structure) ***----------------------------------------- diff --git a/modules/31_fossil/timeDepGrades/preloop.gms b/modules/31_fossil/timeDepGrades/preloop.gms index e08b41fb22..4715991ead 100644 --- a/modules/31_fossil/timeDepGrades/preloop.gms +++ b/modules/31_fossil/timeDepGrades/preloop.gms @@ -68,76 +68,6 @@ p31_datafosdyn(regi, "pecoal", rlf, "incoffset") = 0.002 * p31_grades("2005", re p31_datafosdyn(regi, enty, rlf, "alph") = 20; -***-------------------------------------- -*** MOFEX -***-------------------------------------- -*** Small partial model to compute level values of fossil fuel extraction (vm_fuExtr.l) given a -*** specific demand path -$IFTHEN.mofex %cm_MOFEX% == "on" -option nlp = conopt4; !! Greatly speed up convergence process (x3~x4) - -*** Get fossil fuel demand (vm_prodPe) from reference GDX (input.gdx) -p31_MOFEX_peprod_ref(ttot,regi,peExGrade(enty)) = 0; -p31_MOFEX_Xport_ref(ttot,regi,trade) = 0; -p31_MOFEX_Mport_ref(ttot,regi,trade) = 0; -Execute_Loadpoint 'input', - p31_MOFEX_peprod_ref = vm_prodPe.l, - p31_MOFEX_Xport_ref = vm_Xport.l, - p31_MOFEX_Mport_ref = vm_Mport.l; -display p31_MOFEX_peprod_ref; - -*** Fixing MOFEX fossil fuel demand to reference GDX data -vm_prodPe.fx(ttot,regi,peExGrade(enty)) = p31_MOFEX_peprod_ref(ttot,regi,enty); - -*** Apply other important bounds -v31_fuExtrCum.up(t,regi,peExGrade(enty),rlf) = p31_grades(t,regi,"xi3",enty,rlf); -vm_costFuEx.up(t,regi,peExGrade(enty)) = 10.0; -vm_Xport.fx(ttot,regi,trade)$(ttot.val lt cm_startyear) = p31_MOFEX_Xport_ref(ttot,regi,trade); !! To avoid unbounded results -vm_Mport.fx(ttot,regi,trade)$(ttot.val lt cm_startyear) = p31_MOFEX_Mport_ref(ttot,regi,trade); !! To avoid unbounded results - -display vm_prodPe.l; - -*** Model statement -model m31_MOFEX /q31_MOFEX_costMinFuelEx, q31_MOFEX_tradebal, q31_fuExtrDec, q31_fuExtrInc, - q31_fuExtrCum, q31_costFuExGrade, qm_fuel2pe/; - -*** Iteration loop -o_modelstat = 100; -p31_sol_itr_max = 10; -loop(sol_itr$(sol_itr.val <= p31_sol_itr_max), - - if(ord(sol_itr)>(p31_sol_itr_max-1), - option solprint=on - ); - -*** Solve statement - if(o_modelstat ne 2, - solve m31_MOFEX using nlp minimizing v31_MOFEX_costMinFuelEx; - o_modelstat = m31_MOFEX.modelstat; - ); - -); - -vm_prodPe.lo(ttot,regi,peExGrade(enty)) = 1.e-9; -vm_prodPe.up(ttot,regi,peExGrade(enty)) = 1.e+2; - -*** Save fuel extraction and trade values -p31_MOFEX_fuelex_costMin(ttot,regi,enty,rlf) = vm_fuExtr.l(ttot,regi,enty,rlf); -p31_MOFEX_cumfex_costMin(ttot,regi,enty,rlf) = v31_fuExtrCum.l(ttot,regi,enty,rlf); -p31_MOFEX_Mport_costMin(ttot,regi,trade) = vm_Mport.l(ttot,regi,trade); -p31_MOFEX_Xport_costMin(ttot,regi,trade) = vm_Xport.l(ttot,regi,trade); - -*** Save values in a gdx -if(m31_MOFEX.modelstat ne 2, - Execute_Unload 'mofex'; - abort "MOFEX did not find an optimal solution. Stopping job..."; -); - -display p31_MOFEX_fuelex_costMin; -option nlp = %cm_conoptv%; -$ENDIF.mofex - - ***-------------------------------------- *** URANIUM BOUND ***-------------------------------------- diff --git a/scripts/start/readCheckScenarioConfig.R b/scripts/start/readCheckScenarioConfig.R index 6e35d387b6..144dac7cd6 100644 --- a/scripts/start/readCheckScenarioConfig.R +++ b/scripts/start/readCheckScenarioConfig.R @@ -211,7 +211,8 @@ readCheckScenarioConfig <- function(filename, remindPath = ".", testmode = FALSE "c_regi_capturescen" = "Rename to c_regi_co2captureEnergy, see https://github.com/remindmodel/remind/pull/2424", "cm_CCS_markup" = "Rename to cm_co2captureEnergyMarkup, see https://github.com/remindmodel/remind/pull/2424", "cm_Industry_CCS_markup" = "Rename to cm_co2captureIndMarkup, see https://github.com/remindmodel/remind/pull/2424", - "cm_techcosts" = "Deleted, not used anymore, see https://github.com/remindmodel/remind/pull/2507" + "cm_techcosts" = "Deleted, not used anymore, see https://github.com/remindmodel/remind/pull/2507", + "cm_MOFEX" = "Deleted, not used anymore, see https://github.com/remindmodel/remind/pull/2538" ) for (i in intersect(names(forbiddenColumnNames), unknownColumnNames)) { diff --git a/standalone/template.gms b/standalone/template.gms index b5381f467a..5a248cb7c4 100644 --- a/standalone/template.gms +++ b/standalone/template.gms @@ -273,7 +273,6 @@ cm_carbonprice_temperatureLimit = 1.8; !! def = 1.8 $SETGLOBAL cm_SlowConvergence off !! def = off $setglobal cm_INCONV_PENALTY on !! def = on $setGlobal c_skip_output off !! def = off -$setGlobal cm_MOFEX off !! def = off $setGlobal cm_conoptv conopt3 !! def = conopt3 $setGlobal cm_APscen SSP2 !! def = SSP2 diff --git a/standalone/trade/trade.gms b/standalone/trade/trade.gms index 6626663468..acb1aa2744 100644 --- a/standalone/trade/trade.gms +++ b/standalone/trade/trade.gms @@ -408,7 +408,6 @@ $setGLobal cm_debug_preloop off !! def = off $setglobal cm_INCONV_PENALTY on !! def = on $setglobal cm_INCONV_PENALTY_bioSwitch off !! def = off $setGlobal c_skip_output off !! def = off -$setGlobal cm_MOFEX off !! def = off $setGlobal cm_conoptv conopt3 !! def = conopt3 $setGlobal cm_APscen SSP2 !! def = SSP2 diff --git a/tests/testthat/test_01-gms_readSettings.R b/tests/testthat/test_01-gms_readSettings.R index 26ad5081b0..82d534e757 100644 --- a/tests/testthat/test_01-gms_readSettings.R +++ b/tests/testthat/test_01-gms_readSettings.R @@ -11,5 +11,4 @@ test_that("readSettings exits without warning", { test_that("standalone models have consistent settings definition", { skip("standalone models aren't consistent at the moment") expect_no_warning(gms::readSettings("../../standalone/trade/trade.gms")) - expect_no_warning(gms::readSettings("../../standalone/MOFEX/MOFEX.gms")) })