From a7306887be6fbd58c3033670207366768d7917bf Mon Sep 17 00:00:00 2001 From: Felix Schreyer Date: Wed, 30 Aug 2023 09:41:58 +0200 Subject: [PATCH 1/4] fix bug that 05_initialCap module overwrites pm_inco0_t capital cost in policy runs by loading the parameter from input_ref.gdx, only load and overwrite for the specific case in which 05_initialCap actually changes investment cost --- modules/05_initialCap/on/declarations.gms | 5 ++++- modules/05_initialCap/on/preloop.gms | 13 +++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/modules/05_initialCap/on/declarations.gms b/modules/05_initialCap/on/declarations.gms index 688b2d501..5c0453553 100644 --- a/modules/05_initialCap/on/declarations.gms +++ b/modules/05_initialCap/on/declarations.gms @@ -24,7 +24,10 @@ Parameter p05_aux_cap_distr(all_regi,all_te,rlf) "auxiliary calculation parameter for the calculation of initial capacities, distributed to grades" p05_aux_cap(all_regi,all_te) "auxiliary calculation parameter for the calculation of initial capacities" pm_aux_capLowerLimit(all_te,all_regi,tall) "auxiliary calculation parameter for the calculation of the lowest possible capacities in the first time steps" - p05_aux_calccapLowerLimitSwitch(tall) "auxiliary calculation parameter to allow the calculation of the lowest possible capacities in the first time steps" + p05_aux_calccapLowerLimitSwitch(tall) "auxiliary calculation parameter to allow the calculation of the lowest possible capacities in the first time steps" +$ifThen %cm_techcosts% == "GLO" + p05_inco0_t_ref(ttot,all_regi,all_te) "auxiliary parameter to load pm_inco0_t from reference run if cm_startyear > 2005 and initialCap is therefore not run" +$endIf ; Variables diff --git a/modules/05_initialCap/on/preloop.gms b/modules/05_initialCap/on/preloop.gms index 2f03780c5..b39ed0c46 100644 --- a/modules/05_initialCap/on/preloop.gms +++ b/modules/05_initialCap/on/preloop.gms @@ -512,14 +512,23 @@ if (cm_startyear gt 2005, Execute_Loadpoint 'input_ref' pm_emifac = pm_emifac; Execute_Loadpoint 'input_ref' pm_EN_demand_from_initialcap2 = pm_EN_demand_from_initialcap2; Execute_Loadpoint 'input_ref' pm_pedem_res = pm_pedem_res; - Execute_Loadpoint 'input_ref' pm_inco0_t = pm_inco0_t; Execute_Loadpoint 'input_ref' pm_dataeta = pm_dataeta; Execute_Loadpoint 'input_ref' pm_data = pm_data; Execute_Loadpoint 'input_ref' pm_aux_capLowerLimit = pm_aux_capLowerLimit; Execute_Loadpoint 'input_ref' vm_deltaCap.l = vm_deltaCap.l; Execute_Loadpoint 'input_ref' vm_deltaCap.lo = vm_deltaCap.lo; Execute_Loadpoint 'input_ref' vm_deltaCap.up = vm_deltaCap.up; -); +*** if %cm_techcosts% == "GLO", load pm_inco0_t from input_ref.gdx and overwrite values +*** only for pc, ngt, ngcc since they have been adapted in initialCap routine above +*** This is to avoid overwriting changes to pm_inco0_t by scenario switches +$ifThen %cm_techcosts% == "GLO" + Execute_Loadpoint 'input_ref' p05_inco0_t_ref = pm_inco0_t; + pm_inco0_t(t,regi,te)$( teEtaIncr(te) + AND (sameas(te,"pc") + OR sameas(te,"ngt") + OR sameas(te,"ngcc") ) ) = p05_inco0_t_ref(t,regi,te); +$endIf +); *** EOF ./modules/05_initialCap/on/preloop.gms From 9619dea8757819b114d07b5f1a635485e6e8e708 Mon Sep 17 00:00:00 2001 From: Felix Schreyer Date: Wed, 30 Aug 2023 09:43:40 +0200 Subject: [PATCH 2/4] add note to cm_inco0Factor switches to changes investment cost that it does not work for specific technologies and settings as this gets overwritten in 05_initialCap module --- main.gms | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main.gms b/main.gms index 95a60d1a1..4677cde65 100755 --- a/main.gms +++ b/main.gms @@ -1479,10 +1479,12 @@ $setglobal cm_adj_coeff_multiplier off *** cm_inco0Factor "change investment costs. [factor]." *** def <- "off" = use default inco0 values. *** or list of techs with respective factor to change inco0 value by a multiplication factor. (ex. "ccsinje=0.5,bioigccc=0.66,bioh2c=0.66,biogas=0.66,bioftrec=0.66,bioftcrec=0.66,igccc=0.66,coalh2c=0.66,coalgas=0.66,coalftrec=0.66,coalftcrec=0.66,ngccc=0.66,gash2c=0.66,gasftrec=0.66,gasftcrec=0.66,tnrs=0.66") +*** (note: if %cm_techcosts% == "GLO", switch will not work for policy runs, i.e. cm_startyear > 2005, for pc, ngt and ngcc as this gets overwritten in 05_initialCap module) $setglobal cm_inco0Factor off !! def = off *** cm_inco0RegiFactor "change investment costs regionalized technology values. [factor]." *** def <- "off" = use default p_inco0 values. *** or list of techs with respective factor to change p_inco0 value by a multiplication factor. (ex. "wind=0.33, spv=0.33" makes investment costs for wind and spv 3 times cheaper) +*** (note: if %cm_techcosts% == "GLO", switch will not work for policy runs, i.e. cm_startyear > 2005, for pc, ngt and ngcc as this gets overwritten in 05_initialCap module) $setglobal cm_inco0RegiFactor off !! def = off *** cm_CCS_markup "multiplicative factor for CSS cost markup" *** def <- "off" = use default CCS pm_inco0_t values. From 43c9a9c7fef62668d5679bfb25bbb48b476da562 Mon Sep 17 00:00:00 2001 From: Felix Schreyer Date: Wed, 30 Aug 2023 09:44:07 +0200 Subject: [PATCH 3/4] complete description of cm_techcosts switch in main.gms --- main.gms | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main.gms b/main.gms index 4677cde65..56c8ab757 100755 --- a/main.gms +++ b/main.gms @@ -1322,6 +1322,8 @@ $setglobal cm_CES_calibration_default_prices 0.01 !! def = 0.01 *** cm_calibration_string "def = off, else = additional string to include in the calibration name to be used" label for your calibration run to keep calibration files with different setups apart (e.g. with low elasticities, high elasticities) $setglobal cm_calibration_string off !! def = off *** cm_techcosts - use regionalized or globally homogenous technology costs for certain technologies +*** (REG) regionalized technology costs +*** (GLO) globally homogenous technology costs $setglobal cm_techcosts REG !! def = REG *** cm_regNetNegCO2 - default "on" allows for regionally netNegative CO2 emissions, setting "off" activates bound in core/bounds.gms that disallows net negative CO2 emissions at the regional level $setglobal cm_regNetNegCO2 on !! def = on From c046470f81d5f40bef9bcb10b64c11d24f84b11d Mon Sep 17 00:00:00 2001 From: Felix Schreyer Date: Mon, 4 Sep 2023 10:08:52 +0200 Subject: [PATCH 4/4] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 742d82a79..bb93209f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts** MAgPIE coupling interface: replace old MAgPIE cost variable - **scripts** MAgPIE coupling interface: remove filtering of negative LU emissions - **core** MAgPIE coupling: tolerate negative values for `n2ofertsom` and deactivate its MAC +- **05_initialCap** fix overwriting of investment cost changes from cm_inco0Factor switch ### added - **45_carbonprice** added realization `NPi` (National Policies Implemented)