diff --git a/DESCRIPTION b/DESCRIPTION index 9d8dd29c3..ed5811928 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -59,7 +59,7 @@ Imports: raster, readr, readxl, - remind2 (>= 1.125.0), + remind2 (>= 1.135.6), renv, reshape2, reticulate, diff --git a/Makefile b/Makefile index 40e276964..2caec1cdb 100644 --- a/Makefile +++ b/Makefile @@ -85,6 +85,10 @@ test-full: ## Run all tests, including coupling tests and a default $(info Full tests take more than an hour to run, please be patient) @TESTTHAT_RUN_SLOW=TRUE Rscript -e 'testthat::test_dir("tests/testthat")' +test-full-slurm: ##test-full, but on slurm + $(info Full tests take more than an hour to run, please be patient) + @sbatch --qos=priority --wrap="make test-full" --job-name=test-full --mail-type=END --output=test-full.log --comment="test-full.log" + test-validation: ## Run validation tests, requires a full set of runs in the output folder $(info Run validation tests, requires a full set of runs in the output folder) @TESTTHAT_RUN_SLOW=TRUE Rscript -e 'testthat::test_dir("tests/testthat/validation")' diff --git a/config/scenario_config_GCS.csv b/config/scenario_config_GCS.csv deleted file mode 100644 index e3e2724cd..000000000 --- a/config/scenario_config_GCS.csv +++ /dev/null @@ -1,48 +0,0 @@ -title;start;CES_parameters;cm_rcp_scen;climate;cm_magicc_config;cm_magicc_calibrateTemperature2000;downscaleTemperature;damages;cm_TCpers;cm_TCspec;cm_bioenergy_SustTax;cm_iterative_target_adj;subsidizeLearning;c_budgetCO2from2020;carbonprice;cm_co2_tax_2020;c_peakBudgYr;c_taxCO2inc_after_peakBudgYr;cm_emiscen;cm_flex_tax;cm_EDGEtr_scen;cm_build_H2costAddH2Inv;cm_CESMkup_build;cm_CESMkup_ind;cm_CESMkup_ind_data;cm_PriceDurSlope_elh2;techpol;cm_POPscen;cm_GDPscen;cm_demScen;cm_LU_emi_scen;c_techAssumptScen;cm_nucscen;cm_so2tax_scen;cm_multigasscen;cm_ccapturescen;c_ccsinjecratescen;CCU;cm_INCONV_PENALTY_FESwitch;cm_APscen;cm_startyear;path_gdx;path_gdx_ref;path_gdx_bau;path_gdx_carbonprice -SSP2-Base;1;load;none;magicc;RCP26_50;HADCRUT4;CMIP5;off;9;mean;0;0;off;0;none;-1;2100;3;1;0;Mix1;0.2;standard;standard;;10;none;pop_SSP2EU;gdp_SSP2EU;gdp_SSP2EU;SSP2;1;2;1;2;2;0;off;off;SSP2;2005;;;; -SSP2-Tall-PkBudg750;0;load;rcp20;magicc;RCP26_50;HADCRUT4;CMIP5;KWTCint;9;mean;0;9;globallyOptimal;750;diffCurvPhaseIn2Lin;200;2045;3;9;0;Mix4;0.15;feelhpb 0.87;standard;;10;NDC;pop_SSP2EU;gdp_SSP2EU;gdp_SSP2_lowEn;SSP2;1;2;1;2;1;1;on;off;SSP2;2025;;SSP2-NPi;SSP2-Base; -SSP2-NDC;0;load;rcp45;magicc;RCP26_50;HADCRUT4;CMIP5;KWTCint;9;mean;0;3;globallyOptimal;0;NDC;1;2100;3;9;0;Mix1;0.2;standard;standard;;10;NDC;pop_SSP2EU;gdp_SSP2EU;gdp_SSP2EU;SSP2;1;2;1;3;2;0;off;off;SSP2;2025;;SSP2-NPi;SSP2-Base; -SSP2-NPi;1;load;rcp45;magicc;RCP26_50;HADCRUT4;CMIP5;KWTCint;9;mean;0;3;globallyOptimal;0;NPi;1;2100;3;9;0;Mix1;0.2;standard;standard;;10;NPi2018;pop_SSP2EU;gdp_SSP2EU;gdp_SSP2EU;SSP2;1;2;1;3;2;0;off;off;SSP2;2005;;;; -SSP2-ENEndc;0;load;rcp26;magicc;RCP26_50;HADCRUT4;CMIP5;KWTCint;9;mean;0;0;globallyOptimal;0;exogenous;1;2100;3;9;0;Mix1;0.2;standard;standard;;10;NDC;pop_SSP2EU;gdp_SSP2EU;gdp_SSP2EU;SSP2;1;2;1;3;2;0;off;off;SSP2;2025;;SSP2-NPi;SSP2-Base;SSP2-NDC -SSP2-ENEcp;0;load;rcp26;magicc;RCP26_50;HADCRUT4;CMIP5;KWTCint;9;mean;0;0;globallyOptimal;0;exogenous;1;2100;3;9;0;Mix1;0.2;standard;standard;;10;NPi2018;pop_SSP2EU;gdp_SSP2EU;gdp_SSP2EU;SSP2;1;2;1;3;2;0;off;off;SSP2;2025;;SSP2-NPi;SSP2-Base;SSP2-Tall-PkBudg750 -SSP2-ENEelec;0;load;rcp26;magicc;RCP26_50;HADCRUT4;CMIP5;KWTCint;9;mean;0;0;globallyOptimal;0;exogenous;1;2100;3;9;0;Mix4;0.15;feelhpb 0.87;manual;feel_steel_secondary 1.00, feel_steel_primary 1.00 , feelhth_chemicals 1.00, feelhth_otherInd 1.00, feh2_chemicals 0.87, feh2_steel 0.87, feh2_otherInd 0.87, feh2_cement 0.87;10;NPi2018;pop_SSP2EU;gdp_SSP2EU;gdp_SSP2EU;SSP2;1;2;1;3;2;0;off;off;SSP2;2025;;SSP2-NPi;SSP2-Base;SSP2-NPi -SSP2-ENEcp-ENEcc;0;load;rcp26;magicc;RCP26_50;HADCRUT4;CMIP5;KWTCint;9;mean;0;0;globallyOptimal;0;exogenous;1;2100;3;9;0;Mix1;0.2;standard;standard;;10;NPi2018;pop_SSP2EU;gdp_SSP2EU;gdp_SSP2EU;SSP2;1;2;1;3;1;1;on;off;SSP2;2025;;SSP2-NPi;SSP2-Base;SSP2-Tall-PkBudg750 -SSP2-Tene;0;load;rcp26;magicc;RCP26_50;HADCRUT4;CMIP5;KWTCint;9;mean;0;0;globallyOptimal;0;exogenous;1;2100;3;9;0;Mix4;0.15;feelhpb 0.87;manual;feel_steel_secondary 1.00, feel_steel_primary 1.00 , feelhth_chemicals 1.00, feelhth_otherInd 1.00, feh2_chemicals 0.87, feh2_steel 0.87, feh2_otherInd 0.87, feh2_cement 0.87;10;NDC;pop_SSP2EU;gdp_SSP2EU;gdp_SSP2EU;SSP2;1;2;1;3;1;1;on;off;SSP2;2025;;SSP2-NPi;SSP2-Base;SSP2-Tall-PkBudg750 -SSP2-Tpc;0;load;rcp26;magicc;RCP26_50;HADCRUT4;CMIP5;KWTCint;9;mean;0;0;globallyOptimal;0;exogenous;1;2100;3;9;0;Mix1;0.2;standard;standard;;10;NPi2018;pop_SSP2EU;gdp_SSP2EU;gdp_SSP2_lowEn;SSP2;1;2;1;3;2;0;off;off;SSP2;2025;;SSP2-NPi;SSP2-Base;SSP2-NPi -SSP2-LNDcp;0;load;rcp26;magicc;RCP26_50;HADCRUT4;CMIP5;KWTCint;9;mean;0;0;globallyOptimal;0;exogenous;1;2100;3;9;0;Mix4;0.2;standard;standard;;10;NPi2018;pop_SSP2EU;gdp_SSP2EU;gdp_SSP2EU;SSP2;1;2;1;2;2;0;off;off;SSP2;2025;;SSP2-NPi;SSP2-Base;SSP2-NPi -SSP2-LNDndc;0;load;rcp26;magicc;RCP26_50;HADCRUT4;CMIP5;KWTCint;9;mean;0;0;globallyOptimal;0;exogenous;1;2100;3;9;0;Mix4;0.2;standard;standard;;10;NPi2018;pop_SSP2EU;gdp_SSP2EU;gdp_SSP2EU;SSP2;1;2;1;2;2;0;off;off;SSP2;2025;;SSP2-NPi;SSP2-Base;SSP2-NPi -SSP2-LNDlbs;0;load;rcp26;magicc;RCP26_50;HADCRUT4;CMIP5;KWTCint;9;mean;0;0;globallyOptimal;0;exogenous;1;2100;3;9;0;Mix4;0.2;standard;standard;;10;NPi2018;pop_SSP2EU;gdp_SSP2EU;gdp_SSP2EU;SSP2;1;2;1;2;2;0;off;off;SSP2;2025;;SSP2-NPi;SSP2-Base;SSP2-NPi -SSP2-LNDreseff;0;load;rcp26;magicc;RCP26_50;HADCRUT4;CMIP5;KWTCint;9;mean;0;0;globallyOptimal;0;exogenous;1;2100;3;9;0;Mix4;0.2;standard;standard;;10;NPi2018;pop_SSP2EU;gdp_SSP2EU;gdp_SSP2EU;SSP2;1;2;1;2;2;0;off;off;SSP2;2025;;SSP2-NPi;SSP2-Base;SSP2-NPi -SSP2-LNDfood;0;load;rcp26;magicc;RCP26_50;HADCRUT4;CMIP5;KWTCint;9;mean;0;0;globallyOptimal;0;exogenous;1;2100;3;9;0;Mix4;0.2;standard;standard;;10;NPi2018;pop_SSP2EU;gdp_SSP2EU;gdp_SSP2EU;SSP2;1;2;1;2;2;0;off;off;SSP2;2025;;SSP2-NPi;SSP2-Base;SSP2-NPi -SSP2-Tland;0;load;rcp26;magicc;RCP26_50;HADCRUT4;CMIP5;KWTCint;9;mean;0;0;globallyOptimal;0;exogenous;1;2100;3;9;0;Mix4;0.2;standard;standard;;10;NPi2018;pop_SSP2EU;gdp_SSP2EU;gdp_SSP2EU;SSP2;1;2;1;2;2;0;off;off;SSP2;2025;;SSP2-NPi;SSP2-Base;SSP2-NPi -SSP2-nofood-Tland;0;load;rcp26;magicc;RCP26_50;HADCRUT4;CMIP5;KWTCint;9;mean;0;0;globallyOptimal;0;exogenous;1;2100;3;9;0;Mix4;0.2;standard;standard;;10;NPi2018;pop_SSP2EU;gdp_SSP2EU;gdp_SSP2EU;SSP2;1;2;1;2;2;0;off;off;SSP2;2025;;SSP2-NPi;SSP2-Base;SSP2-NPi -SSP2-Tene-LNDndc;0;load;rcp26;magicc;RCP26_50;HADCRUT4;CMIP5;KWTCint;9;mean;0;0;globallyOptimal;0;exogenous;1;2100;3;9;0;Mix4;0.15;feelhpb 0.87;manual;feel_steel_secondary 1.00, feel_steel_primary 1.00 , feelhth_chemicals 1.00, feelhth_otherInd 1.00, feh2_chemicals 0.87, feh2_steel 0.87, feh2_otherInd 0.87, feh2_cement 0.87;10;NDC;pop_SSP2EU;gdp_SSP2EU;gdp_SSP2EU;SSP2;1;2;1;3;1;1;on;off;SSP2;2025;;SSP2-NPi;SSP2-Base;SSP2-Tall-PkBudg750 -SSP2-Tene-LNDlbs;0;load;rcp26;magicc;RCP26_50;HADCRUT4;CMIP5;KWTCint;9;mean;0;0;globallyOptimal;0;exogenous;1;2100;3;9;0;Mix4;0.15;feelhpb 0.87;manual;feel_steel_secondary 1.00, feel_steel_primary 1.00 , feelhth_chemicals 1.00, feelhth_otherInd 1.00, feh2_chemicals 0.87, feh2_steel 0.87, feh2_otherInd 0.87, feh2_cement 0.87;10;NDC;pop_SSP2EU;gdp_SSP2EU;gdp_SSP2EU;SSP2;1;2;1;2;1;1;on;off;SSP2;2025;;SSP2-NPi;SSP2-Base;SSP2-Tall-PkBudg750 -SSP2-Tene-LNDreseff;0;load;rcp26;magicc;RCP26_50;HADCRUT4;CMIP5;KWTCint;9;mean;0;0;globallyOptimal;0;exogenous;1;2100;3;9;0;Mix4;0.15;feelhpb 0.87;manual;feel_steel_secondary 1.00, feel_steel_primary 1.00 , feelhth_chemicals 1.00, feelhth_otherInd 1.00, feh2_chemicals 0.87, feh2_steel 0.87, feh2_otherInd 0.87, feh2_cement 0.87;10;NDC;pop_SSP2EU;gdp_SSP2EU;gdp_SSP2EU;SSP2;1;2;1;2;1;1;on;off;SSP2;2025;;SSP2-NPi;SSP2-Base;SSP2-Tall-PkBudg750 -SSP2-Tene-LNDfood;0;load;rcp26;magicc;RCP26_50;HADCRUT4;CMIP5;KWTCint;9;mean;0;0;globallyOptimal;0;exogenous;1;2100;3;9;0;Mix4;0.15;feelhpb 0.87;manual;feel_steel_secondary 1.00, feel_steel_primary 1.00 , feelhth_chemicals 1.00, feelhth_otherInd 1.00, feh2_chemicals 0.87, feh2_steel 0.87, feh2_otherInd 0.87, feh2_cement 0.87;10;NDC;pop_SSP2EU;gdp_SSP2EU;gdp_SSP2EU;SSP2;1;2;1;2;1;1;on;off;SSP2;2025;;SSP2-NPi;SSP2-Base;SSP2-Tall-PkBudg750 -SSP2-nofood-Tene-Tland;0;load;rcp26;magicc;RCP26_50;HADCRUT4;CMIP5;KWTCint;9;mean;0;0;globallyOptimal;0;exogenous;1;2100;3;9;0;Mix4;0.15;feelhpb 0.87;manual;feel_steel_secondary 1.00, feel_steel_primary 1.00 , feelhth_chemicals 1.00, feelhth_otherInd 1.00, feh2_chemicals 0.87, feh2_steel 0.87, feh2_otherInd 0.87, feh2_cement 0.87;10;NDC;pop_SSP2EU;gdp_SSP2EU;gdp_SSP2EU;SSP2;1;2;1;2;1;1;on;off;SSP2;2025;;SSP2-NPi;SSP2-Base;SSP2-Tall-PkBudg750 -SSP2-Tene-Tland;0;load;rcp26;magicc;RCP26_50;HADCRUT4;CMIP5;KWTCint;9;mean;0;0;globallyOptimal;0;exogenous;1;2100;3;9;0;Mix4;0.15;feelhpb 0.87;manual;feel_steel_secondary 1.00, feel_steel_primary 1.00 , feelhth_chemicals 1.00, feelhth_otherInd 1.00, feh2_chemicals 0.87, feh2_steel 0.87, feh2_otherInd 0.87, feh2_cement 0.87;10;NDC;pop_SSP2EU;gdp_SSP2EU;gdp_SSP2EU;SSP2;1;2;1;3;1;1;on;off;SSP2;2025;;SSP2-NPi;SSP2-Base;SSP2-Tall-PkBudg750 -SDP-Tall-PkBudg750;0;load;rcp20;magicc;RCP26_50;HADCRUT4;CMIP5;KWTCint;9;mean;0;9;globallyOptimal;750;diffCurvPhaseIn2Lin;200;2045;3;9;0;Mix4;0.15;feelhpb 0.87;standard;;10;NDC;pop_SDP;gdp_SDP;gdp_SDP;SDP;2;2;4;2;1;1;on;off;SSP2;2025;;SSP2-NPi;SSP2-Base; -SDP-Tall-exoCP;0;load;rcp20;magicc;RCP26_50;HADCRUT4;CMIP5;KWTCint;9;mean;0;0;globallyOptimal;0;exogenous;1;2100;3;9;0;Mix4;0.15;feelhpb 0.87;standard;;10;NDC;pop_SDP;gdp_SDP;gdp_SDP;SDP;2;2;4;2;1;1;on;off;SSP2;2025;;SSP2-NPi;SSP2-Base;SSP2-Tall-PkBudg750 -SSP1-Tall-exoCP;0;load;rcp20;magicc;RCP26_50;HADCRUT4;CMIP5;KWTCint;9;mean;0;0;globallyOptimal;0;exogenous;1;2100;3;9;0;Mix4;0.15;feelhpb 0.87;standard;;10;NDC;pop_SSP1;gdp_SSP1;gdp_SSP1;SSP1;2;2;4;2;1;1;on;off;SSP1;2025;;SSP2-NPi;SSP2-Base;SSP2-Tall-PkBudg750 -SSP2-Tene-rcp45;0;load;rcp45;magicc;RCP26_50;HADCRUT4;CMIP5;KWTCint;9;mean;0;0;globallyOptimal;0;exogenous;1;2100;3;9;0;Mix4;0.15;feelhpb 0.87;manual;feel_steel_secondary 1.00, feel_steel_primary 1.00 , feelhth_chemicals 1.00, feelhth_otherInd 1.00, feh2_chemicals 0.87, feh2_steel 0.87, feh2_otherInd 0.87, feh2_cement 0.87;10;NDC;pop_SSP2EU;gdp_SSP2EU;gdp_SSP2EU;SSP2;1;2;1;3;1;1;on;off;SSP2;2025;;SSP2-NPi;SSP2-Base;SSP2-Tall-PkBudg750 -SSP2-Tpc-rcp45;0;load;rcp45;magicc;RCP26_50;HADCRUT4;CMIP5;KWTCint;9;mean;0;0;globallyOptimal;0;exogenous;1;2100;3;9;0;Mix1;0.2;standard;standard;;10;NPi2018;pop_SSP2EU;gdp_SSP2EU;gdp_SSP2_lowEn;SSP2;1;2;1;3;2;0;off;off;SSP2;2025;;SSP2-NPi;SSP2-Base;SSP2-NPi -SSP2-Tland-rcp45;0;load;rcp45;magicc;RCP26_50;HADCRUT4;CMIP5;KWTCint;9;mean;0;0;globallyOptimal;0;exogenous;1;2100;3;9;0;Mix4;0.2;standard;standard;;10;NPi2018;pop_SSP2EU;gdp_SSP2EU;gdp_SSP2EU;SSP2;1;2;1;2;2;0;off;off;SSP2;2025;;SSP2-NPi;SSP2-Base;SSP2-NPi -SSP2-LNDndc-rcp45;0;load;rcp45;magicc;RCP26_50;HADCRUT4;CMIP5;KWTCint;9;mean;0;0;globallyOptimal;0;exogenous;1;2100;3;9;0;Mix4;0.2;standard;standard;;10;NPi2018;pop_SSP2EU;gdp_SSP2EU;gdp_SSP2EU;SSP2;1;2;1;2;2;0;off;off;SSP2;2025;;SSP2-NPi;SSP2-Base;SSP2-NPi -SSP2-LNDlbs-rcp45;0;load;rcp45;magicc;RCP26_50;HADCRUT4;CMIP5;KWTCint;9;mean;0;0;globallyOptimal;0;exogenous;1;2100;3;9;0;Mix4;0.2;standard;standard;;10;NPi2018;pop_SSP2EU;gdp_SSP2EU;gdp_SSP2EU;SSP2;1;2;1;2;2;0;off;off;SSP2;2025;;SSP2-NPi;SSP2-Base;SSP2-NPi -SSP2-LNDreseff-rcp45;0;load;rcp45;magicc;RCP26_50;HADCRUT4;CMIP5;KWTCint;9;mean;0;0;globallyOptimal;0;exogenous;1;2100;3;9;0;Mix4;0.2;standard;standard;;10;NPi2018;pop_SSP2EU;gdp_SSP2EU;gdp_SSP2EU;SSP2;1;2;1;2;2;0;off;off;SSP2;2025;;SSP2-NPi;SSP2-Base;SSP2-NPi -SSP2-LNDfood-rcp45;0;load;rcp45;magicc;RCP26_50;HADCRUT4;CMIP5;KWTCint;9;mean;0;0;globallyOptimal;0;exogenous;1;2100;3;9;0;Mix4;0.2;standard;standard;;10;NPi2018;pop_SSP2EU;gdp_SSP2EU;gdp_SSP2EU;SSP2;1;2;1;2;2;0;off;off;SSP2;2025;;SSP2-NPi;SSP2-Base;SSP2-NPi -SSP2-basendc-Tene;0;load;rcp26;magicc;RCP26_50;HADCRUT4;CMIP5;KWTCint;9;mean;0;0;globallyOptimal;0;exogenous;1;2100;3;9;0;Mix4;0.15;feelhpb 0.87;manual;feel_steel_secondary 1.00, feel_steel_primary 1.00 , feelhth_chemicals 1.00, feelhth_otherInd 1.00, feh2_chemicals 0.87, feh2_steel 0.87, feh2_otherInd 0.87, feh2_cement 0.87;10;NDC;pop_SSP2EU;gdp_SSP2EU;gdp_SSP2EU;SSP2;1;2;1;3;1;1;on;off;SSP2;2025;;SSP2-NPi;SSP2-Base;SSP2-Tall-PkBudg750 -SSP2-basendc-Tland;0;load;rcp26;magicc;RCP26_50;HADCRUT4;CMIP5;KWTCint;9;mean;0;0;globallyOptimal;0;exogenous;1;2100;3;9;0;Mix4;0.2;standard;standard;;10;NDC;pop_SSP2EU;gdp_SSP2EU;gdp_SSP2EU;SSP2;1;2;1;2;2;0;off;off;SSP2;2025;;SSP2-NPi;SSP2-Base;SSP2-NDC -SSP2-Tall-noTpc-PkBudg750;0;load;rcp20;magicc;RCP26_50;HADCRUT4;CMIP5;KWTCint;9;mean;0;9;globallyOptimal;750;diffCurvPhaseIn2Lin;200;2045;3;9;0;Mix4;0.15;feelhpb 0.87;standard;;10;NDC;pop_SSP2EU;gdp_SSP2EU;gdp_SSP2_lowEn;SSP2;1;2;1;2;1;1;on;off;SSP2;2025;;SSP2-NPi;SSP2-Base; -SSP2-Tall-noDam-PkBudg750;0;load;rcp20;magicc;RCP26_50;HADCRUT4;CMIP5;off;9;mean;0;9;globallyOptimal;750;diffCurvPhaseIn2Lin;200;2045;3;9;0;Mix4;0.15;feelhpb 0.87;standard;;10;NDC;pop_SSP2EU;gdp_SSP2EU;gdp_SSP2_lowEn;SSP2;1;2;1;2;1;1;on;off;SSP2;2025;;SSP2-NPi;SSP2-Base; -SSP2-Tall-noDam-exoCP;0;load;rcp20;magicc;RCP26_50;HADCRUT4;CMIP5;off;9;mean;0;0;globallyOptimal;0;exogenous;1;2100;3;9;0;Mix4;0.15;feelhpb 0.87;standard;;10;NDC;pop_SSP2EU;gdp_SSP2EU;gdp_SSP2_lowEn;SSP2;1;2;1;2;1;1;on;off;SSP2;2025;;SSP2-NPi;SSP2-Base;SSP2-Tall-PkBudg750 -SSP2-NPi-noDam;0;load;rcp45;magicc;RCP26_50;HADCRUT4;CMIP5;off;9;mean;0;3;globallyOptimal;0;NPi;1;2100;3;9;0;Mix1;0.2;standard;standard;;10;NPi2018;pop_SSP2EU;gdp_SSP2EU;gdp_SSP2EU;SSP2;1;2;1;3;2;0;off;off;SSP2;2005;;;; -SSP2-notrans-PkBudg750;0;load;rcp26;magicc;RCP26_50;HADCRUT4;CMIP5;KWTCint;9;mean;0;9;globallyOptimal;750;diffCurvPhaseIn2Lin;200;2045;3;9;0;Mix1;0.2;standard;standard;;10;NDC;pop_SSP2EU;gdp_SSP2EU;gdp_SSP2EU;SSP2;1;2;1;3;2;0;off;off;SSP2;2025;;SSP2-NPi;SSP2-Base; -SSP2-notrans-PkBudg500;0;load;rcp26;magicc;RCP26_50;HADCRUT4;CMIP5;KWTCint;9;mean;0;9;globallyOptimal;500;diffCurvPhaseIn2Lin;200;2045;3;9;0;Mix1;0.2;standard;standard;;10;NDC;pop_SSP2EU;gdp_SSP2EU;gdp_SSP2EU;SSP2;1;2;1;3;2;0;off;off;SSP2;2025;;SSP2-NPi;SSP2-Base; -SSP2-CPonly;0;load;rcp26;magicc;RCP26_50;HADCRUT4;CMIP5;KWTCint;9;mean;0;0;globallyOptimal;0;exogenous;1;2100;3;9;0;Mix1;0.2;standard;standard;;10;NPi2018;pop_SSP2EU;gdp_SSP2EU;gdp_SSP2EU;SSP2;1;2;1;3;2;0;off;off;SSP2;2025;;SSP2-NPi;SSP2-Base;SSP2-Tall-PkBudg750 -SSP2-lowEnBase;0;load;none;magicc;RCP26_50;HADCRUT4;CMIP5;off;9;mean;0;0;off;0;none;-1;2100;3;1;0;Mix1;0.2;standard;standard;;10;none;pop_SSP2EU;gdp_SSP2EU;gdp_SSP2_lowEn;SSP2;1;2;1;2;2;0;off;off;SSP2;2005;;;; -SSP2-sens-Tall-PkBudg750;0;load;rcp20;magicc;RCP26_50;HADCRUT4;CMIP5;KWTCint;9;mean;0;9;globallyOptimal;750;diffCurvPhaseIn2Lin;200;2045;3;9;0;Mix4;0.15;feelhpb 0.87;standard;;10;NDC;pop_SSP2EU;gdp_SSP2EU;gdp_SSP2_lowEn;SSP2;1;2;1;2;1;1;on;off;SSP2;2025;;SSP2-NPi;SSP2-Base; -SSP2-sens-Tall-PkBudg700;0;load;rcp20;magicc;RCP26_50;HADCRUT4;CMIP5;KWTCint;9;mean;0;9;globallyOptimal;700;diffCurvPhaseIn2Lin;200;2045;3;9;0;Mix4;0.15;feelhpb 0.87;standard;;10;NDC;pop_SSP2EU;gdp_SSP2EU;gdp_SSP2_lowEn;SSP2;1;2;1;2;1;1;on;off;SSP2;2025;;SSP2-NPi;SSP2-Base; -SSP2-sens-Tall-PkBudg650;0;load;rcp20;magicc;RCP26_50;HADCRUT4;CMIP5;KWTCint;9;mean;0;9;globallyOptimal;650;diffCurvPhaseIn2Lin;200;2045;3;9;0;Mix4;0.15;feelhpb 0.87;standard;;10;NDC;pop_SSP2EU;gdp_SSP2EU;gdp_SSP2_lowEn;SSP2;1;2;1;2;1;1;on;off;SSP2;2025;;SSP2-NPi;SSP2-Base; -SSP2-sens-Tall-PkBudg600;0;load;rcp20;magicc;RCP26_50;HADCRUT4;CMIP5;KWTCint;9;mean;0;9;globallyOptimal;600;diffCurvPhaseIn2Lin;200;2045;3;9;0;Mix4;0.15;feelhpb 0.87;standard;;10;NDC;pop_SSP2EU;gdp_SSP2EU;gdp_SSP2_lowEn;SSP2;1;2;1;2;1;1;on;off;SSP2;2025;;SSP2-NPi;SSP2-Base; diff --git a/config/scenario_config_coupled_SHAPE.csv b/config/scenario_config_coupled_SHAPE.csv deleted file mode 100644 index 7dce22a13..000000000 --- a/config/scenario_config_coupled_SHAPE.csv +++ /dev/null @@ -1,36 +0,0 @@ -title;start;qos;oldrun;path_report;magpie_scen;no_ghgprices_land_until;path_gdx;path_gdx_ref;path_gdx_bau -SSP1-Base;1;short;;;SSP1|NPI|nocc_hist;y2150;;; -SSP1-NDC;0;short;;;SSP1|NDC|nocc_hist;y2150;;; -SSP1-NPi;1;short;;;SSP1|NPI|nocc_hist;y2150;;; -SSP1-PkBudg500;0;short;;;SSP1|NDC|nocc_hist;y2030;;; -SSP1-PkBudg650;1;short;;;SSP1|NDC|nocc_hist;y2030;;; -SSP2EU-Base;1;priority;;;SSP2|NPI|nocc_hist;y2150;;; -SSP2EU-NDC;1;priority;;;SSP2|NDC|nocc_hist;y2150;;; -SSP2EU-NPi;1;short;;;SSP2|NPI|nocc_hist;y2150;;; -SSP2EU-PkBudg500;1;short;;;SSP2|NDC|nocc_hist;y2030;;; -SSP2EU-PkBudg650;1;short;;;SSP2|NDC|nocc_hist;y2030;;; -SDP-Base;0;short;;;SDP|NPI|nocc_hist;y2150;;; -SDP-NDC;0;short;;;SDP|NDC|nocc_hist;y2150;;; -SDP-NPi;0;short;;;SDP|NPI|nocc_hist;y2150;;; -SDP-PkBudg500;0;short;;;SDP|NDC|nocc_hist;y2030;;; -SDP-PkBudg650;0;short;;;SDP|NDC|nocc_hist;y2030;;; -SDP_MC-Base;1;priority;;;SDP-MC|NPI|nocc_hist;y2150;;; -SDP_MC-NDC;1;short;;;SDP-MC|NDC|nocc_hist;y2150;;; -SDP_MC-NPi;1;short;;;SDP-MC|NPI|nocc_hist;y2150;;; -SDP_MC-PkBudg500;1;short;;;SDP-MC|NDC|nocc_hist;y2030;;; -SDP_MC-PkBudg650;1;short;;;SDP-MC|NDC|nocc_hist;y2030;;; -SDP_EI-Base;1;priority;;;SDP-EI|NPI|nocc_hist;y2150;;; -SDP_EI-NDC;1;short;;;SDP-EI|NDC|nocc_hist;y2150;;; -SDP_EI-NPi;1;short;;;SDP-EI|NPI|nocc_hist;y2150;;; -SDP_EI-PkBudg500;1;short;;;SDP-EI|NDC|nocc_hist;y2030;;; -SDP_EI-PkBudg650;1;short;;;SDP-EI|NDC|nocc_hist;y2030;;; -SDP_RC-Base;1;priority;;;SDP-RC|NPI|nocc_hist;y2150;;; -SDP_RC-NDC;1;short;;;SDP-RC|NDC|nocc_hist;y2150;;; -SDP_RC-NPi;1;short;;;SDP-RC|NPI|nocc_hist;y2150;;; -SDP_RC-PkBudg500;1;short;;;SDP-RC|NDC|nocc_hist;y2030;;; -SDP_RC-PkBudg650;1;short;;;SDP-RC|NDC|nocc_hist;y2030;;; -SDP_MC-PkBudg650-CCimp;1;short;;;SDP-MC|NDC|cc|rcp1p9;y2030;;; -SDP_EI-PkBudg650-CCimp;1;short;;;SDP-EI|NDC|cc|rcp1p9;y2030;;; -SDP_RC-PkBudg650-CCimp;1;short;;;SDP-RC|NDC|cc|rcp1p9;y2030;;; -SSP2EU-PkBudg650-CCimp;1;short;;;SSP2|NDC|cc|rcp1p9;y2030;;; -SSP2EU-NPi-CCimp;1;short;;;SSP2|NPI|cc|rcp4p5;y2150;;; diff --git a/config/scenario_config_tradeCap_standalone.csv b/config/scenario_config_tradeCap_standalone.csv deleted file mode 100644 index b391d2f77..000000000 --- a/config/scenario_config_tradeCap_standalone.csv +++ /dev/null @@ -1,2 +0,0 @@ -title;trade;start;model;output;cm_startyear;path_gdx;path_gdx_ref;path_gdx_bau -standalone_trade;capacity;1;standalone/trade/trade.gms;reporting_trade;2005;;; diff --git a/scripts/output/export/xlsx_IIASA.R b/scripts/output/export/xlsx_IIASA.R index 485ba5c87..c7a612b83 100644 --- a/scripts/output/export/xlsx_IIASA.R +++ b/scripts/output/export/xlsx_IIASA.R @@ -67,7 +67,7 @@ lucode2::readArgs("outputdirs", "filename_prefix", "outputFilename", "model", if (is.null(mapping)) { mapping <- gms::chooseFromList(names(piamInterfaces::templateNames()), type = "mapping template") } -if (length(mapping) == 0 || ! all(file.exists(mapping) | mapping %in% names(templateNames()))) +if (length(mapping) == 0 || ! all(file.exists(mapping) | mapping %in% names(templateNames()))) { stop("mapping='", paste(mapping, collapse = ", "), "' not found.") } if (exists("iiasatemplate") && ! is.null(iiasatemplate) && ! file.exists(iiasatemplate)) { diff --git a/scripts/output/single/reporting.R b/scripts/output/single/reporting.R index dc2b42b80..6bf35f01e 100644 --- a/scripts/output/single/reporting.R +++ b/scripts/output/single/reporting.R @@ -50,11 +50,8 @@ load(configfile, envir = envir) # produce REMIND reporting *.mif based on gdx information message("\n### start generation of mif files at ", Sys.time()) -tmp <- try(convGDX2MIF(gdx, gdx_refpolicycost = gdx_refpolicycost, file = remind_reporting_file, - scenario = scenario, gdx_ref = gdx_ref)) # try to execute convGDX2MIF -if (inherits(tmp, "try-error")) { - convGDX2MIF_REMIND2MAgPIE(gdx, file = remind_reporting_file, scenario = scenario) -} +convGDX2MIF(gdx, gdx_refpolicycost = gdx_refpolicycost, file = remind_reporting_file, + scenario = scenario, gdx_ref = gdx_ref) # MAGICC code not working with REMIND-EU # generate MAGICC reporting and append to REMIND reporting @@ -122,11 +119,9 @@ if (! is.null(magpie_reporting_file) && file.exists(magpie_reporting_file)) { message("### end generation of mif files at ", Sys.time()) ## produce REMIND LCOE reporting *.csv based on gdx information -if (! isTRUE(envir$cfg$gms$c_empty_model == "on") || ! grepl("^C_TESTTHAT", scenario)) { - message("### start generation of LCOE reporting at ", Sys.time()) - tmp <- try(convGDX2CSV_LCOE(gdx,file=LCOE_reporting_file,scen=scenario)) # execute convGDX2MIF_LCOE - message("### end generation of LCOE reporting at ", Sys.time()) -} +message("### start generation of LCOE reporting at ", Sys.time()) +tmp <- try(convGDX2CSV_LCOE(gdx,file=LCOE_reporting_file,scen=scenario)) # execute convGDX2MIF_LCOE +message("### end generation of LCOE reporting at ", Sys.time()) ## generate DIETER reporting if it is needed ## the reporting is appended to REMIND_generic_.MIF in "DIETER" Sub Directory diff --git a/scripts/output/single/reportingREMIND2MAgPIE.R b/scripts/output/single/reportingREMIND2MAgPIE.R index 9fc92e542..48171e701 100644 --- a/scripts/output/single/reportingREMIND2MAgPIE.R +++ b/scripts/output/single/reportingREMIND2MAgPIE.R @@ -21,36 +21,35 @@ if(!exists("source_include")) { gdx <- file.path(outputdir,gdx_name) scenario <- getScenNames(outputdir) + +configfile <- file.path(outputdir, "config.Rdata") +envir <- new.env() +load(configfile, envir = envir) + ############################################################################### # paths of the reporting files remind_reporting_file <- file.path(outputdir,paste0("REMIND_generic_",scenario,".mif")) # produce REMIND reporting *.mif based on gdx information +message("\n### start generation of mif files at ", Sys.time()) convGDX2MIF_REMIND2MAgPIE(gdx, file = remind_reporting_file, scenario = scenario) -# create common REMIND-MAgPIE reporting by sticking individual REMIND and MAgPIE reporting mifs together -configfile <- file.path(outputdir, "config.Rdata") -envir <- new.env() -load(configfile, envir = envir) magpie_reporting_file <- envir$cfg$pathToMagpieReport if (! is.null(magpie_reporting_file) && file.exists(magpie_reporting_file)) { message("add MAgPIE reporting from ", magpie_reporting_file) - tmp_rem <- read.report(remind_reporting_file, as.list=FALSE) - tmp_mag <- read.report(magpie_reporting_file, as.list=FALSE)[, getYears(tmp_rem), ] + tmp_rem <- quitte::as.quitte(remind_reporting_file) + tmp_mag <- dplyr::filter(quitte::as.quitte(magpie_reporting_file), .data$period %in% unique(tmp_rem$period)) # remove population from magpie reporting to avoid duplication (units "million" vs. "million people") - tmp_mag <- tmp_mag[, , "Population (million people)", invert = TRUE] - # harmonize scenario name from -mag-xx to -rem-xx - getNames(tmp_mag, dim = 1) <- paste0(scenario) - tmp_rem_mag <- mbind(tmp_rem, tmp_mag) - # extract variable names without units for both models - remind_variables <- magclass::unitsplit(getNames(tmp_rem_mag[, , "REMIND"], dim = 3))$variable - magpie_variables <- magclass::unitsplit(getNames(tmp_rem_mag[, , "MAgPIE"], dim = 3))$variable - if (any(remind_variables %in% magpie_variables)) { - message("Cannot produce common REMIND-MAgPIE reporting because there are identical variable names in both models!") - } else { - write.report(tmp_rem_mag, file = remind_reporting_file, ndigit = 7) - deletePlus(remind_reporting_file, writemif = TRUE) + sharedvariables <- intersect(tmp_mag$variable, tmp_rem$variable) + if (length(sharedvariables) > 0) { + message("The following variables will be dropped from MAgPIE reporting because they are in REMIND reporting: ", paste(sharedvariables, collapse = ", ")) + tmp_mag <- dplyr::filter(tmp_mag, ! .data$variable %in% sharedvariables) } + # harmonize scenario name from -mag-xx to -rem-xx + tmp_mag$scenario <- paste0(scenario) + tmp_rem_mag <- rbind(tmp_rem, tmp_mag) + quitte::write.mif(tmp_rem_mag, path = remind_reporting_file) + deletePlus(remind_reporting_file, writemif = TRUE) } message("### end generation of mif files at ", Sys.time()) diff --git a/start_bundle_coupled.R b/start_bundle_coupled.R index 0ae554cd4..c358dea34 100755 --- a/start_bundle_coupled.R +++ b/start_bundle_coupled.R @@ -124,16 +124,13 @@ NC <- "\033[0m" # No Color # define arguments that are accepted (test for backward compatibility) startgroup <- "1" -flags <- lucode2::readArgs("startgroup", .flags = c(h = "--help", g = "--gamscompile", i = "--interactive", p = "--parallel", t = "--test")) +flags <- lucode2::readArgs("startgroup", .flags = c(h = "--help", g = "--gamscompile", i = "--interactive", t = "--test")) if (! exists("argv")) argv <- commandArgs(trailingOnly = TRUE) if ("--help" %in% flags) { message(helpText) q() } if ("test" %in% argv) flags <- unique(c(flags, "--test")) -if ("--parallel" %in% flags) { - message("The flag --parallel is not necessary anymore, as this is default now") -} # load arguments from command line argv <- grep('(^-|=|^test$)', argv, value = TRUE, invert = TRUE) @@ -155,7 +152,8 @@ if (length(argv) > 0) { message("") } -if (! file.exists("output")) dir.create("output") +dir.create(file.path(path_remind, "output"), showWarnings = FALSE) +dir.create(file.path(path_magpie, "output"), showWarnings = FALSE) ensureRequirementsInstalled(rerunPrompt = "start_bundle_coupled.R") @@ -643,7 +641,7 @@ for (scen in common) { } slurmOptions <- combine_slurmConfig(paste0("--qos=", runEnv$qos, " --job-name=", fullrunname, " --output=", logfile, " --open-mode=append --mail-type=END --comment=REMIND-MAgPIE --tasks-per-node=", runEnv$numberOfTasks, - if (runEnv$numberOfTasks == 1) " --mem=8000"), runEnv$sbatch) + if (runEnv$numberOfTasks == 1) " --mem=16000"), runEnv$sbatch) slurmCommand <- paste0("sbatch ", slurmOptions, " --wrap=\"Rscript start_coupled.R coupled_config=", Rdatafile, "\"") message(slurmCommand) exitCode <- system(slurmCommand) diff --git a/start_coupled.R b/start_coupled.R index 8854d71c1..b4be48fc9 100644 --- a/start_coupled.R +++ b/start_coupled.R @@ -74,7 +74,7 @@ start_coupled <- function(path_remind, path_magpie, cfg_rem, cfg_mag, runname, m # Switch off generation of needless output for all but the last REMIND iteration if (i < max_iterations) { - cfg_rem$output <- intersect(c("reporting", "emulator", "rds_report", "reportingREMIND2MAgPIE"), cfg_rem_original) + cfg_rem$output <- intersect(cfg_rem_original, c("reporting", "reportingREMIND2MAgPIE", "emulator", "rds_report")) } else { cfg_rem$output <- cfg_rem_original } @@ -260,7 +260,7 @@ start_coupled <- function(path_remind, path_magpie, cfg_rem, cfg_mag, runname, m } slurmOptions <- combine_slurmConfig(paste0("--qos=", subseq.env$qos, " --job-name=", subseq.env$fullrunname, " --output=", logfile, " --open-mode=append --mail-type=END --comment=REMIND-MAgPIE --tasks-per-node=", subseq.env$numberOfTasks, - if (subseq.env$numberOfTasks == 1) " --mem=8000"), subseq.env$sbatch) + if (subseq.env$numberOfTasks == 1) " --mem=16000"), subseq.env$sbatch) subsequentcommand <- paste0("sbatch ", slurmOptions, " --wrap=\"Rscript start_coupled.R coupled_config=", RData_file, "\"") message(subsequentcommand) if (length(needfulldatagdx) > 0) { diff --git a/tests/testthat/test_04-gamscompile.R b/tests/testthat/test_04-gamscompile.R index f1b206fd8..f36ff5b1d 100644 --- a/tests/testthat/test_04-gamscompile.R +++ b/tests/testthat/test_04-gamscompile.R @@ -30,9 +30,6 @@ test_that("start.R --gamscompile works on all configs and scenarios", { file.path("../../config", "*", "scenario_config*.csv"))) } csvfiles <- normalizePath(grep("^scenario_config_coupled.*", csvfiles, invert = TRUE, value = TRUE)) - skipfiles <- c("scenario_config_tradeCap_standalone", - "scenario_config_GCS") - csvfiles <- grep(paste(skipfiles, collapse = "|"), csvfiles, invert = TRUE, value = TRUE) expect_true(length(csvfiles) > 0) testthat::with_mocked_bindings( for (csvfile in csvfiles) { diff --git a/tests/testthat/test_20-coupled.R b/tests/testthat/test_20-coupled.R index dacd93c72..21fb15216 100644 --- a/tests/testthat/test_20-coupled.R +++ b/tests/testthat/test_20-coupled.R @@ -40,7 +40,7 @@ test_that("environment is suitable for coupled tests", { test_that("using start_bundle_coupled.R --gamscompile works", { skipIfPreviousFailed() # try compiling - output <- localSystem2("Rscript", c("start_bundle_coupled.R", "--gamscompile", coupledConfig), + output <- localSystem2("Rscript", c("start_bundle_coupled.R", "--gamscompile", coupledConfig, "startgroup=1"), env = paste0("R_PROFILE_USER=", Rprofile)) printIfFailed(output) expectSuccessStatus(output) @@ -59,7 +59,7 @@ test_that("using start_bundle_coupled.R --gamscompile works", { test_that("using start_bundle_coupled.R --test works", { skipIfPreviousFailed() # just test the settings and RData files are written - output <- localSystem2("Rscript", c("start_bundle_coupled.R", "--test", coupledConfig), + output <- localSystem2("Rscript", c("start_bundle_coupled.R", "--test", coupledConfig, "startgroup=1"), env = paste0("R_PROFILE_USER=", Rprofile)) printIfFailed(output) expectSuccessStatus(output) @@ -99,7 +99,7 @@ test_that("using start_bundle_coupled.R --test works", { test_that("runs coupled to MAgPIE work", { skipIfPreviousFailed() # try running actual runs - output <- localSystem2("Rscript", c("start_bundle_coupled.R", coupledConfig), + output <- localSystem2("Rscript", c("start_bundle_coupled.R", coupledConfig, "startgroup=1"), env = paste0("R_PROFILE_USER=", Rprofile)) printIfFailed(output) expectSuccessStatus(output) @@ -138,12 +138,12 @@ test_that("runs coupled to MAgPIE work", { expect_true(any(grepl("^REMIND", levels(qscen$model)))) expect_false(any(grepl("^MAgPIE", levels(qscen$model)))) lengthwithoutmag <- nrow(qscen) - expect_true(lengthwithoutmag > 700000) + expect_true(lengthwithoutmag > 600000) qscen <- quitte::as.quitte(paste0("../../output/C_", scen, "-rem-", max_iterations, "/REMIND_generic_C_", scen, "-rem-", max_iterations, ".mif")) expect_true(any(grepl("^REMIND", levels(qscen$model)))) expect_true(any(grepl("^MAgPIE", levels(qscen$model)))) lengthwithmag <- nrow(qscen) - expect_true(lengthwithmag > 850000 && lengthwithmag > lengthwithoutmag) + expect_true(lengthwithmag > lengthwithoutmag && lengthwithmag > 700000) qscen <- quitte::as.quitte(paste0("../../output/C_", scen, "-rem-1/REMIND_generic_C_", scen, "-rem-1.mif")) # check main mif qscen <- quitte::as.quitte(paste0("../../output/C_", scen, ".mif")) @@ -156,7 +156,7 @@ test_that("runs coupled to MAgPIE work", { test_that("don't run again if completed", { skipIfPreviousFailed() # do not delete anything to simulate re-running already completed run - output <- localSystem2("Rscript", c("start_bundle_coupled.R", coupledConfig), + output <- localSystem2("Rscript", c("start_bundle_coupled.R", coupledConfig, "startgroup=1"), env = paste0("R_PROFILE_USER=", Rprofile)) printIfFailed(output) writeLines(output, "C_TESTTHAT_startlog_1.txt") @@ -175,7 +175,7 @@ test_that("delete last REMIND run to simulate re-starting aborted run", { paste0("../../output/C_", scen, ".mif") ) expect_true(0 == unlink(filestodelete, recursive = TRUE)) - output <- localSystem2("Rscript", c("start_bundle_coupled.R", coupledConfig), + output <- localSystem2("Rscript", c("start_bundle_coupled.R", coupledConfig, "startgroup=1"), env = paste0("R_PROFILE_USER=", Rprofile)) writeLines(output, "C_TESTTHAT_startlog_2.txt") printIfFailed(output) @@ -186,7 +186,7 @@ test_that("delete last REMIND run to simulate re-starting aborted run", { # delete the last MAgPIE, but not the last REMIND scenario and expect fail filestodelete <- file.path(magpie_folder, "output", paste0("C_", scen, "-mag-", (max_iterations - 1))) expect_true(0 == unlink(filestodelete, recursive = TRUE)) - output <- localSystem2("Rscript", c("start_bundle_coupled.R", coupledConfig), + output <- localSystem2("Rscript", c("start_bundle_coupled.R", coupledConfig, "startgroup=1"), env = paste0("R_PROFILE_USER=", Rprofile)) writeLines(output, "C_TESTTHAT_startlog_3.txt") expectFailStatus(output) @@ -200,7 +200,7 @@ test_that("delete last REMIND run to simulate re-starting aborted run", { paste0("../../output/C_", scen, ".mif") ) expect_true(0 == unlink(filestodelete, recursive = TRUE)) - output <- localSystem2("Rscript", c("start_bundle_coupled.R", coupledConfig), + output <- localSystem2("Rscript", c("start_bundle_coupled.R", coupledConfig, "startgroup=1"), env = paste0("R_PROFILE_USER=", Rprofile)) printIfFailed(output) writeLines(output, "C_TESTTHAT_startlog_4.txt") @@ -212,7 +212,7 @@ test_that("delete last REMIND run to simulate re-starting aborted run", { # delete all REMIND, but not MAgPIE, and expect fail filestodelete <- paste0("../../output/C_", scen, "-rem-", seq(max_iterations)) expect_true(0 == unlink(filestodelete, recursive = TRUE)) - output <- localSystem2("Rscript", c("start_bundle_coupled.R", coupledConfig), + output <- localSystem2("Rscript", c("start_bundle_coupled.R", coupledConfig, "startgroup=1"), env = paste0("R_PROFILE_USER=", Rprofile)) writeLines(output, "C_TESTTHAT_startlog_5.txt") expectFailStatus(output)