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 132 additions and 57 deletions
*** | (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/presolve.gms
pm_Xport0(ttot,regi,tradePe) = vm_Xport.l(ttot,regi,tradePe);
*** EOF ./modules/24_trade/standard/presolve.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/realization.gms
*####################### R SECTION START (PHASES) ##############################
$Ifi "%phase%" == "sets" $include "./modules/24_trade/standard/sets.gms"
$Ifi "%phase%" == "declarations" $include "./modules/24_trade/standard/declarations.gms"
$Ifi "%phase%" == "datainput" $include "./modules/24_trade/standard/datainput.gms"
$Ifi "%phase%" == "bounds" $include "./modules/24_trade/standard/bounds.gms"
$Ifi "%phase%" == "presolve" $include "./modules/24_trade/standard/presolve.gms"
$Ifi "%phase%" == "postsolve" $include "./modules/24_trade/standard/postsolve.gms"
*######################## R SECTION END (PHASES) ###############################
*** EOF ./modules/24_trade/realization.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/sets.gms
sets
trade(all_enty) "All traded commodities"
/
/
tradeMacro(all_enty) "Traded macro-economic commodities"
/
good,
perm
/
tradePe(all_enty) "Traded primary energy commodities"
/
peoil,
pecoal,
pegas,
peur,
pebiolc
/
tradeSe(all_enty) "Traded secondary energy commodities"
/
null
/
;
*** EOF ./modules/24_trade/standard/sets.gms
\ No newline at end of file
...@@ -197,7 +197,7 @@ ...@@ -197,7 +197,7 @@
*' *'
*'To implement perfectly complementary factors, you should include the factors in the set `in_complements`. In addition, the elasticity of substitution between these factors should be set to `INF` (which is counter-intuitive). Prices of complementary inputs are set to 1, so that the output is equal to the sum of inputs (reason why the substitution elasticity should be INF), which makes sense for energetic entities. It would however be possible to change this (by choosing another elasticity of substitution) without harming the calibration. *'To implement perfectly complementary factors, you should include the factors in the set `in_complements`. In addition, the elasticity of substitution between these factors should be set to `INF` (which is counter-intuitive). Prices of complementary inputs are set to 1, so that the output is equal to the sum of inputs (reason why the substitution elasticity should be INF), which makes sense for energetic entities. It would however be possible to change this (by choosing another elasticity of substitution) without harming the calibration.
*' *'
*'In the model, the complementary factors are subject to a constraint (`q_prodCompl` or `q_prodCompl_putty`), so that each variable is computed by multiplying a key variable of the CES function by a given factor. The calibration computes this factor for each period. *'In the model, the complementary factors are subject to a constraint (`q01_prodCompl` or `q01_prodCompl_putty`), so that each variable is computed by multiplying a key variable of the CES function by a given factor. The calibration computes this factor for each period.
*' *'
*'#### Setup *'#### Setup
*' *'
......
...@@ -15,3 +15,4 @@ pm_costsTradePeFinancial,parameter,??? ...@@ -15,3 +15,4 @@ pm_costsTradePeFinancial,parameter,???
sm_eps,scalar,??? sm_eps,scalar,???
sm_EJ_2_TWa,input,questionnaire sm_EJ_2_TWa,input,questionnaire
pm_ts,input,questionnaire pm_ts,input,questionnaire
cm_1stgen_phaseout,input,questionnaire
...@@ -24,8 +24,13 @@ ...@@ -24,8 +24,13 @@
vm_fuExtr.up(t,regi,"pebios","5")$(t.val ge 2045) = p30_datapebio(regi,"pebios","5","maxprod",t); vm_fuExtr.up(t,regi,"pebios","5")$(t.val ge 2045) = p30_datapebio(regi,"pebios","5","maxprod",t);
vm_fuExtr.up(t,regi,"pebioil","5")$(t.val ge 2030) = p30_datapebio(regi,"pebioil","5","maxprod",t); vm_fuExtr.up(t,regi,"pebioil","5")$(t.val ge 2030) = p30_datapebio(regi,"pebioil","5","maxprod",t);
vm_fuExtr.lo(t,regi,"pebios","5")$(t.val ge 2030) = p30_datapebio(regi,"pebios","5","maxprod",t)*0.9; if(cm_1stgen_phaseout=0,
vm_fuExtr.lo(t,regi,"pebioil","5")$(t.val ge 2030) = p30_datapebio(regi,"pebioil","5","maxprod",t)*0.9; vm_fuExtr.lo(t,regi,"pebios","5")$(t.val ge 2030) = p30_datapebio(regi,"pebios","5","maxprod",t)*0.9;
vm_fuExtr.lo(t,regi,"pebioil","5")$(t.val ge 2030) = p30_datapebio(regi,"pebioil","5","maxprod",t)*0.9;
else
vm_fuExtr.lo(t,regi,"pebios","5")$(t.val eq 2030) = p30_datapebio(regi,"pebios","5","maxprod",t)*0.9;
vm_fuExtr.lo(t,regi,"pebioil","5")$(t.val eq 2030) = p30_datapebio(regi,"pebioil","5","maxprod",t)*0.9;
);
*** ------------------------------------------------------------- *** -------------------------------------------------------------
*** Bounds on 2nd generation biomass annual production *** Bounds on 2nd generation biomass annual production
......
...@@ -8,17 +8,17 @@ ...@@ -8,17 +8,17 @@
*' @description *' @description
*' *'
*'The `IntC` realization (Integrated Costs) assume a single electricity market balance. *'The `IntC` realization (Integrated Costs) assumes a single electricity market balance.
*' *'
*'This module determine power system supply specific technology behavior, which summs up to the general core capacity equations to define the power sector operation and investment decisions. *'This module determines power system supply specific technology behavior, which sums up to the general core capacity equations to define the power sector operation and investment decisions.
*' *'
*'Contrary to other secondary energies in REMIND, this requires to move the electricity secondary energy balance (supply = demand) from the core to the module code. *'Contrary to other secondary energy types in REMIND, this requires to move the electricity secondary energy balance (supply = demand) from the core to the module code.
*' *'
*' *'
*'In summary, the specific power technology equations found in this module reflect the points below. *'In summary, the specific power technology equations found in this module reflect the points below.
*' *'
*' *'
*'Storage requirements are based on intermittent renewables share, sinergies between different renewables production profiles and curtailment. *'Storage requirements are based on intermittent renewables share, synergies between different renewables production profiles and curtailment.
*' *'
*'Additional grid capacities are calculated for high intermittent renewable capacity (solar and wind) and regional spatial differences. *'Additional grid capacities are calculated for high intermittent renewable capacity (solar and wind) and regional spatial differences.
*' *'
......
...@@ -4,8 +4,13 @@ ...@@ -4,8 +4,13 @@
*** | AGPL-3.0, you are granted additional permissions described in the *** | AGPL-3.0, you are granted additional permissions described in the
*** | REMIND License Exception, version 1.0 (see LICENSE file). *** | REMIND License Exception, version 1.0 (see LICENSE file).
*** | Contact: remind@pik-potsdam.de *** | Contact: remind@pik-potsdam.de
*** SOF ./modules/50_damages/BurkeLike/declarations.gms
parameters parameters
p50_damageFuncCoef1 "coef1 of damamge function", p50_damageFuncCoef1 "coef1 of damamge function",
p50_damageFuncCoef2 "coef2 of damamge function" p50_damageFuncCoef2 "coef2 of damamge function"
; ;
positive variable
vm_damageFactor(ttot,all_regi) "damage factor reducing GDP"
;
*** EOF ./modules/50_damages/BurkeLike/declarations.gms
...@@ -4,7 +4,13 @@ ...@@ -4,7 +4,13 @@
*** | AGPL-3.0, you are granted additional permissions described in the *** | AGPL-3.0, you are granted additional permissions described in the
*** | REMIND License Exception, version 1.0 (see LICENSE file). *** | REMIND License Exception, version 1.0 (see LICENSE file).
*** | Contact: remind@pik-potsdam.de *** | Contact: remind@pik-potsdam.de
*** SOF ./modules/50_damages/DiceLike/declarations.gms
parameters parameters
p50_damageFuncCoef1 "damage function coefficient, linear in temperature" p50_damageFuncCoef1 "damage function coefficient, linear in temperature"
p50_damageFuncCoef2 "damage function coefficient, quadratic in temperture" p50_damageFuncCoef2 "damage function coefficient, quadratic in temperture"
; ;
positive variable
vm_damageFactor(ttot,all_regi) "damage factor reducing GDP"
;
*** EOF ./modules/50_damages/DiceLike/declarations.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/50_damages/off/declarations.gms
positive variable
vm_damageFactor(ttot,all_regi) "damage factor reducing GDP"
;
*** EOF ./modules/50_damages/off/declarations.gms
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
*' @description The off-realization of the damage module sets the damage factor on output to 1, meaning no damage. *' @description The off-realization of the damage module sets the damage factor on output to 1, meaning no damage.
*####################### R SECTION START (PHASES) ############################## *####################### R SECTION START (PHASES) ##############################
$Ifi "%phase%" == "declarations" $include "./modules/50_damages/off/declarations.gms"
$Ifi "%phase%" == "bounds" $include "./modules/50_damages/off/bounds.gms" $Ifi "%phase%" == "bounds" $include "./modules/50_damages/off/bounds.gms"
*######################## R SECTION END (PHASES) ############################### *######################## R SECTION END (PHASES) ###############################
*** EOF ./modules/50_damages/off.gms *** EOF ./modules/50_damages/off.gms
...@@ -79,6 +79,10 @@ p80_SolNonOpt(all_regi) "solve status" ...@@ -79,6 +79,10 @@ p80_SolNonOpt(all_regi) "solve status"
pm_fuExtrForeign(ttot,all_regi,all_enty,rlf) "foreign fuel extraction" pm_fuExtrForeign(ttot,all_regi,all_enty,rlf) "foreign fuel extraction"
; ;
positive variable
*AJS* 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."
;
equations equations
q80_budg_intertemp(all_regi) "interemporal trade balance (Nash mode only)" q80_budg_intertemp(all_regi) "interemporal trade balance (Nash mode only)"
......
...@@ -9,15 +9,12 @@ ...@@ -9,15 +9,12 @@
pm_pvp(ttot,trade)$(ttot.val ge 2005) = 1; pm_pvp(ttot,trade)$(ttot.val ge 2005) = 1;
p80_trade(ttot,regi,trade)$(ttot.val ge 2005) = 0; p80_trade(ttot,regi,trade)$(ttot.val ge 2005) = 0;
$ifthen.cm_compile_main %cm_compile_main% == "FALSE"
if (cm_emiscen eq 1, if (cm_emiscen eq 1,
Execute_Loadpoint "./input.gdx", p80_currentaccount_bau = p80_curracc; Execute_Loadpoint "./input.gdx", p80_currentaccount_bau = p80_curracc;
else else
Execute_Loadpoint "./input_ref.gdx", p80_currentaccount_bau = p80_curracc; Execute_Loadpoint "./input_ref.gdx", p80_currentaccount_bau = p80_curracc;
); );
$endif.cm_compile_main
p80_defic_sum("1") = 1; p80_defic_sum("1") = 1;
......
...@@ -23,6 +23,11 @@ pm_cumEff(tall,all_regi,all_in) "parameter for spillover externality (a ...@@ -23,6 +23,11 @@ pm_cumEff(tall,all_regi,all_in) "parameter for spillover externality (a
pm_fuExtrForeign(ttot,all_regi,all_enty,rlf) "foreign fuel extraction" pm_fuExtrForeign(ttot,all_regi,all_enty,rlf) "foreign fuel extraction"
; ;
positive variable
*AJS* 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."
;
equations equations
q80_balTrade(ttot,all_enty) "trade balance equation" q80_balTrade(ttot,all_enty) "trade balance equation"
q80_budget_helper(ttot,all_regi) "Helper declaration for import from gdx" q80_budget_helper(ttot,all_regi) "Helper declaration for import from gdx"
......
...@@ -24,20 +24,20 @@ if(o_modelstat eq 2, ...@@ -24,20 +24,20 @@ if(o_modelstat eq 2,
IF(o_modelstat eq 2, IF(o_modelstat eq 2,
*AJS*2013-05* Default Negishi convergence scheme: *AJS*2013-05* Default Negishi convergence scheme:
if (ord(iteration) eq 1, s80_cnptfile = 2); if (ord(iteration) eq 1, s80_cnptfile = 2); !! rtredg = 1.d-6
if (ord(iteration) eq 2, s80_cnptfile = 3); if (ord(iteration) eq 2, s80_cnptfile = 3); !! rtredg = 1.d-7
if (ord(iteration) eq 3, s80_cnptfile = 4); if (ord(iteration) eq 3, s80_cnptfile = 3); !! rtredg = 1.d-7
if (ord(iteration) eq 4, s80_cnptfile = 5); if (ord(iteration) eq 4, s80_cnptfile = 3); !! rtredg = 1.d-7
*RP* Slower convergence scheme *RP* Slower convergence scheme
$IFTHEN.cm_SlowConvergence %cm_SlowConvergence% == "on" $IFTHEN.cm_SlowConvergence %cm_SlowConvergence% == "on"
if (ord(iteration) eq 1, s80_cnptfile = 1); if (ord(iteration) eq 1, s80_cnptfile = 1); !! rtredg = 1.d-5
if (ord(iteration) eq 2, s80_cnptfile = 2); if (ord(iteration) eq 2, s80_cnptfile = 2); !! rtredg = 1.d-6
if (ord(iteration) eq 3, s80_cnptfile = 2); if (ord(iteration) eq 3, s80_cnptfile = 2); !! rtredg = 1.d-6
if (ord(iteration) eq 4, s80_cnptfile = 3); if (ord(iteration) eq 4, s80_cnptfile = 3); !! rtredg = 1.d-7
if (ord(iteration) eq 5, s80_cnptfile = 3); if (ord(iteration) eq 5, s80_cnptfile = 3); !! rtredg = 1.d-7
if (ord(iteration) eq 6, s80_cnptfile = 4); if (ord(iteration) eq 6, s80_cnptfile = 3); !! rtredg = 1.d-7
if (ord(iteration) eq 7, s80_cnptfile = 4); if (ord(iteration) eq 7, s80_cnptfile = 3); !! rtredg = 1.d-7
if (ord(iteration) eq 8, s80_cnptfile = 5); if (ord(iteration) eq 8, s80_cnptfile = 3); !! rtredg = 1.d-7
$ENDIF.cm_SlowConvergence $ENDIF.cm_SlowConvergence
); );
*** EOF ./modules/80_optimization/negishi/solve.gms *** EOF ./modules/80_optimization/negishi/solve.gms
...@@ -16,6 +16,11 @@ pm_cumEff(tall,all_regi,all_in) "parameter for spillover ext ...@@ -16,6 +16,11 @@ pm_cumEff(tall,all_regi,all_in) "parameter for spillover ext
pm_fuExtrForeign(ttot,all_regi,all_enty,rlf) "foreign fuel extraction" pm_fuExtrForeign(ttot,all_regi,all_enty,rlf) "foreign fuel extraction"
; ;
positive variable
*AJS* 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."
;
equations equations
q80_budg_intertemp(all_regi) "interemporal trade balance (Nash mode only)" q80_budg_intertemp(all_regi) "interemporal trade balance (Nash mode only)"
q80_costAdjNash(ttot,all_regi) "plays a dummy role for now, allowing fixing to Nash GDX files" q80_costAdjNash(ttot,all_regi) "plays a dummy role for now, allowing fixing to Nash GDX files"
......
...@@ -6,8 +6,7 @@ ...@@ -6,8 +6,7 @@
*** | Contact: remind@pik-potsdam.de *** | Contact: remind@pik-potsdam.de
*** SOF ./modules/80_optimization/testOneRegi/solve.gms *** SOF ./modules/80_optimization/testOneRegi/solve.gms
$IFI %optimization% == "testOneRegi" s80_cnptfile = 9; hybrid.optfile = 9;
hybrid.optfile = s80_cnptfile;
***reduce the problem to one region ***reduce the problem to one region
regi(all_regi) = NO; regi(all_regi) = NO;
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
$setglobal phase %1 $setglobal phase %1
*######################## R SECTION START (MODULES) ############################ *######################## R SECTION START (MODULES) ############################
$include "./modules/01_macro/module.gms"
$include "./modules/02_welfare/module.gms" $include "./modules/02_welfare/module.gms"
$include "./modules/04_PE_FE_parameters/module.gms" $include "./modules/04_PE_FE_parameters/module.gms"
$include "./modules/05_initialCap/module.gms" $include "./modules/05_initialCap/module.gms"
...@@ -19,6 +20,7 @@ $include "./modules/20_growth/module.gms" ...@@ -19,6 +20,7 @@ $include "./modules/20_growth/module.gms"
$include "./modules/21_tax/module.gms" $include "./modules/21_tax/module.gms"
$include "./modules/22_subsidizeLearning/module.gms" $include "./modules/22_subsidizeLearning/module.gms"
$include "./modules/23_capitalMarket/module.gms" $include "./modules/23_capitalMarket/module.gms"
$include "./modules/24_trade/module.gms"
$include "./modules/26_agCosts/module.gms" $include "./modules/26_agCosts/module.gms"
$include "./modules/29_CES_parameters/module.gms" $include "./modules/29_CES_parameters/module.gms"
$include "./modules/30_biomass/module.gms" $include "./modules/30_biomass/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
#! /usr/bin/Rscript
##########################################################
#### Script to start a REMIND run ####
##########################################################
library(lucode, quietly = TRUE, warn.conflicts = FALSE)
library(magclass, quietly = TRUE, warn.conflicts = FALSE)
#Here the function start_run(cfg) is loaded which is needed to start REMIND runs
#The function needs information about the configuration of the run. This can be either supplied as a list of settings or as a file name of a config file
source("scripts/start_functions.R")
if (file.exists("./output/testOneRegi/"))
unlink("./output/testOneRegi/", recursive = TRUE)
#Load config-file
cfg_REMIND <- "oneRegi.cfg"
readArgs("cfg")
# start REMIND run
start_run(cfg_REMIND)
#rep = read.report("coupling.mif")
#start_reportrun(rep)
...@@ -52,11 +52,12 @@ start_comp <- function(outputdirs,shortTerm,outfilename) { ...@@ -52,11 +52,12 @@ start_comp <- function(outputdirs,shortTerm,outfilename) {
cat("Starting ",jobname,"\n") cat("Starting ",jobname,"\n")
on_cluster <- file.exists("/p/projects/") on_cluster <- file.exists("/p/projects/")
if (on_cluster) { if (on_cluster) {
system(paste0("srun --qos=standby --job-name=",jobname," --output=",jobname,".out --error=",jobname,".err --mail-type=END --time=200 --mem-per-cpu=8000 Rscript scripts/run_submit/run_compareScenarios.R outputdirs=",paste(outputdirs,collapse=",")," shortTerm=",shortTerm," outfilename=",jobname," &")) clcom <- paste0("sbatch --qos=standby --job-name=",jobname," --output=",jobname,".out --error=",jobname,".err --mail-type=END --time=200 --mem-per-cpu=8000 --wrap=\"Rscript scripts/utils/run_compareScenarios.R outputdirs=",paste(outputdirs,collapse=",")," shortTerm=",shortTerm," outfilename=",jobname,"\"")
system(clcom)
} else { } else {
outfilename <- jobname outfilename <- jobname
tmp.env <- new.env() tmp.env <- new.env()
script <- "scripts/run_submit/run_compareScenarios.R" script <- "scripts/utils/run_compareScenarios.R"
tmp.error <- try(sys.source(script,envir=tmp.env)) tmp.error <- try(sys.source(script,envir=tmp.env))
if(!is.null(tmp.error)) warning("Script ",script," was stopped by an error and not executed properly!") if(!is.null(tmp.error)) warning("Script ",script," was stopped by an error and not executed properly!")
rm(tmp.env) rm(tmp.env)
......
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