Skip to content
Snippets Groups Projects
Commit 512e3174 authored by Alois Dirnaichner's avatar Alois Dirnaichner
Browse files

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

parents 7e71bca3 b4a8f28c
No related branches found
No related tags found
1 merge request!159Pullreq1
......@@ -22,7 +22,7 @@ cfg$title <- "default"
cfg$regionmapping <- "config/regionmappingH12.csv"
#### Current input data revision (<mainrevision>.<subrevision>) ####
cfg$revision <- 5.942
cfg$revision <- 5.944
#### Force the model to download new input data ####
cfg$force_download <- FALSE
......@@ -206,7 +206,10 @@ cfg$gms$banking <- "off" # def = off
# * (ExogSameAsPrevious): uses the identical carbon prices of a previous run, so far requires manual updating of the input file - see outcommented text in scripts/start_functions.R
# * (temperatureNotToExceed): [test and verify before using it!] Find the optimal carbon carbon tax (set cm_emiscen=9) for the not-to-exceed temperature target defined by cm_carbonprice_temperatureLimit.
# * (NDC2constant): linearly phase in global constant price from NDC prices (default 2020-2040 phase-in)
# * (diffPhaseIn2Constant): linearly phase in global constant price, with starting values differentiated by GDP/cap (Robert's proposal)
# * (diffCurvPhaseIn2Lin): [REMIND 2.1 default for validation peakBudget runs, in combination with "iterative_target_adj" = 9] curved convergence of CO2 prices between regions until cm_CO2priceRegConvEndYr; developed countries have linear path from 0 in 2010 through cm_co2_tax_2020 in 2020;
# * (diffPhaseIn2Constant): !experimental! linearly phase in global constant price, with starting values differentiated by GDP/cap
# *
cfg$gms$carbonprice <- "none" # def = none
......@@ -420,8 +423,10 @@ cfg$action <- "ce" #def <- ce
# Tar-ball all the put files to save space?
cfg$tarball_puts <- "on" # def <- on
# Specify the way REMIND will be run on the cluster (job class, number of nodes, ...) or locally ("direct")
cfg$slurmConfig <- "direct"
# Provide additional SLURM parameters (e.g. "--time=03:30:00") not included in
# the list of following parameters that are set automatically in start.R:
# --qos, --nodes, --tasks-per-node, -job-name, --output, --mail-type, --comment.
cfg$slurmConfig <- ""
# Should REMIND output be shown in console? (0:no, 2:logfile, 3:yes)
cfg$logoption <- 2
......@@ -666,6 +671,7 @@ cfg$RunsUsingTHISgdxAsBAU <- NA
# (5): iterative adjustment V for both budget and tax runs based on CO2 emissions 2011-2100, see core/postsolve.gms for direct algorithms of adjustment
# (6): iterative adjustment VI for both budget and tax runs based on peak CO2 emissions budget, without changing temporal profile (i.e. with overshoot), see core/postsolve.gms for direct algorithms of adjustment
# (7): iterative adjustment VII for tax runs based on peak CO2 emissions, with change of temporal tax profile after time of peak budget, aiming for net-zero thereafter, see core/postsolve.gms for direct algorithms of adjustment
# (9): [REMIND 2.1 default for validation peakBudget runs, in combination with carbonprice = diffCurvPhaseIn2Lin) ] aims at achieving c_budgetCO2 as peakBudget. Scales up and down the original CO2 price path before the peaking year; after the peaking year annual increase by cm_taxCO2inc_after_peakBudgYr. Automatically shifts cm_peakBudgYr to find the correct peaking year for a given .
#c_budgetCO2 "cumulative CO2|Total emissions budget 2011-2100, Gt CO2"
# budgets from 1.5°C report, chapter 2, Table 2.2: 67% 1.5°C GSAT budget 2018-2100 = 420 Gt CO2, 67% 2.0°C GSAT budget 2018-2100 = 1170
# add emissions 2011-2018 = 290 Gt CO2, subtract emissions from feedbacks (e.g. thawing permafrost) 100 Gt CO2
......
title;start;CES_parameters;cm_bioenergy_tax;cm_rcp_scen;cm_iterative_target_adj;cm_nash_autoconverge;cm_iteration_max;c_budgetCO2;carbonprice;cm_co2_tax_2020;cm_peakBudgYr;cm_taxCO2inc_after_peakBudgYr;cm_CO2priceRegConvEndYr;cm_emiscen;cm_earlyreti_rate;cm_fetaxscen;cm_co2_tax_growth;cm_bioenergymaxscen;c_ccsinjecratescen;c_ccscapratescen;techpol;cm_POPscen;cm_GDPscen;cm_oil_scen;cm_gas_scen;cm_coal_scen;c_techAssumptScen;cm_nucscen;cm_so2tax_scen;cm_multigasscen;cm_OILRETIRE;cm_LU_emi_scen;cm_tradecost_bio;cm_1stgen_phaseout;c_SSP_forcing_adjust;cm_APscen;cm_startyear;path_gdx;path_gdx_ref;path_gdx_bau
SSP1-calibrate;0;calibrate;1.75;none;0;1;1;0;none;-1;2100;3;2050;1;0.09;2;1.025;0;2;1;none;pop_SSP1;gdp_SSP1;lowOil;lowGas;lowCoal;2;2;4;2;off;SSP1;1;1;forcing_SSP1;SSP1;2005;./config/input.gdx;;
SSP1-Base;1;load;1.75;none;0;1;1;0;none;-1;2100;3;2050;1;0.09;2;1.025;0;2;1;none;pop_SSP1;gdp_SSP1;lowOil;lowGas;lowCoal;2;2;4;2;off;SSP1;1;1;forcing_SSP1;SSP1;2005;./config/input.gdx;;
SSP1-NDC;1;load;1.75;rcp45;3;1;1;0;NDC2018;1;2100;3;2050;9;0.09;2;1.025;0;2;1;NDC2018;pop_SSP1;gdp_SSP1;lowOil;lowGas;lowCoal;2;2;4;3;off;SSP1;1;1;forcing_SSP1;SSP1;2025;./config/input.gdx;SSP2-NDC;SSP1-Base
SSP1-NPi;1;load;1.75;rcp45;3;1;1;0;NPi2018;1;2100;3;2050;9;0.09;2;1.025;0;2;1;NPi2018;pop_SSP1;gdp_SSP1;lowOil;lowGas;lowCoal;2;2;4;3;off;SSP1;1;1;forcing_SSP1;SSP1;2025;./config/input.gdx;SSP2-NDC;SSP1-Base
SSP1-PkBudg900;1;load;1.75;rcp20;9;1;1;900;diffCurvPhaseIn2Lin;60;2045;3;2050;9;0.09;2;1.025;0;2;1;NDC2018;pop_SSP1;gdp_SSP1;lowOil;lowGas;lowCoal;2;2;4;2;on;SSP1;1;1;forcing_SSP1;SSP1;2025;./config/input.gdx;SSP2-NDC;SSP1-Base
SSP1-PkBudg1100;1;load;1.75;rcp26;9;1;1;1100;diffCurvPhaseIn2Lin;100;2080;3;2050;9;0.09;2;1.025;0;2;1;NDC2018;pop_SSP1;gdp_SSP1;lowOil;lowGas;lowCoal;2;2;4;2;on;SSP1;1;1;forcing_SSP1;SSP1;2025;./config/input.gdx;SSP2-NDC;SSP1-Base
SSP1-PkBudg1300;1;load;1.75;rcp26;9;1;1;1300;diffCurvPhaseIn2Lin;60;2100;3;2050;9;0.09;2;1.025;0;2;1;NDC2018;pop_SSP1;gdp_SSP1;lowOil;lowGas;lowCoal;2;2;4;2;on;SSP1;1;1;forcing_SSP1;SSP1;2025;./config/input.gdx;SSP2-NDC;SSP1-Base
SDP-calibrate;0;calibrate;1.75;none;0;1;1;0;none;-1;2100;3;2050;1;0.12;2;1.025;4;5;1;none;pop_SDP;gdp_SDP;lowOil;lowGas;lowCoal;2;2;4;2;off;SDP;1;1;forcing_SSP1;SSP1;2005;./config/input.gdx;;
SDP-Base;1;load;1.75;none;0;1;1;0;none;-1;2100;3;2050;1;0.12;2;1.025;4;5;1;none;pop_SDP;gdp_SDP;lowOil;lowGas;lowCoal;2;2;4;2;off;SDP;1;1;forcing_SSP1;SSP1;2005;./config/input.gdx;;
SDP-NDC;1;load;1.75;rcp45;3;1;1;0;NDC2018;1;2100;3;2050;9;0.12;2;1.025;4;5;1;NDC2018plus;pop_SDP;gdp_SDP;lowOil;lowGas;lowCoal;2;2;4;3;off;SDP;1;1;forcing_SSP1;SSP1;2025;./config/input.gdx;SSP2-NDC;SDP-Base
SDP-NPi;1;load;1.75;rcp45;3;1;1;0;NPi2018;1;2100;3;2050;9;0.12;2;1.025;4;5;1;NPi2018;pop_SDP;gdp_SDP;lowOil;lowGas;lowCoal;2;2;4;3;off;SDP;1;1;forcing_SSP1;SSP1;2025;./config/input.gdx;SSP2-NDC;SDP-Base
SDP-PkBudg900;1;load;1.75;rcp20;9;1;1;900;diffCurvPhaseIn2Lin;200;2045;3;2050;9;0.12;2;1.025;4;5;1;NDC2018plus;pop_SDP;gdp_SDP;lowOil;lowGas;lowCoal;2;2;4;2;on;SDP;1;1;forcing_SSP1;SSP1;2025;./config/input.gdx;SSP2-NDC;SDP-Base
SDP-PkBudg1000;1;load;1.75;rcp20;9;1;1;1000;diffCurvPhaseIn2Lin;150;2045;3;2050;9;0.12;2;1.025;4;5;1;NDC2018plus;pop_SDP;gdp_SDP;lowOil;lowGas;lowCoal;2;2;4;2;on;SDP;1;1;forcing_SSP1;SSP1;2025;./config/input.gdx;SSP2-NDC;SDP-Base
SDP-PkBudg1100;1;load;1.75;rcp26;9;1;1;1100;diffCurvPhaseIn2Lin;100;2080;3;2050;9;0.12;2;1.025;4;5;1;NDC2018plus;pop_SDP;gdp_SDP;lowOil;lowGas;lowCoal;2;2;4;2;on;SDP;1;1;forcing_SSP1;SSP1;2025;./config/input.gdx;SSP2-NDC;SDP-Base
SDP-PkBudg1300;1;load;1.75;rcp26;9;1;1;1300;diffCurvPhaseIn2Lin;60;2100;3;2050;9;0.12;2;1.025;4;5;1;NDC2018plus;pop_SDP;gdp_SDP;lowOil;lowGas;lowCoal;2;2;4;2;on;SDP;1;1;forcing_SSP1;SSP1;2025;./config/input.gdx;SSP2-NDC;SDP-Base
SSP2-calibrate;0;calibrate;1.5;none;0;1;1;0;none;-1;2100;3;2050;1;0.09;3;1.05;0;1;1;none;pop_SSP2;gdp_SSP2;medOil;medGas;medCoal;1;2;1;2;off;SSP2;2;0;forcing_SSP2;SSP2;2005;./config/input.gdx;;
SSP2-Base;1;load;1.5;none;0;1;1;0;none;-1;2100;3;2050;1;0.09;3;1.05;0;1;1;none;pop_SSP2;gdp_SSP2;medOil;medGas;medCoal;1;2;1;2;off;SSP2;2;0;forcing_SSP2;SSP2;2005;./config/input.gdx;;
SSP2-NDC;1;load;1.5;rcp45;3;1;1;0;NDC2018;1;2100;3;2050;9;0.09;3;1.05;0;1;1;NDC2018;pop_SSP2;gdp_SSP2;medOil;medGas;medCoal;1;2;1;3;off;SSP2;2;0;forcing_SSP2;SSP2;2015;./config/input.gdx;SSP2-Base;SSP2-Base
SSP2-NPi;1;load;1.5;rcp45;3;1;1;0;NPi2018;1;2100;3;2050;9;0.09;3;1.05;0;1;1;NPi2018;pop_SSP2;gdp_SSP2;medOil;medGas;medCoal;1;2;1;3;off;SSP2;2;0;forcing_SSP2;SSP2;2025;./config/input.gdx;SSP2-NDC;SSP2-Base
SSP2-PkBudg900;1;load;1.5;rcp20;9;1;1;900;diffCurvPhaseIn2Lin;200;2045;3;2050;9;0.09;3;1.05;0;1;1;NDC2018;pop_SSP2;gdp_SSP2;medOil;medGas;medCoal;1;2;1;2;on;SSP2;2;0;forcing_SSP2;SSP2;2025;./config/input.gdx;SSP2-NDC;SSP2-Base
SSP2-PkBudg1100;1;load;1.5;rcp26;9;1;1;1100;diffCurvPhaseIn2Lin;100;2080;3;2050;9;0.09;3;1.05;0;1;1;NDC2018;pop_SSP2;gdp_SSP2;medOil;medGas;medCoal;1;2;1;2;on;SSP2;2;0;forcing_SSP2;SSP2;2025;./config/input.gdx;SSP2-NDC;SSP2-Base
SSP2-PkBudg1300;1;load;1.5;rcp26;9;1;1;1300;diffCurvPhaseIn2Lin;60;2100;3;2050;9;0.09;3;1.05;0;1;1;NDC2018;pop_SSP2;gdp_SSP2;medOil;medGas;medCoal;1;2;1;2;on;SSP2;2;0;forcing_SSP2;SSP2;2025;./config/input.gdx;SSP2-NDC;SSP2-Base
SSP5-calibrate;0;calibrate;1.75;none;0;1;1;0;none;-1;2100;3;2050;1;0.09;1;1.05;0;3;2;none;pop_SSP5;gdp_SSP5;highOil;highGas;highCoal;3;6;4;2;off;SSP5;1;1;forcing_SSP5;SSP5;2005;./config/input.gdx;;
SSP5-Base;1;load;1.75;none;0;1;1;0;none;-1;2100;3;2050;1;0.09;1;1.05;0;3;2;none;pop_SSP5;gdp_SSP5;highOil;highGas;highCoal;3;6;4;2;off;SSP5;1;1;forcing_SSP5;SSP5;2005;./config/input.gdx;;
SSP5-NDC;1;load;1.75;rcp45;3;1;1;0;NDC2018;1;2100;3;2050;9;0.09;1;1.05;0;3;2;NDC2018;pop_SSP5;gdp_SSP5;highOil;highGas;highCoal;3;6;4;3;off;SSP5;1;1;forcing_SSP5;SSP5;2025;./config/input.gdx;SSP2-NDC;SSP5-Base
SSP5-NPi;1;load;1.75;rcp45;3;1;1;0;NPi2018;1;2100;3;2050;9;0.09;1;1.05;0;3;2;NPi2018;pop_SSP5;gdp_SSP5;highOil;highGas;highCoal;3;6;4;3;off;SSP5;1;1;forcing_SSP5;SSP5;2025;./config/input.gdx;SSP2-NDC;SSP5-Base
SSP5-PkBudg900;1;load;1.75;rcp20;9;1;1;900;diffCurvPhaseIn2Lin;300;2045;3;2050;9;0.09;1;1.05;0;3;2;NDC2018;pop_SSP5;gdp_SSP5;highOil;highGas;highCoal;3;6;4;2;on;SSP5;1;1;forcing_SSP5;SSP5;2025;./config/input.gdx;SSP2-NDC;SSP5-Base
SSP5-PkBudg1100;1;load;1.75;rcp26;9;1;1;1100;diffCurvPhaseIn2Lin;150;2080;3;2050;9;0.09;1;1.05;0;3;2;NDC2018;pop_SSP5;gdp_SSP5;highOil;highGas;highCoal;3;6;4;2;on;SSP5;1;1;forcing_SSP5;SSP5;2025;./config/input.gdx;SSP2-NDC;SSP5-Base
SSP5-PkBudg1300;1;load;1.75;rcp26;9;1;1;1300;diffCurvPhaseIn2Lin;80;2100;3;2050;9;0.09;1;1.05;0;3;2;NDC2018;pop_SSP5;gdp_SSP5;highOil;highGas;highCoal;3;6;4;2;on;SSP5;1;1;forcing_SSP5;SSP5;2025;./config/input.gdx;SSP2-NDC;SSP5-Base
title;start;CES_parameters;cm_bioenergy_tax;cm_rcp_scen;cm_iterative_target_adj;subsidizeLearning;c_budgetCO2;carbonprice;cm_co2_tax_2020;cm_peakBudgYr;cm_taxCO2inc_after_peakBudgYr;cm_CO2priceRegConvEndYr;cm_emiscen;cm_earlyreti_rate;cm_fetaxscen;cm_co2_tax_growth;cm_bioenergymaxscen;c_ccsinjecratescen;c_ccscapratescen;techpol;cm_POPscen;cm_GDPscen;cm_oil_scen;cm_gas_scen;cm_coal_scen;c_techAssumptScen;cm_nucscen;cm_so2tax_scen;cm_multigasscen;cm_OILRETIRE;cm_LU_emi_scen;cm_tradecost_bio;cm_1stgen_phaseout;c_SSP_forcing_adjust;cm_APscen;cm_startyear;path_gdx;path_gdx_ref;path_gdx_bau
SSP1-calibrate;0;calibrate;1.75;none;0;off;0;none;-1;2100;3;2050;1;0.09;2;1.025;0;2;1;none;pop_SSP1;gdp_SSP1;lowOil;lowGas;lowCoal;2;2;4;2;off;SSP1;1;1;forcing_SSP1;SSP1;2005;./config/input.gdx;;
SSP1-Base;1;load;1.75;none;0;off;0;none;-1;2100;3;2050;1;0.09;2;1.025;0;2;1;none;pop_SSP1;gdp_SSP1;lowOil;lowGas;lowCoal;2;2;4;2;off;SSP1;1;1;forcing_SSP1;SSP1;2005;./config/input.gdx;;
SSP1-NDC;1;load;1.75;rcp45;3;globallyOptimal;0;NDC2018;1;2100;3;2050;9;0.09;2;1.025;0;2;1;NDC2018;pop_SSP1;gdp_SSP1;lowOil;lowGas;lowCoal;2;2;4;3;off;SSP1;1;1;forcing_SSP1;SSP1;2025;./config/input.gdx;SSP2-NDC;SSP1-Base
SSP1-NPi;1;load;1.75;rcp45;3;off;0;NPi2018;1;2100;3;2050;9;0.09;2;1.025;0;2;1;NPi2018;pop_SSP1;gdp_SSP1;lowOil;lowGas;lowCoal;2;2;4;3;off;SSP1;1;1;forcing_SSP1;SSP1;2025;./config/input.gdx;SSP2-NDC;SSP1-Base
SSP1-PkBudg900;1;load;1.75;rcp20;9;globallyOptimal;900;diffCurvPhaseIn2Lin;60;2045;3;2050;9;0.09;2;1.025;0;2;1;NDC2018;pop_SSP1;gdp_SSP1;lowOil;lowGas;lowCoal;2;2;4;2;on;SSP1;1;1;forcing_SSP1;SSP1;2025;./config/input.gdx;SSP2-NDC;SSP1-Base
SSP1-PkBudg1100;1;load;1.75;rcp26;9;globallyOptimal;1100;diffCurvPhaseIn2Lin;100;2080;3;2050;9;0.09;2;1.025;0;2;1;NDC2018;pop_SSP1;gdp_SSP1;lowOil;lowGas;lowCoal;2;2;4;2;on;SSP1;1;1;forcing_SSP1;SSP1;2025;./config/input.gdx;SSP2-NDC;SSP1-Base
SSP1-PkBudg1300;1;load;1.75;rcp26;9;globallyOptimal;1300;diffCurvPhaseIn2Lin;60;2100;3;2050;9;0.09;2;1.025;0;2;1;NDC2018;pop_SSP1;gdp_SSP1;lowOil;lowGas;lowCoal;2;2;4;2;on;SSP1;1;1;forcing_SSP1;SSP1;2025;./config/input.gdx;SSP2-NDC;SSP1-Base
SDP-calibrate;0;calibrate;1.75;none;0;off;0;none;-1;2100;3;2050;1;0.12;2;1.025;4;5;1;none;pop_SDP;gdp_SDP;lowOil;lowGas;lowCoal;2;2;4;2;off;SDP;1;1;forcing_SSP1;SSP1;2005;./config/input.gdx;;
SDP-Base;1;load;1.75;none;0;off;0;none;-1;2100;3;2050;1;0.12;2;1.025;4;5;1;none;pop_SDP;gdp_SDP;lowOil;lowGas;lowCoal;2;2;4;2;off;SDP;1;1;forcing_SSP1;SSP1;2005;./config/input.gdx;;
SDP-NDC;1;load;1.75;rcp45;3;globallyOptimal;0;NDC2018;1;2100;3;2050;9;0.12;2;1.025;4;5;1;NDC2018plus;pop_SDP;gdp_SDP;lowOil;lowGas;lowCoal;2;2;4;3;off;SDP;1;1;forcing_SSP1;SSP1;2025;./config/input.gdx;SSP2-NDC;SDP-Base
SDP-NPi;1;load;1.75;rcp45;3;off;0;NPi2018;1;2100;3;2050;9;0.12;2;1.025;4;5;1;NPi2018;pop_SDP;gdp_SDP;lowOil;lowGas;lowCoal;2;2;4;3;off;SDP;1;1;forcing_SSP1;SSP1;2025;./config/input.gdx;SSP2-NDC;SDP-Base
SDP-PkBudg900;1;load;1.75;rcp20;9;globallyOptimal;900;diffCurvPhaseIn2Lin;200;2045;3;2050;9;0.12;2;1.025;4;5;1;NDC2018plus;pop_SDP;gdp_SDP;lowOil;lowGas;lowCoal;2;2;4;2;on;SDP;1;1;forcing_SSP1;SSP1;2025;./config/input.gdx;SSP2-NDC;SDP-Base
SDP-PkBudg1000;1;load;1.75;rcp20;9;globallyOptimal;1000;diffCurvPhaseIn2Lin;150;2045;3;2050;9;0.12;2;1.025;4;5;1;NDC2018plus;pop_SDP;gdp_SDP;lowOil;lowGas;lowCoal;2;2;4;2;on;SDP;1;1;forcing_SSP1;SSP1;2025;./config/input.gdx;SSP2-NDC;SDP-Base
SDP-PkBudg1100;1;load;1.75;rcp26;9;globallyOptimal;1100;diffCurvPhaseIn2Lin;100;2080;3;2050;9;0.12;2;1.025;4;5;1;NDC2018plus;pop_SDP;gdp_SDP;lowOil;lowGas;lowCoal;2;2;4;2;on;SDP;1;1;forcing_SSP1;SSP1;2025;./config/input.gdx;SSP2-NDC;SDP-Base
SDP-PkBudg1300;1;load;1.75;rcp26;9;globallyOptimal;1300;diffCurvPhaseIn2Lin;60;2100;3;2050;9;0.12;2;1.025;4;5;1;NDC2018plus;pop_SDP;gdp_SDP;lowOil;lowGas;lowCoal;2;2;4;2;on;SDP;1;1;forcing_SSP1;SSP1;2025;./config/input.gdx;SSP2-NDC;SDP-Base
SSP2-calibrate;0;calibrate;1.5;none;0;off;0;none;-1;2100;3;2050;1;0.09;3;1.05;0;1;1;none;pop_SSP2;gdp_SSP2;medOil;medGas;medCoal;1;2;1;2;off;SSP2;2;0;forcing_SSP2;SSP2;2005;./config/input.gdx;;
SSP2-Base;1;load;1.5;none;0;off;0;none;-1;2100;3;2050;1;0.09;3;1.05;0;1;1;none;pop_SSP2;gdp_SSP2;medOil;medGas;medCoal;1;2;1;2;off;SSP2;2;0;forcing_SSP2;SSP2;2005;./config/input.gdx;;
SSP2-NDC;1;load;1.5;rcp45;3;globallyOptimal;0;NDC2018;1;2100;3;2050;9;0.09;3;1.05;0;1;1;NDC2018;pop_SSP2;gdp_SSP2;medOil;medGas;medCoal;1;2;1;3;off;SSP2;2;0;forcing_SSP2;SSP2;2015;./config/input.gdx;SSP2-Base;SSP2-Base
SSP2-NPi;1;load;1.5;rcp45;3;off;0;NPi2018;1;2100;3;2050;9;0.09;3;1.05;0;1;1;NPi2018;pop_SSP2;gdp_SSP2;medOil;medGas;medCoal;1;2;1;3;off;SSP2;2;0;forcing_SSP2;SSP2;2025;./config/input.gdx;SSP2-NDC;SSP2-Base
SSP2-PkBudg900;1;load;1.5;rcp20;9;globallyOptimal;900;diffCurvPhaseIn2Lin;200;2045;3;2050;9;0.09;3;1.05;0;1;1;NDC2018;pop_SSP2;gdp_SSP2;medOil;medGas;medCoal;1;2;1;2;on;SSP2;2;0;forcing_SSP2;SSP2;2025;./config/input.gdx;SSP2-NDC;SSP2-Base
SSP2-PkBudg1100;1;load;1.5;rcp26;9;globallyOptimal;1100;diffCurvPhaseIn2Lin;100;2080;3;2050;9;0.09;3;1.05;0;1;1;NDC2018;pop_SSP2;gdp_SSP2;medOil;medGas;medCoal;1;2;1;2;on;SSP2;2;0;forcing_SSP2;SSP2;2025;./config/input.gdx;SSP2-NDC;SSP2-Base
SSP2-PkBudg1300;1;load;1.5;rcp26;9;globallyOptimal;1300;diffCurvPhaseIn2Lin;60;2100;3;2050;9;0.09;3;1.05;0;1;1;NDC2018;pop_SSP2;gdp_SSP2;medOil;medGas;medCoal;1;2;1;2;on;SSP2;2;0;forcing_SSP2;SSP2;2025;./config/input.gdx;SSP2-NDC;SSP2-Base
SSP5-calibrate;0;calibrate;1.75;none;0;off;0;none;-1;2100;3;2050;1;0.09;1;1.05;0;3;2;none;pop_SSP5;gdp_SSP5;highOil;highGas;highCoal;3;6;4;2;off;SSP5;1;1;forcing_SSP5;SSP5;2005;./config/input.gdx;;
SSP5-Base;1;load;1.75;none;0;off;0;none;-1;2100;3;2050;1;0.09;1;1.05;0;3;2;none;pop_SSP5;gdp_SSP5;highOil;highGas;highCoal;3;6;4;2;off;SSP5;1;1;forcing_SSP5;SSP5;2005;./config/input.gdx;;
SSP5-NDC;1;load;1.75;rcp45;3;globallyOptimal;0;NDC2018;1;2100;3;2050;9;0.09;1;1.05;0;3;2;NDC2018;pop_SSP5;gdp_SSP5;highOil;highGas;highCoal;3;6;4;3;off;SSP5;1;1;forcing_SSP5;SSP5;2025;./config/input.gdx;SSP2-NDC;SSP5-Base
SSP5-NPi;1;load;1.75;rcp45;3;off;0;NPi2018;1;2100;3;2050;9;0.09;1;1.05;0;3;2;NPi2018;pop_SSP5;gdp_SSP5;highOil;highGas;highCoal;3;6;4;3;off;SSP5;1;1;forcing_SSP5;SSP5;2025;./config/input.gdx;SSP2-NDC;SSP5-Base
SSP5-PkBudg900;1;load;1.75;rcp20;9;globallyOptimal;900;diffCurvPhaseIn2Lin;300;2045;3;2050;9;0.09;1;1.05;0;3;2;NDC2018;pop_SSP5;gdp_SSP5;highOil;highGas;highCoal;3;6;4;2;on;SSP5;1;1;forcing_SSP5;SSP5;2025;./config/input.gdx;SSP2-NDC;SSP5-Base
SSP5-PkBudg1100;1;load;1.75;rcp26;9;globallyOptimal;1100;diffCurvPhaseIn2Lin;150;2080;3;2050;9;0.09;1;1.05;0;3;2;NDC2018;pop_SSP5;gdp_SSP5;highOil;highGas;highCoal;3;6;4;2;on;SSP5;1;1;forcing_SSP5;SSP5;2025;./config/input.gdx;SSP2-NDC;SSP5-Base
SSP5-PkBudg1300;1;load;1.75;rcp26;9;globallyOptimal;1300;diffCurvPhaseIn2Lin;80;2100;3;2050;9;0.09;1;1.05;0;3;2;NDC2018;pop_SSP5;gdp_SSP5;highOil;highGas;highCoal;3;6;4;2;on;SSP5;1;1;forcing_SSP5;SSP5;2025;./config/input.gdx;SSP2-NDC;SSP5-Base
title;start;oldrun;path_report;magpie_scen;LU_pricing;path_gdx;path_gdx_ref;path_gdx_bau;path_gdx_opt
SSP1-Base;0;;;SSP1,NPI;y2150;;;;
SSP1-NDC;0;;;SSP1,NDC;y2150;;;;
SSP1-NPi;0;;;SSP1,NPI;y2150;;;;
SSP1-PkBudg900;0;;;SSP1,NDC;y2020;;;;
SSP1-PkBudg1100;0;;;SSP1,NDC;y2020;;;;
SSP1-PkBudg1300;0;;;SSP1,NDC;y2020;;;;
SSP2-Base;0;;;SSP2,NPI;y2150;;;;
SSP2-NDC;0;;;SSP2,NDC;y2150;;;;
SSP2-NPi;0;;;SSP2,NPI;y2150;;;;
SSP2-PkBudg900;0;;;SSP2,NDC;y2020;;;;
SSP2-PkBudg1100;0;;;SSP2,NDC;y2020;;;;
SSP2-PkBudg1300;0;;;SSP2,NDC;y2020;;;;
SSP5-Base;0;;;SSP5,NPI;y2150;;;;
SSP5-NDC;0;;;SSP5,NDC;y2150;;;;
SSP5-NPi;0;;;SSP5,NPI;y2150;;;;
SSP5-PkBudg900;0;;;SSP5,NDC;y2020;;;;
SSP5-PkBudg1100;0;;;SSP5,NDC;y2020;;;;
SSP5-PkBudg1300;0;;;SSP5,NDC;y2020;;;;
SDP-Base;0;;;SDP,NPI;y2150;;;;
SDP-NDC;0;;;SDP,NDC;y2150;;;;
SDP-NPi;0;;;SDP,NPI;y2150;;;;
SDP-PkBudg900;0;;;SDP,NDC;y2020;;;;
SDP-PkBudg1000;0;;;SDP,NDC;y2020;;;;
SDP-PkBudg1100;0;;;SDP,NDC;y2020;;;;
SDP-PkBudg1300;0;;;SDP,NDC;y2020;;;;
title;start;qos;oldrun;path_report;magpie_scen;LU_pricing;path_gdx;path_gdx_ref;path_gdx_bau;path_gdx_opt
SSP1-Base;0;priority;;;SSP1,NPI;y2150;;;;
SSP1-NDC;0;short;;;SSP1,NDC;y2150;;;;
SSP1-NPi;0;short;;;SSP1,NPI;y2150;;;;
SSP1-PkBudg900;0;short;;;SSP1,NDC;y2020;;;;
SSP1-PkBudg1100;0;short;;;SSP1,NDC;y2020;;;;
SSP1-PkBudg1300;0;short;;;SSP1,NDC;y2020;;;;
SSP2-Base;1;priority;;;SSP2,NPI;y2150;;;;
SSP2-NDC;1;priority;;;SSP2,NDC;y2150;;;;
SSP2-NPi;0;short;;;SSP2,NPI;y2150;;;;
SSP2-PkBudg900;1;short;;;SSP2,NDC;y2020;;;;
SSP2-PkBudg1100;0;short;;;SSP2,NDC;y2020;;;;
SSP2-PkBudg1300;0;short;;;SSP2,NDC;y2020;;;;
SSP5-Base;1;short;;;SSP5,NPI;y2150;;;;
SSP5-NDC;0;short;;;SSP5,NDC;y2150;;;;
SSP5-NPi;0;short;;;SSP5,NPI;y2150;;;;
SSP5-PkBudg900;0;short;;;SSP5,NDC;y2020;;;;
SSP5-PkBudg1100;0;short;;;SSP5,NDC;y2020;;;;
SSP5-PkBudg1300;0;short;;;SSP5,NDC;y2020;;;;
SDP-Base;0;priority;;;SDP,NPI;y2150;;;;
SDP-NDC;0;short;;;SDP,NDC;y2150;;;;
SDP-NPi;0;short;;;SDP,NPI;y2150;;;;
SDP-PkBudg900;0;short;;;SDP,NDC;y2020;;;;
SDP-PkBudg1000;0;short;;;SDP,NDC;y2020;;;;
SDP-PkBudg1100;0;short;;;SDP,NDC;y2020;;;;
SDP-PkBudg1300;0;short;;;SDP,NDC;y2020;;;;
......@@ -53,14 +53,16 @@ o_diff_to_Budg(iteration) "Difference between actual
o_totCO2emi_peakBudgYr(iteration) "Total CO2 emissions in the peakBudgYr"
o_peakBudgYr_Itr(iteration) "Year in which the CO2 budget is supposed to peak. Is changed in iterative_target_adjust = 9"
o_factorRescale_taxCO2_afterPeakBudgYr(iteration) "Multiplicative factor for rescaling the CO2 price in the year after peakBudgYr - only needed if flip-flopping of peakBudgYr occurs"
o_delay_increase_peakBudgYear(iteration) "Switch that tracks if flip-flopping of peakBudgYr happened. Starts an inner loop to try and overcome this"
o_reached_until2150pricepath(iteration) "Switch that tracks if the inner loop of increasing the CO2 price AFTER peakBudgYr goes beyond the initial trajectory"
p_taxCO2eq_until2150(ttot,all_regi) "CO2 price trajectory continued until 2150 - as if there was no change in trajectory after peakBudgYr. Needed to recalculate CO2 price trajectory after peakBudgYr was shifted right"
o_delay_increase_peakBudgYear(iteration) "Counter that tracks if flip-flopping of peakBudgYr happened. Starts an inner loop to try and overcome this"
o_reached_until2150pricepath(iteration) "Counter that tracks if the inner loop of increasing the CO2 price AFTER peakBudgYr goes beyond the initial trajectory"
p_taxCO2eq_until2150(ttot,all_regi) "CO2 price trajectory continued until 2150 - as if there was no change in trajectory after peakBudgYr. Needed to recalculate CO2 price trajectory after peakBudgYr was shifted right"
o_totCO2emi_allYrs(ttot,iteration) "Global CO2 emissions over time and iterations. Needed to check the procedure to find the peakBudgYr"
o_change_totCO2emi_peakBudgYr "Measure for how much the CO2 emissions change around the peakBudgYr"
p_factorRescale_taxCO2(iteration) "Multiplicative factor for rescaling the CO2 price to reach the target"
p_factorRescale_taxCO2_Funneled(iteration) "Multiplicative factor for rescaling the CO2 price to reach the target - limited by an iteration-dependent funnel"
o_taxCO2eq_Itr_1regi(ttot,iteration) "CO2 taxed in the last region, tracked over iterations for debugging"
o_pkBudgYr_flipflop(iteration) "Counter that tracks if flipfloping of cm_peakBudgYr occured in the last iterations"
o_taxCO2eq_afterPeakShiftLoop_Itr_1regi(ttot, iteration) "CO2 taxed in the last region, after the loop that shifts peakBudgYr, tracked over iterations for debugging"
***----------------------------------------------------------------------------------------
***-----------------------------------------------ESM module-------------------------------
......
......@@ -295,8 +295,7 @@ display p_actualbudgetco2;
*** if tax after cm_peakBudgYr is higher than normal increase rate (exceeding a 20% tolerance): shift right
elseif( ( sum(regi, sum(t2$(t2.val = pm_ttot_val(ttot+1)),pm_taxCO2eq(t2,regi))) > sum(regi,sum(t2$(t2.val = pm_ttot_val(ttot+1)),p_taxCO2eq_until2150(t2,regi)))*1.2 ) AND (cm_peakBudgYr < 2100) ), !! if peaking time would be after 2100, keep 2100 budget year
if( (iteration.val > 2) AND ( o_peakBudgYr_Itr(iteration - 1) > o_peakBudgYr_Itr(iteration) ) AND ( o_peakBudgYr_Itr(iteration - 2) = o_peakBudgYr_Itr(iteration) ) , !! if the target year was just shifted left after being shifted right
o_peakBudgYr_Itr(iteration+1) = o_peakBudgYr_Itr(iteration); !! don't shift right again immediately, but go into a different loop:
o_delay_increase_peakBudgYear(iteration) = 1;
o_peakBudgYr_Itr(iteration+1) = o_peakBudgYr_Itr(iteration); !! don't shift right again immediately
else
display "shift peakBudgYr right";
o_peakBudgYr_Itr(iteration+1) = pm_ttot_val(ttot + 1); !! ttot+1 is the new peakBudgYr
......@@ -422,6 +421,13 @@ if(cm_iterative_target_adj eq 9,
*** ----B1: check if cm_peakBudgYr should be shifted left or right:
if( abs(o_diff_to_Budg(iteration)) < 20, !! only think about shifting peakBudgYr if the budget is close enough to target budget
display "close enough to target budget to check timing of peak year";
!! check if the target year was just shifted back left after being shifted right before
if ( (iteration.val > 2) AND ( o_peakBudgYr_Itr(iteration - 1) > o_peakBudgYr_Itr(iteration) ) AND ( o_peakBudgYr_Itr(iteration - 2) = o_peakBudgYr_Itr(iteration) ),
o_pkBudgYr_flipflop(iteration) = 1;
display "flipflop observed (before loop)";
);
loop(ttot$(ttot.val = cm_peakBudgYr), !! look at the peak timing
if( ( (o_totCO2emi_peakBudgYr(iteration) < -(0.1 + o_change_totCO2emi_peakBudgYr(iteration)) ) AND (cm_peakBudgYr > 2040) ), !! no peaking time before 2040
display "shift peakBudgYr left";
......@@ -429,9 +435,13 @@ if(cm_iterative_target_adj eq 9,
pm_taxCO2eq(t,regi)$(t.val gt pm_ttot_val(ttot - 1)) = p_taxCO2eq_until2150(ttot-1,regi) + (t.val - pm_ttot_val(ttot - 1)) * cm_taxCO2inc_after_peakBudgYr * sm_DptCO2_2_TDpGtC; !! increase by cm_taxCO2inc_after_peakBudgYr per year after peakBudgYr
elseif ( ( o_totCO2emi_peakBudgYr(iteration) > (0.1 + o_change_totCO2emi_peakBudgYr(iteration)) ) AND (cm_peakBudgYr < 2100) ), !! if peaking time would be after 2100, keep 2100 budget year
if( (iteration.val > 2) AND ( o_peakBudgYr_Itr(iteration - 1) > o_peakBudgYr_Itr(iteration) ) AND ( o_peakBudgYr_Itr(iteration - 2) = o_peakBudgYr_Itr(iteration) ) , !! if the target year was just shifted left after being shifted right
if( (o_pkBudgYr_flipflop(iteration) eq 1), !! if the target year was just shifted left after being shifted right, and would now be shifted right again
display "peakBudgYr was left, right, left and is now supposed to be shifted right again -> flipflop, thus go into separate loop";
o_peakBudgYr_Itr(iteration+1) = o_peakBudgYr_Itr(iteration); !! don't shift right again immediately, but go into a different loop:
o_delay_increase_peakBudgYear(iteration) = 1;
elseif ( o_delay_increase_peakBudgYear(iteration) eq 1 ),
display "still in separate loop trying to resolve flip-flop behavior";
o_peakBudgYr_Itr(iteration+1) = o_peakBudgYr_Itr(iteration); !! keep current peakBudgYr,
else
display "shift peakBudgYr right";
o_peakBudgYr_Itr(iteration+1) = pm_ttot_val(ttot + 1); !! ttot+1 is the new peakBudgYr
......@@ -456,27 +466,36 @@ if(cm_iterative_target_adj eq 9,
display "not shifting peakBudgYr right, instead adjusting CO2 price for following year";
loop(ttot$(ttot.val eq cm_peakBudgYr), !! set ttot to the current peakBudgYr
loop(t2$(t2.val eq pm_ttot_val(ttot+1)), !! set t2 to the following time step
o_factorRescale_taxCO2_afterPeakBudgYr(iteration) = 1 + max(sum(regi2,vm_emiAll.l(t2,regi2,"co2"))/sum(regi2,vm_emiAll.l("2015",regi2,"co2")),-0.75) ; !! inspired by Christoph. This value is 1 if emissions are 0.
o_factorRescale_taxCO2_afterPeakBudgYr(iteration) = 1 + max(sum(regi2,vm_emiAll.l(ttot,regi2,"co2"))/sum(regi2,vm_emiAll.l("2015",regi2,"co2")),-0.75) ;
!! this was inspired by Christoph's approach. This value is 1 if emissions in the peakBudgYr are 0; goes down to 0.25 if emissions are <0 and approaching the size of 2015 emissions, and > 1 if emissions > 0.
!! in case the normal linear extension still is not enough to get emissions to 0 after the peakBudgYr, shift peakBudgYr right again:
if( ( o_reached_until2150pricepath(iteration-1) eq 1 ) AND ( (o_factorRescale_taxCO2_afterPeakBudgYr(iteration) / p_factorRescale_taxCO2_Funneled(iteration)) > 1),
display "price in following year reached original path and is still not enough -> shift peakBudgYr to right";
o_delay_increase_peakBudgYear(iteration) = 0;
if( ( o_reached_until2150pricepath(iteration-1) eq 1 ) AND ( o_totCO2emi_peakBudgYr(iteration) > (0.1 + o_change_totCO2emi_peakBudgYr(iteration)) ),
display "price in following year reached original path in previous iteration and is still not enough -> shift peakBudgYr to right";
o_delay_increase_peakBudgYear(iteration+1) = 0; !! probably is not necessary
o_reached_until2150pricepath(iteration) = 0;
o_peakBudgYr_Itr(iteration+1) = t2.val; !! shift PeakBudgYear to the following time step
cm_peakBudgYr = o_peakBudgYr_Itr(iteration+1);
pm_taxCO2eq(t2,regi) = p_taxCO2eq_until2150(t2,regi) ; !! set CO2 price in t2 to value in the "continuous path"
display cm_peakBudgYr;
elseif ( ( o_reached_until2150pricepath(iteration-1) eq 1 ) AND ( o_totCO2emi_peakBudgYr(iteration) < (0.1 + o_change_totCO2emi_peakBudgYr(iteration)) ) ),
display "New intermediate price in timestep after cm_peakBudgYr is sufficient to stabilize peaking year - go back to normal loop";
o_delay_increase_peakBudgYear(iteration+1) = 0; !! probably is not necessary
o_reached_until2150pricepath(iteration) = 0;
o_peakBudgYr_Itr(iteration+1) = o_peakBudgYr_Itr(iteration);
cm_peakBudgYr = o_peakBudgYr_Itr(iteration+1);
else !! either didn't reach the continued "until2150"-price path in last iteration, or the increase was high enough to get emissions to 0.
!! in this case, keep PeakBudgYr, and adjust the price in the year after the peakBudgYr to get emissions close to 0,
o_delay_increase_peakBudgYear(iteration+1) = 1; !! make sure next iteration peakBudgYr is not shifted right again
o_peakBudgYr_Itr(iteration+1) = o_peakBudgYr_Itr(iteration);
pm_taxCO2eq(t2,regi) = max(pm_taxCO2eq(ttot,regi), !! at least as high as the price in the peakBudgYr
pm_taxCO2eq(t2,regi) * (o_factorRescale_taxCO2_afterPeakBudgYr(iteration) / p_factorRescale_taxCO2_Funneled(iteration) ) !! the full path was already rescaled by p_factorRescale_taxCO2_Funneled, so adjust the second rescaling
);
loop(regi, !! this loop necessary to allow the <-comparison in the next if statement
loop(regi, !! this loop is necessary to allow the <-comparison in the next if statement
if( p_taxCO2eq_until2150(t2,regi) < pm_taxCO2eq(t2,regi) , !! check if new price would be higher than the price if the peakBudgYr would be one timestep later
pm_taxCO2eq(t2,regi) = p_taxCO2eq_until2150(t2,regi);
display "price increase reached price from path with cm_peakBudgYr one timestep later - downscale to 99%";
pm_taxCO2eq(t2,regi) = 0.99 * p_taxCO2eq_until2150(t2,regi); !! reduce the new CO2 price to 99% of the price that it would be if the peaking year was one timestep later. The next iteration will show if this is enough, otherwise cm_peakBudgYr will be shifted right
o_reached_until2150pricepath(iteration) = 1; !! upward CO2 price correction reached the continued price path - check in next iteration if this is high enough.
);
);
......@@ -490,7 +509,12 @@ if(cm_iterative_target_adj eq 9,
cm_peakBudgYr = o_peakBudgYr_Itr(iteration+1); !! this has to happen outside the loop, otherwise the loop condition might be true twice
); !! if o_delay_increase_peakBudgYear(iteration) = 1, !! if there was a flip-floping in the previous iterations, try to solve this
display o_delay_increase_peakBudgYear, o_reached_until2150pricepath, pm_taxCO2eq, o_peakBudgYr_Itr;
loop(regi, !! not a nice solution to having only the price of one regi display (for better visibility), but this way it overwrites again and again until the value from the last regi remain
o_taxCO2eq_afterPeakShiftLoop_Itr_1regi(t,iteration+1) = pm_taxCO2eq(t,regi);
);
display o_delay_increase_peakBudgYear, o_reached_until2150pricepath, pm_taxCO2eq, o_peakBudgYr_Itr, o_taxCO2eq_afterPeakShiftLoop_Itr_1regi, o_pkBudgYr_flipflop;
); !! if cm_emiscen eq 9,
); !! if cm_iterative_target_adj eq 8,
......
......@@ -82,9 +82,9 @@
*
* Regionscode: 690d3718e151be1b450b394c1064b1c5
*
* Input data revision: 5.942
* Input data revision: 5.944
*
* Last modification (input data): Tue Apr 28 08:29:32 2020
* Last modification (input data): Tue Apr 28 10:13:23 2020
*
*###################### R SECTION END (VERSION INFO) ###########################
......
......@@ -47,9 +47,11 @@ loop(ttot$((ttot.val ge cm_startyear) AND (ttot.val le cm_CO2priceRegConvEndYr)
min(1,
max(0,
p45_phasein_2025ratio(regi) + (1 - p45_phasein_2025ratio(regi))
* ( ( (ttot.val - 2025) + (cm_CO2priceRegConvEndYr - 2025) * 0.1 )
/ ( (cm_CO2priceRegConvEndYr - 2025) * 1.1 )
) ** 2
* Power(
( (ttot.val - 2025) + (cm_CO2priceRegConvEndYr - 2025) * 0.1 )
/ ( (cm_CO2priceRegConvEndYr - 2025) * 1.1 )
, 2
) !! use Power instead of ** to allow ttot be smaller than 2025, and thus the base to be negative
)
);
);
......
......@@ -24,8 +24,6 @@ library(lucode)
if(!exists("source_include")) {
# if this script is not being sourced by another script but called from the command line via Rscript read the command line arguments and let the user choose the slurm options
readArgs("outputdir","output","comp","remind_dir")
#source("scripts/utils/choose_slurmConfig.R")
#slurmConfig <- choose_slurmConfig()
}
#Setting relevant paths
......
......@@ -69,3 +69,44 @@ choose_slurmConfig <- function() {
return(comp)
}
# combine_slurmconfig takes two strings with SLURM parameters (e.g. "--qos=priority --time=03:30:00")
# and combines them into one sting of SLURM parameters overwriting the parameters in "original"
# if they also exist in "update_with".
combine_slurmConfig <- function (original, update_with) {
# trim whitespaces
original <- trimws(original)
update_with <- trimws(update_with)
# remove double whitespaces
original <- gsub("\\s+"," ",original)
update_with <- gsub("\\s+"," ",update_with)
# if user chose "direct" dont update any slurm commands
if(update_with == "direct") return(update_with)
# ignore original if it is "direct"
if (original == "direct") original <- ""
# put RHS strings into vector
v_update_with <- gsub("--.*=(.*)","\\1",unlist(strsplit(update_with,split=" ")))
# name the vector using LHS strings
names(v_update_with) <- gsub("--(.*)=.*","\\1",unlist(strsplit(update_with,split=" ")))
# put RHS strings into vector
v_original <- gsub("--.*=(.*)","\\1",unlist(strsplit(original,split=" ")))
# name the vector using LHS strings
names(v_original) <- gsub("--(.*)=.*","\\1",unlist(strsplit(original,split=" ")))
# remove elements from "original" that are existing in "update_with"
v_original <- v_original[!names(v_original) %in% "qos"]
combined <- c(v_update_with,v_original)
# concatenate SLURM command (insert "--" and "=")
res <- paste(paste0("--",names(combined),"=",combined),collapse = " ")
return(res)
}
......@@ -169,6 +169,12 @@ prepare <- function() {
}
}
# Display git information
cat("\n===== git info =====\nLatest commit: ")
cat(try(system("git show -s --format='%h %ci %cn'", intern=TRUE), silent=TRUE),"\nChanges since then: ")
cat(paste(try(system("git status", intern=TRUE), silent=TRUE),collapse="\n"))
cat("\n====================\n")
load("config.Rdata")
# Store results folder of current scenario
......@@ -856,15 +862,15 @@ run <- function(start_subsequent_runs = TRUE) {
# Call prepare and run without cfg, because cfg is read from results folder, where it has been
# copied to by submit(cfg)
if (!file.exists("fulldata.gdx")) {
# If no "fulldata.gdx" exists, the script assumes that REMIND did not run before and
if (!file.exists("full.gms")) {
# If no "full.gms" exists, the script assumes that REMIND did not run before and
# prepares all inputs before starting the run.
prepare()
start_subsequent_runs <- TRUE
} else {
# If "fulldata.gdx" exists, the script assumes that REMIND did run before and you want
# to restart REMIND in the same folder using the gdx that it previously produced.
file.copy("fulldata.gdx", "input.gdx", overwrite = TRUE)
# If "full.gms" exists, the script assumes that a full.gms has been generated before and you want
# to restart REMIND in the same folder using the gdx that it eventually previously produced.
if(file.exists("fulldata.gdx")) file.copy("fulldata.gdx", "input.gdx", overwrite = TRUE)
start_subsequent_runs <- FALSE
}
......
......@@ -47,7 +47,7 @@ choose_folder <- function(folder,title="Please choose a folder") {
# Detect all output folders containing fulldata.gdx or non_optimal.gdx
# For coupled runs please use the outcommented text block below
dirs <- sub("/(non_optimal|fulldata).gdx","",sub("./output/","",Sys.glob(c(file.path(folder,"*","non_optimal.gdx"),file.path(folder,"*","fulldata.gdx")))))
dirs <- sub("/full.gms","",sub("./output/","",Sys.glob(file.path(folder,"*","full.gms"))))
# DK: The following outcommented lines are specially made for listing results of coupled runs
#runs <- findCoupledruns(folder)
......@@ -196,7 +196,8 @@ if ('--restart' %in% argv) {
for (outputdir in outputdirs) {
cat("Restarting",outputdir,"\n")
load(paste0("output/",outputdir,"/config.Rdata")) # read config.Rdata from results folder
cfg$slurmConfig <- slurmConfig # update the slurmConfig setting to what the user just chose (it was being ignored before)
cfg$slurmConfig <- combine_slurmConfig(cfg$slurmConfig,slurmConfig) # update the slurmConfig setting to what the user just chose (it was being ignored before)
cfg$results_folder <- paste0("output/",outputdir) # overwrite results_folder in cfg with name of the folder the user wants to restart, because user might have renamed the folder before restarting
submit(cfg, restart = TRUE)
#cat(paste0("output/",outputdir,"/config.Rdata"),"\n")
}
......@@ -238,7 +239,7 @@ if ('--restart' %in% argv) {
source("config/default.cfg")
# Have the log output written in a file (not on the screen)
cfg$slurmConfig <- slurmConfig
cfg$slurmConfig <- combine_slurmConfig(cfg$slurmConfig,slurmConfig)
cfg$logoption <- 2
start_now <- TRUE
......
......@@ -100,7 +100,9 @@ for(scen in common){
runname <- paste0(prefix_runname,scen) # name of the run that is used for the folder names
path_report <- NULL # sets the path to the report REMIND is started with in the first loop
LU_pricing <- scenarios_coupled[scen, "LU_pricing"] # indicates whether GHG prices should be used by MAgPIE or not
LU_pricing <- scenarios_coupled[scen, "LU_pricing"] # set the GHG prices to zero up to and including the year specified here
qos <- scenarios_coupled[scen, "qos"] # set the SLURM quality of service (priority/short/medium/...)
if(is.null(qos)) qos <- "short" # if qos could not be found in scenarios_coupled use short
start_iter <- 1 # iteration to start the coupling with
......@@ -269,7 +271,7 @@ for(scen in common){
}
}
save(path_remind,path_magpie,cfg_rem,cfg_mag,runname,max_iterations,start_iter,n600_iterations,path_report,LU_pricing,file=paste0(runname,".RData"))
save(path_remind,path_magpie,cfg_rem,cfg_mag,runname,max_iterations,start_iter,n600_iterations,path_report,LU_pricing,qos,file=paste0(runname,".RData"))
# Define colors for output
red <- "\033[0;31m"
......@@ -281,6 +283,7 @@ for(scen in common){
cat("\nSUMMARY\n")
cat("runname :",runname,"\n")
cat("QOS :",qos,"\n")
cat("start_iter :",start_iter,"\n")
cat("path_remind : ",ifelse(dir.exists(path_remind),green,red), path_remind, NC, "\n",sep="")
cat("path_magpie : ",ifelse(dir.exists(path_magpie),green,red), path_magpie, NC, "\n",sep="")
......@@ -300,7 +303,7 @@ for(scen in common){
if (start_now){
# Start SSP2-Base and SSP2-NDC as priority jobs since ALL subsequent runs depend on them
qos <- ifelse(grepl("SSP2-(NDC|Base)",runname),"priority","short")
#qos <- ifelse(grepl("SSP2-(NDC|Base)",runname),"priority","short")
if (!exists("test")) system(paste0("sbatch --qos=",qos," --job-name=",runname," --output=",runname,".log --mail-type=END --comment=REMIND-MAgPIE --tasks-per-node=",nr_of_regions," --wrap=\"Rscript start_coupled.R coupled_config=",runname,".RData\""))
else cat("Test mode: run NOT submitted to the cluster\n")
} else {
......
......@@ -7,7 +7,7 @@
##################################################################
################# D E F I N E start_coupled #####################
##################################################################
start_coupled <- function(path_remind,path_magpie,cfg_rem,cfg_mag,runname,max_iterations=5,start_iter=1,n600_iterations=0,report=NULL,LU_pricing=TRUE) {
start_coupled <- function(path_remind,path_magpie,cfg_rem,cfg_mag,runname,max_iterations=5,start_iter=1,n600_iterations=0,report=NULL,LU_pricing=TRUE,qos) {
require(lucode)
require(magclass)
......@@ -26,7 +26,7 @@ start_coupled <- function(path_remind,path_magpie,cfg_rem,cfg_mag,runname,max_it
# retrieve REMIND settings
cfg_rem <- check_config(cfg_rem,paste0(path_remind,"config/default.cfg"),paste0(path_remind,"modules"))
cfg_rem$sequential <- TRUE
cfg_rem$slurmConfig <- "direct"
cm_iteration_max_tmp <- cfg_rem$gms$cm_iteration_max # save default setting
cfg_rem_original <- cfg_rem$output
......@@ -210,7 +210,7 @@ start_coupled <- function(path_remind,path_magpie,cfg_rem,cfg_mag,runname,max_it
for(run in cfg_rem$subsequentruns){
cat("Submitting subsequent run",run,"\n")
# Start SSP2-Base and SSP2-NDC as priority jobs since ALL subsequent runs depend on them
qos <- ifelse(grepl("SSP2-(NDC|Base)",run),"priority","short")
#qos <- ifelse(grepl("SSP2-(NDC|Base)",run),"priority","short")
system(paste0("sbatch --qos=",qos," --job-name=C_",run," --output=C_",run,".log --mail-type=END --comment=REMIND-MAgPIE --tasks-per-node=",nr_of_regions," --wrap=\"Rscript start_coupled.R coupled_config=C_",run,".RData\""))
}
......@@ -257,7 +257,7 @@ require(lucode)
readArgs("coupled_config")
load(coupled_config)
start_coupled(path_remind,path_magpie,cfg_rem,cfg_mag,runname,max_iterations,start_iter,n600_iterations,path_report,LU_pricing)
start_coupled(path_remind,path_magpie,cfg_rem,cfg_mag,runname,max_iterations,start_iter,n600_iterations,path_report,LU_pricing,qos)
# Manual call:
# Rscript start_coupled.R coupled_config=runname
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