Skip to content
Snippets Groups Projects
Commit f024fd2a authored by Marianna Rottoli's avatar Marianna Rottoli
Browse files

Merge branch 'develop' of github.com:remindmodel/remind into REMIND_new_transp_esm

parents f02f41f6 26757d4b
No related branches found
No related tags found
1 merge request!67Request to merge the new transport module EDGE-T
Showing
with 664 additions and 1 deletion
*** | (C) 2006-2019 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/01_macro/singleSectorGr/datainput.gms
*** depreciation rate of capital
pm_delta_kap(regi,"kap") = 0.05;
*** load data for macro investments in 2005, used as bound
parameter p01_boundInvMacro(all_regi) "macro investments in 2005"
/
$ondelim
$include "./modules/01_macro/singleSectorGr/input/p01_boundInvMacro.cs4r"
$offdelim
/
;
p01_boundInvMacro(all_regi) = p01_boundInvMacro(all_regi) * pm_shPPPMER(all_regi);
*** EOF ./modules/01_macro/singleSectorGr/datainput.gms
\ No newline at end of file
*** | (C) 2006-2019 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/01_macro/singleSectorGr/declarations.gms
***-------------------------------------------------------------------------------
*** PARAMETERS
***-------------------------------------------------------------------------------
parameters
pm_delta_kap(all_regi,all_in) "Depreciation rate of capital."
pm_cumDeprecFactor_old(ttot,all_regi,all_in) "Investment depreciation within a period, applied to the investment of t -1."
pm_cumDeprecFactor_new(ttot,all_regi,all_in) "Investment depreciation within a period, applied to the investment of t."
pm_ppfen_ratios(all_in,all_in) "Limit ratio of two primary production factors of energy (ppfEn)."
pm_ppfen_shares(all_in,all_in) "Limit the share of one ppfEn in total CES nest inputs."
pm_consPC(tall,all_regi) "Consumption per capita"
;
***------------------------------------------------------------ -------------------
*** VARIABLES
***------------------------------------------------------------ -------------------
positive variables
vm_cons(ttot,all_regi) "Consumption"
vm_cesIO(tall,all_regi,all_in) "Production factor"
vm_invMacro(ttot,all_regi,all_in) "Investment for capital for ttot"
v01_invMacroAdj(ttot,all_regi,all_in) "Adjustment costs of macro economic investments"
vm_invRD(ttot,all_regi,all_in) "R&D investments"
vm_invInno(ttot,all_regi,all_in) "Investment into innovation"
vm_invImi(ttot, all_regi,all_in) "Investment into imitation"
*** putty-clay variables
vm_cesIOdelta(tall,all_regi,all_in) "Putty-clay production factor"
;
***------------------------------------------------------------ -------------------
*** EQUATIONS
***------------------------------------------------------------ -------------------
equations
qm_budget(ttot,all_regi) "Budget balance"
q01_balLab(ttot,all_regi) "Labour balance"
q01_cesIO(ttot,all_regi,all_in) "Production function"
q01_prodCompl(ttot,all_regi,all_in,all_in) "Constraints for perfect complements in the CES tree"
q01_kapMo(ttot,all_regi,all_in) "Capital motion equation"
q01_kapMo0(t0,all_regi,all_in) "Initial condition for capital"
q01_invMacroAdj(ttot,all_regi,all_in) "Adjustment costs for macro economic investments"
q01_limitShPpfen(ttot,all_regi,all_in,all_in) "Limit the share of one ppfEn in total CES nest inputs"
q01_limtRatioPpfen(ttot,all_regi,all_in,all_in) "Limit the ratio of two ppfEn"
*** putty-clay equations
q01_cesIO_puttyclay(ttot,all_regi,all_in) "Putty-clay production function"
q01_puttyclay(ttot,all_regi,all_in) "Putty-clay Correspondance between variations in input and past stocks of input"
q01_prodCompl_putty(ttot,all_regi,all_in,all_in) "Putty-Clay constraints for perfect complements in the CES tree"
q01_kapMo_putty(ttot,all_regi,all_in) "Putty-clay capital motion equation"
;
*** EOF ./modules/01_macro/singleSectorGr/declarations.gms
\ No newline at end of file
*** | (C) 2006-2019 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/01_macro/singleSectorGr/equations.gms
***---------------------------------------------------------------------------
*' Usable macroeconomic output - net of climate change damages - is calculated from the macroeconomic output,
*' taking into account export and import of the final good, taking specific trade costs into account,
*' which are assigned to the importer. The resulting output is used for consumption,
*' for investments into the capital stock, and for the energy system cost components investments,
*' fuel costs and operation & maintenance.
*' Other additional costs like non-energy related greenhouse gas abatement costs and
*' agricultural costs, which are delivered by the land use model MAgPIE, are deduced from disposable output.
*' Net tax revenues and adjustment costs converge to zero in the optimal solution (equilibrium point).
***---------------------------------------------------------------------------
qm_budget(ttot,regi)$( ttot.val ge cm_startyear ) ..
vm_cesIO(ttot,regi,"inco") * vm_damageFactor(ttot,regi)
- vm_Xport(ttot,regi,"good")
+ vm_Mport(ttot,regi,"good") * (1 - pm_tradecostgood(regi) - pm_risk_premium(regi))
=g=
vm_cons(ttot,regi)
+ sum(ppfKap(in), vm_invMacro(ttot,regi,in))
+ sum(ppfKap(in), v01_invMacroAdj(ttot,regi,in))
+ sum(in, vm_invRD(ttot,regi,in))
+ sum(in, vm_invInno(ttot,regi,in))
+ sum(in, vm_invImi(ttot,regi,in))
+ sum(tradePe(enty), pm_costsTradePeFinancial(regi,"Mport",enty) * vm_Mport(ttot,regi,enty))
+ sum(tradePe(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
)
)$( ttot.val ge max(2010, cm_startyear) )
)
)
+ vm_taxrev(ttot,regi)$(ttot.val ge 2010)
+ vm_costAdjNash(ttot,regi)
+ sum(in_enerSerAdj(in), vm_enerSerAdj(ttot,regi,in))
+ sum(teEs, vm_esCapInv(ttot,regi,teEs))
+ vm_costpollution(ttot,regi)
+ pm_totLUcosts(ttot,regi)
*** agricultural MACs are part of pm_totLUcosts (see module 26_agCosts)
+ sum(enty$(emiMacSector(enty) AND (NOT emiMacMagpie(enty))), pm_macCost(ttot,regi,enty))
+ vm_costEnergySys(ttot,regi)
;
***---------------------------------------------------------------------------
*' The labor available in every time step and every region comes from exogenous data.
*' It is the population corrected by the population age structure,
*' which results in the labour force of people agged 15 to 65.
*' The labor participation rate is not factored into the labour supply (as it would only imply a
*' rescaling of parameters without consequences for the model's dynamic).
*' The labour market balance equation reads as follows:
***---------------------------------------------------------------------------
q01_balLab(t,regi)..
vm_cesIO(t,regi,"lab")
=e=
pm_lab(t,regi)
;
***---------------------------------------------------------------------------
*' The production function is a nested CES (constant elasticity of substitution) production function.
*' The macroeconomic output is generated by the inputs capital, labor, and total final energy (as a macro-ecoomic
*' aggregate in $US units). The generation of total final energy is described
*' by a CES production function as well, whose input factors are CES function outputs again.
*' Hence, the outputs of CES nests are intermediates measured in $US units.
*' According to the Euler-equation the value of the intermediate equals the sum of expenditures for the inputs.
*' Sector-specific final energy types represent the bottom end of the `CES-tree'. These 'CES leaves' are
*' measured in physical units and have a price in $US per physical unit.
*' The top of the tree is the total economic output measured in $US.
*' The following equation is the generic form of the production function.
*' It treats the various CES nests separately and the nests are inter-connetected via mappings.
*' This equation calculates the amount of intermediate output in a time-step and region
*' from the associated factor input amounts according to:
*** Keep in mind to adjust the calculation of derivatives and shares
*** in ./core/reswrite.inc if you change the structure of this function.
***---------------------------------------------------------------------------
q01_cesIO(t,regi,ipf(out))$ ( NOT ipf_putty(out)) ..
vm_cesIO(t,regi,out)
=e=
sum(cesOut2cesIn(out,in),
pm_cesdata(t,regi,in,"xi")
* (
pm_cesdata(t,regi,in,"eff")
* vm_effGr(t,regi,in)
* vm_cesIO(t,regi,in)
)
** pm_cesdata(t,regi,out,"rho")
)
** (1 / pm_cesdata(t,regi,out,"rho"))
;
***---------------------------------------------------------------------------
*' Constraints for perfect complements in the CES tree
***---------------------------------------------------------------------------
q01_prodCompl(t,regi,in,in2) $ (complements_ref(in,in2) AND (( NOT in_putty(in2)) OR ppfIO_putty(in2))) ..
vm_cesIO(t,regi,in)
=e=
pm_cesdata(t,regi,in2,"compl_coef")
* vm_cesIO(t,regi,in2)
;
***---------------------------------------------------------------------------
*' The capital stock is claculated recursively. Its amount in the previous time
*' step is devaluated by an annual depreciation factor and enlarged by investments.
*' Both depreciation and investments are expressed as annual values,
*' so the time step length is taken into account.
***---------------------------------------------------------------------------
q01_kapMo(ttot,regi,ppfKap(in))$( ( NOT in_putty(in)) AND (ord(ttot) lt card(ttot)) AND (pm_ttot_val(ttot+1) ge max(2010, cm_startyear)) AND (pm_cesdata("2005",regi,in,"quantity") gt 0))..
vm_cesIO(ttot+1,regi,in)
=e=
(1- pm_delta_kap(regi,in))**(pm_ttot_val(ttot+1)-pm_ttot_val(ttot)) * vm_cesIO(ttot,regi,in)
$ifthen setGlobal END2110
*gl* short time horizon requires investments to materialize in the same time step
+ pm_ts(ttot)*vm_invMacro(ttot,regi,in)*0.94**5 - (0.5*pm_ts(ttot)*vm_invMacro(ttot,regi,in)*0.94**5)$(ord(ttot) eq card(ttot));
$else
+ pm_cumDeprecFactor_old(ttot+1,regi,in) * vm_invMacro(ttot,regi,in)
+ pm_cumDeprecFactor_new(ttot+1,regi,in) * vm_invMacro(ttot+1,regi,in) ;
$endif
;
***---------------------------------------------------------------------------
*' Adjustment costs of macro economic investments:
***---------------------------------------------------------------------------
q01_invMacroAdj(ttot,regi,ppfKap(in))$( ttot.val ge max(2010, cm_startyear))..
v01_invMacroAdj(ttot,regi,in)
=e=
sqr( (vm_invMacro(ttot,regi,in)-vm_invMacro(ttot-1,regi,in))
/ (pm_ttot_val(ttot)-pm_ttot_val(ttot-1))
/ (vm_invMacro(ttot,regi,in)+0.0001)
)
* vm_cesIO(ttot,regi,in) / 11
*ML/RP* use "kap/11" instead of "vm_invMacro" for the scaling to remove the "invest=0"-trap that sometimes appeared in delay scenarios; kap/11 corresponds to the global average ratio of investments to capital in 2005.
*** In some regions the ratio kap:invest is higher, in some it is lower.
;
***---------------------------------------------------------------------------
*' Initial conditions for capital:
***---------------------------------------------------------------------------
q01_kapMo0(t0(t),regi,ppfKap(in))$(pm_cesdata(t,regi,in,"quantity") gt 0)..
vm_cesIO(t,regi,in)
=e=
pm_cesdata(t,regi,in,"quantity");
*' Limit the share of one ppfEn in total CES nest inputs:
q01_limitShPpfen(t,regi,out,in)$( pm_ppfen_shares(out,in) ) ..
vm_cesIO(t,regi,in)
=l=
pm_ppfen_shares(out,in)
* sum(cesOut2cesIn(out,in2), vm_cesIO(t,regi,in2))
;
*' Limit the ratio of two ppfEn:
q01_limtRatioPpfen(t,regi,in,in2)$( pm_ppfen_ratios(in,in2) ) ..
vm_cesIO(t,regi,in)
=l=
pm_ppfen_ratios(in,in2)
* vm_cesIO(t,regi,in2)
;
***---------------------------------------------------------------------------
*** Start of Putty-Clay equations
*' Putty-Clay production function:
***---------------------------------------------------------------------------
q01_cesIO_puttyclay(t,regi,ipf_putty(out)) ..
vm_cesIOdelta(t,regi,out)
=e=
sum(cesOut2cesIn(out,in),
pm_cesdata(t,regi,in,"xi")
* (
pm_cesdata(t,regi,in,"eff")
* vm_effGr(t,regi,in)
* vm_cesIOdelta(t,regi,in)
)
** pm_cesdata(t,regi,out,"rho")
)
** (1 / pm_cesdata(t,regi,out,"rho"))
;
*' Putty-Clay constraints for perfect complements in the CES tree:
q01_prodCompl_putty(t,regi,in,in2) $ (complements_ref(in,in2)
AND ( in_putty(in2) AND ( NOT ppfIO_putty(in2)))) ..
vm_cesIOdelta(t,regi,in) =e=
pm_cesdata(t,regi,in2,"compl_coef")
* vm_cesIOdelta(t,regi,in2);
*' Correspondance between vm_cesIO and vm_cesIOdelta:
q01_puttyclay(ttot,regi,in_putty(in))$(ord(ttot) lt card(ttot) AND (pm_ttot_val(ttot+1) ge max(2010, cm_startyear)))..
vm_cesIO(ttot+1,regi,in)
=e=
vm_cesIO(ttot,regi,in)*(1- pm_delta_kap(regi,in))**(pm_ttot_val(ttot+1)-pm_ttot_val(ttot))
+ pm_cumDeprecFactor_old(ttot+1,regi,in)* vm_cesIOdelta(ttot,regi,in)
+ pm_cumDeprecFactor_new(ttot+1,regi,in)* vm_cesIOdelta(ttot+1,regi,in)
;
*' Capital motion equation for putty clay capital:
q01_kapMo_putty(ttot,regi,in_putty(in))$(ppfKap(in) AND (ord(ttot) le card(ttot)) AND (pm_ttot_val(ttot) ge max(2005, cm_startyear)) AND (pm_cesdata("2005",regi,in,"quantity") gt 0))..
vm_cesIOdelta(ttot,regi,in)
=e=
0
$ifthen setGlobal END2110
*gl* short time horizon requires investments to materialize in the same time step
+ pm_ts(ttot)*vm_invMacro(ttot,regi,in)*0.94**5 - (0.5*pm_ts(ttot)*vm_invMacro(ttot,regi,in)*0.94**5)$(ord(ttot) eq card(ttot));
$else
+ vm_invMacro(ttot,regi,in)
;
$endif
;
***---------------------------------------------------------------------------
*** End of Putty-Clay equations
***---------------------------------------------------------------------------
*** EOF ./modules/01_macro/singleSectorGr/equations.gms
\ No newline at end of file
p01_boundInvMacro.cs4r
*** | (C) 2006-2019 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/01_macro/singleSectorGr/postsolve.gms
*** Consumption per capita
pm_consPC(ttot,regi)$(ttot.val gt 2005 and ttot.val le 2150 and (pm_SolNonInfes(regi) eq 1) ) =
vm_cons.l(ttot,regi)/pm_pop(ttot,regi)
;
*** Interpolate years
loop(ttot$(ttot.val ge 2005),
loop(tall$(pm_tall_2_ttot(tall, ttot)),
pm_consPC(tall,regi) =
(1- pm_interpolWeight_ttot_tall(tall)) * pm_consPC(ttot,regi)
+ pm_interpolWeight_ttot_tall(tall) * pm_consPC(ttot + 1,regi);
));
pm_consPC(tall,regi)$(tall.val gt 2150) = pm_consPC("2150",regi);
*** EOF ./modules/01_macro/singleSectorGr/postsolve.gms
\ No newline at end of file
*** | (C) 2006-2019 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/01_macro/singleSectorGr/preloop.gms
*** Calculate cummulative depreciation factors
loop ((t,counter),
if ( pm_dt(t) eq 2 * counter.val,
pm_cumDeprecFactor_old(t,regi,in)$(ppfKap(in) OR in_putty(in))
= ((1 - pm_delta_kap(regi,in)) ** (pm_dt(t)/2 )
- (1 - pm_delta_kap(regi,in)) ** (pm_dt(t) ))
/ pm_delta_kap(regi,in)
;
pm_cumDeprecFactor_new(t,regi,in)$(ppfKap(in) OR in_putty(in))
= ( 1
- (1 - pm_delta_kap(regi,in)) ** (pm_dt(t)/2)
)
/ pm_delta_kap(regi,in)
;
);
if ( pm_dt(t) eq (2 * counter.val -1),
pm_cumDeprecFactor_old(t,regi,in)$(ppfKap(in) OR in_putty(in))
= ((1 - pm_delta_kap(regi,in)) ** (pm_dt(t)/2 - 0.5)
- (1 - pm_delta_kap(regi,in)) ** (pm_dt(t)))
/ pm_delta_kap(regi,in)
- 1/2 * (1 - pm_delta_kap(regi,in)) ** (pm_dt(t)/2 - 0.5 )
;
pm_cumDeprecFactor_new(t,regi,in)$(ppfKap(in) OR in_putty(in))
= ( 1
- (1 - pm_delta_kap(regi,in)) ** (pm_dt(t)/2 - 0.5 + 1)
)
/ pm_delta_kap(regi,in)
- 1/2 * (1 - pm_delta_kap(regi,in)) ** (pm_dt(t)/2 - 0.5)
;
);
);
display "test Deprec", pm_cumDeprecFactor_new,pm_cumDeprecFactor_old;
*** EOF ./modules/01_macro/singleSectorGr/preloop.gms
*** | (C) 2006-2019 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/01_macro/singleSectorGr.gms
*' @description The singleSectorGr realization corresponds to a neo-classical, single
*' sector growth model.
*####################### R SECTION START (PHASES) ##############################
$Ifi "%phase%" == "sets" $include "./modules/01_macro/singleSectorGr/sets.gms"
$Ifi "%phase%" == "declarations" $include "./modules/01_macro/singleSectorGr/declarations.gms"
$Ifi "%phase%" == "datainput" $include "./modules/01_macro/singleSectorGr/datainput.gms"
$Ifi "%phase%" == "equations" $include "./modules/01_macro/singleSectorGr/equations.gms"
$Ifi "%phase%" == "preloop" $include "./modules/01_macro/singleSectorGr/preloop.gms"
$Ifi "%phase%" == "bounds" $include "./modules/01_macro/singleSectorGr/bounds.gms"
$Ifi "%phase%" == "postsolve" $include "./modules/01_macro/singleSectorGr/postsolve.gms"
*######################## R SECTION END (PHASES) ###############################
*** EOF ./modules/01_macro/singleSectorGr.gms
*** | (C) 2006-2019 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/01_macro/singleSectorGr/sets.gms
Sets
cesOut2cesIn(all_in,all_in) "CES tree structure"
/
inco . (lab, kap, en)
/
cesLevel2cesIO(counter,all_in) "CES tree structure by level"
cesRev2cesIO(counter,all_in) "CES tree structure by level - descending order"
cesOut2cesIn_below(all_in,all_in) "All elements of the CES below located below the first item given"
in_below_putty(all_in) "All elements of the CES below ppf_putty, excluding ppf_putty. Only meaningful in case putty structures are not intertwined"
in(all_in) "All inputs and outputs of the CES function"
/
inco "Macroeconomic output"
lab "Labour input"
kap "Capital input"
en "Energy input"
/
ppf(all_in) "All primary production factors"
ipf(all_in) "All intermediate production factors"
ppfKap(all_in) "Primary production factors capital" / kap /
ppfEn(all_in) "Primary production factors energy"
in_putty(all_in) "Production factors subject to putty-clay dynamics"
ppf_putty(all_in) "All putty-clay primary production factors"
ipf_putty(all_in) "All putty-clay intermediate production factors"
ppfIO_putty(all_in) "Factors treated in the normal CES as ppf and in putty-clay as output"
nests_putty(all_in,all_in) "Defines factors which are in the same putty subnest. The first all_in gives the higher factors of the subnest"
in_enerSerAdj(all_in) "Energy services factors which should be constrained by adjustment costs" //
in_complements(all_in) "Factors which are perfect complements" //
complements_ref(all_in,all_in) "Correspondence between complementary factors. Necessary to have a reference factor for the constraints equations"
;
in_putty(all_in) = NO;
ppf_putty(all_in) = NO;
ipf_putty(all_in) = NO;
ppfIO_putty(all_in) = NO;
alias(cesOut2cesIn,cesOut2cesIn2);
alias(in,out);
alias(in,in2,in3);
alias(ipf,ipf2);
*** EOF ./modules/01_macro/singleSectorGr/sets.gms
\ No newline at end of file
......@@ -29,7 +29,6 @@ vm_welfareGlob "Global welfare"
$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_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"
$endif.inconv
;
......
......@@ -7,6 +7,15 @@
*' @description This realization used IEA data from 2014.
*' The realization iea2014 serves to caliibrate the conversion efficiencies
*' to be consistent with predefined dataset (here iea2014, but it is flexible for up-dates).
*' The module realization starts with the final energy demands and then derives backwards
*' what the secondary and primary energy demands have been.
*' The file datainput.gms reads in the energy data related to each process. The process related inputs are
*' contained in input/f04_IO_input.cs4r and the output are contained in input/f04_IO_output.cs4r.
*' These files also contain all information about existing and statistically reported joint production processes.
*' Based on these energy flows the corresponding conversion efficiencies that replicate these energy flows.
*' The efficiencies are assigned to the parameter pm_data(*,"eta",*).
*####################### R SECTION START (PHASES) ##############################
$Ifi "%phase%" == "sets" $include "./modules/04_PE_FE_parameters/iea2014/sets.gms"
......
*** | (C) 2006-2019 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/20_growth/exogenous/declarations.gms
positive variables
vm_effGr(ttot,all_regi,all_in) "growth of factor efficiency"
;
*** EOF ./modules/20_growth/exogenous/declarations.gms
......@@ -11,3 +11,4 @@ pm_ttot_val, parameter, ???
pm_ts, parameter, ???
cm_startyear, switch, ???
pm_cumEff, parameter, ???
vm_invRD,input,questionnaire
......@@ -16,6 +16,7 @@
*' growth paths in reaction of policy shocks. This correction is done by an adjustment of capital accumulation.
*####################### R SECTION START (PHASES) ##############################
$Ifi "%phase%" == "declarations" $include "./modules/20_growth/exogenous/declarations.gms"
$Ifi "%phase%" == "bounds" $include "./modules/20_growth/exogenous/bounds.gms"
*######################## R SECTION END (PHASES) ###############################
*** EOF ./modules/20_growth/exogenous.gms
......@@ -24,6 +24,7 @@ Parameters
*mlb* vm_invInno and vm_invImi and pm_cumEff shifted to the core folder
Positive variables
vm_effGr(ttot,all_regi,all_in) "growth of factor efficiency"
v20_effInno(ttot,all_regi,all_in) "efficiency improvement by innovation"
v20_effImi(ttot,all_regi,all_in) "efficiency improvement by imitation"
;
......
*** | (C) 2006-2019 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/24_trade/module.gms
*' @title Trade module
*'
*' @description This file loads the trade module realization.
*###################### R SECTION START (MODULETYPES) ##########################
$Ifi "%trade%" == "standard" $include "./modules/24_trade/standard/realization.gms"
*###################### R SECTION END (MODULETYPES) ############################
*** EOF ./modules/24_trade/module.gms
*** | (C) 2006-2019 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/24_trade/standard/bounds.gms
*** set Mport and Xport positive
vm_Mport.lo(ttot,regi,tradePe)$(ttot.val ge 2005) = 0;
vm_Xport.lo(ttot,regi,tradePe)$(ttot.val ge 2005) = 0;
*** -----------------------------------------------------------
*** no permit trade allowed in BAU and tax scenarios:
*** -----------------------------------------------------------
if (cm_emiscen = 1 or cm_emiscen = 9,
vm_Xport.fx(t,regi,"perm") = 0;
vm_Mport.fx(t,regi,"perm") = 0;
else
vm_Xport.fx("2005",regi,"perm") = 0;
vm_Mport.fx("2005",regi,"perm") = 0;
vm_Xport.fx("2010",regi,"perm") = 0;
vm_Mport.fx("2010",regi,"perm") = 0;
);
*NB*110625 fix 2005 trade values to historic values
*RR*Added correction factor to match fossil supply and internal region energy demand in the initial year if necessary
*SB*190514 Made the correction factor for insufficient imports conditional on the fossil module realization
*** Mports fixing for fossils in the initial year
loop( regi,
loop (enty$peFos(enty),
*** if imports minus exports is higher than initial year demand there is a surplus of pe in the region. Correction -> set imports to 80% of the region pe demand plus Xports in the initial year
if ( (pm_EN_demand_from_initialcap2(regi,enty) < (1-pm_costsPEtradeMp(regi,enty))*pm_IO_trade("2005",regi,enty,"Mport") - pm_IO_trade("2005",regi,enty,"Xport")), !!region has more available pe through trade than it needs
p24_Mport2005correct(regi,enty) = (pm_EN_demand_from_initialcap2(regi,enty) + pm_IO_trade("2005",regi,enty,"Xport")) - pm_IO_trade("2005",regi,enty,"Mport");
);
*** if internal region production (plus trade) is not enough to provide the energy demand. Correction -> set imports to the difference between region energy demand (pm_EN_demand_from_initialcap2) and the internal production (pm_ffPolyCumEx(regi,enty,"max")) plus the trade balance (Mports-Xports)
$iftheni.fossil_realization %cfg$gms$fossil% == "timeDepGrades"
if ( pm_prodIni(regi,enty) + (1-pm_costsPEtradeMp(regi,enty))*(pm_IO_trade("2005",regi,enty,"Mport")+ p24_Mport2005correct(regi,enty)) - pm_IO_trade("2005",regi,enty,"Xport") < pm_EN_demand_from_initialcap2(regi,enty), !!region has a unbalance
p24_Mport2005correct(regi,enty) = pm_EN_demand_from_initialcap2(regi,enty) - ((1-pm_costsPEtradeMp(regi,enty))*pm_IO_trade("2005",regi,enty,"Mport") - pm_IO_trade("2005",regi,enty,"Xport")) - pm_prodIni(regi,enty) ; !! SB: use pm_prodIni as an analog for pm_ffPolyCumEx(regi,enty,"max"), which does not exist in timeDepGrades
);
$elseifi.fossil_realization %cfg$gms$fossil% == "grades2poly"
if ( (pm_ffPolyCumEx(regi,enty,"max") / (5*4)) + (1-pm_costsPEtradeMp(regi,enty))*(pm_IO_trade("2005",regi,enty,"Mport")+ p24_Mport2005correct(regi,enty)) - pm_IO_trade("2005",regi,enty,"Xport") < pm_EN_demand_from_initialcap2(regi,enty), !!region has a unbalance
p24_Mport2005correct(regi,enty) = pm_EN_demand_from_initialcap2(regi,enty) - ((1-pm_costsPEtradeMp(regi,enty))*pm_IO_trade("2005",regi,enty,"Mport") - pm_IO_trade("2005",regi,enty,"Xport")) - pm_ffPolyCumEx(regi,enty,"max") / (5*4) ; !!pm_ffPolyCumEx(regi,enty,"max") is a 5 years value, so we dived by 5 to get the annual value and additionally we assume that if all the extraction is made in the first years, this would take a t least 4 time steps to completely exhaust the resources
);
$endif.fossil_realization
);
);
vm_Mport.fx(t0(tall),regi,peFos(enty)) = pm_IO_trade(t0,regi,enty,"Mport") + p24_Mport2005correct(regi,enty);
*** Xports fixing for fossils in the initial year (with added exports to compensate for the Mports corrections above)
loop( regi,
loop (enty$peFos(enty),
if ( (p24_Mport2005correct(regi,enty) = 0),
vm_Xport.fx(t0(tall),regi,peFos(enty)) = pm_IO_trade(t0,regi,enty,"Xport") +
( pm_IO_trade(t0,regi,enty,"Xport") / sum((regi2)$(NOT (p24_Mport2005correct(regi,enty))),pm_IO_trade(t0,regi2,enty,"Xport")) ) !! share of region Xports between regions with no balance problems
* sum((regi2),p24_Mport2005correct(regi2,enty)) !! total unbalance problem
;
else
vm_Xport.fx(t0(tall),regi,peFos(enty)) = pm_IO_trade(t0,regi,enty,"Xport") ;
);
);
);
*** if region has no internal resources, demand must be entirely provided by trade (Switzerland problem). Correction -> set imports free, exports zero. Warning: if the region is big enough this could cause a trade unbalance. The first best solution would be to calculate the exact imports amount needed and add extra exports to other countries to compensate for this exact amount.
loop( regi,
loop (enty$peFos(enty),
$iftheni.timeDepGrades %cfg$gms$fossil% == "timeDepGrades"
if ( (pm_fuelex_cum("2005",regi,enty,1) = 0),
vm_Xport.fx(t0(tall),regi,peFos(enty)) = 0;
vm_Mport.up(t0(tall),regi,peFos(enty)) = 1e10;
vm_Mport.lo(t0(tall),regi,peFos(enty)) = 1e-6;
);
$elseifi.timeDepGrades %cfg$gms$fossil% == "grades2poly"
if ( (pm_ffPolyCumEx(regi,enty,"max") = 0),
vm_Xport.fx(t0(tall),regi,peFos(enty)) = 0;
vm_Mport.up(t0(tall),regi,peFos(enty)) = 1e10;
vm_Mport.lo(t0(tall),regi,peFos(enty)) = 1e-6;
);
$endif.timeDepGrades
);
);
*** bounds on oil exports in 2010 and 2015
vm_Xport.lo("2010",regi,"peoil") = 0.95 * pm_IO_trade("2010",regi,"peoil","Xport");
vm_Xport.up("2010",regi,"peoil") = 1.05 * pm_IO_trade("2010",regi,"peoil","Xport");
vm_Xport.lo("2015",regi,"peoil") = 0.95 * pm_IO_trade("2015",regi,"peoil","Xport");
vm_Xport.up("2015",regi,"peoil") = 1.05 * pm_IO_trade("2015",regi,"peoil","Xport");
*** upper bounds ( 1% yearly growth rate) on all big oil exporters (more than 15EJ in 2010) in 2020, 2025 and 2030
loop(regi,
if( (pm_IO_trade("2010",regi,"peoil","Xport") ge (15*sm_EJ_2_TWa)),
vm_Xport.up("2020",regi,"peoil") = ((1 + 0.02) ** 10) * pm_IO_trade("2010",regi,"peoil","Xport");
vm_Xport.up("2025",regi,"peoil") = ((1 + 0.02) ** 15) * pm_IO_trade("2010",regi,"peoil","Xport");
vm_Xport.up("2030",regi,"peoil") = ((1 + 0.02) ** 20) * pm_IO_trade("2010",regi,"peoil","Xport");
);
);
*** EOF ./modules/24_trade/standard/bounds.gms
\ No newline at end of file
*** | (C) 2006-2019 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/24_trade/standard/datainput.gms
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)
pm_tradecostgood(regi) = 0.03;
*** load data on transportation costs of imports
parameter pm_costsPEtradeMp(all_regi,all_enty) "PE tradecosts (energy losses on import)"
/
$ondelim
$include "./modules/24_trade/standard/input/pm_costsPEtradeMp.cs4r"
$offdelim
/
;
table pm_costsTradePeFinancial(all_regi,char,all_enty) "PE tradecosts (financial costs on import, export and use)"
$ondelim
$include "./modules/24_trade/standard/input/pm_costsTradePeFinancial.cs3r"
$offdelim
;
pm_costsTradePeFinancial(regi,"XportElasticity", tradePe(enty)) = 100;
pm_costsTradePeFinancial(regi, "tradeFloor", tradePe(enty)) = 0.0125;
*DK* Only for SSP cases other than SSP2: use default trade costs
if(cm_tradecost_bio = 1,
pm_costsTradePeFinancial(regi,"Xport", "pebiolc") = pm_costsTradePeFinancial(regi,"Xport", "pebiolc")/2;
);
pm_costsTradePeFinancial(regi,"Xport", "pegas") = cm_trdcst * pm_costsTradePeFinancial(regi,"Xport", "pegas") ;
pm_costsTradePeFinancial(regi,"XportElasticity","pegas") = cm_trdadj *pm_costsTradePeFinancial(regi,"XportElasticity","pegas");
*** EOF ./modules/24_trade/standard/datainput.gms
\ No newline at end of file
*** | (C) 2006-2019 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/24_trade/standard/declarations.gms
***-------------------------------------------------------------------------------
*** PARAMETERS
***-------------------------------------------------------------------------------
parameters
pm_tradecostgood(all_regi) "Trade costs (final good)."
pm_Xport0(tall,all_regi,all_enty) "Reference level value of export."
pm_IO_trade(tall,all_regi,all_enty,char) "Energy trade bounds based on IEA data."
p24_Mport2005correct(all_regi,all_enty) "Correction factor to match fossil supply and internal region energy demand in the initial year"
;
***-------------------------------------------------------------------------------
*** VARIABLES
***-------------------------------------------------------------------------------
positive VARIABLES
vm_Xport(tall,all_regi,all_enty) "Export of traded commodity."
vm_Mport(tall,all_regi,all_enty) "Import of traded commodity."
;
*** EOF ./modules/24_trade/standard/declarations.gms
\ No newline at end of file
pm_costsPEtradeMp.cs4r
pm_costsTradePeFinancial.cs3r
*** | (C) 2006-2019 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/24_trade/standard/postsolve.gms
pm_Xport0(ttot,regi,tradePe) = vm_Xport.l(ttot,regi,tradePe);
*** EOF ./modules/24_trade/standard/postsolve.gms
\ No newline at end of file
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