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

Add a new module: 'welfare'

This is part of a larger refactoring effort of the remind core.
Here, code related to the social welfare functions has been moved
from the core to the new module. Some renaming was required. For
now, only one module realization exists, 'utilitarian', which
corresponds one to one to what was in the core before. This
refactoring exercises has no effect on the results!
parent 79148bb2
No related branches found
No related tags found
1 merge request!16Welfare module
......@@ -13,7 +13,7 @@ cfg <- list()
#### Main settings ####
#short description of the actual run
cfg$title <- "default"
cfg$title <- "welfare_mod_namechange"
# path to the submodel to be used relative to main model folder (e.g."standalone/template.gms")
#cfg$model <- "main.gms" #def = "main.gms"
......@@ -49,6 +49,10 @@ cfg$gms <- list()
# *** MODULES START
# ***------------------------------------------------------------------------------
# ***--------------------- 02_welfare ---------------------------------------
# * (utilitarian):
cfg$gms$welfare <- "utilitarian" # def = utilitarian
# ***--------------------- 04_PE_FE_parameters ----------------------------
# * (iea2014): new PE-FE parameters based on IEA 2014
cfg$gms$PE_FE_parameters <- "iea2014" # def = iea2014
......
......@@ -62,9 +62,6 @@ pm_ttot_2_tall(ttot,tall)$((ttot.val = tall.val) ) = Yes;
if(cm_prtpScen eq 1, pm_prtp(regi) = 0.01);
if(cm_prtpScen eq 3, pm_prtp(regi) = 0.03);
pm_welf(ttot)$(ttot.val ge 2005) = 1;
$if %cm_less_TS% == "on" pm_welf("2060") = 0.9;
*------------------------------------------------------------------------------------
*------------------------------------------------------------------------------------
*** macro-economy
......
......@@ -15,8 +15,6 @@ parameters
***----------------------------------------------------------------------------------------
***--------------------------------------------------MACRO module--------------------------
pm_welf(tall) "weight parameter in the welfare function to avoid jumps with cm_less_TS"
***prices
pm_pvp(ttot,all_enty) "Price on commodity markets",
p_pvpRef(ttot,all_enty) "Price on commodity markets - imported from REF gdx",
......@@ -211,7 +209,6 @@ o_negitr_total_forc(iteration) "total forcing in 2100"
***----------------------------------------------------------------------------------------
***------------------------------------------------trade module----------------------------
pm_w(all_regi) "Negishi weights"
p_tradecostgood(all_regi) "tradecosts (final good)"
pm_ttot_val(ttot) "value of ttot set element"
......@@ -221,8 +218,6 @@ pm_dt(tall) "difference to last timeste
pm_interpolWeight_ttot_tall(tall) "weight for linear interpolation of ttot-dependent variables"
pm_tall_2_ttot(tall,ttot) "mapping from tall to ttot"
pm_ttot_2_tall(ttot,tall) "mapping from ttot to tall"
pm_prtp(all_regi) "pure rate of time preference"
p_share_seliq_s(ttot,all_regi) "share of liquids used for stationary sector (fehos). [0..1]"
p_share_seh2_s(ttot,all_regi) "share of hydrogen used for stationary sector (feh2s). [0..1]"
......@@ -243,17 +238,9 @@ p_Mport2005correct(all_regi,all_enty) "correction factor to match
variables
***----------------------------------------------------------------------------------------
***--------------------------------------------------MACRO module--------------------------
v_welfare(all_regi) "regional welfare"
vm_welfareGlob "global welfare"
vm_taxrev(ttot,all_regi) "difference between tax volume in current and previous iteration"
vm_costSubsidizeLearning(ttot,all_regi) "regional cost of subsidy for learning technologies"
vm_dummyBudget(ttot,all_regi) "auxiliary variable that helps to meet permit allocation equation in nash case"
$ifthen.inconv %c_INCONV_PENALTY% == "on"
v_inconvPen(ttot,all_regi) "Inconvenience penalty in the welfare function, e.g. for air pollution. [Utils]"
v_inconvPenCoalSolids(ttot,all_regi) "Inconvenience penalty in the welfare function, e.g. for air pollution. [Utils]"
v_inconvPenCoalSolids(ttot,all_regi) "Inconvenience penalty in the welfare function, e.g. for air pollution. [Utils]"
v_sesoInconvPenSlack(ttot,all_regi) "slack to avoid negative inconvenience penalty for Coal Solids"
$endif.inconv
***----------------------------------------------------------------------------------------
***-------------------------------------------------ESM module-----------------------------
vm_macBase(ttot,all_regi,all_enty) "baseline emissions for all emissions subject to MACCs (type emismac)"
......@@ -342,8 +329,6 @@ v_prodEs(ttot,all_regi,all_enty,all_esty,all_teEs) "Energy services (un
***------------------------------------------------trade module----------------------------
vm_Xport(tall,all_regi,all_enty) "export of traded commodity"
vm_Mport(tall,all_regi,all_enty) "import of traded commodity"
*AG* brought here from former climate files during modularisation
vm_forcOs(ttot) "forcing overshoot"
*** Adjustment costs for Nash trade algorithm. Only non-zero in the Nash_test realization of 80_optimization module.
vm_costAdjNash(ttot,all_regi) "adjustment costs for deviation from the trade structure of the last iteration"
;
......@@ -353,8 +338,6 @@ vm_costAdjNash(ttot,all_regi) "adjustment costs for devia
equations
***----------------------------------------------------------------------------------------
***------------------------------------------------MACRO module----------------------------
q_welfareGlob "global welfare"
q_welfare "regional welfare"
qm_budget(ttot,all_regi) "budget balance"
q_balLab(ttot,all_regi) "labour balance"
q_cesIO(ttot,all_regi,all_in) "production function"
......@@ -368,10 +351,6 @@ q_invMacroAdj(ttot,all_regi,all_in) "adjustment costs for macro
qm_balFeForCesAndEs(ttot,all_regi,all_enty) "FE balance coupling ESM and production function either directly (Pathway I) or Indirectly through Energy services (Pathway III)"
*** perm_restr(ttot,all_regi) "emission permit trade restriction"
*** multistage(ttot) "calculation of remaining permits in multistage approach"
$ifthen.inconv %c_INCONV_PENALTY% == "on"
q_inconvPen(ttot,all_regi) "calculate the inconvenience penalty v_inconvPen"
q_inconvPenCoalSolids(ttot,all_regi) "calculate the inconvenience penalty v_inconvPen"
$endif.inconv
q_limtRatioPpfen(ttot,all_regi,all_in,all_in) "limit the ratio of two ppfEn"
q_limitShPpfen(ttot,all_regi,all_in,all_in) "limit the share of one ppfEn in total CES nest inputs"
q_limitSeel2fehes(ttot,all_regi) "equation to limit the share of electricity that can be used for fehes"
......
......@@ -752,66 +752,6 @@ q_smoothphaseoutCapEarlyReti(ttot,regi,te)$(ttot.val lt 2120 AND pm_ttot_val(tto
*** more retirement possible for first generation biofuels
+ 0.05$(sameas(te,"biodiesel") or sameas(te, "bioeths")));
***---------------------------------------------------------------------------
*' The objective of the optimization is to maximize the total discounted intertemporal utility.
*' It is summed over all regions.
***---------------------------------------------------------------------------
q_welfareGlob..
vm_welfareGlob
=e=
SUM(regi,
pm_w(regi) * v_welfare(regi)
)
;
***---------------------------------------------------------------------------
*' Total discounted intertemporal regional welfare calculated from per capita consumption
*' summing over all time steps taking into account the pure time preference rate.
*' Assuming an intertemporal elasticity of substitution of 1, it holds:
***---------------------------------------------------------------------------
q_welfare(regi)..
v_welfare(regi) =e=
SUM(ttot $(ttot.val ge 2005),
pm_welf(ttot) * pm_ts(ttot) * (1 / ( (1 + pm_prtp(regi))**(pm_ttot_val(ttot)-2005) ) )
* ( (pm_pop(ttot,regi)
* (
((( (vm_cons(ttot,regi)*(1-c_damage*vm_forcOs(ttot)*vm_forcOs(ttot)))/pm_pop(ttot,regi))**(1-1/pm_ies(regi))-1)/(1-1/pm_ies(regi)) )$(pm_ies(regi) ne 1)
+ (log((vm_cons(ttot,regi)*(1-c_damage*vm_forcOs(ttot)*vm_forcOs(ttot))) / pm_pop(ttot,regi)))$(pm_ies(regi) eq 1)
)
)
$if %c_INCONV_PENALTY% == "on" - v_inconvPen(ttot,regi) - v_inconvPenCoalSolids(ttot,regi)
)
)
;
$IFTHEN.INCONV %c_INCONV_PENALTY% == "on"
***---------------------------------------------------------------------------
*' Calculation of the inconvenience penalty:
***---------------------------------------------------------------------------
q_inconvPen(t,regi)$(t.val > 2005)..
v_inconvPen(t,regi)
=g=
*' local air pollution for all entySe production except for coal solids (=sesofos), which is treated separately (see below)
SUM(pe2se(enty,entySe,te)$(NOT sameas(entySe,"sesofos")),
p_inconvpen_lap(t,regi,te) * (vm_prodSe(t,regi,enty,entySe,te))
)
;
q_inconvPenCoalSolids(t,regi)$(t.val > 2005)..
v_inconvPenCoalSolids(t,regi)
=g=
*' local air pollution for coal: inconvinienve penalty applies only for buildings use; slack variable ensures that v_inconvPen can stay > 0
p_inconvpen_lap(t,regi,"coaltr") * (vm_prodSe(t,regi,"pecoal","sesofos","coaltr")
- vm_cesIO(t,regi,"fesoi"))
+ v_sesoInconvPenSlack(t,regi)
;
v_sesoInconvPenSlack.lo(t,regi)=0;
v_inconvPenCoalSolids.fx("2005",regi) = 0;
v_inconvPenCoalSolids.lo(t,regi) = 0;
v_inconvPen.lo(t,regi) = 0;
v_inconvPen.fx("2005",regi) = 0;
$ENDIF.INCONV
***---------------------------------------------------------------------------
*' Usable macroeconomic output - net of climate change damages - is calculated from the macroeconomic output,
......
......@@ -771,6 +771,7 @@ sets
modules "all the available modules"
/
welfare
PE_FE_parameters
initialCap
aerosols
......@@ -804,6 +805,7 @@ sets
/
module2realisation(modules,*) "mapping of modules and active realisations" /
welfare . %welfare%
PE_FE_parameters . %PE_FE_parameters%
initialCap . %initialCap%
aerosols . %aerosols%
......
......@@ -58,7 +58,7 @@
*
* Input data revision: 5.936
*
* Last modification (input data): Wed Dec 11 09:40:06 2019
* Last modification (input data): Thu Dec 12 14:55:25 2019
*
*###################### R SECTION END (VERSION INFO) ###########################
......@@ -104,12 +104,14 @@ option profile = 0;
***--------------------- Run name -----------------------------------------
$setGlobal c_expname default
$setGlobal c_expname welfare_mod_namechange
***------------------------------------------------------------------------------
*** MODULES
***------------------------------------------------------------------------------
***--------------------- 02_welfare ---------------------------------------
$setGlobal welfare utilitarian !! def = utilitarian
***--------------------- 04_PE_FE_parameters ------------------------------
$setGlobal PE_FE_parameters iea2014 !! def = iea2014
***--------------------- 05_initialCap ------------------------------------
......@@ -118,7 +120,7 @@ $setGlobal initialCap on !! def = on
$setGlobal aerosols exoGAINS !! def = exoGAINS
***--------------------- 15_climate ---------------------------------------
$setGlobal climate off !! def = off
***--------------------- 16_downscaleTemperature ---------------------------------------
***--------------------- 16_downscaleTemperature --------------------------
$setGlobal downscaleTemperature off !! def = off
***--------------------- 20_growth ----------------------------------------
$setGlobal growth exogenous !! def = exogenous
......
*** | (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/02_welfare/module.gms
*' @title Welfare
*'
*' @description The welfare module enables the implementation of different social welfare functions.
*###################### R SECTION START (MODULETYPES) ##########################
$Ifi "%welfare%" == "utilitarian" $include "./modules/02_welfare/utilitarian/realization.gms"
*###################### R SECTION END (MODULETYPES) ############################
*** EOF ./modules/02_welfare/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/02_welfare/utilitarian/bounds.gms
$IFTHEN.INCONV %c_INCONV_PENALTY% == "on"
v02_sesoInconvPenSlack.lo(t,regi)=0;
v02_inconvPenCoalSolids.fx("2005",regi) = 0;
v02_inconvPenCoalSolids.lo(t,regi) = 0;
v02_inconvPen.lo(t,regi) = 0;
v02_inconvPen.fx("2005",regi) = 0;
$ENDIF.INCONV
*** EOF ./modules/02_welfare/utilitarian/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/02_welfare/utilitarian/datainput.gms
pm_welf(ttot)$(ttot.val ge 2005) = 1;
$if %cm_less_TS% == "on" pm_welf("2060") = 0.9;
*** EOF ./modules/02_welfare/utilitarian/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/02_welfare/utilitarian/declarations.gms
***-------------------------------------------------------------------------------
*** PARAMETERS
***-------------------------------------------------------------------------------
parameters
pm_welf(tall) "Weight parameter in the welfare function to avoid jumps with cm_less_TS"
pm_w(all_regi) "Negishi weights"
pm_prtp(all_regi) "Pure rate of time preference"
;
***-------------------------------------------------------------------------------
*** VARIABLES
***-------------------------------------------------------------------------------
variables
v02_welfare(all_regi) "Regional welfare"
vm_welfareGlob "Global welfare"
$ifthen.inconv %c_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
;
positive variables
vm_forcOs(ttot) "Forcing overshoot"
;
***-------------------------------------------------------------------------------
*** EQUATIONS
***-------------------------------------------------------------------------------
equations
q02_welfareGlob "Global welfare"
q02_welfare "Regional welfare"
$ifthen.inconv %c_INCONV_PENALTY% == "on"
q02_inconvPen(ttot,all_regi) "Calculate the inconvenience penalty v02_inconvPen"
q02_inconvPenCoalSolids(ttot,all_regi) "Calculate the inconvenience penalty v02_inconvPen"
$endif.inconv
;
*** EOF ./modules/02_welfare/utilitarian/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/02_welfare/utilitarian/equations.gms
***---------------------------------------------------------------------------
*' The objective of the optimization is to maximize the total discounted intertemporal utility.
*' It is summed over all regions.
***---------------------------------------------------------------------------
q02_welfareGlob..
vm_welfareGlob
=e=
sum(regi, pm_w(regi)*v02_welfare(regi) )
;
***---------------------------------------------------------------------------
*' Total discounted intertemporal regional welfare calculated from per capita consumption
*' summing over all time steps taking into account the pure time preference rate.
*' Assuming an intertemporal elasticity of substitution of 1, it holds:
***---------------------------------------------------------------------------
q02_welfare(regi)..
v02_welfare(regi)
=e=
sum(ttot $(ttot.val ge 2005),
pm_welf(ttot) * pm_ts(ttot) * (1 / ( (1 + pm_prtp(regi))**(pm_ttot_val(ttot)-2005) ) )
* ( (pm_pop(ttot,regi)
* (
((( (vm_cons(ttot,regi)*(1-c_damage*vm_forcOs(ttot)*vm_forcOs(ttot)))/pm_pop(ttot,regi))**(1-1/pm_ies(regi))-1)/(1-1/pm_ies(regi)) )$(pm_ies(regi) ne 1)
+ (log((vm_cons(ttot,regi)*(1-c_damage*vm_forcOs(ttot)*vm_forcOs(ttot))) / pm_pop(ttot,regi)))$(pm_ies(regi) eq 1)
)
)
$if %c_INCONV_PENALTY% == "on" - v02_inconvPen(ttot,regi) - v02_inconvPenCoalSolids(ttot,regi)
)
)
;
***---------------------------------------------------------------------------
*' Calculation of the inconvenience penalty:
***---------------------------------------------------------------------------
$IFTHEN.INCONV %c_INCONV_PENALTY% == "on"
q02_inconvPen(t,regi)$(t.val > 2005)..
v02_inconvPen(t,regi)
=g=
*' local air pollution for all entySe production except for coal solids (=sesofos), which is treated separately (see below)
SUM(pe2se(enty,entySe,te)$(NOT sameas(entySe,"sesofos")),
p_inconvpen_lap(t,regi,te) * (vm_prodSe(t,regi,enty,entySe,te))
)
;
q02_inconvPenCoalSolids(t,regi)$(t.val > 2005)..
v02_inconvPenCoalSolids(t,regi)
=g=
*' local air pollution for coal: inconvinienve penalty applies only for buildings use; slack variable ensures that v02_inconvPen can stay > 0
p_inconvpen_lap(t,regi,"coaltr") * (vm_prodSe(t,regi,"pecoal","sesofos","coaltr")
- vm_cesIO(t,regi,"fesoi"))
+ v02_sesoInconvPenSlack(t,regi)
;
$ENDIF.INCONV
*** EOF ./modules/02_welfare/utilitarian/equations.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/02_welfare/realization.gms
*' @description
*' The utilitarian realization loads the utilitarian aka. Benthamite social welfare function, in which social welfare is equal to the discounted intertemporal sum of utility, which itself is a function of per capita consumption.
*####################### R SECTION START (PHASES) ##############################
$Ifi "%phase%" == "declarations" $include "./modules/02_welfare/utilitarian/declarations.gms"
$Ifi "%phase%" == "datainput" $include "./modules/02_welfare/utilitarian/datainput.gms"
$Ifi "%phase%" == "equations" $include "./modules/02_welfare/utilitarian/equations.gms"
$Ifi "%phase%" == "bounds" $include "./modules/02_welfare/utilitarian/bounds.gms"
*######################## R SECTION END (PHASES) ###############################
*** EOF ./modules/02_welfare/realization.gms
......@@ -9,6 +9,7 @@
$setglobal phase %1
*######################## R SECTION START (MODULES) ############################
$include "./modules/02_welfare/module.gms"
$include "./modules/04_PE_FE_parameters/module.gms"
$include "./modules/05_initialCap/module.gms"
$include "./modules/11_aerosols/module.gms"
......
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