From 81727a78f0eb3ad6a8abe0b503912a94c234f345 Mon Sep 17 00:00:00 2001 From: David Klein Date: Mon, 13 Jul 2026 10:52:59 +0200 Subject: [PATCH] Follow-up to 9c0c81406f464d7b5cb4f21c336670d1881f3dc5 that corrected the fixing of p_co2lucSub for standalone runs. This commit adds the same correction also for coupled runs. This is necessary because in coupled runs the values are updated and the correction needs to be applied to this update mechanism as well. --- core/datainput.gms | 7 ++++--- core/presolve.gms | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/core/datainput.gms b/core/datainput.gms index b45fd3598..c3a15aea3 100644 --- a/core/datainput.gms +++ b/core/datainput.gms @@ -1527,13 +1527,14 @@ pm_macBaseMagpie(ttot,regi,emiMacMagpie(enty))$(ttot.val ge 2005) = f_macBaseMag *** pm_macBaseMagpie gets updated in core/presolve.gms when coupling to MAgPIE is active *** In case of fixing, load p_co2lucSub from input_ref.gdx, since parameters are not automatically treated by the fixing mechanism. -*** Years >= cm_startyear get their values from the lookup table +*** Years >= cm_startyear get their values from the lookup table rather than the input_ref.gdx (see below). if( (cm_startyear gt 2005), Execute_Loadpoint "input_ref" p_co2lucSub = p_co2lucSub; ); -*** p_co2lucSub gets updated in core/presolve.gms when coupling to MAgPIE is active -*** Overwrite values >= cm_startyear with lookup table, leave values < cm_startyear untouched (from input_ref.gdx, see above) + +*** Overwrite values >= cm_startyear with lookup table, leave values < cm_startyear untouched (from input_ref.gdx, see above). +*** Gets updated for >= cm_startyear in core/presolve.gms when coupling to MAgPIE is active. p_co2lucSub(ttot,regi,emiMacMagpieCO2Sub(all_enty))$(ttot.val ge cm_startyear) = f_macBaseMagpie(ttot,regi,emiMacMagpieCO2Sub,"%cm_LU_emi_scen%","%cm_rcp_scen%"); *** p_macPolCO2luc defines the lower limit for abatement of CO2 landuse change emissions in REMIND diff --git a/core/presolve.gms b/core/presolve.gms index df00a7cc7..b63eb97f8 100644 --- a/core/presolve.gms +++ b/core/presolve.gms @@ -127,7 +127,7 @@ if (sm_magpieIter gt 0, *** MAgPIE has run once at least: the start values for pm_macBaseMagpie come from the last MAgPIE iteration Execute_Loadpoint 'magpieData.gdx' f_macBaseMagpie_coupling; pm_macBaseMagpie(ttot,regi,emiMacMagpie(enty))$(ttot.val ge 2005) = f_macBaseMagpie_coupling(ttot,regi,emiMacMagpie); - p_co2lucSub(ttot,regi,emiMacMagpieCO2Sub(all_enty))$(ttot.val ge 2005) = f_macBaseMagpie_coupling(ttot,regi,emiMacMagpieCO2Sub); + p_co2lucSub(ttot,regi,emiMacMagpieCO2Sub(all_enty))$(ttot.val ge cm_startyear) = f_macBaseMagpie_coupling(ttot,regi,emiMacMagpieCO2Sub); *** Biomass emission factor is set to zero after MAgPIE has run at least one, since biomass emissions are included in the emissions imported above. p_efFossilFuelExtr(regi,"pebiolc","n2obio") = 0.0; *** In coupling mode LU emissions are abated in MAgPIE (moved here from core/datainput.gms)