Skip to content
Snippets Groups Projects
Commit ec30df1a authored by Johannes Koch's avatar Johannes Koch
Browse files

Fixup remaining issues

The code should now run. Some namechanges had to be corrected/reversed. These module additions do not affect the results. Further improvements will be commited at a later date.
parent 26628d1a
No related branches found
No related tags found
1 merge request!32Macro trade modules
...@@ -18,6 +18,7 @@ core/input/f_macBaseMagpie.cs4r ...@@ -18,6 +18,7 @@ core/input/f_macBaseMagpie.cs4r
core/input/f_maxProdGradeRegiHydro.cs3r core/input/f_maxProdGradeRegiHydro.cs3r
core/input/f_maxProdGradeRegiWind.cs3r core/input/f_maxProdGradeRegiWind.cs3r
core/input/f_pop.cs3r core/input/f_pop.cs3r
core/input/f_IO_trade.cs4r
core/input/p_abatparam_CH4.cs4r core/input/p_abatparam_CH4.cs4r
core/input/p_abatparam_N2O.cs4r core/input/p_abatparam_N2O.cs4r
core/input/p_abatparam_CO2.cs4r core/input/p_abatparam_CO2.cs4r
...@@ -79,7 +80,6 @@ modules/23_capitalMarket/imperfect/input/pm_ies.cs4r ...@@ -79,7 +80,6 @@ modules/23_capitalMarket/imperfect/input/pm_ies.cs4r
modules/23_capitalMarket/imperfect/input/pm_nfa_start.cs4r modules/23_capitalMarket/imperfect/input/pm_nfa_start.cs4r
modules/23_capitalMarket/imperfect/input/pm_risk_premium.cs4r modules/23_capitalMarket/imperfect/input/pm_risk_premium.cs4r
modules/23_capitalMarket/perfect/input/pm_nfa_start.cs4r modules/23_capitalMarket/perfect/input/pm_nfa_start.cs4r
modules/24_trade/standard/input/f24_IO_trade.cs4r
modules/24_trade/standard/input/pm_costsPEtradeMp.cs4r modules/24_trade/standard/input/pm_costsPEtradeMp.cs4r
modules/24_trade/standard/input/pm_costsTradePeFinancial.cs3r modules/24_trade/standard/input/pm_costsTradePeFinancial.cs3r
modules/26_agCosts/costs/input/p26_totLUcostLookup.cs4r modules/26_agCosts/costs/input/p26_totLUcostLookup.cs4r
......
...@@ -13,7 +13,7 @@ cfg <- list() ...@@ -13,7 +13,7 @@ cfg <- list()
#### Main settings #### #### Main settings ####
#short description of the actual run #short description of the actual run
cfg$title <- "default_mm" cfg$title <- "default"
# path to the submodel to be used relative to main model folder (e.g."standalone/template.gms") # path to the submodel to be used relative to main model folder (e.g."standalone/template.gms")
#cfg$model <- "main.gms" #def = "main.gms" #cfg$model <- "main.gms" #def = "main.gms"
......
...@@ -114,12 +114,12 @@ p_developmentState(tall,all_regi) = f_developmentState(tall,all_regi,"%c_GDPpcSc ...@@ -114,12 +114,12 @@ p_developmentState(tall,all_regi) = f_developmentState(tall,all_regi,"%c_GDPpcSc
*** Load information from BAU run *** Load information from BAU run
$ifthen.cm_compile_main %cm_compile_main% == "TRUE" $ifthen.cm_compile_main %cm_compile_main% == "TRUE"
pm_gdp_gdx(ttot,regi) = 0; pm_gdp_gdx(ttot,regi) = 0;
pm_inv_gdx(ttot,regi) = 0; p_inv_gdx(ttot,regi) = 0;
$else.cm_compile_main $else.cm_compile_main
Execute_Loadpoint 'input' vm_cesIO, vm_invMacro; Execute_Loadpoint 'input' vm_cesIO, vm_invMacro;
pm_gdp_gdx(ttot,regi) = vm_cesIO.l(ttot,regi,"inco"); pm_gdp_gdx(ttot,regi) = vm_cesIO.l(ttot,regi,"inco");
pm_inv_gdx(ttot,regi) = vm_invMacro.l(ttot,regi,"kap"); p_inv_gdx(ttot,regi) = vm_invMacro.l(ttot,regi,"kap");
$endif.cm_compile_main $endif.cm_compile_main
*** permit price initilization *** permit price initilization
...@@ -327,6 +327,26 @@ loop(emi2te(enty,enty2,te,enty3)$teCCS(te), ...@@ -327,6 +327,26 @@ loop(emi2te(enty,enty2,te,enty3)$teCCS(te),
p_boundtmp(ttot,all_regi,te,rlf)$(ttot.val ge 2005) = 0; p_boundtmp(ttot,all_regi,te,rlf)$(ttot.val ge 2005) = 0;
p_bound_cap(ttot,all_regi,te,rlf)$(ttot.val ge 2005) = 0; p_bound_cap(ttot,all_regi,te,rlf)$(ttot.val ge 2005) = 0;
*NB* include data and parameters for upper bounds on fossil fuel transport
parameter f_IO_trade(tall,all_regi,all_enty,char) "Energy trade bounds based on IEA data"
/
$ondelim
$include "./core/input/f_IO_trade.cs4r"
$offdelim
/
;
pm_IO_trade(ttot,regi,enty,char) = f_IO_trade(ttot,regi,enty,char) * sm_EJ_2_TWa;
*LB* use scaled data for export to guarantee net trade = 0 for each traded good
loop(tradePe,
loop(t,
if(sum(regi2, pm_IO_trade(t,regi2,tradePe,"Xport")) ne 0,
pm_IO_trade(t,regi,tradePe,"Xport") = pm_IO_trade(t,regi,tradePe,"Xport") * sum(regi2, pm_IO_trade(t,regi2,tradePe,"Mport")) / sum(regi2, pm_IO_trade(t,regi2,tradePe,"Xport"));
);
);
);
display pm_IO_trade;
***nicolasb*DOT* FILE produced from D:\projekte\rose\resources\fossilGrades_nico.m; 2011,12,16;12:14:44 ***nicolasb*DOT* FILE produced from D:\projekte\rose\resources\fossilGrades_nico.m; 2011,12,16;12:14:44
***nicolasb*DOT* original data from literature (Brandt 2009, Charpentier 2009) ***nicolasb*DOT* original data from literature (Brandt 2009, Charpentier 2009)
***nicolasb*DOT* data files are available at RD3 drive roseBob_finSSP.xls ***nicolasb*DOT* data files are available at RD3 drive roseBob_finSSP.xls
......
...@@ -26,7 +26,7 @@ pm_pricePerm(ttot) "permit price in special ca ...@@ -26,7 +26,7 @@ pm_pricePerm(ttot) "permit price in special ca
p_share(ttot,all_regi,all_in,all_in) "share of production factors" p_share(ttot,all_regi,all_in,all_in) "share of production factors"
pm_share_trans(tall,all_regi) "transportation share" pm_share_trans(tall,all_regi) "transportation share"
pm_gdp_gdx(tall,all_regi) "GDP path from gdx, updated iteratively." pm_gdp_gdx(tall,all_regi) "GDP path from gdx, updated iteratively."
pm_inv_gdx(tall,all_regi) "macro-investments path from gdx, updated iteratively." p_inv_gdx(tall,all_regi) "macro-investments path from gdx, updated iteratively."
pm_taxCO2eq(ttot,all_regi) "CO2 tax path in T$/GtC = $/kgC. To get $/tCO2, multiply with 272 [T$/GtC]" pm_taxCO2eq(ttot,all_regi) "CO2 tax path in T$/GtC = $/kgC. To get $/tCO2, multiply with 272 [T$/GtC]"
pm_taxCO2eqHist(ttot,all_regi) "Historic CO2 tax path in 2010 and 2015 (also in BAU!) in T$/GtC = $/kgC. To get $/tCO2, multiply with 272 [T$/GtC]" pm_taxCO2eqHist(ttot,all_regi) "Historic CO2 tax path in 2010 and 2015 (also in BAU!) in T$/GtC = $/kgC. To get $/tCO2, multiply with 272 [T$/GtC]"
pm_taxCO2eq_iteration(iteration,ttot,all_regi) "save CO2eq tax used in iteration" pm_taxCO2eq_iteration(iteration,ttot,all_regi) "save CO2eq tax used in iteration"
...@@ -267,7 +267,7 @@ vm_damageFactor(ttot,all_regi) "damage factor reducing GDP ...@@ -267,7 +267,7 @@ vm_damageFactor(ttot,all_regi) "damage factor reducing GDP
vm_esCapInv(ttot,all_regi,all_teEs) "investment for energy end-use capital at the energy service level" vm_esCapInv(ttot,all_regi,all_teEs) "investment for energy end-use capital at the energy service level"
***---------------------------------------------------------------------------------------- ***----------------------------------------------------------------------------------------
*-----------------------------------------------ESM module--------------------------------- *-----------------------------------------------ESM module---------------------------------
vm_costEnergySys(ttot,all_regi) "total energy cost" vm_costEnergySys(ttot,all_regi) "energy system costs"
vm_cap(tall,all_regi,all_te,rlf) "net total capacities" vm_cap(tall,all_regi,all_te,rlf) "net total capacities"
vm_capDistr(tall,all_regi,all_te,rlf) "net capacities, distributed to the different grades for renewables" vm_capDistr(tall,all_regi,all_te,rlf) "net capacities, distributed to the different grades for renewables"
...@@ -318,7 +318,7 @@ q_limitSeel2fehes(ttot,all_regi) "equation to limit the shar ...@@ -318,7 +318,7 @@ q_limitSeel2fehes(ttot,all_regi) "equation to limit the shar
q_esCapInv(ttot,all_regi,all_teEs) "investment equation for end-use capital investments (energy service layer)" q_esCapInv(ttot,all_regi,all_teEs) "investment equation for end-use capital investments (energy service layer)"
***---------------------------------------------------------------------------------------- ***----------------------------------------------------------------------------------------
***-----------------------------------------------ESM module------------------------------- ***-----------------------------------------------ESM module-------------------------------
q_costEnergySys(ttot,all_regi) "total energy cost" q_costEnergySys(ttot,all_regi) "energy system costs"
q_costFu(ttot,all_regi) "costs of fuels" q_costFu(ttot,all_regi) "costs of fuels"
q_costOM(ttot,all_regi) "costs of o&m" q_costOM(ttot,all_regi) "costs of o&m"
......
...@@ -7,6 +7,7 @@ f_macBaseMagpie.cs4r ...@@ -7,6 +7,7 @@ f_macBaseMagpie.cs4r
f_maxProdGradeRegiHydro.cs3r f_maxProdGradeRegiHydro.cs3r
f_maxProdGradeRegiWind.cs3r f_maxProdGradeRegiWind.cs3r
f_pop.cs3r f_pop.cs3r
f_IO_trade.cs4r
p_abatparam_CH4.cs4r p_abatparam_CH4.cs4r
p_abatparam_N2O.cs4r p_abatparam_N2O.cs4r
p_abatparam_CO2.cs4r p_abatparam_CO2.cs4r
...@@ -18,6 +19,8 @@ p_earlyRetirementAdjFactor.cs3r ...@@ -18,6 +19,8 @@ p_earlyRetirementAdjFactor.cs3r
p_emiFossilFuelExtr.cs4r p_emiFossilFuelExtr.cs4r
p_emineg_econometric.cs3r p_emineg_econometric.cs3r
p_histCap.cs3r p_histCap.cs3r
p_histEmiMac.cs4r
p_histEmiSector.cs4r
p_PE_histCap.cs3r p_PE_histCap.cs3r
p_macBase1990.cs4r p_macBase1990.cs4r
p_macBase2005.cs4r p_macBase2005.cs4r
......
...@@ -564,7 +564,7 @@ display p_bioshare; ...@@ -564,7 +564,7 @@ display p_bioshare;
*LB* update parameter that are used for variables during the run *LB* update parameter that are used for variables during the run
pm_gdp_gdx(ttot,regi)$(ttot.val ge 2005) = vm_cesIO.l(ttot,regi,"inco"); pm_gdp_gdx(ttot,regi)$(ttot.val ge 2005) = vm_cesIO.l(ttot,regi,"inco");
pm_inv_gdx(ttot,regi)$(ttot.val ge 2005) = vm_invMacro.l(ttot,regi,"kap"); p_inv_gdx(ttot,regi)$(ttot.val ge 2005) = vm_invMacro.l(ttot,regi,"kap");
pm_GDPGross(ttot,regi)$( (pm_SolNonInfes(regi) eq 1) ) = vm_cesIO.l(ttot,regi,"inco"); pm_GDPGross(ttot,regi)$( (pm_SolNonInfes(regi) eq 1) ) = vm_cesIO.l(ttot,regi,"inco");
......
...@@ -26,7 +26,7 @@ p_emineg_econometric(regi,"n2owaste","p2")$(pm_gdp_gdx("2005",regi)/pm_pop("2005 ...@@ -26,7 +26,7 @@ p_emineg_econometric(regi,"n2owaste","p2")$(pm_gdp_gdx("2005",regi)/pm_pop("2005
*JeS CO2 emissions from cement production. p_switch_cement describes an s-curve to provide a smooth switching from the short-term *JeS CO2 emissions from cement production. p_switch_cement 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). *** behavior (depending on per capita capital investments) to the long-term behavior (constant per capita emissions).
p_switch_cement(ttot,regi)$(ttot.val ge 2005) = 1 / ( 1 + exp( - (s_c_so2 / s_tau_cement) p_switch_cement(ttot,regi)$(ttot.val ge 2005) = 1 / ( 1 + exp( - (s_c_so2 / s_tau_cement)
*(1000 * pm_inv_gdx(ttot,regi) / (pm_pop(ttot,regi)*pm_shPPPMER(regi)) - p_emineg_econometric(regi,"co2cement_process","p4")) *(1000 * p_inv_gdx(ttot,regi) / (pm_pop(ttot,regi)*pm_shPPPMER(regi)) - p_emineg_econometric(regi,"co2cement_process","p4"))
) )
); );
display p_switch_cement; display p_switch_cement;
...@@ -42,8 +42,8 @@ p_emineg_econometric(regi,"co2cement_process","p1")$( p_switch_cement("2005",reg ...@@ -42,8 +42,8 @@ p_emineg_econometric(regi,"co2cement_process","p1")$( p_switch_cement("2005",reg
* ( ( 1000 * ( ( 1000
!! use default per-capita investments if no investment data in gdx !! use default per-capita investments if no investment data in gdx
!! (due to different region settings) !! (due to different region settings)
* ( (pm_inv_gdx("2005",regi) / pm_pop("2005",regi))$( pm_inv_gdx("2005",regi) ) * ( (p_inv_gdx("2005",regi) / pm_pop("2005",regi))$( p_inv_gdx("2005",regi) )
+ 4$( NOT pm_inv_gdx("2005",regi) ) + 4$( NOT p_inv_gdx("2005",regi) )
) )
/ pm_shPPPMER(regi) / pm_shPPPMER(regi)
) )
...@@ -96,7 +96,7 @@ display p_efFossilFuelExtr; ...@@ -96,7 +96,7 @@ display p_efFossilFuelExtr;
***-------------------------------------- ***--------------------------------------
*JeS CO2 emissions from cement production. p_switch_cement describes an s-curve to provide a smooth switching from the short-term *JeS CO2 emissions from cement production. p_switch_cement 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). *** behavior (depending on per capita capital investments) to the long-term behavior (constant per capita emissions).
p_switch_cement(ttot,regi)$(ttot.val ge 1990)=1/(1+exp(-(s_c_so2/s_tau_cement)*(1000*pm_inv_gdx(ttot,regi)/(pm_pop(ttot,regi)*pm_shPPPMER(regi))-p_emineg_econometric(regi,"co2cement_process","p4")))); p_switch_cement(ttot,regi)$(ttot.val ge 1990)=1/(1+exp(-(s_c_so2/s_tau_cement)*(1000*p_inv_gdx(ttot,regi)/(pm_pop(ttot,regi)*pm_shPPPMER(regi))-p_emineg_econometric(regi,"co2cement_process","p4"))));
display p_switch_cement; display p_switch_cement;
*** scale CO2 luc baselines from MAgPIE to EDGAR v4.2 2005 data in REMIND standalone runs: linear, phase out within 20 years *** scale CO2 luc baselines from MAgPIE to EDGAR v4.2 2005 data in REMIND standalone runs: linear, phase out within 20 years
...@@ -155,7 +155,7 @@ vm_macBase.fx(ttot,regi,"co2cement_process")$( ttot.val ge 2005 ) ...@@ -155,7 +155,7 @@ vm_macBase.fx(ttot,regi,"co2cement_process")$( ttot.val ge 2005 )
* ( (1 - p_switch_cement(ttot,regi)) * ( (1 - p_switch_cement(ttot,regi))
* p_emineg_econometric(regi,"co2cement_process","p1") * p_emineg_econometric(regi,"co2cement_process","p1")
* ( (1000 * ( (1000
* pm_inv_gdx(ttot,regi) * p_inv_gdx(ttot,regi)
/ ( pm_pop(ttot,regi) / ( pm_pop(ttot,regi)
* pm_shPPPMER(regi) * pm_shPPPMER(regi)
) )
...@@ -165,7 +165,7 @@ vm_macBase.fx(ttot,regi,"co2cement_process")$( ttot.val ge 2005 ) ...@@ -165,7 +165,7 @@ vm_macBase.fx(ttot,regi,"co2cement_process")$( ttot.val ge 2005 )
* p_emineg_econometric(regi,"co2cement_process","p3") * p_emineg_econometric(regi,"co2cement_process","p3")
) )
) )
)$(pm_inv_gdx(ttot,regi) ne 0) )$(p_inv_gdx(ttot,regi) ne 0)
; ;
vm_macBaseInd.fx(ttot,regi,"co2cement_process","cement")$( ttot.val ge 2005 ) vm_macBaseInd.fx(ttot,regi,"co2cement_process","cement")$( ttot.val ge 2005 )
......
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
* *
* Input data revision: 5.937 * Input data revision: 5.937
* *
* Last modification (input data): Wed Jan 15 10:44:14 2020 * Last modification (input data): Wed Jan 15 14:19:35 2020
* *
*###################### R SECTION END (VERSION INFO) ########################### *###################### R SECTION END (VERSION INFO) ###########################
...@@ -120,7 +120,7 @@ option profile = 0; ...@@ -120,7 +120,7 @@ option profile = 0;
***--------------------- Run name ----------------------------------------- ***--------------------- Run name -----------------------------------------
$setGlobal c_expname default_mm $setGlobal c_expname default
***------------------------------------------------------------------------------ ***------------------------------------------------------------------------------
*** MODULES *** MODULES
......
...@@ -29,7 +29,6 @@ vm_welfareGlob "Global welfare" ...@@ -29,7 +29,6 @@ vm_welfareGlob "Global welfare"
$ifthen.inconv %cm_INCONV_PENALTY% == "on" $ifthen.inconv %cm_INCONV_PENALTY% == "on"
v02_inconvPen(ttot,all_regi) "Inconvenience penalty in the welfare function, e.g. for air pollution. Unit: ?Utils?" v02_inconvPen(ttot,all_regi) "Inconvenience penalty in the welfare function, e.g. for air pollution. Unit: ?Utils?"
v02_inconvPenCoalSolids(ttot,all_regi) "Inconvenience penalty in the welfare function, e.g. for air pollution. Unit: ?Utils?" v02_inconvPenCoalSolids(ttot,all_regi) "Inconvenience penalty in the welfare function, e.g. for air pollution. Unit: ?Utils?"
v02_inconvPenCoalSolids(ttot,all_regi) "Inconvenience penalty in the welfare function, e.g. for air pollution. Unit: ?Utils?"
v02_sesoInconvPenSlack(ttot,all_regi) "Slack to avoid negative inconvenience penalty for Coal Solids" v02_sesoInconvPenSlack(ttot,all_regi) "Slack to avoid negative inconvenience penalty for Coal Solids"
$endif.inconv $endif.inconv
; ;
......
...@@ -12,29 +12,6 @@ pm_Xport0("2005",regi,peFos) = 0; ...@@ -12,29 +12,6 @@ pm_Xport0("2005",regi,peFos) = 0;
*ML* Reintroduction of trade cost for composite good (based on export/import value difference for non-energy goods in GTAP6) *ML* Reintroduction of trade cost for composite good (based on export/import value difference for non-energy goods in GTAP6)
pm_tradecostgood(regi) = 0.03; pm_tradecostgood(regi) = 0.03;
*NB* include data and parameters for upper bounds on fossil fuel transport
parameter f24_IO_trade(tall,all_regi,all_enty,char) "Energy trade bounds based on IEA data"
/
$ondelim
$include "./modules/24_trade/standard/input/f24_IO_trade.cs4r"
$offdelim
/
;
pm_IO_trade(ttot,regi,enty,char) = f24_IO_trade(ttot,regi,enty,char) * sm_EJ_2_TWa;
*LB* use scaled data for export to guarantee net trade = 0 for each traded good
loop(tradePe,
loop(t,
if(sum(regi2, pm_IO_trade(t,regi2,tradePe,"Xport")) ne 0,
pm_IO_trade(t,regi,tradePe,"Xport") = pm_IO_trade(t,regi,tradePe,"Xport") * sum(regi2, pm_IO_trade(t,regi2,tradePe,"Mport")) / sum(regi2, pm_IO_trade(t,regi2,tradePe,"Xport"));
);
);
);
display pm_IO_trade;
*** load data on transportation costs of imports *** load data on transportation costs of imports
parameter pm_costsPEtradeMp(all_regi,all_enty) "PE tradecosts (energy losses on import)" parameter pm_costsPEtradeMp(all_regi,all_enty) "PE tradecosts (energy losses on import)"
/ /
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment