diff --git a/CHANGELOG.md b/CHANGELOG.md index 769e79a74..7e1169a81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - plastic waste by default does not lag plastics production by ten years anymore; can be re-activated using `cm_wastelag` - moved to edgeTransport 2.0 version [[#1749](https://github.com/remindmodel/remind/pull/1749)] +- **scripts** in readCheckScenarioConfig(), do not automatically remove path_gdx_bau if allegedly 'not needed' + [[#1809](https://github.com/remindmodel/remind/pull/1809)] ### added - **50_damages**, **51_internalizeDamages** add KotzWenz realization based on Kotz & Wenz (2024) diff --git a/config/scenario_config_DeepEl.csv b/config/scenario_config_DeepEl.csv index f72f817fe..22fa0f660 100644 --- a/config/scenario_config_DeepEl.csv +++ b/config/scenario_config_DeepEl.csv @@ -3,7 +3,7 @@ testOneRegi-Base-DeepEl;0;;testOneRegi;8;;;;0;;;;;;;;;;;;;;;;;;;;;;;;testOneRegi # H12 SSP2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; SSP2-NPi-calibrate-DeepEl;1;calibrate;;14;rcp45;;;0;;0;NPi;1;2100;;9;;;;NPi2018;regiCarbonPrice;on;on;3;;heat;Mix1;2005;;;;;SSP2-NPi-calibrate: This reference policy/baseline scenario follows the Shared Socioeconomic Pathways 2 called Middle of the Road. SSP2-Base-DeepEl;1;;;1;;;;0;;0;;;2100;;;off;;;;;;;;;heat;Mix1;2005;;;;;SSP2-Base: This baseline calibration scenario follows the Shared Socioeconomic Pathways 2 called Middle of the Road. -SSP2-NPi-DeepEl;1;;;1;rcp45;3;;0;;0;NPi;1;2100;;9;;;;NPi2018;regiCarbonPrice;on;on;3;;heat;Mix1;2005;;;;;SSP2-NPi: This National Policies Implemented (Npi) scenario follows the Shared Socioeconomic Pathways 2 called Middle of the Road. The NPi is identical to the NDC scenario until 2020 but assumes that policies fail to achieve NDC targets in 2030. Instead, carbon prices are assumed to grow and converge more slowly, leading to emissions trajectories in line with bottom-up studies on the effect of currently implemented policies. -SSP2-NDC-DeepEl;1;;;1;rcp45;3;globallyOptimal;0;;0;NDC;1;2100;;9;;;;NDC;regiCarbonPrice;on;on;3;;heat;Mix2;2025;;SSP2-NPi-DeepEl;SSP2-NPi-DeepEl;;SSP2-NDC: This Nationally Determined Contribution (NDC) scenario follows the Shared Socioeconomic Pathways 2 called Middle of the Road. The NDC includes all pledged policies even if not yet implemented. It assumes that the moderate and heterogeneous climate ambition reflected in the NDCs at the begining of 2021 continues over the 21st century. This scenario serves as reference for all other policy scenarios and The NPi scenario until 2020. -SSP2-PkBudg500-DeepEl;1;;;1;rcp20;9;globallyOptimal;1;2050.GLO 0.9;500;diffCurvPhaseIn2Lin;100;2080;;9;GLO.(biodiesel 0.14, bioeths 0.14), EUR_regi.(biodiesel 0.15, bioeths 0.15), USA_regi.pc 0.13, REF_regi.pc 0.13, CHA_regi.pc 0.13, IND_regi.pc 0.13;100;5;NDC;regiCarbonPrice;on;on;2;1;heat;Mix4;2025;;SSP2-NPi-DeepEl;SSP2-NPi-DeepEl;;SSP2-PkBudg500: This climate policy scenario follows the Shared Socioeconomic Pathways 2 called Middle of the Road. The stylized climate policy scenario assumes a peak budget of 500 Gt?CO2 on total CO2 emissions from 2015 to 2100. This is a 1.5??C scenario, peak warming is allowed to be at or slightly above 1.5??C, at median climate sensitivity but returns to values below 1.5??C in at least 67?% of scenarios by the end of the century. -SSP2-PkBudg1150-DeepEl;1;;;1;rcp26;9;globallyOptimal;1;2050.GLO 0.5;1150;diffCurvPhaseIn2Lin;60;2100;;9;GLO.(biodiesel 0.14, bioeths 0.14), EUR_regi.(biodiesel 0.15, bioeths 0.15), USA_regi.pc 0.13, REF_regi.pc 0.13, CHA_regi.pc 0.13, IND_regi.pc 0.13;100;5;NDC;regiCarbonPrice;on;on;2;1;heat;Mix4;2025;;SSP2-NPi-DeepEl;SSP2-NPi-DeepEl;;SSP2-PkBudg1150: This climate policy scenario follows the Shared Socioeconomic Pathways 2 called Middle of the Road. The stylized climate policy scenario assumes a peak budget of 1150 Gt?CO2 on total CO2 emissions from 2015 to 2100. This is a weel below 2??C scenario, peak warming is allowed to be at or slightly above 2??C, at median climate sensitivity but returns to values below 2??C in at least 67?% of scenarios by the end of the century. +SSP2-NPi-DeepEl;1;;;1;rcp45;3;;0;;0;NPi;1;2100;;9;;;;NPi2018;regiCarbonPrice;on;on;3;;heat;Mix1;2005;;;;;SSP2-NPi: This National Policies Implemented (NPi) scenario follows the Shared Socioeconomic Pathways 2 called Middle of the Road. The NPi is identical to the NDC scenario until 2020 but assumes that policies fail to achieve NDC targets in 2030. Instead, carbon prices are assumed to grow and converge more slowly, leading to emissions trajectories in line with bottom-up studies on the effect of currently implemented policies. +SSP2-NDC-DeepEl;1;;;1;rcp45;3;globallyOptimal;0;;0;NDC;1;2100;;9;;;;NDC;regiCarbonPrice;on;on;3;;heat;Mix2;2025;;SSP2-NPi-DeepEl;SSP2-NPi-DeepEl;;SSP2-NDC: This Nationally Determined Contribution (NDC) scenario follows the Shared Socioeconomic Pathways 2 called Middle of the Road. The NDC includes all pledged policies even if not yet implemented. It assumes that the moderate and heterogeneous climate ambition reflected in the NDCs at the begining of 2021 continues over the 21st century. +SSP2-PkBudg500-DeepEl;1;;;1;rcp20;9;globallyOptimal;1;2050.GLO 0.9;500;diffCurvPhaseIn2Lin;100;2080;;9;GLO.(biodiesel 0.14, bioeths 0.14), EUR_regi.(biodiesel 0.15, bioeths 0.15), USA_regi.pc 0.13, REF_regi.pc 0.13, CHA_regi.pc 0.13, IND_regi.pc 0.13;100;5;NDC;regiCarbonPrice;on;on;2;1;heat;Mix4;2025;;SSP2-NPi-DeepEl;;;SSP2-PkBudg500: This climate policy scenario follows the Shared Socioeconomic Pathways 2 called Middle of the Road. The stylized climate policy scenario assumes a peak budget of 500 Gt CO2 on total CO2 emissions from 2015 to 2100. This is a 1.5 C scenario, peak warming is allowed to be at or slightly above 1.5 C, at median climate sensitivity but returns to values below 1.5 C in at least 67 % of scenarios by the end of the century. +SSP2-PkBudg1150-DeepEl;1;;;1;rcp26;9;globallyOptimal;1;2050.GLO 0.5;1150;diffCurvPhaseIn2Lin;60;2100;;9;GLO.(biodiesel 0.14, bioeths 0.14), EUR_regi.(biodiesel 0.15, bioeths 0.15), USA_regi.pc 0.13, REF_regi.pc 0.13, CHA_regi.pc 0.13, IND_regi.pc 0.13;100;5;NDC;regiCarbonPrice;on;on;2;1;heat;Mix4;2025;;SSP2-NPi-DeepEl;;;SSP2-PkBudg1150: This climate policy scenario follows the Shared Socioeconomic Pathways 2 called Middle of the Road. The stylized climate policy scenario assumes a peak budget of 1150 Gt CO2 on total CO2 emissions from 2015 to 2100. This is a well below 2 C scenario, peak warming is allowed to be at or slightly above 2 C, at median climate sensitivity but returns to values below 2 C in at least 67 % of scenarios by the end of the century. diff --git a/config/scenario_config_IKEA.csv b/config/scenario_config_IKEA.csv index 10d99c8ec..284a2e11f 100644 --- a/config/scenario_config_IKEA.csv +++ b/config/scenario_config_IKEA.csv @@ -11,8 +11,8 @@ SSP2-NPi;0;;floor cost default;;;;;default;;1;5;;;rcp45;default;3;;0;0;;0;NPi;1; SSP2-NDC;0;;floor cost default;;;;;default;;1;5;;;rcp45;default;3;;0;0;globallyOptimal;0;NDC;1;2100;9;2;GLO 0.05, EUR_regi 0.15;CHA_regi.pc 0.001, IND_regi.pc 0.001, SSA_regi.pc 0.001, OAS_regi.pc 0.001, CHA_regi.coalchp 0.001, IND_regi.coalchp 0.001, SSA_regi.coalchp 0.001, OAS_regi.coalchp 0.001;;;;;;;NDC;regiCarbonPrice;2030.EUR_regi.tax.t.FE_wo_b_wo_n_e.all 1.2809;2020.2030.EUR_regi.all.year.netGHG_LULUCFGrassi 2.450;on;on;EUR_regi, NEU_regi;3;;heat;Mix2;2030;;SSP2-NPi;SSP2-NPi;;SSP2-NDC: This Nationally Determined Contribution (NDC) scenario follows the Shared Socioeconomic Pathways 2 called Middle of the Road. The NDC includes all pledged policies even if not yet implemented. It assumes that the moderate and heterogeneous climate ambition reflected in the NDCs at the begining of 2021 continues over the 21st century. This scenario serves as reference for all other policy scenarios and The NPi scenario until 2020. SSP2-PkBudg1150;0;;floor cost default;;;;;default;;1;5;;;rcp26;default;9;2100;1;1;globallyOptimal;1150;diffCurvPhaseIn2Lin;60;2100;9;2;GLO 0.06, EUR_regi 0.15;GLO.(biodiesel 0.14, bioeths 0.14), EUR_regi.(biodiesel 0.15, bioeths 0.15), USA_regi.pc 0.13, REF_regi.pc 0.13, CHA_regi.pc 0.04, (IND_regi, SSA_regi, OAS_regi).pc 0.001, (IND_regi, SSA_regi, OAS_regi).coalchp 0.001;;;75;2;feelhpb 1.05, fehob 1.75, feheb 0.35;feh2_otherInd 1.05, feelhth_otherInd 0.43, feh2_cement 2.2, feelhth_chemicals 1.4, feh2_chemicals 1.05, fehos_cement 2.2;NDC;regiCarbonPrice;2030.EUR_regi.tax.t.FE_wo_b_wo_n_e.all 1.2809, 2050.GLO.tax.t.CCS.biomass 2000;;on;on;EUR_regi, NEU_regi;;1;heat;Mix4;2030;;SSP2-NPi;SSP2-NPi;;SSP2-PkBudg1150: This climate policy scenario follows the Shared Socioeconomic Pathways 2 called Middle of the Road. The stylized climate policy scenario assumes a peak budget of 1150 Gt?CO2 on total CO2 emissions from 2015 to 2100. This is a weel below 2??C scenario, peak warming is allowed to be at or slightly above 2??C, at median climate sensitivity but returns to values below 2??C in at least 67?% of scenarios by the end of the century. SSP2-PkBudg650;0;;floor cost default;;;2;;default;;1;5;;;rcp20;default;9;2100;1;1;globallyOptimal;650;diffCurvPhaseIn2Lin;100;2080;9;2;GLO 0.09, EUR_regi 0.15;GLO.(biodiesel 0.14, bioeths 0.14), EUR_regi.(biodiesel 0.15, bioeths 0.15), USA_regi.pc 0.13, REF_regi.pc 0.13, CHA_regi.pc 0.04, (IND_regi, SSA_regi, OAS_regi).pc 0.001, (IND_regi, SSA_regi, OAS_regi).coalchp 0.001;;;75;2;feelhpb 1.05, fehob 1.75, feheb 0.35;feh2_otherInd 1.05, feelhth_otherInd 0.43, feh2_cement 2.2, feelhth_chemicals 1.4, feh2_chemicals 1.05, fehos_cement 2.2;NDC;regiCarbonPrice;2030.EUR_regi.tax.t.FE_wo_b_wo_n_e.all 1.2809, 2050.GLO.tax.t.CCS.biomass 2000;;on;on;EUR_regi, NEU_regi;;1;heat;Mix4;2030;;SSP2-NPi;SSP2-NPi;;SSP2-PkBudg650: This climate policy scenario follows the Shared Socioeconomic Pathways 2 called Middle of the Road. The stylized climate policy scenario assumes a peak budget of 500 Gt?CO2 on total CO2 emissions from 2015 to 2100. This is a 1.5??C scenario, peak warming is allowed to be at or slightly above 1.5??C, at median climate sensitivity but returns to values below 1.5??C in at least 67?% of scenarios by the end of the century. -SSP2-PkBudg620;0;;floor cost default;;;2;;default;;1;5;;;rcp20;default;9;2100;1;1;globallyOptimal;620;diffCurvPhaseIn2Lin;100;2080;9;2;GLO 0.09, EUR_regi 0.15;GLO.(biodiesel 0.14, bioeths 0.14), EUR_regi.(biodiesel 0.15, bioeths 0.15), USA_regi.pc 0.13, REF_regi.pc 0.13, CHA_regi.pc 0.04, (IND_regi, SSA_regi, OAS_regi).pc 0.001, (IND_regi, SSA_regi, OAS_regi).coalchp 0.001;;;75;2;feelhpb 1.05, fehob 1.75, feheb 0.35;feh2_otherInd 1.05, feelhth_otherInd 0.43, feh2_cement 2.2, feelhth_chemicals 1.4, feh2_chemicals 1.05, fehos_cement 2.2;NDC;regiCarbonPrice;2030.EUR_regi.tax.t.FE_wo_b_wo_n_e.all 1.2809, 2050.GLO.tax.t.CCS.biomass 2000;;on;on;EUR_regi, NEU_regi;;1;heat;Mix4;2030;;SSP2-NPi;SSP2NPi;;SSP2PkBudg620: This climate policy scenario follows the Shared Socioeconomic Pathways 2 called Middle of the Road. The stylized climate policy scenario assumes a peak budget of 500 Gt?CO2 on total CO2 emissions from 2015 to 2100. This is a 1.5??C scenario, peak warming is allowed to be at or slightly above 1.5??C, at median climate sensitivity but returns to values below 1.5??C in at least 67?% of scenarios by the end of the century. -SSP2PkBudg590;0;;floor cost default;;;2;;default;;1;5;;;rcp20;default;9;2100;1;1;globallyOptimal;590;diffCurvPhaseIn2Lin;100;2080;9;2;GLO 0.09, EUR_regi 0.15;GLO.(biodiesel 0.14, bioeths 0.14), EUR_regi.(biodiesel 0.15, bioeths 0.15), USA_regi.pc 0.13, REF_regi.pc 0.13, CHA_regi.pc 0.04, (IND_regi, SSA_regi, OAS_regi).pc 0.001, (IND_regi, SSA_regi, OAS_regi).coalchp 0.001;;;75;2;feelhpb 1.05, fehob 1.75, feheb 0.35;feh2_otherInd 1.05, feelhth_otherInd 0.43, feh2_cement 2.2, feelhth_chemicals 1.4, feh2_chemicals 1.05, fehos_cement 2.2;NDC;regiCarbonPrice;2030.EUR_regi.tax.t.FE_wo_b_wo_n_e.all 1.2809, 2050.GLO.tax.t.CCS.biomass 2000;;on;on;EUR_regi, NEU_regi;;1;heat;Mix4;2030;;SSP2-NPi;SSP2-NPi;;SSP2-PkBudg590: This climate policy scenario follows the Shared Socioeconomic Pathways 2 called Middle of the Road. The stylized climate policy scenario assumes a peak budget of 500 Gt?CO2 on total CO2 emissions from 2015 to 2100. This is a 1.5??C scenario, peak warming is allowed to be at or slightly above 1.5??C, at median climate sensitivity but returns to values below 1.5??C in at least 67?% of scenarios by the end of the century. +SSP2-PkBudg620;0;;floor cost default;;;2;;default;;1;5;;;rcp20;default;9;2100;1;1;globallyOptimal;620;diffCurvPhaseIn2Lin;100;2080;9;2;GLO 0.09, EUR_regi 0.15;GLO.(biodiesel 0.14, bioeths 0.14), EUR_regi.(biodiesel 0.15, bioeths 0.15), USA_regi.pc 0.13, REF_regi.pc 0.13, CHA_regi.pc 0.04, (IND_regi, SSA_regi, OAS_regi).pc 0.001, (IND_regi, SSA_regi, OAS_regi).coalchp 0.001;;;75;2;feelhpb 1.05, fehob 1.75, feheb 0.35;feh2_otherInd 1.05, feelhth_otherInd 0.43, feh2_cement 2.2, feelhth_chemicals 1.4, feh2_chemicals 1.05, fehos_cement 2.2;NDC;regiCarbonPrice;2030.EUR_regi.tax.t.FE_wo_b_wo_n_e.all 1.2809, 2050.GLO.tax.t.CCS.biomass 2000;;on;on;EUR_regi, NEU_regi;;1;heat;Mix4;2030;;SSP2-NPi;SSP2-NPi;;SSP2-PkBudg620: This climate policy scenario follows the Shared Socioeconomic Pathways 2 called Middle of the Road. The stylized climate policy scenario assumes a peak budget of 500 Gt?CO2 on total CO2 emissions from 2015 to 2100. This is a 1.5??C scenario, peak warming is allowed to be at or slightly above 1.5??C, at median climate sensitivity but returns to values below 1.5??C in at least 67?% of scenarios by the end of the century. +SSP2-PkBudg590;0;;floor cost default;;;2;;default;;1;5;;;rcp20;default;9;2100;1;1;globallyOptimal;590;diffCurvPhaseIn2Lin;100;2080;9;2;GLO 0.09, EUR_regi 0.15;GLO.(biodiesel 0.14, bioeths 0.14), EUR_regi.(biodiesel 0.15, bioeths 0.15), USA_regi.pc 0.13, REF_regi.pc 0.13, CHA_regi.pc 0.04, (IND_regi, SSA_regi, OAS_regi).pc 0.001, (IND_regi, SSA_regi, OAS_regi).coalchp 0.001;;;75;2;feelhpb 1.05, fehob 1.75, feheb 0.35;feh2_otherInd 1.05, feelhth_otherInd 0.43, feh2_cement 2.2, feelhth_chemicals 1.4, feh2_chemicals 1.05, fehos_cement 2.2;NDC;regiCarbonPrice;2030.EUR_regi.tax.t.FE_wo_b_wo_n_e.all 1.2809, 2050.GLO.tax.t.CCS.biomass 2000;;on;on;EUR_regi, NEU_regi;;1;heat;Mix4;2030;;SSP2-NPi;SSP2-NPi;;SSP2-PkBudg590: This climate policy scenario follows the Shared Socioeconomic Pathways 2 called Middle of the Road. The stylized climate policy scenario assumes a peak budget of 500 Gt?CO2 on total CO2 emissions from 2015 to 2100. This is a 1.5??C scenario, peak warming is allowed to be at or slightly above 1.5??C, at median climate sensitivity but returns to values below 1.5??C in at least 67?% of scenarios by the end of the century. SSP2-PkBudg560;0;;floor cost default;;;2;;default;;1;5;;;rcp20;default;9;2100;1;1;globallyOptimal;560;diffCurvPhaseIn2Lin;100;2080;9;2;GLO 0.09, EUR_regi 0.15;GLO.(biodiesel 0.14, bioeths 0.14), EUR_regi.(biodiesel 0.15, bioeths 0.15), USA_regi.pc 0.13, REF_regi.pc 0.13, CHA_regi.pc 0.04, (IND_regi, SSA_regi, OAS_regi).pc 0.001, (IND_regi, SSA_regi, OAS_regi).coalchp 0.001;;;75;2;feelhpb 1.05, fehob 1.75, feheb 0.35;feh2_otherInd 1.05, feelhth_otherInd 0.43, feh2_cement 2.2, feelhth_chemicals 1.4, feh2_chemicals 1.05, fehos_cement 2.2;NDC;regiCarbonPrice;2030.EUR_regi.tax.t.FE_wo_b_wo_n_e.all 1.2809, 2050.GLO.tax.t.CCS.biomass 2000;;on;on;EUR_regi, NEU_regi;;1;heat;Mix4;2030;;SSP2-NPi;SSP2-NPi;;SSP2-PkBudg550: This climate policy scenario follows the Shared Socioeconomic Pathways 2 called Middle of the Road. The stylized climate policy scenario assumes a peak budget of 500 Gt?CO2 on total CO2 emissions from 2015 to 2100. This is a 1.5??C scenario, peak warming is allowed to be at or slightly above 1.5??C, at median climate sensitivity but returns to values below 1.5??C in at least 67?% of scenarios by the end of the century. SSP2-PkBudg530;0;;floor cost default;;;2;;default;;1;5;;;rcp20;default;9;2100;1;1;globallyOptimal;530;diffCurvPhaseIn2Lin;100;2080;9;2;GLO 0.09, EUR_regi 0.15;GLO.(biodiesel 0.14, bioeths 0.14), EUR_regi.(biodiesel 0.15, bioeths 0.15), USA_regi.pc 0.13, REF_regi.pc 0.13, CHA_regi.pc 0.04, (IND_regi, SSA_regi, OAS_regi).pc 0.001, (IND_regi, SSA_regi, OAS_regi).coalchp 0.001;;;75;2;feelhpb 1.05, fehob 1.75, feheb 0.35;feh2_otherInd 1.05, feelhth_otherInd 0.43, feh2_cement 2.2, feelhth_chemicals 1.4, feh2_chemicals 1.05, fehos_cement 2.2;NDC;regiCarbonPrice;2030.EUR_regi.tax.t.FE_wo_b_wo_n_e.all 1.2809, 2050.GLO.tax.t.CCS.biomass 2000;;on;on;EUR_regi, NEU_regi;;1;heat;Mix4;2030;;SSP2-NPi;SSP2-NPi;;SSP2-PkBudg500: This climate policy scenario follows the Shared Socioeconomic Pathways 2 called Middle of the Road. The stylized climate policy scenario assumes a peak budget of 500 Gt?CO2 on total CO2 emissions from 2015 to 2100. This is a 1.5??C scenario, peak warming is allowed to be at or slightly above 1.5??C, at median climate sensitivity but returns to values below 1.5??C in at least 67?% of scenarios by the end of the century. SSP2-NPi_floor2;0;;floor cost preserves price structure;;;;;pricestruc;;1;5;;;rcp45;pricestruc;3;;0;0;;0;NPi;1;2100;9;2;GLO 0.04, EUR_regi 0.15;CHA_regi.pc 0.001, IND_regi.pc 0.001, SSA_regi.pc 0.001, OAS_regi.pc 0.001, CHA_regi.coalchp 0.001, IND_regi.coalchp 0.001, SSA_regi.coalchp 0.001, OAS_regi.coalchp 0.001;;;;;;;NPi2018;regiCarbonPrice;;;on;on;EUR_regi, NEU_regi;3;;heat;Mix1;2030;;;;;SSP2-NPi: This National Policies Implemented (Npi) scenario follows the Shared Socioeconomic Pathways 2 called Middle of the Road. The NPi is identical to the NDC scenario until 2020 but assumes that policies fail to achieve NDC targets in 2030. Instead, carbon prices are assumed to grow and converge more slowly, leading to emissions trajectories in line with bottom-up studies on the effect of currently implemented policies. diff --git a/config/tests/scenario_config_shortCascade.csv b/config/tests/scenario_config_shortCascade.csv index cc8b6b5e1..31901ef3b 100644 --- a/config/tests/scenario_config_shortCascade.csv +++ b/config/tests/scenario_config_shortCascade.csv @@ -1,4 +1,4 @@ -title;start;c_empty_model;path_gdx_ref;path_gdx_bau;output -TESTTHAT-SSP2-Base;1;on;;;reportingREMIND2MAgPIE -TESTTHAT-SSP2-NDC;1;on;TESTTHAT-SSP2-Base;TESTTHAT-SSP2-Base;reportingREMIND2MAgPIE -TESTTHAT-SSP2-Policy;2;on;TESTTHAT-SSP2-Base;TESTTHAT-SSP2-Base;reportingREMIND2MAgPIE +title;start;c_empty_model;path_gdx_ref;output +TESTTHAT-SSP2-Base;1;on;;reportingREMIND2MAgPIE +TESTTHAT-SSP2-NDC;1;on;TESTTHAT-SSP2-Base;reportingREMIND2MAgPIE +TESTTHAT-SSP2-Policy;2;on;TESTTHAT-SSP2-Base;reportingREMIND2MAgPIE diff --git a/scripts/start/checkFixCfg.R b/scripts/start/checkFixCfg.R index bbe0b4206..f81f7aa37 100644 --- a/scripts/start/checkFixCfg.R +++ b/scripts/start/checkFixCfg.R @@ -107,9 +107,8 @@ checkFixCfg <- function(cfg, remindPath = ".", testmode = FALSE) { } } else { if (! is.na(cfg$files2export$start["input_bau.gdx"])) { - message("You have specified no realization that requires 'path_gdx_bau' but you have specified it. ", - "To avoid an unnecessary dependency to another run, setting 'path_gdx_bau' to NA.") - cfg$files2export$start["input_bau.gdx"] <- NA + message("According to 'scripts/start/needBau.R', you use no realization that requires 'path_gdx_bau' but you have specified it. ", + "To avoid an unnecessary dependency to another run, you can set 'path_gdx_bau' to NA.") } } diff --git a/scripts/start/needBau.R b/scripts/start/needBau.R index 7c3003b9a..25af30586 100644 --- a/scripts/start/needBau.R +++ b/scripts/start/needBau.R @@ -8,6 +8,6 @@ # and the realizations that require a 'path_gdx_bau' as elements # This allows readCheckScenarioConfig and checkFixConfig to set it to NA # if not needed, and complain if it is missing. -needBau <- list(carbonprice = c("NDC"), +needBau <- list(carbonprice = "NDC", carbonpriceRegi = "NDC", emicapregi = "AbilityToPay") diff --git a/scripts/start/readCheckScenarioConfig.R b/scripts/start/readCheckScenarioConfig.R index aa8f9f6df..f738180a0 100644 --- a/scripts/start/readCheckScenarioConfig.R +++ b/scripts/start/readCheckScenarioConfig.R @@ -97,33 +97,25 @@ readCheckScenarioConfig <- function(filename, remindPath = ".", testmode = FALSE ", no column path_gdx_refpolicycost for policy cost comparison found, using path_gdx_ref instead.") message(msg) } - if ("path_gdx_bau" %in% names(scenConf)) { - # fix if bau given despite not needed. needBau is defined in needBau.R - # initialize vector with FALSE everywhere and turn elements to TRUE if a scenario config row setting matches a needBau element - scenNeedsBau <- rep(FALSE, nrow(scenConf)) - for (n in intersect(names(needBau), names(scenConf))) { - scenNeedsBau <- scenNeedsBau | scenConf[[n]] %in% needBau[[n]] - } - BAUbutNotNeeded <- ! is.na(scenConf$path_gdx_bau) & ! (scenNeedsBau) - if (sum(BAUbutNotNeeded) > 0 && ! grepl("scenario_config_coupled", filename)) { - msg <- paste0("In ", sum(BAUbutNotNeeded), " scenarios, 'path_gdx_bau' is not empty although no realization is selected that needs it.\n", - "To avoid unnecessary dependencies to other runs, automatically setting 'path_gdx_bau' to NA for:\n", - paste(rownames(scenConf)[BAUbutNotNeeded], collapse = ", ")) - message(msg) - scenConf$path_gdx_bau[BAUbutNotNeeded] <- NA - } - # fail if bau not given but needed - noBAUbutNeeded <- is.na(scenConf$path_gdx_bau) & (scenNeedsBau) - if (sum(noBAUbutNeeded) > 0) { - pathgdxerrors <- pathgdxerrors + sum(noBAUbutNeeded) - warning("In ", sum(noBAUbutNeeded), " scenarios, a reference gdx in 'path_gdx_bau' is needed, but it is empty. ", - "These realizations need it: ", - paste0(names(needBau), ": ", sapply(needBau, paste, collapse = ", "), ".", collapse = " ")) - } - } + # make sure every path gdx column exists scenConf[, names(path_gdx_list)[! names(path_gdx_list) %in% names(scenConf)]] <- NA + # check if path_gdx_bau is needed, based on needBau.R + # initialize vector with FALSE everywhere and turn elements to TRUE if a scenario config row setting matches a needBau element + scenNeedsBau <- rep(FALSE, nrow(scenConf)) + for (n in intersect(names(needBau), names(scenConf))) { + scenNeedsBau <- scenNeedsBau | scenConf[[n]] %in% needBau[[n]] + } + # fail if bau not given but needed + noBAUbutNeeded <- is.na(scenConf$path_gdx_bau) & (scenNeedsBau) + if (sum(noBAUbutNeeded) > 0) { + pathgdxerrors <- pathgdxerrors + sum(noBAUbutNeeded) + warning("In ", sum(noBAUbutNeeded), " scenarios, a reference gdx in 'path_gdx_bau' is needed, but it is empty. ", + "These realizations need it: ", + paste0(names(needBau), ": ", sapply(needBau, paste, collapse = ", "), ".", collapse = " ")) + } + # collect errors errorsfound <- length(colduplicates) + sum(toolong) + sum(regionname) + sum(nameisNA) + sum(illegalchars) + whitespaceErrors + copyConfigFromErrors + pathgdxerrors + missingRealizations @@ -168,11 +160,8 @@ readCheckScenarioConfig <- function(filename, remindPath = ".", testmode = FALSE "cm_solwindenergyscen"= "Deleted, not used, see https://github.com/remindmodel/remind/pull/1532", NULL) for (i in intersect(names(forbiddenColumnNames), unknownColumnNames)) { - if (testmode) { - warning("Column name ", i, " in remind settings is outdated. ", forbiddenColumnNames[i]) - } else { - message("Column name ", i, " in remind settings is outdated. ", forbiddenColumnNames[i]) - } + msg <- paste0("Column name ", i, " in remind settings is outdated. ", forbiddenColumnNames[i]) + if (testmode) warning(msg) else message(msg) } if (any(names(forbiddenColumnNames) %in% unknownColumnNames)) { warning("Outdated column names found that must not be used.") diff --git a/tests/testthat/test_01-readCheckScenarioConfig.R b/tests/testthat/test_01-readCheckScenarioConfig.R index 5234ad302..e347f0e43 100644 --- a/tests/testthat/test_01-readCheckScenarioConfig.R +++ b/tests/testthat/test_01-readCheckScenarioConfig.R @@ -38,7 +38,6 @@ test_that("readCheckScenarioConfig fails on error-loaden config", { expect_match(w, "Do not use 'NA' as scenario name", all = FALSE, fixed = TRUE) expect_match(w, "For module carbonprice.*notNDC_but_has_path_gdx_bau", all = FALSE, fixed = FALSE) expect_match(m, "no column path_gdx_refpolicycost for policy cost comparison found, using path_gdx_ref instead", all = FALSE, fixed = TRUE) - expect_match(m, "is not empty although no realization is selected that needs it", all = FALSE, fixed = TRUE) copiedFromPBS <- c("c_budgetCO2", "path_gdx", "path_gdx_ref") expect_identical(unlist(scenConf["PBS", copiedFromPBS]), unlist(scenConf["PBScopy", copiedFromPBS])) diff --git a/tutorials/03_RunningBundleOfRuns.md b/tutorials/03_RunningBundleOfRuns.md index 8d38a610a..1f5292edc 100644 --- a/tutorials/03_RunningBundleOfRuns.md +++ b/tutorials/03_RunningBundleOfRuns.md @@ -47,7 +47,7 @@ Example with comments and different ways to specify subsequent runs. The columns to implement subsequent runs are usually found at the end, starting with `path_gdx`: * `path_gdx` allows to specify initial conditions for the run, overwriting the usual initial conditions taken from the calibration files found in [`./config/gdx-files/`](../config/gdx-files/files). If it points to an unconverged run, this can be used to restart runs, similar to `Rscript start.R --restart`. -* `path_gdx_bau` points to the run used as business as usual (BAU) scenario, for example for runs using [`45_carbonprice/NDC`](../modules/45_carbonprice/NDC), where some countries specify emission as percentage reduction compared to BAU. All realizations needing it have to be summarized in [`scripts/start/needBau.R`](../scripts/start/needBau.R). +* `path_gdx_bau` points to the run used as business as usual (BAU) scenario, for example for runs using [`45_carbonprice/NDC`](../modules/45_carbonprice/NDC), where some countries specify emission as percentage reduction compared to BAU. All realizations needing it should be summarized in [`scripts/start/needBau.R`](../scripts/start/needBau.R). * `path_gdx_carbonprice` can be used to use a carbon tax path from an earlier run with realization [`45_carbonprice/exogenous`](../modules/45_carbonprice/exogenous). * `path_gdx_ref` points to the run used for all `t < cm_startyear`, which can be used for example for delayed transition scenarios. * `path_gdx_refpolicycost` points to the run that is used as a comparison for the policy cost calculation. If no such column exists, `path_gdx_ref` is used instead.