From bb4344abb4c395dec9badc22bf9358fba5cff2f8 Mon Sep 17 00:00:00 2001 From: robertpietzcker Date: Thu, 16 Jul 2026 15:36:53 +0200 Subject: [PATCH 1/5] add iteration tracking parameters --- modules/80_optimization/nash/declarations.gms | 13 +++++++++++++ modules/80_optimization/nash/postsolve.gms | 18 ++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/modules/80_optimization/nash/declarations.gms b/modules/80_optimization/nash/declarations.gms index b00b11108..bef538ece 100644 --- a/modules/80_optimization/nash/declarations.gms +++ b/modules/80_optimization/nash/declarations.gms @@ -36,11 +36,24 @@ p80_defic_sum_rel(iteration) "Surplus monetary value over all tim p80_etaLT_correct(all_enty,iteration) "long term price correction factor in percent" p80_etaST_correct(tall,all_enty,iteration) "short term price correction factor in percent" +*** RP parameters to track model results over iterations to help diagnose convergence problems +*** Trade p80_Mport_iter(ttot,all_regi,all_enty,iteration) "Imports over iterations" p80_Xport_iter(ttot,all_regi,all_enty,iteration) "Exports over iterations" p80_prodPe_iter(ttot,all_regi,all_enty,iteration) "PE production over iterations" p80_fuExtr_iter(ttot,all_regi,all_enty,rlf,iteration) "Fuel extraction over iterations" +*** edgeTransport +p80_esCapCost_iter(ttot,all_regi,all_teEs,iteration) "Capital energy cost per unit of consumption for end-use capital (energy service layer) over iterations [T$/unit energy service]" +p80_fe2es_iter(ttot,all_regi,all_teEs,iteration) "Conversion factor from final energies to transport energy services over iterations [Tpkm/TWa, Ttkm/TWa]" +p80_shFeCes_iter(ttot,all_regi,all_enty,all_in,all_teEs,iteration) "Shares of fuels by CES node over iterations" + +*** CES tree +p80_cesIO_iter(ttot,all_regi,all_in,iteration) "Production factor over iterations" +p80_demFeForEs_iter(ttot,all_regi,all_enty,all_esty,all_teEs,iteration) "Final energy which will be used in the energy service layer over iterations [TWa]" +p80_prodEs_iter(ttot,all_regi,all_enty,all_esty,all_teEs,iteration) "Energy services over iterations [Tpkm for passenger transport, Ttkm for freight transport]" + + p80_etaST_correct_safecopy(tall,all_enty,iteration) "auxiliary parameter to remember short term price correction factor in percent, before new convergence adjustments" o80_counter_iteration_trade_ttot(ttot,all_enty,iteration) "auxiliary parameter to display in which iteration and for which item (ttot, trade) additional convergence measures were taken" o80_trackSurplusSign(ttot,all_enty,iteration) "auxiliary parameter to track how long the surplus for an item (ttot, trade) had the same sign over iterations" diff --git a/modules/80_optimization/nash/postsolve.gms b/modules/80_optimization/nash/postsolve.gms index 24d9abac8..90f010975 100644 --- a/modules/80_optimization/nash/postsolve.gms +++ b/modules/80_optimization/nash/postsolve.gms @@ -36,6 +36,24 @@ loop(ttot$(ttot.val ge 2005), ); ); +*** track parameters read in from edgeTransport over iterations +if(edgeTransportIter(iteration), + loop(ttot$(ttot.val ge 2005), + p80_esCapCost_iter(ttot,regi,teEs_dyn35,iteration) = pm_esCapCost(ttot,regi,teEs_dyn35); + p80_fe2es_iter(ttot,regi,teEs_dyn35,iteration) = pm_fe2es(ttot,regi,teEs_dyn35); + p80_shFeCes_iter(ttot,regi,entyFe,ppfen_dyn35,teEs_dyn35,iteration) = pm_shFeCes(ttot,regi,entyFe,ppfen_dyn35,teEs_dyn35); + ); +); + +*** track CES tree and energy services over iterations +loop(ttot$(ttot.val ge 2005), + p80_cesIO_iter(ttot,regi,in,iteration) = vm_cesIO.l(ttot,regi,in) ; + loop(entyFe2Sector(entyFe,"trans"), + p80_demFeForEs_iter(ttot,regi,entyFe,esty,teEs,iteration)$fe2es(entyFe,esty,teEs) = vm_demFeForEs.l(ttot,regi,entyFe,esty,teEs); + p80_prodEs_iter(ttot,regi,entyFe,esty,teEs,iteration)$fe2es(entyFe,esty,teEs) = v_prodEs.l(ttot,regi,entyFe,esty,teEs); + ); +); + ***calculate residual surplus on the markets loop(ttot$(ttot.val ge 2005), loop(trade$(NOT tradeSe(trade)), From 9cd30a0cac87b4f88a7021f88cb21a77be33204b Mon Sep 17 00:00:00 2001 From: robertpietzcker Date: Thu, 16 Jul 2026 16:05:26 +0200 Subject: [PATCH 2/5] shift to core --- core/declarations.gms | 5 +++++ core/postsolve.gms | 11 +++++++++++ modules/80_optimization/nash/declarations.gms | 4 ---- modules/80_optimization/nash/postsolve.gms | 9 --------- 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/core/declarations.gms b/core/declarations.gms index 556f80571..d4b14a6f0 100644 --- a/core/declarations.gms +++ b/core/declarations.gms @@ -620,6 +620,11 @@ o_vm_fuExtr_pebiolc(iteration,ttot,all_regi) "track vm_fuExtr for pebiol o_vm_pebiolc_price(iteration,ttot,all_regi) "track vm_pebiolc_price across Nash iterations" o_PEDem_Bio_ECrops(iteration,ttot,all_regi) "track pebiolc demand across Nash iterations" o_vm_emiMacSector_co2luc(iteration,ttot,all_regi) "track co2luc across Nash iterations" + +o_vm_cesIO_iter(ttot,all_regi,all_in,iteration) "Production factor over iterations" +o_vm_demFeForEs_iter(ttot,all_regi,all_enty,all_esty,all_teEs,iteration) "Final energy which will be used in the energy service layer over iterations [TWa]" +o_v_prodEs_iter(ttot,all_regi,all_enty,all_esty,all_teEs,iteration) "Energy services over iterations [Tpkm for passenger transport, Ttkm for freight transport]" + ; *** ------------- Scalars ---------------------------- diff --git a/core/postsolve.gms b/core/postsolve.gms index b4deaa266..83a290fdc 100644 --- a/core/postsolve.gms +++ b/core/postsolve.gms @@ -225,4 +225,15 @@ o_vm_fuExtr_pebiolc(iteration,ttot,regi) = vm_fuExtr.l(ttot,regi,"pebiolc","1"); o_PEDem_Bio_ECrops(iteration,ttot,regi) = vm_fuExtr.l(ttot,regi,"pebiolc","1") + (1 - pm_costsPEtradeMp(regi,"pebiolc")) * vm_Mport.l(ttot,regi,"pebiolc") - vm_Xport.l(ttot,regi,"pebiolc"); o_vm_emiMacSector_co2luc(iteration,ttot,regi) = vm_emiMacSector.l(ttot,regi,"co2luc"); +*** track CES tree and energy services over iterations +loop(ttot$(ttot.val ge 2005), + o_vm_cesIO_iter(ttot,regi,in,iteration) = vm_cesIO.l(ttot,regi,in) ; + loop(entyFe2Sector(entyFe,"trans"), + o_vm_demFeForEs_iter(ttot,regi,entyFe,esty,teEs,iteration)$fe2es(entyFe,esty,teEs) = vm_demFeForEs.l(ttot,regi,entyFe,esty,teEs); + o_v_prodEs_iter(ttot,regi,entyFe,esty,teEs,iteration)$fe2es(entyFe,esty,teEs) = v_prodEs.l(ttot,regi,entyFe,esty,teEs); + ); +); + + + *** EOF ./core/postsolve.gms diff --git a/modules/80_optimization/nash/declarations.gms b/modules/80_optimization/nash/declarations.gms index bef538ece..9db67bafd 100644 --- a/modules/80_optimization/nash/declarations.gms +++ b/modules/80_optimization/nash/declarations.gms @@ -48,10 +48,6 @@ p80_esCapCost_iter(ttot,all_regi,all_teEs,iteration) "Capital en p80_fe2es_iter(ttot,all_regi,all_teEs,iteration) "Conversion factor from final energies to transport energy services over iterations [Tpkm/TWa, Ttkm/TWa]" p80_shFeCes_iter(ttot,all_regi,all_enty,all_in,all_teEs,iteration) "Shares of fuels by CES node over iterations" -*** CES tree -p80_cesIO_iter(ttot,all_regi,all_in,iteration) "Production factor over iterations" -p80_demFeForEs_iter(ttot,all_regi,all_enty,all_esty,all_teEs,iteration) "Final energy which will be used in the energy service layer over iterations [TWa]" -p80_prodEs_iter(ttot,all_regi,all_enty,all_esty,all_teEs,iteration) "Energy services over iterations [Tpkm for passenger transport, Ttkm for freight transport]" p80_etaST_correct_safecopy(tall,all_enty,iteration) "auxiliary parameter to remember short term price correction factor in percent, before new convergence adjustments" diff --git a/modules/80_optimization/nash/postsolve.gms b/modules/80_optimization/nash/postsolve.gms index 90f010975..d55558712 100644 --- a/modules/80_optimization/nash/postsolve.gms +++ b/modules/80_optimization/nash/postsolve.gms @@ -45,15 +45,6 @@ if(edgeTransportIter(iteration), ); ); -*** track CES tree and energy services over iterations -loop(ttot$(ttot.val ge 2005), - p80_cesIO_iter(ttot,regi,in,iteration) = vm_cesIO.l(ttot,regi,in) ; - loop(entyFe2Sector(entyFe,"trans"), - p80_demFeForEs_iter(ttot,regi,entyFe,esty,teEs,iteration)$fe2es(entyFe,esty,teEs) = vm_demFeForEs.l(ttot,regi,entyFe,esty,teEs); - p80_prodEs_iter(ttot,regi,entyFe,esty,teEs,iteration)$fe2es(entyFe,esty,teEs) = v_prodEs.l(ttot,regi,entyFe,esty,teEs); - ); -); - ***calculate residual surplus on the markets loop(ttot$(ttot.val ge 2005), loop(trade$(NOT tradeSe(trade)), From 1f6e9c9b333be4ab14c9c237575a1353b1a3f2db Mon Sep 17 00:00:00 2001 From: robertpietzcker Date: Thu, 16 Jul 2026 16:08:27 +0200 Subject: [PATCH 3/5] shift all to core --- core/declarations.gms | 6 ++++++ core/postsolve.gms | 8 ++++++++ modules/80_optimization/nash/declarations.gms | 5 ----- modules/80_optimization/nash/postsolve.gms | 9 --------- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/core/declarations.gms b/core/declarations.gms index d4b14a6f0..729ee29b8 100644 --- a/core/declarations.gms +++ b/core/declarations.gms @@ -621,10 +621,16 @@ o_vm_pebiolc_price(iteration,ttot,all_regi) "track vm_pebiolc_price acr o_PEDem_Bio_ECrops(iteration,ttot,all_regi) "track pebiolc demand across Nash iterations" o_vm_emiMacSector_co2luc(iteration,ttot,all_regi) "track co2luc across Nash iterations" +*** CES tree and energy services o_vm_cesIO_iter(ttot,all_regi,all_in,iteration) "Production factor over iterations" o_vm_demFeForEs_iter(ttot,all_regi,all_enty,all_esty,all_teEs,iteration) "Final energy which will be used in the energy service layer over iterations [TWa]" o_v_prodEs_iter(ttot,all_regi,all_enty,all_esty,all_teEs,iteration) "Energy services over iterations [Tpkm for passenger transport, Ttkm for freight transport]" +*** edgeTransport +o_pm_esCapCost_iter(ttot,all_regi,all_teEs,iteration) "Capital energy cost per unit of consumption for end-use capital (energy service layer) over iterations [T$/unit energy service]" +o_pm_fe2es_iter(ttot,all_regi,all_teEs,iteration) "Conversion factor from final energies to transport energy services over iterations [Tpkm/TWa, Ttkm/TWa]" +o_pm_shFeCes_iter(ttot,all_regi,all_enty,all_in,all_teEs,iteration) "Shares of fuels by CES node over iterations" + ; *** ------------- Scalars ---------------------------- diff --git a/core/postsolve.gms b/core/postsolve.gms index 83a290fdc..a65c6a76e 100644 --- a/core/postsolve.gms +++ b/core/postsolve.gms @@ -234,6 +234,14 @@ loop(ttot$(ttot.val ge 2005), ); ); +*** track parameters read in from edgeTransport over iterations +if(edgeTransportIter(iteration), + loop(ttot$(ttot.val ge 2005), + o_pm_esCapCost_iter(ttot,regi,teEs_dyn35,iteration) = pm_esCapCost(ttot,regi,teEs_dyn35); + o_pm_fe2es_iter(ttot,regi,teEs_dyn35,iteration) = pm_fe2es(ttot,regi,teEs_dyn35); + o_pm_shFeCes_iter(ttot,regi,entyFe,ppfen_dyn35,teEs_dyn35,iteration) = pm_shFeCes(ttot,regi,entyFe,ppfen_dyn35,teEs_dyn35); + ); +); *** EOF ./core/postsolve.gms diff --git a/modules/80_optimization/nash/declarations.gms b/modules/80_optimization/nash/declarations.gms index 9db67bafd..fdac04544 100644 --- a/modules/80_optimization/nash/declarations.gms +++ b/modules/80_optimization/nash/declarations.gms @@ -43,11 +43,6 @@ p80_Xport_iter(ttot,all_regi,all_enty,iteration) "Exports over iteratio p80_prodPe_iter(ttot,all_regi,all_enty,iteration) "PE production over iterations" p80_fuExtr_iter(ttot,all_regi,all_enty,rlf,iteration) "Fuel extraction over iterations" -*** edgeTransport -p80_esCapCost_iter(ttot,all_regi,all_teEs,iteration) "Capital energy cost per unit of consumption for end-use capital (energy service layer) over iterations [T$/unit energy service]" -p80_fe2es_iter(ttot,all_regi,all_teEs,iteration) "Conversion factor from final energies to transport energy services over iterations [Tpkm/TWa, Ttkm/TWa]" -p80_shFeCes_iter(ttot,all_regi,all_enty,all_in,all_teEs,iteration) "Shares of fuels by CES node over iterations" - p80_etaST_correct_safecopy(tall,all_enty,iteration) "auxiliary parameter to remember short term price correction factor in percent, before new convergence adjustments" diff --git a/modules/80_optimization/nash/postsolve.gms b/modules/80_optimization/nash/postsolve.gms index d55558712..24d9abac8 100644 --- a/modules/80_optimization/nash/postsolve.gms +++ b/modules/80_optimization/nash/postsolve.gms @@ -36,15 +36,6 @@ loop(ttot$(ttot.val ge 2005), ); ); -*** track parameters read in from edgeTransport over iterations -if(edgeTransportIter(iteration), - loop(ttot$(ttot.val ge 2005), - p80_esCapCost_iter(ttot,regi,teEs_dyn35,iteration) = pm_esCapCost(ttot,regi,teEs_dyn35); - p80_fe2es_iter(ttot,regi,teEs_dyn35,iteration) = pm_fe2es(ttot,regi,teEs_dyn35); - p80_shFeCes_iter(ttot,regi,entyFe,ppfen_dyn35,teEs_dyn35,iteration) = pm_shFeCes(ttot,regi,entyFe,ppfen_dyn35,teEs_dyn35); - ); -); - ***calculate residual surplus on the markets loop(ttot$(ttot.val ge 2005), loop(trade$(NOT tradeSe(trade)), From 0c589c401027ff2f52221ab6cc498334b94f52df Mon Sep 17 00:00:00 2001 From: robertpietzcker Date: Thu, 16 Jul 2026 16:58:50 +0200 Subject: [PATCH 4/5] harmonize names --- core/declarations.gms | 8 ++++---- core/postsolve.gms | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/core/declarations.gms b/core/declarations.gms index 729ee29b8..f01725e21 100644 --- a/core/declarations.gms +++ b/core/declarations.gms @@ -616,10 +616,10 @@ o_pm_pebiolc_demandmag(iteration,ttot,all_regi) "track pm_pebiolc_demandmag o_pm_macBaseMagpie(iteration,ttot,all_regi,all_enty) "track pm_macBaseMagpie across Nash iterations" o_pm_macSwitch(iteration,ttot,all_regi,all_enty) "track pm_macSwitch across Nash iterations" o_p_efFossilFuelExtr_n2obio(iteration,all_regi) "track p_efFossilFuelExtr for n2obio across Nash iterations" -o_vm_fuExtr_pebiolc(iteration,ttot,all_regi) "track vm_fuExtr for pebiolc across Nash iterations" -o_vm_pebiolc_price(iteration,ttot,all_regi) "track vm_pebiolc_price across Nash iterations" -o_PEDem_Bio_ECrops(iteration,ttot,all_regi) "track pebiolc demand across Nash iterations" -o_vm_emiMacSector_co2luc(iteration,ttot,all_regi) "track co2luc across Nash iterations" +o_vm_fuExtr_pebiolc_iter(iteration,ttot,all_regi) "track vm_fuExtr for pebiolc across Nash iterations" +o_vm_pebiolc_price_iter(iteration,ttot,all_regi) "track vm_pebiolc_price across Nash iterations" +o_PEDem_Bio_ECrops_iter(iteration,ttot,all_regi) "track pebiolc demand across Nash iterations" +o_vm_emiMacSector_co2luc_iter(iteration,ttot,all_regi) "track co2luc across Nash iterations" *** CES tree and energy services o_vm_cesIO_iter(ttot,all_regi,all_in,iteration) "Production factor over iterations" diff --git a/core/postsolve.gms b/core/postsolve.gms index a65c6a76e..422f815fc 100644 --- a/core/postsolve.gms +++ b/core/postsolve.gms @@ -220,10 +220,10 @@ p_FEPrice_by_EmiMkt_iter(iteration,t,regi,entyFe,emiMkt) = p_FEPrice_by_EmiMkt(t p_FEPrice_by_FE_iter(iteration,t,regi,entyFe) = p_FEPrice_by_FE(t,regi,entyFe); *** Track demand for purpose-grown ligno-cellulosic biomass across iterations -o_vm_pebiolc_price(iteration,ttot,regi) = vm_pebiolc_price.l(ttot,regi); -o_vm_fuExtr_pebiolc(iteration,ttot,regi) = vm_fuExtr.l(ttot,regi,"pebiolc","1"); -o_PEDem_Bio_ECrops(iteration,ttot,regi) = vm_fuExtr.l(ttot,regi,"pebiolc","1") + (1 - pm_costsPEtradeMp(regi,"pebiolc")) * vm_Mport.l(ttot,regi,"pebiolc") - vm_Xport.l(ttot,regi,"pebiolc"); -o_vm_emiMacSector_co2luc(iteration,ttot,regi) = vm_emiMacSector.l(ttot,regi,"co2luc"); +o_vm_pebiolc_price_iter(iteration,ttot,regi) = vm_pebiolc_price.l(ttot,regi); +o_vm_fuExtr_pebiolc_iter(iteration,ttot,regi) = vm_fuExtr.l(ttot,regi,"pebiolc","1"); +o_PEDem_Bio_ECrops_iter(iteration,ttot,regi) = vm_fuExtr.l(ttot,regi,"pebiolc","1") + (1 - pm_costsPEtradeMp(regi,"pebiolc")) * vm_Mport.l(ttot,regi,"pebiolc") - vm_Xport.l(ttot,regi,"pebiolc"); +o_vm_emiMacSector_co2luc_iter(iteration,ttot,regi) = vm_emiMacSector.l(ttot,regi,"co2luc"); *** track CES tree and energy services over iterations loop(ttot$(ttot.val ge 2005), From 1d1b72cbbff3055fd689b7fdd2c88b452970b43b Mon Sep 17 00:00:00 2001 From: robertpietzcker Date: Thu, 16 Jul 2026 17:59:09 +0200 Subject: [PATCH 5/5] correct names in scripts --- scripts/output/comparison/plotRemMagNash.R | 34 +++++++++++----------- scripts/output/single/plotRemMagNash.R | 34 +++++++++++----------- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/scripts/output/comparison/plotRemMagNash.R b/scripts/output/comparison/plotRemMagNash.R index 1f2189a9e..6c74d7345 100644 --- a/scripts/output/comparison/plotRemMagNash.R +++ b/scripts/output/comparison/plotRemMagNash.R @@ -78,23 +78,23 @@ plot_iterations <- function(dat, runname) { # ---- Plot: MAgPIE co2luc ---- - p_emi_mag <- myplot(dat, "o_vm_emiMacSector_co2luc", runname, ylab = "Mt CO2/yr") - p_emi_mag_it <- myplot(dat, "o_vm_emiMacSector_co2luc", xaxis = "iteration", color = "ttot", runname, ylab = "Mt CO2/yr") + p_emi_mag <- myplot(dat, "o_vm_emiMacSector_co2luc_iter", runname, ylab = "Mt CO2/yr") + p_emi_mag_it <- myplot(dat, "o_vm_emiMacSector_co2luc_iter", xaxis = "iteration", color = "ttot", runname, ylab = "Mt CO2/yr") # ---- Plot: REMIND Production of purpose grown bioenergy ---- - p_fuelex <- myplot(dat, "o_vm_fuExtr_pebiolc", runname, ylab = "EJ/yr") - p_fuelex_it <- myplot(dat, "o_vm_fuExtr_pebiolc", runname, xaxis = "iteration", color = "ttot", ylab = "EJ/yr") - p_fuelex_it_fix <- myplot(dat, "o_vm_fuExtr_pebiolc", runname, xaxis = "iteration", color = "ttot", ylab = "EJ/yr", scales = "fixed") + p_fuelex <- myplot(dat, "o_vm_fuExtr_pebiolc_iter", runname, ylab = "EJ/yr") + p_fuelex_it <- myplot(dat, "o_vm_fuExtr_pebiolc_iter", runname, xaxis = "iteration", color = "ttot", ylab = "EJ/yr") + p_fuelex_it_fix <- myplot(dat, "o_vm_fuExtr_pebiolc_iter", runname, xaxis = "iteration", color = "ttot", ylab = "EJ/yr", scales = "fixed") p_fuelex_it_2060 <- myplot(dat |> filter(ttot == 2060), - "o_vm_fuExtr_pebiolc", runname, type = "bar", + "o_vm_fuExtr_pebiolc_iter", runname, type = "bar", xaxis = "iteration", color = "ttot", ylab = "EJ/yr", scales = "fixed") # ---- Plot: REMIND Demand for purpose grown bioenergy ---- - p_demPE <- myplot(dat, "o_PEDem_Bio_ECrops", runname, ylab = "EJ/yr") - p_demPE_it <- myplot(dat, "o_PEDem_Bio_ECrops", runname, xaxis = "iteration", color = "ttot", ylab = "EJ/yr") + p_demPE <- myplot(dat, "o_PEDem_Bio_ECrops_iter", runname, ylab = "EJ/yr") + p_demPE_it <- myplot(dat, "o_PEDem_Bio_ECrops_iter", runname, xaxis = "iteration", color = "ttot", ylab = "EJ/yr") # ---- Plot: REMIND Price scaling factor ---- @@ -151,9 +151,9 @@ readDataFromGdx <- function(runfolder, allIter = TRUE) { # "Emi|CO2|+|Land-Use Change (Mt CO2/yr)" # vm_emiMacSector <- readGDX(gdx, "vm_emiMacSector", field = "l", restore_zeros = FALSE) # dimSums(vm_emiMacSector[, , "co2luc"] , dim = 3) * GtC_2_MtCO2 - # "o_vm_emiMacSector_co2luc" + # "o_vm_emiMacSector_co2luc_iter" # core/postsolve.gms: - # o_vm_emiMacSector_co2luc(iteration,ttot,regi) = vm_emiMacSector.l(ttot,regi,"co2luc"); + # o_vm_emiMacSector_co2luc_iter(iteration,ttot,regi) = vm_emiMacSector.l(ttot,regi,"co2luc"); # "Primary Energy Production|Biomass|Energy Crops (EJ/yr)" # remind2::reportExtraction.R @@ -162,16 +162,16 @@ readDataFromGdx <- function(runfolder, allIter = TRUE) { # dimSums(fuelex_bio[, , "pebiolc.1"], dim = 3) * TWa_2_EJ # -> "PE|Production|Biomass|+|Lignocellulosic (EJ/yr)" # -> "Primary Energy Production|Biomass|Energy Crops (EJ/yr)" (used also in coupling interface in MAgPIE) - # "o_vm_fuExtr_pebiolc" + # "o_vm_fuExtr_pebiolc_iter" # core/postsolve.gms: - # o_vm_fuExtr_pebiolc = vm_fuExtr.l(ttot,regi,"pebiolc","1"); + # o_vm_fuExtr_pebiolc_iter = vm_fuExtr.l(ttot,regi,"pebiolc","1"); # "PE|Biomass|+++|Energy Crops (EJ/yr)" # remind2::reportPE.R # fuelex[,,"pebiolc.1"] + (1-p_costsPEtradeMp[,,"pebiolc"]) * Mport[,,"pebiolc"] - Xport[,,"pebiolc"] -> "PE|Biomass|+++|Energy Crops (EJ/yr)" - # "o_PEDem_Bio_ECrops" + # "o_PEDem_Bio_ECrops_iter" # core/postsolve.gms: - # o_PEDem_Bio_ECrops(iteration,ttot,regi) = vm_fuExtr.l(ttot,regi,"pebiolc","1") + (1 - pm_costsPEtradeMp(ttot,regi"pebiolc")) * vm_Mport.l(ttot,regi,"pebiolc") - vm_Xport.l(ttot,regi"pebiolc"); + # o_PEDem_Bio_ECrops_iter(iteration,ttot,regi) = vm_fuExtr.l(ttot,regi,"pebiolc","1") + (1 - pm_costsPEtradeMp(ttot,regi"pebiolc")) * vm_Mport.l(ttot,regi,"pebiolc") - vm_Xport.l(ttot,regi"pebiolc"); # "Internal|Price|Biomass|Multfactor ()" # remind2::reportPrices.R @@ -197,9 +197,9 @@ readDataFromGdx <- function(runfolder, allIter = TRUE) { items <- tribble( ~par , ~var , ~factor, "o_p30_pebiolc_pricemag" , "Internal|Price|Biomass|MAgPIE (US$2017/GJ)" , sm_tdptwyr2dpgj, - "o_vm_emiMacSector_co2luc", "Emi|CO2|+|Land-Use Change (Mt CO2/yr)" , GtC_2_MtCO2, - "o_vm_fuExtr_pebiolc" , "Primary Energy Production|Biomass|Energy Crops (EJ/yr)", TWa2EJ, - "o_PEDem_Bio_ECrops" , "PE|Biomass|+++|Energy Crops (EJ/yr)" , TWa2EJ, + "o_vm_emiMacSector_co2luc_iter", "Emi|CO2|+|Land-Use Change (Mt CO2/yr)" , GtC_2_MtCO2, + "o_vm_fuExtr_pebiolc_iter" , "Primary Energy Production|Biomass|Energy Crops (EJ/yr)", TWa2EJ, + "o_PEDem_Bio_ECrops_iter" , "PE|Biomass|+++|Energy Crops (EJ/yr)" , TWa2EJ, "o_p30_pebiolc_pricmult" , "Internal|Price|Biomass|Multfactor ()" , 1, "pm_taxCO2eq_iter" , "Price|Carbon (US$2017/t CO2)" , 1000 * 12 / 44, ) diff --git a/scripts/output/single/plotRemMagNash.R b/scripts/output/single/plotRemMagNash.R index 8d6a4b394..dae144698 100644 --- a/scripts/output/single/plotRemMagNash.R +++ b/scripts/output/single/plotRemMagNash.R @@ -80,23 +80,23 @@ plot_iterations <- function(dat, runname) { # ---- Plot: MAgPIE co2luc ---- - p_emi_mag <- myplot(dat, "o_vm_emiMacSector_co2luc", runname, ylab = "Mt CO2/yr") - p_emi_mag_it <- myplot(dat, "o_vm_emiMacSector_co2luc", xaxis = "iteration", color = "ttot", runname, ylab = "Mt CO2/yr") + p_emi_mag <- myplot(dat, "o_vm_emiMacSector_co2luc_iter", runname, ylab = "Mt CO2/yr") + p_emi_mag_it <- myplot(dat, "o_vm_emiMacSector_co2luc_iter", xaxis = "iteration", color = "ttot", runname, ylab = "Mt CO2/yr") # ---- Plot: REMIND Production of purpose grown bioenergy ---- - p_fuelex <- myplot(dat, "o_vm_fuExtr_pebiolc", runname, ylab = "EJ/yr") - p_fuelex_it <- myplot(dat, "o_vm_fuExtr_pebiolc", runname, xaxis = "iteration", color = "ttot", ylab = "EJ/yr") - p_fuelex_it_fix <- myplot(dat, "o_vm_fuExtr_pebiolc", runname, xaxis = "iteration", color = "ttot", ylab = "EJ/yr", scales = "fixed") + p_fuelex <- myplot(dat, "o_vm_fuExtr_pebiolc_iter", runname, ylab = "EJ/yr") + p_fuelex_it <- myplot(dat, "o_vm_fuExtr_pebiolc_iter", runname, xaxis = "iteration", color = "ttot", ylab = "EJ/yr") + p_fuelex_it_fix <- myplot(dat, "o_vm_fuExtr_pebiolc_iter", runname, xaxis = "iteration", color = "ttot", ylab = "EJ/yr", scales = "fixed") p_fuelex_it_2060 <- myplot(dat |> filter(ttot == 2060), - "o_vm_fuExtr_pebiolc", runname, type = "bar", + "o_vm_fuExtr_pebiolc_iter", runname, type = "bar", xaxis = "iteration", color = "ttot", ylab = "EJ/yr", scales = "fixed") # ---- Plot: REMIND Demand for purpose grown bioenergy ---- - p_demPE <- myplot(dat, "o_PEDem_Bio_ECrops", runname, ylab = "EJ/yr") - p_demPE_it <- myplot(dat, "o_PEDem_Bio_ECrops", runname, xaxis = "iteration", color = "ttot", ylab = "EJ/yr") + p_demPE <- myplot(dat, "o_PEDem_Bio_ECrops_iter", runname, ylab = "EJ/yr") + p_demPE_it <- myplot(dat, "o_PEDem_Bio_ECrops_iter", runname, xaxis = "iteration", color = "ttot", ylab = "EJ/yr") # ---- Plot: REMIND Price scaling factor ---- @@ -153,9 +153,9 @@ readDataFromGdx <- function(runfolder, allIter = TRUE) { # "Emi|CO2|+|Land-Use Change (Mt CO2/yr)" # vm_emiMacSector <- readGDX(gdx, "vm_emiMacSector", field = "l", restore_zeros = FALSE) # dimSums(vm_emiMacSector[, , "co2luc"] , dim = 3) * GtC_2_MtCO2 - # "o_vm_emiMacSector_co2luc" + # "o_vm_emiMacSector_co2luc_iter" # core/postsolve.gms: - # o_vm_emiMacSector_co2luc(iteration,ttot,regi) = vm_emiMacSector.l(ttot,regi,"co2luc"); + # o_vm_emiMacSector_co2luc_iter(iteration,ttot,regi) = vm_emiMacSector.l(ttot,regi,"co2luc"); # "Primary Energy Production|Biomass|Energy Crops (EJ/yr)" # remind2::reportExtraction.R @@ -164,16 +164,16 @@ readDataFromGdx <- function(runfolder, allIter = TRUE) { # dimSums(fuelex_bio[, , "pebiolc.1"], dim = 3) * TWa_2_EJ # -> "PE|Production|Biomass|+|Lignocellulosic (EJ/yr)" # -> "Primary Energy Production|Biomass|Energy Crops (EJ/yr)" (used also in coupling interface in MAgPIE) - # "o_vm_fuExtr_pebiolc" + # "o_vm_fuExtr_pebiolc_iter" # core/postsolve.gms: - # o_vm_fuExtr_pebiolc = vm_fuExtr.l(ttot,regi,"pebiolc","1"); + # o_vm_fuExtr_pebiolc_iter = vm_fuExtr.l(ttot,regi,"pebiolc","1"); # "PE|Biomass|+++|Energy Crops (EJ/yr)" # remind2::reportPE.R # fuelex[,,"pebiolc.1"] + (1-p_costsPEtradeMp[,,"pebiolc"]) * Mport[,,"pebiolc"] - Xport[,,"pebiolc"] -> "PE|Biomass|+++|Energy Crops (EJ/yr)" - # "o_PEDem_Bio_ECrops" + # "o_PEDem_Bio_ECrops_iter" # core/postsolve.gms: - # o_PEDem_Bio_ECrops(iteration,ttot,regi) = vm_fuExtr.l(ttot,regi,"pebiolc","1") + (1 - pm_costsPEtradeMp(ttot,regi"pebiolc")) * vm_Mport.l(ttot,regi,"pebiolc") - vm_Xport.l(ttot,regi"pebiolc"); + # o_PEDem_Bio_ECrops_iter(iteration,ttot,regi) = vm_fuExtr.l(ttot,regi,"pebiolc","1") + (1 - pm_costsPEtradeMp(ttot,regi"pebiolc")) * vm_Mport.l(ttot,regi,"pebiolc") - vm_Xport.l(ttot,regi"pebiolc"); # "Internal|Price|Biomass|Multfactor ()" # remind2::reportPrices.R @@ -199,9 +199,9 @@ readDataFromGdx <- function(runfolder, allIter = TRUE) { items <- tribble( ~par , ~var , ~factor, "o_p30_pebiolc_pricemag" , "Internal|Price|Biomass|MAgPIE (US$2017/GJ)" , sm_tdptwyr2dpgj, - "o_vm_emiMacSector_co2luc", "Emi|CO2|+|Land-Use Change (Mt CO2/yr)" , GtC_2_MtCO2, - "o_vm_fuExtr_pebiolc" , "Primary Energy Production|Biomass|Energy Crops (EJ/yr)", TWa2EJ, - "o_PEDem_Bio_ECrops" , "PE|Biomass|+++|Energy Crops (EJ/yr)" , TWa2EJ, + "o_vm_emiMacSector_co2luc_iter", "Emi|CO2|+|Land-Use Change (Mt CO2/yr)" , GtC_2_MtCO2, + "o_vm_fuExtr_pebiolc_iter" , "Primary Energy Production|Biomass|Energy Crops (EJ/yr)", TWa2EJ, + "o_PEDem_Bio_ECrops_iter" , "PE|Biomass|+++|Energy Crops (EJ/yr)" , TWa2EJ, "o_p30_pebiolc_pricmult" , "Internal|Price|Biomass|Multfactor ()" , 1, "pm_taxCO2eq_iter" , "Price|Carbon (US$2017/t CO2)" , 1000 * 12 / 44, )