From 9590c4c701d0e69905476a8fb1e4f09943e12b38 Mon Sep 17 00:00:00 2001 From: Falk Benke Date: Mon, 29 Jul 2024 11:25:10 +0200 Subject: [PATCH 1/6] switch to US017 in reporting functions --- R/readConsumption.R | 14 +-- R/reportCosts.R | 184 ++++++++++++++++++------------------- R/reportCrossVariables.R | 50 +++++----- R/reportEnergyInvestment.R | 150 +++++++++++++++--------------- R/reportFE.R | 22 ++--- R/reportMacroEconomy.R | 46 +++++----- R/reportPolicyCosts.R | 34 +++---- R/reportSDPVariables.R | 20 ++-- R/reportTax.R | 114 +++++++++++------------ R/reportTrade.R | 86 ++++++++--------- 10 files changed, 359 insertions(+), 361 deletions(-) diff --git a/R/readConsumption.R b/R/readConsumption.R index 9c86633b..5468b128 100644 --- a/R/readConsumption.R +++ b/R/readConsumption.R @@ -1,16 +1,16 @@ #' Read Consumption from GDX file -#' +#' #' Read Consumption data from a GDX file into a magpie object. -#' -#' +#' +#' #' @param gdx a GDX list as created by readGDX, or the file name of a gdx #' file(file name is recommended as this speeds up the code) #' @param field one of 'l', 'm', 's', 'lo', 'up' #' @author Jonas Hoersch #' @examples -#' +#' #' \dontrun{cons <- readConsumption(gdx)} -#' +#' #' @export #' @importFrom gdx readGDX #' @importFrom magclass mbind getNames<- @@ -19,6 +19,6 @@ readConsumption <- function(gdx, field="l"){ tmp <- readGDX(gdx, name='vm_cons', field=field, format="first_found") tmp <- tmp * 1000 tmp <- mbind(tmp["GLO",,,invert=T],dimSums(tmp,dim=1)) - getNames(tmp) <- "Consumption (billion US$2005/yr)" + getNames(tmp) <- "Consumption (billion US$2017/yr)" return(tmp) -} +} diff --git a/R/reportCosts.R b/R/reportCosts.R index de2ecdd8..8c954166 100644 --- a/R/reportCosts.R +++ b/R/reportCosts.R @@ -138,9 +138,9 @@ reportCosts <- function(gdx,output=NULL,regionSubsetList=NULL,t=c(seq(2005,2060, #febalForUe.m <- dimReduce(febalForUe.m, dim_exclude = 2) demFeTrans.m <- readGDX(gdx,name=c("q35_demFeTrans"),types="equations",restore_zeros=FALSE,field="m",format="first_found") y1 <- Reduce(intersect,list(getYears(demFeTrans.m),getYears(budget.m),getYears(vm_demFeSector))) - price_fe_trans_emiMkt <- abs(demFeTrans.m[,y1,]/(budget.m[,y1,]+1e-10)) * 1000 / pm_conv_TWa_EJ # price of final energy in transportation per emission market (US$2005/GJ) + price_fe_trans_emiMkt <- abs(demFeTrans.m[,y1,]/(budget.m[,y1,]+1e-10)) * 1000 / pm_conv_TWa_EJ # price of final energy in transportation per emission market (US$2017/GJ) quant_fe_trans_emiMkt <- dimSums(dimSums(vm_demFeSector[,y1,"trans"],dim=c(3.1), na.rm=T),dim=c(3.2), na.rm=T)[,,getNames(price_fe_trans_emiMkt[,y1,])] # quantity of final energy in transportation per emission market - price_fe_trans <- dimSums(price_fe_trans_emiMkt*quant_fe_trans_emiMkt,dim=3.2,na.rm=T) / dimSums(quant_fe_trans_emiMkt,dim=3,na.rm=T) # price of final energy in transportation (US$2005/GJ) + price_fe_trans <- dimSums(price_fe_trans_emiMkt*quant_fe_trans_emiMkt,dim=3.2,na.rm=T) / dimSums(quant_fe_trans_emiMkt,dim=3,na.rm=T) # price of final energy in transportation (US$2017/GJ) febalForUe.m <- price_fe_trans } else { febalForUe.m <- readGDX(gdx,name=c("q_balFeForUe","q_balFe","q_febal"),types="equations",field="m",format="first_found",restore_zeros=FALSE) @@ -262,18 +262,18 @@ reportCosts <- function(gdx,output=NULL,regionSubsetList=NULL,t=c(seq(2005,2060, ########## Biomass costs ############## ####################################### - if(!is.null(cost_mag)) {tmp <- mbind(tmp,setNames(cost_mag * 1000, "Costs|Biomass|MAgPIE (billion US$2005/yr)"))} - tmp <- mbind(tmp,setNames(cost_emu_pre * 1000, "Costs|Biomass|Price integral presolve (billion US$2005/yr)")) - tmp <- mbind(tmp,setNames(cost_emu * 1000, "Costs|Biomass|Price integral (billion US$2005/yr)")) + if(!is.null(cost_mag)) {tmp <- mbind(tmp,setNames(cost_mag * 1000, "Costs|Biomass|MAgPIE (billion US$2017/yr)"))} + tmp <- mbind(tmp,setNames(cost_emu_pre * 1000, "Costs|Biomass|Price integral presolve (billion US$2017/yr)")) + tmp <- mbind(tmp,setNames(cost_emu * 1000, "Costs|Biomass|Price integral (billion US$2017/yr)")) tmp <- mbind(tmp,setNames(bio_cost_adjfac, "Costs|Biomass|Adjfactor (-)")) - if(!is.null(totLUcosts)) {tmp <- mbind(tmp,setNames(totLUcosts * 1000, "Costs|Land Use (billion US$2005/yr)"))} - if(!is.null(totLUcostsWithMAC)) {tmp <- mbind(tmp,setNames(totLUcostsWithMAC * 1000, "Costs|Land Use with MAC-costs from MAgPIE (billion US$2005/yr)"))} - if(!is.null(costsLuMACLookup)) {tmp <- mbind(tmp,setNames(costsLuMACLookup * 1000, "Costs|Land Use|MAC-costs Lookup (billion US$2005/yr)"))} - if(!is.null(getNames(costsMAC))) tmp <- mbind(tmp,setNames(dimSums(costsMAC[,,emiMacMagpie], dim=3,na.rm=T) * 1000, "Costs|Land Use|MAC-costs (billion US$2005/yr)")) - if(!is.null(getNames(costsMAC))) tmp <- mbind(tmp,setNames(dimSums(costsMAC[,,emiMacMagpieN2O],dim=3,na.rm=T) * 1000, "Costs|Land Use|MAC-costs|N2O (billion US$2005/yr)")) - if(!is.null(getNames(costsMAC))) tmp <- mbind(tmp,setNames(dimSums(costsMAC[,,emiMacMagpieCH4],dim=3,na.rm=T) * 1000, "Costs|Land Use|MAC-costs|CH4 (billion US$2005/yr)")) - if(!is.null(getNames(costsMAC))) tmp <- mbind(tmp,setNames(dimSums(costsMAC[,,emiMacMagpieCO2],dim=3,na.rm=T) * 1000, "Costs|Land Use|MAC-costs|CO2 (billion US$2005/yr)")) + if(!is.null(totLUcosts)) {tmp <- mbind(tmp,setNames(totLUcosts * 1000, "Costs|Land Use (billion US$2017/yr)"))} + if(!is.null(totLUcostsWithMAC)) {tmp <- mbind(tmp,setNames(totLUcostsWithMAC * 1000, "Costs|Land Use with MAC-costs from MAgPIE (billion US$2017/yr)"))} + if(!is.null(costsLuMACLookup)) {tmp <- mbind(tmp,setNames(costsLuMACLookup * 1000, "Costs|Land Use|MAC-costs Lookup (billion US$2017/yr)"))} + if(!is.null(getNames(costsMAC))) tmp <- mbind(tmp,setNames(dimSums(costsMAC[,,emiMacMagpie], dim=3,na.rm=T) * 1000, "Costs|Land Use|MAC-costs (billion US$2017/yr)")) + if(!is.null(getNames(costsMAC))) tmp <- mbind(tmp,setNames(dimSums(costsMAC[,,emiMacMagpieN2O],dim=3,na.rm=T) * 1000, "Costs|Land Use|MAC-costs|N2O (billion US$2017/yr)")) + if(!is.null(getNames(costsMAC))) tmp <- mbind(tmp,setNames(dimSums(costsMAC[,,emiMacMagpieCH4],dim=3,na.rm=T) * 1000, "Costs|Land Use|MAC-costs|CH4 (billion US$2017/yr)")) + if(!is.null(getNames(costsMAC))) tmp <- mbind(tmp,setNames(dimSums(costsMAC[,,emiMacMagpieCO2],dim=3,na.rm=T) * 1000, "Costs|Land Use|MAC-costs|CO2 (billion US$2017/yr)")) tmp <- tmp[,y,] @@ -282,7 +282,7 @@ reportCosts <- function(gdx,output=NULL,regionSubsetList=NULL,t=c(seq(2005,2060, ####################################### ##### Total - tmp <- mbind(tmp,setNames(v_costfu * 1000, "Fuel supply costs (billion US$2005/yr)")) + tmp <- mbind(tmp,setNames(v_costfu * 1000, "Fuel supply costs (billion US$2017/yr)")) ##### Fuel costs for own ESM regi_on_gdx <- unique(readGDX(gdx, name = "regi2iso")[,1]) @@ -292,62 +292,62 @@ reportCosts <- function(gdx,output=NULL,regionSubsetList=NULL,t=c(seq(2005,2060, cost <- v_costfu * 1000 - setNames(output[regi_on_gdx,,"Res|Average Supply Costs|Coal ($/GJ)"] * Xport[,,"pecoal"] * pm_conv_TWa_EJ,NULL) - setNames(output[regi_on_gdx,,"Res|Average Supply Costs|Gas ($/GJ)"] * Xport[,,"pegas"] * pm_conv_TWa_EJ,NULL) - setNames(output[regi_on_gdx,,"Res|Average Supply Costs|Oil ($/GJ)"] * Xport[,,"peoil"] * pm_conv_TWa_EJ,NULL) - - setNames(output[regi_on_gdx,,"Price|Primary Energy|Biomass|Modern|Rawdata (US$2005/GJ)"] * Xport[,,"pebiolc"] * pm_conv_TWa_EJ,NULL) - + setNames(output[regi_on_gdx,,"Price|Primary Energy|Biomass|Modern|Rawdata (US$2017/GJ)"] * Xport[,,"pebiolc"] * pm_conv_TWa_EJ,NULL) - setNames(output[regi_on_gdx,,"Res|Average Supply Costs|Uranium ($/GJ)"] * Xport[,,"peur"] * pm_conv_TWa_EJ * 4.43,NULL) + dimSums(Mport[,,trade_pe] * pebal.m[,,trade_pe] / (budget.m + 1.e-10), dim=3,na.rm=T) * 1000 # imports valued with domestic market price - tmp <- mbind(tmp,setNames(cost, "Fuel costs for own ESM (billion US$2005/yr)")) + tmp <- mbind(tmp,setNames(cost, "Fuel costs for own ESM (billion US$2017/yr)")) ##### Import fuel costs cost<- cost_Mport(trade_pe,pm_petradecost2_Mp_fin,pm_pvp,budget.m,Mport) - tmp <- mbind(tmp,setNames(cost, "Import Fuel costs (billion US$2005/yr)")) + tmp <- mbind(tmp,setNames(cost, "Import Fuel costs (billion US$2017/yr)")) ###### Import fuel costs|Coal cost<- cost_Mport("pecoal",pm_petradecost2_Mp_fin,pm_pvp,budget.m,Mport) - tmp <- mbind(tmp,setNames(cost, "Import Fuel costs|Coal (billion US$2005/yr)")) + tmp <- mbind(tmp,setNames(cost, "Import Fuel costs|Coal (billion US$2017/yr)")) ###### Import fuel costs|Gas cost<- cost_Mport("pegas",pm_petradecost2_Mp_fin,pm_pvp,budget.m,Mport) - tmp <- mbind(tmp,setNames(cost, "Import Fuel costs|Gas (billion US$2005/yr)")) + tmp <- mbind(tmp,setNames(cost, "Import Fuel costs|Gas (billion US$2017/yr)")) ###### Import fuel costs|Oil cost<- cost_Mport("peoil",pm_petradecost2_Mp_fin,pm_pvp,budget.m,Mport) - tmp <- mbind(tmp,setNames(cost, "Import Fuel costs|Oil (billion US$2005/yr)")) + tmp <- mbind(tmp,setNames(cost, "Import Fuel costs|Oil (billion US$2017/yr)")) ###### Import fuel costs|Uranium cost<- cost_Mport("peur",pm_petradecost2_Mp_fin,pm_pvp,budget.m,Mport) - tmp <- mbind(tmp,setNames(cost, "Import Fuel costs|Uranium (billion US$2005/yr)")) + tmp <- mbind(tmp,setNames(cost, "Import Fuel costs|Uranium (billion US$2017/yr)")) ###### Import fuel costs|Pebiolc cost<- cost_Mport("pebiolc",pm_petradecost2_Mp_fin,pm_pvp,budget.m,Mport) - tmp <- mbind(tmp,setNames(cost, "Import Fuel costs|Biomass (billion US$2005/yr)")) + tmp <- mbind(tmp,setNames(cost, "Import Fuel costs|Biomass (billion US$2017/yr)")) ###### Export Fuel Costs|Coal cost <- output[regi_on_gdx,,"Res|Average Supply Costs|Coal ($/GJ)"] * Xport[,,"pecoal"] * pm_conv_TWa_EJ - tmp <- mbind(tmp,setNames(cost, "Export Fuel costs|Coal (billion US$2005/yr)")) + tmp <- mbind(tmp,setNames(cost, "Export Fuel costs|Coal (billion US$2017/yr)")) ###### Export Fuel Costs|Gas cost <- output[regi_on_gdx,,"Res|Average Supply Costs|Gas ($/GJ)"] * Xport[,,"pegas"] * pm_conv_TWa_EJ - tmp <- mbind(tmp,setNames(cost, "Export Fuel costs|Gas (billion US$2005/yr)")) + tmp <- mbind(tmp,setNames(cost, "Export Fuel costs|Gas (billion US$2017/yr)")) ###### Export Fuel Costs|Oil cost <- output[regi_on_gdx,,"Res|Average Supply Costs|Oil ($/GJ)"] * Xport[,,"peoil"] * pm_conv_TWa_EJ - tmp <- mbind(tmp,setNames(cost, "Export Fuel costs|Oil (billion US$2005/yr)")) + tmp <- mbind(tmp,setNames(cost, "Export Fuel costs|Oil (billion US$2017/yr)")) ###### Export Fuel Costs|Biomass #cost <- output[regi_on_gdx,,"Res|Average Supply Costs|Biomass ($/GJ)"] * Xport[,,"pebiolc"] - #tmp <- mbind(tmp,setNames(cost, "Export Fuel costs|Biomass (billion US$2005/yr)")) + #tmp <- mbind(tmp,setNames(cost, "Export Fuel costs|Biomass (billion US$2017/yr)")) ###### Export Fuel Costs|Uranium cost <- output[regi_on_gdx,,"Res|Average Supply Costs|Uranium ($/GJ)"] * Xport[,,"peur"] * p_eta_conv[,,"tnrs"] * pm_conv_TWa_EJ - tmp <- mbind(tmp,setNames(cost, "Export Fuel costs|Uranium (billion US$2005/yr)")) + tmp <- mbind(tmp,setNames(cost, "Export Fuel costs|Uranium (billion US$2017/yr)")) ####################################### ########## Energy System costs ######## ####################################### - cost <- (v_costin + v_costom) * 1000 + tmp[,,"Fuel costs for own ESM (billion US$2005/yr)"] - tmp <- mbind(tmp,setNames(cost,"Energy system costs (billion US$2005/yr)")) + cost <- (v_costin + v_costom) * 1000 + tmp[,,"Fuel costs for own ESM (billion US$2017/yr)"] + tmp <- mbind(tmp,setNames(cost,"Energy system costs (billion US$2017/yr)")) ####################################### ########## Energy costs ############### @@ -356,27 +356,27 @@ reportCosts <- function(gdx,output=NULL,regionSubsetList=NULL,t=c(seq(2005,2060, x[setdiff(getRegions(x), c('GLO', names(regionSubsetList))),,] } - price_feeli <- dimSums(output[,,'Price|Final Energy|Industry|Electricity (US$2005/GJ)'], + price_feeli <- dimSums(output[,,'Price|Final Energy|Industry|Electricity (US$2017/GJ)'], dim = 3, na.rm = TRUE) %>% .drop_GLOs() - price_fegai <- dimSums(output[,,'Price|Final Energy|Industry|Gases (US$2005/GJ)'], + price_fegai <- dimSums(output[,,'Price|Final Energy|Industry|Gases (US$2017/GJ)'], dim = 3, na.rm = TRUE) %>% .drop_GLOs() - price_feh2i <- dimSums(output[,,'Price|Final Energy|Industry|Hydrogen (US$2005/GJ)'], + price_feh2i <- dimSums(output[,,'Price|Final Energy|Industry|Hydrogen (US$2017/GJ)'], dim = 3, na.rm = TRUE) %>% .drop_GLOs() - price_fedie <- abs(febalForUe.m[,,"fedie"]/(budget.m+1e-10)) * 1000 / pm_conv_TWa_EJ # "Price|Final Energy|Diesel (US$2005/GJ)") + price_fedie <- abs(febalForUe.m[,,"fedie"]/(budget.m+1e-10)) * 1000 / pm_conv_TWa_EJ # "Price|Final Energy|Diesel (US$2017/GJ)") tmp <- mbind( tmp, - setNames(price_feeli * CDR_FEdemand[,,"feels"] * pm_conv_TWa_EJ, "Energy costs CDR|Electricity (billion US$2005/yr)"), - setNames(price_fedie * CDR_FEdemand[,,"fedie"] * pm_conv_TWa_EJ, "Energy costs CDR|Diesel (billion US$2005/yr)"), + setNames(price_feeli * CDR_FEdemand[,,"feels"] * pm_conv_TWa_EJ, "Energy costs CDR|Electricity (billion US$2017/yr)"), + setNames(price_fedie * CDR_FEdemand[,,"fedie"] * pm_conv_TWa_EJ, "Energy costs CDR|Diesel (billion US$2017/yr)"), setNames((price_fegai * CDR_FEdemand[,,"fegas"] + price_feh2i * CDR_FEdemand[,,"feh2s"]) * pm_conv_TWa_EJ, - "Energy costs CDR|Heat (billion US$2005/yr)"), + "Energy costs CDR|Heat (billion US$2017/yr)"), setNames((price_feeli * CDR_FEdemand[,,"feels"] + price_fedie * CDR_FEdemand[,,"fedie"] + price_fegai * CDR_FEdemand[,,"fegas"] + price_feh2i * CDR_FEdemand[,,"feh2s"]) * pm_conv_TWa_EJ, - "Energy costs CDR (billion US$2005/yr)")) + "Energy costs CDR (billion US$2017/yr)")) ####################################### ########## Total Energy costs ######### @@ -386,154 +386,154 @@ reportCosts <- function(gdx,output=NULL,regionSubsetList=NULL,t=c(seq(2005,2060, cost1 <- op_costs(ei=temapall$all_enty,eo=sety,te=teall2rlf$all_te,e2e=temapall,teall2rlf=teall2rlf,vm_prodE=vm_prodSe,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) cost2 <- op_costs(ei=temapall$all_enty,eo=fety,te=teall2rlf$all_te,e2e=temapall,teall2rlf=teall2rlf,vm_prodE=vm_prodFe,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) cost3 <- op_costs(ei=NULL,eo=NULL,te=tenotransform,e2e=NULL,teall2rlf=teall2rlf,vm_prodE=NULL,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) - tmp <- mbind(tmp,setNames(cost1 + cost2 + cost3 + output[regi_on_gdx,,"Energy Investments|Supply (billion US$2005/yr)"], "Total Energy costs (billion US$2005/yr)")) + tmp <- mbind(tmp,setNames(cost1 + cost2 + cost3 + output[regi_on_gdx,,"Energy Investments|Supply (billion US$2017/yr)"], "Total Energy costs (billion US$2017/yr)")) ##### Electricity cost1 <- op_costs(ei=pe2se$all_enty,eo="seel",te=pe2se$all_te,e2e=pe2se,teall2rlf=teall2rlf,vm_prodE=vm_prodSe,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) cost2 <- op_costs(ei="seel",eo=se2fe$all_enty1,te=se2fe$all_te,e2e=se2fe,teall2rlf=teall2rlf,vm_prodE=vm_prodFe,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) cost3 <- op_costs(ei=NULL,eo=NULL,te=tenotransform,e2e=NULL,teall2rlf=teall2rlf,vm_prodE=NULL,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) - tmp <- mbind(tmp,setNames(cost1 + cost2 + cost3 + output[regi_on_gdx,,"Energy Investments|Electricity (billion US$2005/yr)"], "Total Energy costs|Electricity (billion US$2005/yr)")) + tmp <- mbind(tmp,setNames(cost1 + cost2 + cost3 + output[regi_on_gdx,,"Energy Investments|Electricity (billion US$2017/yr)"], "Total Energy costs|Electricity (billion US$2017/yr)")) ##### Electricity|Fossil cost <- op_costs(ei=petyf,eo="seel",te=pe2se$all_te,e2e=pe2se,teall2rlf=teall2rlf,vm_prodE=vm_prodSe,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) - tmp <- mbind(tmp,setNames(cost + output[regi_on_gdx,,"Energy Investments|Electricity|Fossil (billion US$2005/yr)"], "Total Energy costs|Electricity|Fossil (billion US$2005/yr)")) + tmp <- mbind(tmp,setNames(cost + output[regi_on_gdx,,"Energy Investments|Electricity|Fossil (billion US$2017/yr)"], "Total Energy costs|Electricity|Fossil (billion US$2017/yr)")) ##### Electricity|Non-fossil cost <- op_costs(ei=setdiff(pe2se$all_enty,petyf),eo="seel",te=pe2se$all_te,e2e=pe2se,teall2rlf=teall2rlf,vm_prodE=vm_prodSe,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) - tmp <- mbind(tmp,setNames(cost + output[regi_on_gdx,,"Energy Investments|Electricity|Non-Fossil (billion US$2005/yr)"], "Total Energy costs|Electricity|Non-Fossil (billion US$2005/yr)")) + tmp <- mbind(tmp,setNames(cost + output[regi_on_gdx,,"Energy Investments|Electricity|Non-Fossil (billion US$2017/yr)"], "Total Energy costs|Electricity|Non-Fossil (billion US$2017/yr)")) ##### Electricity|Biomass cost <- op_costs(ei="pebiolc",eo="seel",te=pe2se$all_te,e2e=pe2se,teall2rlf=teall2rlf,vm_prodE=vm_prodSe,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) - tmp <- mbind(tmp,setNames(cost + output[regi_on_gdx,,"Energy Investments|Electricity|Biomass (billion US$2005/yr)"], "Total Energy costs|Electricity|Biomass (billion US$2005/yr)")) + tmp <- mbind(tmp,setNames(cost + output[regi_on_gdx,,"Energy Investments|Electricity|Biomass (billion US$2017/yr)"], "Total Energy costs|Electricity|Biomass (billion US$2017/yr)")) cost <- op_costs(ei="pebiolc",eo="seel",te=teccs,e2e=pe2se,teall2rlf=teall2rlf,vm_prodE=vm_prodSe,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) - tmp <- mbind(tmp,setNames(cost + output[regi_on_gdx,,"Energy Investments|Electricity|Biomass|w/ CC (billion US$2005/yr)"], "Total Energy costs|Electricity|Biomass|w/ CC (billion US$2005/yr)")) + tmp <- mbind(tmp,setNames(cost + output[regi_on_gdx,,"Energy Investments|Electricity|Biomass|w/ CC (billion US$2017/yr)"], "Total Energy costs|Electricity|Biomass|w/ CC (billion US$2017/yr)")) cost <- op_costs(ei="pebiolc",eo="seel",te=tenoccs,e2e=pe2se,teall2rlf=teall2rlf,vm_prodE=vm_prodSe,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) - tmp <- mbind(tmp,setNames(cost + output[regi_on_gdx,,"Energy Investments|Electricity|Biomass|w/o CC (billion US$2005/yr)"], "Total Energy costs|Electricity|Biomass|w/o CC (billion US$2005/yr)")) + tmp <- mbind(tmp,setNames(cost + output[regi_on_gdx,,"Energy Investments|Electricity|Biomass|w/o CC (billion US$2017/yr)"], "Total Energy costs|Electricity|Biomass|w/o CC (billion US$2017/yr)")) ##### Electricity|Coal cost <- op_costs(ei="pecoal",eo="seel",te=pe2se$all_te,e2e=pe2se,teall2rlf=teall2rlf,vm_prodE=vm_prodSe,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) - cost <- cost + output[regi_on_gdx,,"Energy Investments|Electricity|Coal (billion US$2005/yr)"] - tmp <- mbind(tmp,setNames(cost, "Total Energy costs|Electricity|Coal (billion US$2005/yr)")) + cost <- cost + output[regi_on_gdx,,"Energy Investments|Electricity|Coal (billion US$2017/yr)"] + tmp <- mbind(tmp,setNames(cost, "Total Energy costs|Electricity|Coal (billion US$2017/yr)")) cost <- op_costs(ei="pecoal",eo="seel",te=teccs,e2e=pe2se,teall2rlf=teall2rlf,vm_prodE=vm_prodSe,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) - cost <- cost + output[regi_on_gdx,,"Energy Investments|Electricity|Coal|w/ CC (billion US$2005/yr)"] - tmp <- mbind(tmp,setNames(cost, "Total Energy costs|Electricity|Coal|w/ CC (billion US$2005/yr)")) + cost <- cost + output[regi_on_gdx,,"Energy Investments|Electricity|Coal|w/ CC (billion US$2017/yr)"] + tmp <- mbind(tmp,setNames(cost, "Total Energy costs|Electricity|Coal|w/ CC (billion US$2017/yr)")) cost <- op_costs(ei="pecoal",eo="seel",te=tenoccs,e2e=pe2se,teall2rlf=teall2rlf,vm_prodE=vm_prodSe,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) - cost <- cost + output[regi_on_gdx,,"Energy Investments|Electricity|Coal|w/o CC (billion US$2005/yr)"] - tmp <- mbind(tmp,setNames(cost, "Total Energy costs|Electricity|Coal|w/o CC (billion US$2005/yr)")) + cost <- cost + output[regi_on_gdx,,"Energy Investments|Electricity|Coal|w/o CC (billion US$2017/yr)"] + tmp <- mbind(tmp,setNames(cost, "Total Energy costs|Electricity|Coal|w/o CC (billion US$2017/yr)")) ##### Electricity|Gas cost <- op_costs(ei="pegas",eo="seel",te=pe2se$all_te,e2e=pe2se,teall2rlf=teall2rlf,vm_prodE=vm_prodSe,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) - tmp <- mbind(tmp,setNames(cost + output[regi_on_gdx,,"Energy Investments|Electricity|Gas (billion US$2005/yr)"], "Total Energy costs|Electricity|Gas (billion US$2005/yr)")) + tmp <- mbind(tmp,setNames(cost + output[regi_on_gdx,,"Energy Investments|Electricity|Gas (billion US$2017/yr)"], "Total Energy costs|Electricity|Gas (billion US$2017/yr)")) cost <- op_costs(ei="pegas",eo="seel",te=teccs,e2e=pe2se,teall2rlf=teall2rlf,vm_prodE=vm_prodSe,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) - tmp <- mbind(tmp,setNames(cost + output[regi_on_gdx,,"Energy Investments|Electricity|Gas|w/ CC (billion US$2005/yr)"], "Total Energy costs|Electricity|Gas|w/ CC (billion US$2005/yr)")) + tmp <- mbind(tmp,setNames(cost + output[regi_on_gdx,,"Energy Investments|Electricity|Gas|w/ CC (billion US$2017/yr)"], "Total Energy costs|Electricity|Gas|w/ CC (billion US$2017/yr)")) cost <- op_costs(ei="pegas",eo="seel",te=tenoccs,e2e=pe2se,teall2rlf=teall2rlf,vm_prodE=vm_prodSe,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) - tmp <- mbind(tmp,setNames(cost + output[regi_on_gdx,,"Energy Investments|Electricity|Gas|w/o CC (billion US$2005/yr)"], "Total Energy costs|Electricity|Gas|w/o CC (billion US$2005/yr)")) + tmp <- mbind(tmp,setNames(cost + output[regi_on_gdx,,"Energy Investments|Electricity|Gas|w/o CC (billion US$2017/yr)"], "Total Energy costs|Electricity|Gas|w/o CC (billion US$2017/yr)")) ##### Electricity|Oil cost <- op_costs(ei="peoil",eo="seel",te=pe2se$all_te,e2e=pe2se,teall2rlf=teall2rlf,vm_prodE=vm_prodSe,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) - tmp <- mbind(tmp,setNames(cost + output[regi_on_gdx,,"Energy Investments|Electricity|Oil (billion US$2005/yr)"], "Total Energy costs|Electricity|Oil (billion US$2005/yr)")) + tmp <- mbind(tmp,setNames(cost + output[regi_on_gdx,,"Energy Investments|Electricity|Oil (billion US$2017/yr)"], "Total Energy costs|Electricity|Oil (billion US$2017/yr)")) cost <- op_costs(ei="peoil",eo="seel",te=tenoccs,e2e=pe2se,teall2rlf=teall2rlf,vm_prodE=vm_prodSe,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) - tmp <- mbind(tmp,setNames(cost + output[regi_on_gdx,,"Energy Investments|Electricity|Oil|w/o CC (billion US$2005/yr)"], "Total Energy costs|Electricity|Oil|w/o CC (billion US$2005/yr)")) + tmp <- mbind(tmp,setNames(cost + output[regi_on_gdx,,"Energy Investments|Electricity|Oil|w/o CC (billion US$2017/yr)"], "Total Energy costs|Electricity|Oil|w/o CC (billion US$2017/yr)")) ##### Electricity|Nuclear cost <- op_costs(ei="peur",eo="seel",te=pe2se$all_te,e2e=pe2se,teall2rlf=teall2rlf,vm_prodE=vm_prodSe,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) - tmp <- mbind(tmp,setNames(cost + output[regi_on_gdx,,"Energy Investments|Electricity|Nuclear (billion US$2005/yr)"], "Total Energy costs|Electricity|Nuclear (billion US$2005/yr)")) + tmp <- mbind(tmp,setNames(cost + output[regi_on_gdx,,"Energy Investments|Electricity|Nuclear (billion US$2017/yr)"], "Total Energy costs|Electricity|Nuclear (billion US$2017/yr)")) ##### Electricity|Non-biomass renewables cost <- op_costs(ei=setdiff(perenew,pebio),eo="seel",te=pe2se$all_te,e2e=pe2se,teall2rlf=teall2rlf,vm_prodE=vm_prodSe,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) - tmp <- mbind(tmp,setNames(cost + output[regi_on_gdx,,"Energy Investments|Electricity|Non-Bio Re (billion US$2005/yr)"], "Total Energy costs|Electricity|Non-Bio Re (billion US$2005/yr)")) + tmp <- mbind(tmp,setNames(cost + output[regi_on_gdx,,"Energy Investments|Electricity|Non-Bio Re (billion US$2017/yr)"], "Total Energy costs|Electricity|Non-Bio Re (billion US$2017/yr)")) ##### Electricity|Solar cost <- op_costs(ei="pesol",eo="seel",te=pe2se$all_te,e2e=pe2se,teall2rlf=teall2rlf,vm_prodE=vm_prodSe,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) - tmp <- mbind(tmp,setNames(cost + output[regi_on_gdx,,"Energy Investments|Electricity|Solar (billion US$2005/yr)"], "Total Energy costs|Electricity|Solar (billion US$2005/yr)")) + tmp <- mbind(tmp,setNames(cost + output[regi_on_gdx,,"Energy Investments|Electricity|Solar (billion US$2017/yr)"], "Total Energy costs|Electricity|Solar (billion US$2017/yr)")) ##### Electricity|Wind cost <- op_costs(ei="pewin",eo="seel",te=pe2se$all_te,e2e=pe2se,teall2rlf=teall2rlf,vm_prodE=vm_prodSe,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) - tmp <- mbind(tmp,setNames(cost + output[regi_on_gdx,,"Energy Investments|Electricity|Wind (billion US$2005/yr)"], "Total Energy costs|Electricity|Wind (billion US$2005/yr)")) + tmp <- mbind(tmp,setNames(cost + output[regi_on_gdx,,"Energy Investments|Electricity|Wind (billion US$2017/yr)"], "Total Energy costs|Electricity|Wind (billion US$2017/yr)")) ##### Electricity|Hydro cost <- op_costs(ei="pehyd",eo="seel",te=pe2se$all_te,e2e=pe2se,teall2rlf=teall2rlf,vm_prodE=vm_prodSe,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) - tmp <- mbind(tmp,setNames(cost + output[regi_on_gdx,,"Energy Investments|Electricity|Hydro (billion US$2005/yr)"], "Total Energy costs|Electricity|Hydro (billion US$2005/yr)")) + tmp <- mbind(tmp,setNames(cost + output[regi_on_gdx,,"Energy Investments|Electricity|Hydro (billion US$2017/yr)"], "Total Energy costs|Electricity|Hydro (billion US$2017/yr)")) ##### Electricity|Geothermal cost <- op_costs(ei="pegeo",eo="seel",te=pe2se$all_te,e2e=pe2se,teall2rlf=teall2rlf,vm_prodE=vm_prodSe,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) - tmp <- mbind(tmp,setNames(cost + output[regi_on_gdx,,"Energy Investments|Electricity|Geothermal (billion US$2005/yr)"], "Total Energy costs|Electricity|Geothermal (billion US$2005/yr)")) + tmp <- mbind(tmp,setNames(cost + output[regi_on_gdx,,"Energy Investments|Electricity|Geothermal (billion US$2017/yr)"], "Total Energy costs|Electricity|Geothermal (billion US$2017/yr)")) ##### Electricity|Hydrogen if ("h2turb" %in% se2se$all_te) { cost <- op_costs(ei="seh2",eo="seel",te=se2se$all_te,e2e=se2se,teall2rlf=teall2rlf,vm_prodE=vm_prodSe,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) - tmp <- mbind(tmp,setNames(cost + output[regi_on_gdx,,"Energy Investments|Electricity|Hydrogen (billion US$2005/yr)"], "Total Energy costs|Electricity|Hydrogen (billion US$2005/yr)")) + tmp <- mbind(tmp,setNames(cost + output[regi_on_gdx,,"Energy Investments|Electricity|Hydrogen (billion US$2017/yr)"], "Total Energy costs|Electricity|Hydrogen (billion US$2017/yr)")) } ##### Electricity|Storage cost <- op_costs(ei=NULL,eo=NULL,te=stor,e2e=NULL,teall2rlf=teall2rlf,vm_prodE=NULL,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) - tmp <- mbind(tmp,setNames(cost + output[regi_on_gdx,,"Energy Investments|Electricity|Storage (billion US$2005/yr)"], "Total Energy costs|Electricity|Storage (billion US$2005/yr)")) + tmp <- mbind(tmp,setNames(cost + output[regi_on_gdx,,"Energy Investments|Electricity|Storage (billion US$2017/yr)"], "Total Energy costs|Electricity|Storage (billion US$2017/yr)")) ##### Electricity|Grid cost1 <- op_costs(ei=NULL,eo=NULL,te=grid,e2e=NULL,teall2rlf=teall2rlf,vm_prodE=NULL,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) cost2 <- op_costs(ei="seel",eo=se2fe$all_enty1,te=se2fe$all_te,e2e=se2fe,teall2rlf=teall2rlf,vm_prodE=NULL,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) - tmp <- mbind(tmp,setNames(cost1 + cost2 + output[regi_on_gdx,,"Energy Investments|Electricity|Grid (billion US$2005/yr)"], "Total Energy costs|Electricity|Grid (billion US$2005/yr)")) + tmp <- mbind(tmp,setNames(cost1 + cost2 + output[regi_on_gdx,,"Energy Investments|Electricity|Grid (billion US$2017/yr)"], "Total Energy costs|Electricity|Grid (billion US$2017/yr)")) ##### Heat #TiA: including investments, and operation and maintenance, BUT excluding input fuel costs cost_pe2se <- op_costs(ei=pe2se$all_enty,eo="sehe",te=pe2se$all_te,e2e=pe2se,teall2rlf=teall2rlf,vm_prodE=vm_prodSe,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) cost_se2fe <- op_costs(ei="sehe",eo=se2fe$all_enty1,te=se2fe$all_te,e2e=se2fe,teall2rlf=teall2rlf,vm_prodE=vm_prodFe,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) - tmp <- mbind(tmp,setNames(cost_pe2se + cost_se2fe + output[regi_on_gdx,,"Energy Investments|Heat (billion US$2005/yr)"], "Total Energy costs|Heat (billion US$2005/yr)")) + tmp <- mbind(tmp,setNames(cost_pe2se + cost_se2fe + output[regi_on_gdx,,"Energy Investments|Heat (billion US$2017/yr)"], "Total Energy costs|Heat (billion US$2017/yr)")) ##### Hydrogen #TiA: including investments, and operation and maintenance, BUT excluding input fuel costs cost_pe2se <- op_costs(ei=pe2se$all_enty,eo="seh2",te=pe2se$all_te,e2e=pe2se,teall2rlf=teall2rlf,vm_prodE=vm_prodSe,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) cost_se2fe <- op_costs(ei="seh2",eo=se2fe$all_enty1,te=se2fe$all_te,e2e=se2fe,teall2rlf=teall2rlf,vm_prodE=vm_prodFe,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) - tmp <- mbind(tmp,setNames(cost_pe2se + cost_se2fe + output[regi_on_gdx,,"Energy Investments|Hydrogen (billion US$2005/yr)"], "Total Energy costs|Hydrogen (billion US$2005/yr)")) + tmp <- mbind(tmp,setNames(cost_pe2se + cost_se2fe + output[regi_on_gdx,,"Energy Investments|Hydrogen (billion US$2017/yr)"], "Total Energy costs|Hydrogen (billion US$2017/yr)")) ##### Hydrogen|Fossil cost <- op_costs(ei=petyf,eo="seh2",te=pe2se$all_te,e2e=pe2se,teall2rlf=teall2rlf,vm_prodE=vm_prodSe,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) - tmp <- mbind(tmp,setNames(cost + output[regi_on_gdx,,"Energy Investments|Hydrogen|Fossil (billion US$2005/yr)"], "Total Energy costs|Hydrogen|Fossil (billion US$2005/yr)")) + tmp <- mbind(tmp,setNames(cost + output[regi_on_gdx,,"Energy Investments|Hydrogen|Fossil (billion US$2017/yr)"], "Total Energy costs|Hydrogen|Fossil (billion US$2017/yr)")) ##### Hydrogen|RE cost <- op_costs(ei=perenew,eo="seh2",te=pe2se$all_te,e2e=pe2se,teall2rlf=teall2rlf,vm_prodE=vm_prodSe,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) - tmp <- mbind(tmp,setNames(cost + output[regi_on_gdx,,"Energy Investments|Hydrogen|RE (billion US$2005/yr)"], "Total Energy costs|Hydrogen|RE (billion US$2005/yr)")) + tmp <- mbind(tmp,setNames(cost + output[regi_on_gdx,,"Energy Investments|Hydrogen|RE (billion US$2017/yr)"], "Total Energy costs|Hydrogen|RE (billion US$2017/yr)")) ##### Liquids #TiA: including investments, and operation and maintenance, BUT excluding input fuel costs cost_pe2se <- op_costs(ei=pe2se$all_enty,eo=se_Liq,te=pe2se$all_te,e2e=pe2se,teall2rlf=teall2rlf,vm_prodE=vm_prodSe,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) cost_se2fe <- op_costs(ei=se_Liq,eo=se2fe$all_enty1,te=se2fe$all_te,e2e=se2fe,teall2rlf=teall2rlf,vm_prodE=vm_prodFe,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) - tmp <- mbind(tmp,setNames(cost_pe2se + cost_se2fe + output[regi_on_gdx,,"Energy Investments|Liquids (billion US$2005/yr)"], "Total Energy costs|Liquids (billion US$2005/yr)")) + tmp <- mbind(tmp,setNames(cost_pe2se + cost_se2fe + output[regi_on_gdx,,"Energy Investments|Liquids (billion US$2017/yr)"], "Total Energy costs|Liquids (billion US$2017/yr)")) ##### Liquids|Oil Ref costoil <- op_costs(ei="peoil",eo=se_Liq,te=pe2se$all_te,e2e=pe2se,teall2rlf=teall2rlf,vm_prodE=vm_prodSe,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) - tmp <- mbind(tmp,setNames(costoil + output[regi_on_gdx,,"Energy Investments|Liquids|Oil Ref (billion US$2005/yr)"], "Total Energy costs|Liquids|Oil Ref (billion US$2005/yr)")) + tmp <- mbind(tmp,setNames(costoil + output[regi_on_gdx,,"Energy Investments|Liquids|Oil Ref (billion US$2017/yr)"], "Total Energy costs|Liquids|Oil Ref (billion US$2017/yr)")) ##### Liquids|Fossil cost <- op_costs(ei=petyf,eo=se_Liq,te=pe2se$all_te,e2e=pe2se,teall2rlf=teall2rlf,vm_prodE=vm_prodSe,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) - tmp <- mbind(tmp,setNames(cost + output[regi_on_gdx,,"Energy Investments|Liquids|Fossil (billion US$2005/yr)"], "Total Energy costs|Liquids|Fossil (billion US$2005/yr)")) + tmp <- mbind(tmp,setNames(cost + output[regi_on_gdx,,"Energy Investments|Liquids|Fossil (billion US$2017/yr)"], "Total Energy costs|Liquids|Fossil (billion US$2017/yr)")) ##### Liquids|Fossil|w/o oil - tmp <- mbind(tmp,setNames(cost - costoil + output[regi_on_gdx,,"Energy Investments|Liquids|Fossil|w/o oil (billion US$2005/yr)"], "Total Energy costs|Liquids|Fossil|w/o oil (billion US$2005/yr)")) + tmp <- mbind(tmp,setNames(cost - costoil + output[regi_on_gdx,,"Energy Investments|Liquids|Fossil|w/o oil (billion US$2017/yr)"], "Total Energy costs|Liquids|Fossil|w/o oil (billion US$2017/yr)")) ##### Liquids|Bio cost <- op_costs(ei=perenew,eo=se_Liq,te=pe2se$all_te,e2e=pe2se,teall2rlf=teall2rlf,vm_prodE=vm_prodSe,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) - tmp <- mbind(tmp,setNames(cost + output[regi_on_gdx,,"Energy Investments|Liquids|Bio (billion US$2005/yr)"], "Total Energy costs|Liquids|Bio (billion US$2005/yr)")) + tmp <- mbind(tmp,setNames(cost + output[regi_on_gdx,,"Energy Investments|Liquids|Bio (billion US$2017/yr)"], "Total Energy costs|Liquids|Bio (billion US$2017/yr)")) ##### CO2 Trans&Stor cost <- op_costs(ei=ccs2te$all_enty,eo=ccs2te$all_enty1,te=ccs2te$all_te,e2e=ccs2te,teall2rlf=teall2rlf,vm_prodE=NULL,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) - tmp <- mbind(tmp,setNames(cost + output[regi_on_gdx,,"Energy Investments|CO2 Trans&Stor (billion US$2005/yr)"], "Total Energy costs|CO2 Trans&Stor (billion US$2005/yr)")) + tmp <- mbind(tmp,setNames(cost + output[regi_on_gdx,,"Energy Investments|CO2 Trans&Stor (billion US$2017/yr)"], "Total Energy costs|CO2 Trans&Stor (billion US$2017/yr)")) ##### Other - tmp <- mbind(tmp,setNames(tmp[,,"Total Energy costs (billion US$2005/yr)"]- - tmp[,,"Total Energy costs|Electricity (billion US$2005/yr)"]- - tmp[,,"Total Energy costs|Hydrogen (billion US$2005/yr)"]- - tmp[,,"Total Energy costs|Liquids (billion US$2005/yr)"]- - tmp[,,"Total Energy costs|Heat (billion US$2005/yr)"]- - tmp[,,"Total Energy costs|CO2 Trans&Stor (billion US$2005/yr)"], - "Total Energy costs|Other (billion US$2005/yr)")) + tmp <- mbind(tmp,setNames(tmp[,,"Total Energy costs (billion US$2017/yr)"]- + tmp[,,"Total Energy costs|Electricity (billion US$2017/yr)"]- + tmp[,,"Total Energy costs|Hydrogen (billion US$2017/yr)"]- + tmp[,,"Total Energy costs|Liquids (billion US$2017/yr)"]- + tmp[,,"Total Energy costs|Heat (billion US$2017/yr)"]- + tmp[,,"Total Energy costs|CO2 Trans&Stor (billion US$2017/yr)"], + "Total Energy costs|Other (billion US$2017/yr)")) ##################################### ########## O & M costs ############## @@ -545,10 +545,10 @@ reportCosts <- function(gdx,output=NULL,regionSubsetList=NULL,t=c(seq(2005,2060, e2e=temapall ##### Total - tmp <- mbind(tmp,setNames(v_costom * 1000, "OandM costs (billion US$2005/yr)")) + tmp <- mbind(tmp,setNames(v_costom * 1000, "OandM costs (billion US$2017/yr)")) ##### CDR - tmp <- mbind(tmp,setNames(vm_omcosts_cdr * 1000, "OandM costs CDR (billion US$2005/yr)")) + tmp <- mbind(tmp,setNames(vm_omcosts_cdr * 1000, "OandM costs CDR (billion US$2017/yr)")) ##################################### ########## Operational costs ######## @@ -557,45 +557,45 @@ reportCosts <- function(gdx,output=NULL,regionSubsetList=NULL,t=c(seq(2005,2060, ##### Fossils cost1 <- op_costs(ei="pecoal",eo="seel",te=tenoccs,e2e=pe2se,teall2rlf=teall2rlf,vm_prodE=vm_prodSe,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) cost2 <- op_costs_part2_foss(pe="pecoal",se="seel",te=tenoccs,vm_prodSe,pe2se,p_dataeta,vm_costfu_ex,vm_fuelex,sm_tdptwyr2dpgj,pm_conv_TWa_EJ) - tmp <- mbind(tmp,setNames(cost1+cost2, "Operational costs|Electricity|Coal|w/o CC (billion US$2005/yr)")) + tmp <- mbind(tmp,setNames(cost1+cost2, "Operational costs|Electricity|Coal|w/o CC (billion US$2017/yr)")) cost1 <- op_costs(ei="pecoal",eo="seel",te=teccs,e2e=pe2se,teall2rlf=teall2rlf,vm_prodE=vm_prodSe,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) cost2 <- op_costs_part2_foss(pe="pecoal",se="seel",te=teccs,vm_prodSe,pe2se,p_dataeta,vm_costfu_ex,vm_fuelex,sm_tdptwyr2dpgj,pm_conv_TWa_EJ) - tmp <- mbind(tmp,setNames(cost1+cost2, "Operational costs|Electricity|Coal|w/ CC (billion US$2005/yr)")) + tmp <- mbind(tmp,setNames(cost1+cost2, "Operational costs|Electricity|Coal|w/ CC (billion US$2017/yr)")) cost1 <- op_costs(ei="pegas",eo="seel",te=tenoccs,e2e=pe2se,teall2rlf=teall2rlf,vm_prodE=vm_prodSe,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) cost2 <- op_costs_part2_foss(pe="pegas",se="seel",te=tenoccs,vm_prodSe,pe2se,p_dataeta,vm_costfu_ex,vm_fuelex,sm_tdptwyr2dpgj,pm_conv_TWa_EJ) - tmp <- mbind(tmp,setNames(cost1+cost2, "Operational costs|Electricity|Gas|w/o CC (billion US$2005/yr)")) + tmp <- mbind(tmp,setNames(cost1+cost2, "Operational costs|Electricity|Gas|w/o CC (billion US$2017/yr)")) cost1 <- op_costs(ei="pegas",eo="seel",te=teccs,e2e=pe2se,teall2rlf=teall2rlf,vm_prodE=vm_prodSe,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) cost2 <- op_costs_part2_foss(pe="pegas",se="seel",te=teccs,vm_prodSe,pe2se,p_dataeta,vm_costfu_ex,vm_fuelex,sm_tdptwyr2dpgj,pm_conv_TWa_EJ) - tmp <- mbind(tmp,setNames(cost1+cost2, "Operational costs|Electricity|Gas|w/ CC (billion US$2005/yr)")) + tmp <- mbind(tmp,setNames(cost1+cost2, "Operational costs|Electricity|Gas|w/ CC (billion US$2017/yr)")) ##### Biomass price_pebiolc <- pebal.m[,,"pebiolc"] / (budget.m+1e-10) * 1000 / pm_conv_TWa_EJ cost1 <- op_costs(ei="pebiolc",eo="seel",te=tenoccs,e2e=pe2se,teall2rlf=teall2rlf,vm_prodE=vm_prodSe,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) cost2 <- price_pebiolc * op_costs_part2_bio_nuc(pe="pebiolc",se="seel",te=tenoccs,vm_prodSe,pe2se,p_dataeta,pm_conv_TWa_EJ) - tmp <- mbind(tmp,setNames(cost1+cost2, "Operational costs|Electricity|Biomass|w/o CC (billion US$2005/yr)")) + tmp <- mbind(tmp,setNames(cost1+cost2, "Operational costs|Electricity|Biomass|w/o CC (billion US$2017/yr)")) cost1 <- op_costs(ei="pebiolc",eo="seel",te=teccs,e2e=pe2se,teall2rlf=teall2rlf,vm_prodE=vm_prodSe,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) cost2 <- price_pebiolc * op_costs_part2_bio_nuc(pe="pebiolc",se="seel",te=teccs,vm_prodSe,pe2se,p_dataeta,pm_conv_TWa_EJ) - tmp <- mbind(tmp,setNames(cost1+cost2, "Operational costs|Electricity|Biomass|w/ CC (billion US$2005/yr)")) + tmp <- mbind(tmp,setNames(cost1+cost2, "Operational costs|Electricity|Biomass|w/ CC (billion US$2017/yr)")) ##### Nuclear cost1 <- op_costs(ei="peur",eo="seel",te="tnrs",e2e=pe2se,teall2rlf=teall2rlf,vm_prodE=vm_prodSe,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) cost2 <- op_costs_part2_bio_nuc(pe="peur",se="seel",te="tnrs",vm_prodSe,pe2se,p_dataeta,pm_conv_TWa_EJ) - tmp <- mbind(tmp,setNames(cost1*cost2, "Operational costs|Electricity|Nuclear (billion US$2005/yr)")) + tmp <- mbind(tmp,setNames(cost1*cost2, "Operational costs|Electricity|Nuclear (billion US$2017/yr)")) ##### Renewables cost1 <- op_costs(ei=setdiff(perenew,pebio),eo="seel",te=tenoccs,e2e=pe2se,teall2rlf=teall2rlf,vm_prodE=vm_prodSe,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) - tmp <- mbind(tmp,setNames(cost1, "Operational costs|Electricity|Non-Bio Re (billion US$2005/yr)")) + tmp <- mbind(tmp,setNames(cost1, "Operational costs|Electricity|Non-Bio Re (billion US$2017/yr)")) cost1 <- op_costs(ei="pesol",eo="seel",te=tenoccs,e2e=pe2se,teall2rlf=teall2rlf,vm_prodE=vm_prodSe,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) - tmp <- mbind(tmp,setNames(cost1, "Operational costs|Electricity|Solar (billion US$2005/yr)")) + tmp <- mbind(tmp,setNames(cost1, "Operational costs|Electricity|Solar (billion US$2017/yr)")) cost1 <- op_costs(ei="pewin",eo="seel",te=tenoccs,e2e=pe2se,teall2rlf=teall2rlf,vm_prodE=vm_prodSe,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) - tmp <- mbind(tmp,setNames(cost1, "Operational costs|Electricity|Wind (billion US$2005/yr)")) + tmp <- mbind(tmp,setNames(cost1, "Operational costs|Electricity|Wind (billion US$2017/yr)")) # add global values tmp <- mbind(tmp, dimSums(tmp,dim=1)) diff --git a/R/reportCrossVariables.R b/R/reportCrossVariables.R index 08e28326..5807eb24 100644 --- a/R/reportCrossVariables.R +++ b/R/reportCrossVariables.R @@ -83,8 +83,8 @@ reportCrossVariables <- function(gdx, output = NULL, regionSubsetList = NULL, tmp <- mbind(tmp,setNames( - output[r,,"Energy Investments (billion US$2005/yr)"] - -output[r,,"Energy Investments|Electricity (billion US$2005/yr)"],"Energy Investments|Non-Electricity (billion US$2005/yr)")) + output[r,,"Energy Investments (billion US$2017/yr)"] + -output[r,,"Energy Investments|Electricity (billion US$2017/yr)"],"Energy Investments|Non-Electricity (billion US$2017/yr)")) # gas capacity factor tmp <- mbind(tmp,setNames( output[r,,"SE|Electricity|Gas (EJ/yr)"] / output[r,,"Cap|Electricity|Gas (GW)"] / TWa_2_EJ * 1000 * 100, @@ -142,18 +142,18 @@ reportCrossVariables <- function(gdx, output = NULL, regionSubsetList = NULL, setNames( output[,,"FE (EJ/yr)"] * 1000 - / output[,,"GDP|MER (billion US$2005/yr)"], - "Intensity|GDP|Final Energy (MJ/US$2005)"), + / output[,,"GDP|MER (billion US$2017/yr)"], + "Intensity|GDP|Final Energy (MJ/US$2017)"), setNames( - output[,,"GDP|MER (billion US$2005/yr)"] + output[,,"GDP|MER (billion US$2017/yr)"] / output[,,"FE (EJ/yr)"], - "Productivity|GDP|MER|Final Energy (US$2005/GJ)"), + "Productivity|GDP|MER|Final Energy (US$2017/GJ)"), setNames( - output[,,"GDP|PPP (billion US$2005/yr)"] + output[,,"GDP|PPP (billion US$2017/yr)"] / output[,,"FE (EJ/yr)"], - "Productivity|GDP|PPP|Final Energy (US$2005/GJ)"), + "Productivity|GDP|PPP|Final Energy (US$2017/GJ)"), setNames( output[,,"Emi|CO2|Energy and Industrial Processes (Mt CO2/yr)"] @@ -167,18 +167,18 @@ reportCrossVariables <- function(gdx, output = NULL, regionSubsetList = NULL, setNames( output[,,"Emi|GHG (Mt CO2eq/yr)"] - / output[,,"GDP|MER (billion US$2005/yr)"], - "Intensity|GDP|GHG (Mt CO2-equiv/US$2005)"), + / output[,,"GDP|MER (billion US$2017/yr)"], + "Intensity|GDP|GHG (Mt CO2-equiv/US$2017)"), setNames( - output[,,"GDP|MER (billion US$2005/yr)"] + output[,,"GDP|MER (billion US$2017/yr)"] / output[,,"Population (million)"], - "GDP|per capita|MER (kUS$2005/per capita)"), + "GDP|per capita|MER (kUS$2017/per capita)"), setNames( - output[,,"GDP|PPP (billion US$2005/yr)"] + output[,,"GDP|PPP (billion US$2017/yr)"] / output[,,"Population (million)"], - "GDP|per capita|PPP (kUS$2005/per capita)"), + "GDP|per capita|PPP (kUS$2017/per capita)"), setNames( output[,,"Welfare|Real and undiscounted|Yearly (arbitrary unit/yr)"] @@ -231,9 +231,9 @@ reportCrossVariables <- function(gdx, output = NULL, regionSubsetList = NULL, # Energy expenditures tmp <- mbind(tmp,setNames( - output[,,"FE|Transport|Liquids (EJ/yr)"] * output[,,"Price|Final Energy|Transport|Liquids (US$2005/GJ)"] + - output[,,"FE|Transport|Hydrogen (EJ/yr)"] * output[,,"Price|Final Energy|Transport|Hydrogen (US$2005/GJ)"] + - output[,,"FE|Transport|Electricity (EJ/yr)"] * output[,,"Price|Final Energy|Transport|Electricity (US$2005/GJ)"], + output[,,"FE|Transport|Liquids (EJ/yr)"] * output[,,"Price|Final Energy|Transport|Liquids (US$2017/GJ)"] + + output[,,"FE|Transport|Hydrogen (EJ/yr)"] * output[,,"Price|Final Energy|Transport|Hydrogen (US$2017/GJ)"] + + output[,,"FE|Transport|Electricity (EJ/yr)"] * output[,,"Price|Final Energy|Transport|Electricity (US$2017/GJ)"], "Expenditure|Transport|Fuel (billion $US/yr)")) # calculate intensities growth @@ -245,14 +245,14 @@ reportCrossVariables <- function(gdx, output = NULL, regionSubsetList = NULL, int_gr[,t,"Intensity Growth|GDP|Final Energy (% pa)"] <- ( ( - (tmp[,t,"Intensity|GDP|Final Energy (MJ/US$2005)"] / setYears(tmp[,(which(getYears(tmp)==t)-1),"Intensity|GDP|Final Energy (MJ/US$2005)"],t)) + (tmp[,t,"Intensity|GDP|Final Energy (MJ/US$2017)"] / setYears(tmp[,(which(getYears(tmp)==t)-1),"Intensity|GDP|Final Energy (MJ/US$2017)"],t)) ^ (1 / ( getYears(tmp[,t,],as.integer=TRUE) - getYears(tmp[,(which(getYears(tmp)==t)-1),],as.integer=TRUE) ) ) ) - 1 ) * 100 int_gr[,t,"Intensity Growth|GDP|Final Energy to 2005 (% pa)"] <- ( ( - (tmp[,t,"Intensity|GDP|Final Energy (MJ/US$2005)"] / setYears(tmp[,2005,"Intensity|GDP|Final Energy (MJ/US$2005)"],t)) + (tmp[,t,"Intensity|GDP|Final Energy (MJ/US$2017)"] / setYears(tmp[,2005,"Intensity|GDP|Final Energy (MJ/US$2017)"],t)) ^ (1 / ( getYears(tmp[,t,],as.integer=TRUE) - 2005 ) ) ) - 1 ) * 100 @@ -273,14 +273,14 @@ reportCrossVariables <- function(gdx, output = NULL, regionSubsetList = NULL, int_gr[,t,"Intensity Growth|GDP|CO2-equiv (% pa)"] <- ( ( - (tmp[,t,"Intensity|GDP|GHG (Mt CO2-equiv/US$2005)"] / setYears(tmp[,(which(getYears(tmp)==t)-1),"Intensity|GDP|GHG (Mt CO2-equiv/US$2005)"],t)) + (tmp[,t,"Intensity|GDP|GHG (Mt CO2-equiv/US$2017)"] / setYears(tmp[,(which(getYears(tmp)==t)-1),"Intensity|GDP|GHG (Mt CO2-equiv/US$2017)"],t)) ^ (1 / ( getYears(tmp[,t,],as.integer=TRUE) - getYears(tmp[,(which(getYears(tmp)==t)-1),],as.integer=TRUE) ) ) ) - 1 ) * 100 int_gr[,t,"Intensity Growth|GDP|CO2-equiv to 2005 (% pa)"] <- ( ( - (tmp[,t,"Intensity|GDP|GHG (Mt CO2-equiv/US$2005)"] / setYears(tmp[,2005,"Intensity|GDP|GHG (Mt CO2-equiv/US$2005)"],t)) + (tmp[,t,"Intensity|GDP|GHG (Mt CO2-equiv/US$2017)"] / setYears(tmp[,2005,"Intensity|GDP|GHG (Mt CO2-equiv/US$2017)"],t)) ^ (1 / ( getYears(tmp[,t,],as.integer=TRUE) - 2005 ) ) ) - 1 ) * 100 @@ -334,7 +334,7 @@ reportCrossVariables <- function(gdx, output = NULL, regionSubsetList = NULL, tribble( ~unit, ~new.unit, ~factor, 'Mt/yr', 't/yr', 1, - 'billion US$2005/yr', 'US$2005/yr', 1e-3), + 'billion US$2017/yr', 'US$2017/yr', 1e-3), 'unit' ) %>% @@ -361,7 +361,7 @@ reportCrossVariables <- function(gdx, output = NULL, regionSubsetList = NULL, select(-'Cell') %>% # join with population numbers left_join( - output[,,'GDP|PPP (billion US$2005/yr)'] %>% + output[,,'GDP|PPP (billion US$2017/yr)'] %>% as.data.frame() %>% as_tibble() %>% select('Region', 'Year', population = 'Value'), @@ -374,8 +374,8 @@ reportCrossVariables <- function(gdx, output = NULL, regionSubsetList = NULL, tribble( ~unit, ~new.unit, ~factor, # Mt/$bn * 1e6 t/Mt * 1e-3 $bn/$m = t/$m - 'Mt/yr', 't/million US$2005', 1e3, - 'billion US$2005/yr', 'US$2005/US$2005', 1 # $bn/$bn = $/$ + 'Mt/yr', 't/million US$2017', 1e3, + 'billion US$2017/yr', 'US$2017/US$2017', 1 # $bn/$bn = $/$ ), 'unit' diff --git a/R/reportEnergyInvestment.R b/R/reportEnergyInvestment.R index d77d1cdd..f7ca7884 100644 --- a/R/reportEnergyInvestment.R +++ b/R/reportEnergyInvestment.R @@ -98,115 +98,115 @@ reportEnergyInvestment <- function(gdx, regionSubsetList = NULL, t = c(seq(2005, # build reporting tmp <- NULL - tmp <- mbind(tmp, setNames(inv_se(ie = petyf, oe = "seel", pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Electricity|Fossil (billion US$2005/yr)")) - tmp <- mbind(tmp, setNames(inv_se(ie = "pecoal", oe = "seel", pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Electricity|+|Coal (billion US$2005/yr)")) - tmp <- mbind(tmp, setNames(inv_se(ie = "pecoal", te = teccs, oe = "seel", pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Electricity|Coal|+|w/ CC (billion US$2005/yr)")) - tmp <- mbind(tmp, setNames(inv_se(ie = "pecoal", te = tenoccs, oe = "seel", pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Electricity|Coal|+|w/o CC (billion US$2005/yr)")) - tmp <- mbind(tmp, setNames(inv_se(ie = "pegas", oe = "seel", pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Electricity|+|Gas (billion US$2005/yr)")) - tmp <- mbind(tmp, setNames(inv_se(ie = "pegas", te = teccs, oe = "seel", pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Electricity|Gas|+|w/ CC (billion US$2005/yr)")) - tmp <- mbind(tmp, setNames(inv_se(ie = "pegas", te = tenoccs, oe = "seel", pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Electricity|Gas|+|w/o CC (billion US$2005/yr)")) + tmp <- mbind(tmp, setNames(inv_se(ie = petyf, oe = "seel", pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Electricity|Fossil (billion US$2017/yr)")) + tmp <- mbind(tmp, setNames(inv_se(ie = "pecoal", oe = "seel", pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Electricity|+|Coal (billion US$2017/yr)")) + tmp <- mbind(tmp, setNames(inv_se(ie = "pecoal", te = teccs, oe = "seel", pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Electricity|Coal|+|w/ CC (billion US$2017/yr)")) + tmp <- mbind(tmp, setNames(inv_se(ie = "pecoal", te = tenoccs, oe = "seel", pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Electricity|Coal|+|w/o CC (billion US$2017/yr)")) + tmp <- mbind(tmp, setNames(inv_se(ie = "pegas", oe = "seel", pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Electricity|+|Gas (billion US$2017/yr)")) + tmp <- mbind(tmp, setNames(inv_se(ie = "pegas", te = teccs, oe = "seel", pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Electricity|Gas|+|w/ CC (billion US$2017/yr)")) + tmp <- mbind(tmp, setNames(inv_se(ie = "pegas", te = tenoccs, oe = "seel", pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Electricity|Gas|+|w/o CC (billion US$2017/yr)")) if ("h2turb" %in% all_te) { - tmp <- mbind(tmp, setNames(inv_se(ie = "seh2", oe = "seel", se2se, adjte, v_directteinv, v_adjustteinv, te = se2se$all_te), "Energy Investments|Electricity|+|Hydrogen (billion US$2005/yr)")) + tmp <- mbind(tmp, setNames(inv_se(ie = "seh2", oe = "seel", se2se, adjte, v_directteinv, v_adjustteinv, te = se2se$all_te), "Energy Investments|Electricity|+|Hydrogen (billion US$2017/yr)")) } - tmp <- mbind(tmp, setNames(inv_se(ie = "peoil", oe = "seel", pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Electricity|+|Oil (billion US$2005/yr)")) - tmp <- mbind(tmp, setNames(inv_se(ie = "peoil", te = tenoccs, oe = "seel", pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Electricity|Oil|+|w/o CC (billion US$2005/yr)")) - tmp <- mbind(tmp, setNames(inv_se(ie = "peoil", te = teccs, oe = "seel", pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Electricity|Oil|+|w/ CC (billion US$2005/yr)")) - tmp <- mbind(tmp, setNames(inv_se(ie = "pebiolc", oe = "seel", pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Electricity|+|Biomass (billion US$2005/yr)")) - tmp <- mbind(tmp, setNames(inv_se(ie = "pebiolc", te = teccs, oe = "seel", pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Electricity|Biomass|+|w/ CC (billion US$2005/yr)")) - tmp <- mbind(tmp, setNames(inv_se(ie = "pebiolc", te = tenoccs, oe = "seel", pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Electricity|Biomass|+|w/o CC (billion US$2005/yr)")) - tmp <- mbind(tmp, setNames(inv_se(ie = "peur", oe = "seel", pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Electricity|+|Nuclear (billion US$2005/yr)")) - tmp <- mbind(tmp, setNames(inv_se(ie = "pesol", oe = "seel", pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Electricity|+|Solar (billion US$2005/yr)")) + tmp <- mbind(tmp, setNames(inv_se(ie = "peoil", oe = "seel", pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Electricity|+|Oil (billion US$2017/yr)")) + tmp <- mbind(tmp, setNames(inv_se(ie = "peoil", te = tenoccs, oe = "seel", pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Electricity|Oil|+|w/o CC (billion US$2017/yr)")) + tmp <- mbind(tmp, setNames(inv_se(ie = "peoil", te = teccs, oe = "seel", pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Electricity|Oil|+|w/ CC (billion US$2017/yr)")) + tmp <- mbind(tmp, setNames(inv_se(ie = "pebiolc", oe = "seel", pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Electricity|+|Biomass (billion US$2017/yr)")) + tmp <- mbind(tmp, setNames(inv_se(ie = "pebiolc", te = teccs, oe = "seel", pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Electricity|Biomass|+|w/ CC (billion US$2017/yr)")) + tmp <- mbind(tmp, setNames(inv_se(ie = "pebiolc", te = tenoccs, oe = "seel", pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Electricity|Biomass|+|w/o CC (billion US$2017/yr)")) + tmp <- mbind(tmp, setNames(inv_se(ie = "peur", oe = "seel", pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Electricity|+|Nuclear (billion US$2017/yr)")) + tmp <- mbind(tmp, setNames(inv_se(ie = "pesol", oe = "seel", pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Electricity|+|Solar (billion US$2017/yr)")) if ("windoff" %in% te) { - tmp <- mbind(tmp, setNames(inv_se(ie = "pewin", oe = "seel", pe2se, adjte, v_directteinv, v_adjustteinv, te="wind"), "Energy Investments|Electricity|Wind|+|Onshore (billion US$2005/yr)")) - tmp <- mbind(tmp, setNames(inv_se(ie = "pewin", oe = "seel", pe2se, adjte, v_directteinv, v_adjustteinv, te="windoff"), "Energy Investments|Electricity|Wind|+|Offshore (billion US$2005/yr)")) + tmp <- mbind(tmp, setNames(inv_se(ie = "pewin", oe = "seel", pe2se, adjte, v_directteinv, v_adjustteinv, te="wind"), "Energy Investments|Electricity|Wind|+|Onshore (billion US$2017/yr)")) + tmp <- mbind(tmp, setNames(inv_se(ie = "pewin", oe = "seel", pe2se, adjte, v_directteinv, v_adjustteinv, te="windoff"), "Energy Investments|Electricity|Wind|+|Offshore (billion US$2017/yr)")) } - tmp <- mbind(tmp, setNames(inv_se(ie = "pewin", oe = "seel", pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Electricity|+|Wind (billion US$2005/yr)")) - tmp <- mbind(tmp, setNames(inv_se(ie = "pehyd", oe = "seel", pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Electricity|+|Hydro (billion US$2005/yr)")) - tmp <- mbind(tmp, setNames(inv_se(ie = "pegeo", oe = "seel", pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Electricity|+|Geothermal (billion US$2005/yr)")) - tmp <- mbind(tmp, setNames(inv_se(ie = NULL, oe = NULL, stor, adjte, v_directteinv, v_adjustteinv, te = all_te), "Energy Investments|Electricity|+|Storage (billion US$2005/yr)")) - tmp <- mbind(tmp, setNames(inv_se(ie = NULL, oe = NULL, c("tdels", "tdelt", grid), adjte, v_directteinv, v_adjustteinv, te = all_te), "Energy Investments|Electricity|+|Grid (billion US$2005/yr)")) + tmp <- mbind(tmp, setNames(inv_se(ie = "pewin", oe = "seel", pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Electricity|+|Wind (billion US$2017/yr)")) + tmp <- mbind(tmp, setNames(inv_se(ie = "pehyd", oe = "seel", pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Electricity|+|Hydro (billion US$2017/yr)")) + tmp <- mbind(tmp, setNames(inv_se(ie = "pegeo", oe = "seel", pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Electricity|+|Geothermal (billion US$2017/yr)")) + tmp <- mbind(tmp, setNames(inv_se(ie = NULL, oe = NULL, stor, adjte, v_directteinv, v_adjustteinv, te = all_te), "Energy Investments|Electricity|+|Storage (billion US$2017/yr)")) + tmp <- mbind(tmp, setNames(inv_se(ie = NULL, oe = NULL, c("tdels", "tdelt", grid), adjte, v_directteinv, v_adjustteinv, te = all_te), "Energy Investments|Electricity|+|Grid (billion US$2017/yr)")) # split out the amount of "normal" grid, the additional grid/charger investments due to electric vehicles, and the additional grid investments needed for better pooling of VRE. For BEVs, the assumption is to only take the share of tdelt costs that are higher than the tdels costs - tmp <- mbind(tmp, setNames(inv_se(ie = NULL, oe = NULL, c("tdelt"), adjte, v_directteinv, v_adjustteinv, te = all_te) * (costRatioTdelt2Tdels - 1)/costRatioTdelt2Tdels, "Energy Investments|Electricity|Grid|+|BEV Chargers (billion US$2005/yr)")) + tmp <- mbind(tmp, setNames(inv_se(ie = NULL, oe = NULL, c("tdelt"), adjte, v_directteinv, v_adjustteinv, te = all_te) * (costRatioTdelt2Tdels - 1)/costRatioTdelt2Tdels, "Energy Investments|Electricity|Grid|+|BEV Chargers (billion US$2017/yr)")) tmp <- mbind(tmp, setNames(inv_se(ie = NULL, oe = NULL, c("tdels"), adjte, v_directteinv, v_adjustteinv, te = all_te) - + inv_se(ie = NULL, oe = NULL, c("tdelt"), adjte, v_directteinv, v_adjustteinv, te = all_te) * 1/costRatioTdelt2Tdels, "Energy Investments|Electricity|Grid|+|Normal (billion US$2005/yr)")) - tmp <- mbind(tmp, setNames(inv_se(ie = NULL, oe = NULL, c(grid), adjte, v_directteinv, v_adjustteinv, te = all_te), "Energy Investments|Electricity|Grid|+|VRE support (billion US$2005/yr)")) + + inv_se(ie = NULL, oe = NULL, c("tdelt"), adjte, v_directteinv, v_adjustteinv, te = all_te) * 1/costRatioTdelt2Tdels, "Energy Investments|Electricity|Grid|+|Normal (billion US$2017/yr)")) + tmp <- mbind(tmp, setNames(inv_se(ie = NULL, oe = NULL, c(grid), adjte, v_directteinv, v_adjustteinv, te = all_te), "Energy Investments|Electricity|Grid|+|VRE support (billion US$2017/yr)")) - tmp <- mbind(tmp, setNames(inv_se(ie = pe2se$all_enty[!(pe2se$all_enty %in% petyf)], oe = "seel", pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Electricity|Non-Fossil (billion US$2005/yr)")) - tmp <- mbind(tmp, setNames(inv_se(ie = pe2se$all_enty[which(pe2se$all_enty %in% perenew)][!(pe2se$all_enty[which(pe2se$all_enty %in% perenew)] %in% pebio)], oe = "seel", pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Electricity|Non-Bio Re (billion US$2005/yr)")) + tmp <- mbind(tmp, setNames(inv_se(ie = pe2se$all_enty[!(pe2se$all_enty %in% petyf)], oe = "seel", pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Electricity|Non-Fossil (billion US$2017/yr)")) + tmp <- mbind(tmp, setNames(inv_se(ie = pe2se$all_enty[which(pe2se$all_enty %in% perenew)][!(pe2se$all_enty[which(pe2se$all_enty %in% perenew)] %in% pebio)], oe = "seel", pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Electricity|Non-Bio Re (billion US$2017/yr)")) tmp <- mbind(tmp, setNames((inv_se(ie = pe2se$all_enty, oe = "seel", pe2se, adjte, v_directteinv, v_adjustteinv) + inv_se(ie = se2se$all_enty, oe = "seel", se2se, adjte, v_directteinv, v_adjustteinv, te = se2se$all_te) - + inv_se(ie = NULL, oe = NULL, c("tdels", "tdelt", tenotransform), adjte, v_directteinv, v_adjustteinv, te = all_te)), "Energy Investments|Electricity (billion US$2005/yr)")) + + inv_se(ie = NULL, oe = NULL, c("tdels", "tdelt", tenotransform), adjte, v_directteinv, v_adjustteinv, te = all_te)), "Energy Investments|Electricity (billion US$2017/yr)")) tmp <- mbind(tmp, setNames(inv_se(ie = pe2se$all_enty, oe = "seh2", pe2se, adjte, v_directteinv, v_adjustteinv) + inv_se(ie = "seel", oe = "seh2", se2se, adjte, v_directteinv, v_adjustteinv, te = se2se$all_te) - + inv_se(ie = "seh2", oe = se2fe$all_enty1, se2fe, adjte, v_directteinv, v_adjustteinv, te = se2fe$all_te), "Energy Investments|Hydrogen (billion US$2005/yr)")) + + inv_se(ie = "seh2", oe = se2fe$all_enty1, se2fe, adjte, v_directteinv, v_adjustteinv, te = se2fe$all_te), "Energy Investments|Hydrogen (billion US$2017/yr)")) - tmp <- mbind(tmp, setNames(inv_se(ie = pe2se$all_enty, oe = "seh2", pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Hydrogen|PE (billion US$2005/yr)")) - tmp <- mbind(tmp, setNames(inv_se(ie = "seel", oe = "seh2", se2se, adjte, v_directteinv, v_adjustteinv, te = se2se$all_te), "Energy Investments|Hydrogen|se2se (billion US$2005/yr)")) - tmp <- mbind(tmp, setNames( inv_se(ie = "seh2", oe = se2fe$all_enty1, se2fe, adjte, v_directteinv, v_adjustteinv, te = se2fe$all_te), "Energy Investments|Hydrogen|se2fe (billion US$2005/yr)")) + tmp <- mbind(tmp, setNames(inv_se(ie = pe2se$all_enty, oe = "seh2", pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Hydrogen|PE (billion US$2017/yr)")) + tmp <- mbind(tmp, setNames(inv_se(ie = "seel", oe = "seh2", se2se, adjte, v_directteinv, v_adjustteinv, te = se2se$all_te), "Energy Investments|Hydrogen|se2se (billion US$2017/yr)")) + tmp <- mbind(tmp, setNames( inv_se(ie = "seh2", oe = se2fe$all_enty1, se2fe, adjte, v_directteinv, v_adjustteinv, te = se2fe$all_te), "Energy Investments|Hydrogen|se2fe (billion US$2017/yr)")) - tmp <- mbind(tmp, setNames(inv_se(ie = petyf, oe = "seh2", pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Hydrogen|+|Fossil (billion US$2005/yr)")) - tmp <- mbind(tmp, setNames(inv_se(ie = perenew, oe = "seh2", pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Hydrogen|+|RE (billion US$2005/yr)")) - tmp <- mbind(tmp, setNames(inv_se(ie = pebio, oe = "seh2", pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Hydrogen|Bio (billion US$2005/yr)")) - tmp <- mbind(tmp, setNames(inv_se(ie = "seel", oe = "seh2", se2se, adjte, v_directteinv, v_adjustteinv, te = se2se$all_te), "Energy Investments|Hydrogen|+|Electrolysis (billion US$2005/yr)")) - tmp <- mbind(tmp, setNames(inv_se(ie = "seh2", oe = se2fe$all_enty1, se2fe, adjte, v_directteinv, v_adjustteinv, te = se2fe$all_te), "Energy Investments|Hydrogen|+|Transmission and Distribution (billion US$2005/yr)")) + tmp <- mbind(tmp, setNames(inv_se(ie = petyf, oe = "seh2", pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Hydrogen|+|Fossil (billion US$2017/yr)")) + tmp <- mbind(tmp, setNames(inv_se(ie = perenew, oe = "seh2", pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Hydrogen|+|RE (billion US$2017/yr)")) + tmp <- mbind(tmp, setNames(inv_se(ie = pebio, oe = "seh2", pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Hydrogen|Bio (billion US$2017/yr)")) + tmp <- mbind(tmp, setNames(inv_se(ie = "seel", oe = "seh2", se2se, adjte, v_directteinv, v_adjustteinv, te = se2se$all_te), "Energy Investments|Hydrogen|+|Electrolysis (billion US$2017/yr)")) + tmp <- mbind(tmp, setNames(inv_se(ie = "seh2", oe = se2fe$all_enty1, se2fe, adjte, v_directteinv, v_adjustteinv, te = se2fe$all_te), "Energy Investments|Hydrogen|+|Transmission and Distribution (billion US$2017/yr)")) # Liquids tmp <- mbind(tmp, setNames((inv_se(ie = pe2se$all_enty, oe = se_Liq, pe2se, adjte, v_directteinv, v_adjustteinv) - + inv_se(ie = se2se$all_enty, oe = se_Liq, se2se, adjte, v_directteinv, v_adjustteinv, te = se2se$all_te) ), "Energy Investments|Liquids (billion US$2005/yr)")) - tmp <- mbind(tmp, setNames(inv_se(ie = "peoil", oe = se_Liq, pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Liquids|Oil Ref (billion US$2005/yr)")) - tmp <- mbind(tmp, setNames(inv_se(ie = petyf, oe = se_Liq, pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Liquids|+|Fossil (billion US$2005/yr)")) + + inv_se(ie = se2se$all_enty, oe = se_Liq, se2se, adjte, v_directteinv, v_adjustteinv, te = se2se$all_te) ), "Energy Investments|Liquids (billion US$2017/yr)")) + tmp <- mbind(tmp, setNames(inv_se(ie = "peoil", oe = se_Liq, pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Liquids|Oil Ref (billion US$2017/yr)")) + tmp <- mbind(tmp, setNames(inv_se(ie = petyf, oe = se_Liq, pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Liquids|+|Fossil (billion US$2017/yr)")) tmp <- mbind(tmp, setNames(inv_se(ie = "pecoal", oe = se_Liq, pe2se, adjte, v_directteinv, v_adjustteinv) - + inv_se(ie = "pegas", oe = se_Liq, pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Liquids|Fossil|w/o oil (billion US$2005/yr)")) - tmp <- mbind(tmp, setNames(inv_se(ie = pebio, oe = se_Liq, pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Liquids|+|Bio (billion US$2005/yr)")) - tmp <- mbind(tmp, setNames(inv_se(ie = "seh2", oe = se_Liq, se2se, adjte, v_directteinv, v_adjustteinv, te = se2se$all_te), "Energy Investments|Liquids|+|Hydrogen (billion US$2005/yr)")) - tmp <- mbind(tmp, setNames(inv_se(ie = se_Liq, oe = se2fe$all_enty1, se2fe, adjte, v_directteinv, v_adjustteinv, te = se2fe$all_te), "Energy Investments|Liquids|Transport and Distribution including gas stations (billion US$2005/yr)")) + + inv_se(ie = "pegas", oe = se_Liq, pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Liquids|Fossil|w/o oil (billion US$2017/yr)")) + tmp <- mbind(tmp, setNames(inv_se(ie = pebio, oe = se_Liq, pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Liquids|+|Bio (billion US$2017/yr)")) + tmp <- mbind(tmp, setNames(inv_se(ie = "seh2", oe = se_Liq, se2se, adjte, v_directteinv, v_adjustteinv, te = se2se$all_te), "Energy Investments|Liquids|+|Hydrogen (billion US$2017/yr)")) + tmp <- mbind(tmp, setNames(inv_se(ie = se_Liq, oe = se2fe$all_enty1, se2fe, adjte, v_directteinv, v_adjustteinv, te = se2fe$all_te), "Energy Investments|Liquids|Transport and Distribution including gas stations (billion US$2017/yr)")) tmp <- mbind(tmp, setNames((inv_se(ie = pe2se$all_enty, oe = se_Liq, pe2se, adjte, v_directteinv, v_adjustteinv) + inv_se(ie = se2se$all_enty, oe = se_Liq, se2se, adjte, v_directteinv, v_adjustteinv, te = se2se$all_te) - + inv_se(ie = se_Liq, oe = se2fe$all_enty1, se2fe, adjte, v_directteinv, v_adjustteinv, te = se2fe$all_te)), "Energy Investments|Liquids including gas stations (billion US$2005/yr)")) + + inv_se(ie = se_Liq, oe = se2fe$all_enty1, se2fe, adjte, v_directteinv, v_adjustteinv, te = se2fe$all_te)), "Energy Investments|Liquids including gas stations (billion US$2017/yr)")) - tmp <- mbind(tmp, setNames(v_directteinv[, , "ccsinje"] + v_adjustteinv[, , "ccsinje"], "Energy Investments|CO2 Trans&Stor (billion US$2005/yr)") * 1000) - tmp <- mbind(tmp, setNames(v_directteinv[, , "dac"] + v_adjustteinv[, , "dac"], "Energy Investments|DAC (billion US$2005/yr)") * 1000) - tmp <- mbind(tmp, setNames(dimSums(v_directteinv[, , teue2rlf$all_te] + v_adjustteinv[, , teue2rlf$all_te], dim = 3), "Energy Investments|Demand (billion US$2005/yr)") * 1000) + tmp <- mbind(tmp, setNames(v_directteinv[, , "ccsinje"] + v_adjustteinv[, , "ccsinje"], "Energy Investments|CO2 Trans&Stor (billion US$2017/yr)") * 1000) + tmp <- mbind(tmp, setNames(v_directteinv[, , "dac"] + v_adjustteinv[, , "dac"], "Energy Investments|DAC (billion US$2017/yr)") * 1000) + tmp <- mbind(tmp, setNames(dimSums(v_directteinv[, , teue2rlf$all_te] + v_adjustteinv[, , teue2rlf$all_te], dim = 3), "Energy Investments|Demand (billion US$2017/yr)") * 1000) tmp <- mbind(tmp, setNames((inv_se(ie = temapall$all_enty, oe = temapall$all_enty1, temapall[!(temapall$all_te %in% teue2rlf$all_te), ], adjte, v_directteinv, v_adjustteinv, te = all_te) - + inv_se(ie = NULL, oe = NULL, tenotransform, adjte, v_directteinv, v_adjustteinv, te = all_te)), "Energy Investments|Supply (billion US$2005/yr)")) + + inv_se(ie = NULL, oe = NULL, tenotransform, adjte, v_directteinv, v_adjustteinv, te = all_te)), "Energy Investments|Supply (billion US$2017/yr)")) tmp <- mbind(tmp, setNames((inv_se(ie = pe2se$all_enty, oe = se_Solids, pe2se, adjte, v_directteinv, v_adjustteinv) - + inv_se(ie = se_Solids, oe = se2fe$all_enty1, se2fe, adjte, v_directteinv, v_adjustteinv, te = se2fe$all_te)), "Energy Investments|Solids (billion US$2005/yr)")) + + inv_se(ie = se_Solids, oe = se2fe$all_enty1, se2fe, adjte, v_directteinv, v_adjustteinv, te = se2fe$all_te)), "Energy Investments|Solids (billion US$2017/yr)")) # Gases tmp <- mbind(tmp, setNames((inv_se(ie = pe2se$all_enty, oe = se_Gas, pe2se, adjte, v_directteinv, v_adjustteinv) + inv_se(ie = se2se$all_enty, oe = se_Gas, se2se, adjte, v_directteinv, v_adjustteinv, te = se2se$all_te) - + inv_se(ie = se_Gas, oe = se2fe$all_enty1, se2fe, adjte, v_directteinv, v_adjustteinv, te = se2fe$all_te)), "Energy Investments|Gases (billion US$2005/yr)")) - tmp <- mbind(tmp, setNames(inv_se(ie = petyf, oe = se_Gas, pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Gases|+|Fossil (billion US$2005/yr)")) - tmp <- mbind(tmp, setNames(inv_se(ie = "seh2", oe = se_Gas, se2se, adjte, v_directteinv, v_adjustteinv, te = se2se$all_te), "Energy Investments|Gases|+|Hydrogen (billion US$2005/yr)")) - tmp <- mbind(tmp, setNames(inv_se(ie = pebio, oe = se_Gas, pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Gases|+|Biomass (billion US$2005/yr)")) - tmp <- mbind(tmp, setNames(inv_se(ie = pebio, te = teccs, oe = se_Gas, pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Gases|Biomass|+|w/ CC (billion US$2005/yr)")) - tmp <- mbind(tmp, setNames(inv_se(ie = pebio, te = tenoccs, oe = se_Gas, pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Gases|Biomass|+|w/o CC (billion US$2005/yr)")) - # tmp <- mbind(tmp, setNames(inv_se(ie = NULL, oe = NULL, c("tdbiogas","tdfosgas","tdsyngas","tdbiogat","tdfosgat","tdsyngat"), adjte, v_directteinv, v_adjustteinv, te = all_te), "Energy Investments|Gases|Grid (billion US$2005/yr)")) - tmp <- mbind(tmp, setNames(inv_se(ie = se_Gas, oe = se2fe$all_enty1, se2fe, adjte, v_directteinv, v_adjustteinv, te = se2fe$all_te), "Energy Investments|Gases|+|Transmission and Distribution (billion US$2005/yr)")) + + inv_se(ie = se_Gas, oe = se2fe$all_enty1, se2fe, adjte, v_directteinv, v_adjustteinv, te = se2fe$all_te)), "Energy Investments|Gases (billion US$2017/yr)")) + tmp <- mbind(tmp, setNames(inv_se(ie = petyf, oe = se_Gas, pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Gases|+|Fossil (billion US$2017/yr)")) + tmp <- mbind(tmp, setNames(inv_se(ie = "seh2", oe = se_Gas, se2se, adjte, v_directteinv, v_adjustteinv, te = se2se$all_te), "Energy Investments|Gases|+|Hydrogen (billion US$2017/yr)")) + tmp <- mbind(tmp, setNames(inv_se(ie = pebio, oe = se_Gas, pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Gases|+|Biomass (billion US$2017/yr)")) + tmp <- mbind(tmp, setNames(inv_se(ie = pebio, te = teccs, oe = se_Gas, pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Gases|Biomass|+|w/ CC (billion US$2017/yr)")) + tmp <- mbind(tmp, setNames(inv_se(ie = pebio, te = tenoccs, oe = se_Gas, pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Gases|Biomass|+|w/o CC (billion US$2017/yr)")) + # tmp <- mbind(tmp, setNames(inv_se(ie = NULL, oe = NULL, c("tdbiogas","tdfosgas","tdsyngas","tdbiogat","tdfosgat","tdsyngat"), adjte, v_directteinv, v_adjustteinv, te = all_te), "Energy Investments|Gases|Grid (billion US$2017/yr)")) + tmp <- mbind(tmp, setNames(inv_se(ie = se_Gas, oe = se2fe$all_enty1, se2fe, adjte, v_directteinv, v_adjustteinv, te = se2fe$all_te), "Energy Investments|Gases|+|Transmission and Distribution (billion US$2017/yr)")) tmp <- mbind(tmp, setNames((inv_se(ie = pe2se$all_enty, oe = "sehe", pe2se, adjte, v_directteinv, v_adjustteinv) - + inv_se(ie = "sehe", oe = se2fe$all_enty1, se2fe, adjte, v_directteinv, v_adjustteinv, te = se2fe$all_te)), "Energy Investments|Heat (billion US$2005/yr)")) - tmp <- mbind(tmp, setNames(inv_se(ie = "pegeo", oe = "sehe", pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Heat|+|Heat Pump (billion US$2005/yr)")) - tmp <- mbind(tmp, setNames(inv_se(ie = "pegas", oe = "sehe", pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Heat|+|Gas (billion US$2005/yr)")) - tmp <- mbind(tmp, setNames(inv_se(ie = "pecoal", oe = "sehe", pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Heat|+|Coal (billion US$2005/yr)")) - tmp <- mbind(tmp, setNames(inv_se(ie = petyf, oe = "sehe", pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Heat|Fossil (billion US$2005/yr)")) - tmp <- mbind(tmp, setNames(inv_se(ie = pebio, oe = "sehe", pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Heat|+|Biomass (billion US$2005/yr)")) - tmp <- mbind(tmp, setNames(inv_se(ie = NULL, oe = NULL, c("tdhes"), adjte, v_directteinv, v_adjustteinv, te = all_te), "Energy Investments|Heat|+|Grid (billion US$2005/yr)")) - - tmp <- mbind(tmp, setNames((tmp[, , "Energy Investments|Supply (billion US$2005/yr)"] - - tmp[, , "Energy Investments|Electricity (billion US$2005/yr)"] - - tmp[, , "Energy Investments|Hydrogen (billion US$2005/yr)"] - - tmp[, , "Energy Investments|Liquids (billion US$2005/yr)"] - - tmp[, , "Energy Investments|Heat (billion US$2005/yr)"] - - tmp[, , "Energy Investments|Gases (billion US$2005/yr)"] - - tmp[, , "Energy Investments|Solids (billion US$2005/yr)"] - - tmp[, , "Energy Investments|CO2 Trans&Stor (billion US$2005/yr)"]), "Energy Investments|Other (billion US$2005/yr)")) + + inv_se(ie = "sehe", oe = se2fe$all_enty1, se2fe, adjte, v_directteinv, v_adjustteinv, te = se2fe$all_te)), "Energy Investments|Heat (billion US$2017/yr)")) + tmp <- mbind(tmp, setNames(inv_se(ie = "pegeo", oe = "sehe", pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Heat|+|Heat Pump (billion US$2017/yr)")) + tmp <- mbind(tmp, setNames(inv_se(ie = "pegas", oe = "sehe", pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Heat|+|Gas (billion US$2017/yr)")) + tmp <- mbind(tmp, setNames(inv_se(ie = "pecoal", oe = "sehe", pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Heat|+|Coal (billion US$2017/yr)")) + tmp <- mbind(tmp, setNames(inv_se(ie = petyf, oe = "sehe", pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Heat|Fossil (billion US$2017/yr)")) + tmp <- mbind(tmp, setNames(inv_se(ie = pebio, oe = "sehe", pe2se, adjte, v_directteinv, v_adjustteinv), "Energy Investments|Heat|+|Biomass (billion US$2017/yr)")) + tmp <- mbind(tmp, setNames(inv_se(ie = NULL, oe = NULL, c("tdhes"), adjte, v_directteinv, v_adjustteinv, te = all_te), "Energy Investments|Heat|+|Grid (billion US$2017/yr)")) + + tmp <- mbind(tmp, setNames((tmp[, , "Energy Investments|Supply (billion US$2017/yr)"] + - tmp[, , "Energy Investments|Electricity (billion US$2017/yr)"] + - tmp[, , "Energy Investments|Hydrogen (billion US$2017/yr)"] + - tmp[, , "Energy Investments|Liquids (billion US$2017/yr)"] + - tmp[, , "Energy Investments|Heat (billion US$2017/yr)"] + - tmp[, , "Energy Investments|Gases (billion US$2017/yr)"] + - tmp[, , "Energy Investments|Solids (billion US$2017/yr)"] + - tmp[, , "Energy Investments|CO2 Trans&Stor (billion US$2017/yr)"]), "Energy Investments|Other (billion US$2017/yr)")) # add global values diff --git a/R/reportFE.R b/R/reportFE.R index 74f13f40..c0005a12 100644 --- a/R/reportFE.R +++ b/R/reportFE.R @@ -559,7 +559,7 @@ reportFE <- function(gdx, regionSubsetList = NULL, if(tran_mod == "edge_esm") { vm_demFeForEs <- readGDX(gdx,name = c("vm_demFeForEs"), field="l", restore_zeros=FALSE,format= "first_found",react = "silent")[,t,]*TWa_2_EJ } - + # CES nodes, convert from TWa to EJ vm_cesIO <- readGDX(gdx, name=c("vm_cesIO"), field="l", restore_zeros=FALSE,format= "first_found")[,t,]*TWa_2_EJ @@ -654,7 +654,7 @@ reportFE <- function(gdx, regionSubsetList = NULL, dim = 3, na.rm = TRUE), "UE|Buildings (EJ/yr)")) } - } + } # Industry Module ---- ## FE demand ---- @@ -861,15 +861,15 @@ reportFE <- function(gdx, regionSubsetList = NULL, "Production|Industry|Steel (Mt/yr)", c("ue_steel_primary", "ue_steel_secondary"), "Production|Industry|Steel|Primary (Mt/yr)", "ue_steel_primary", "Production|Industry|Steel|Secondary (Mt/yr)", "ue_steel_secondary", - "Value Added|Industry|Chemicals (billion US$2005/yr)", "ue_chemicals", - "Value Added|Industry|Other Industry (billion US$2005/yr)", "ue_otherInd") + "Value Added|Industry|Chemicals (billion US$2017/yr)", "ue_chemicals", + "Value Added|Industry|Other Industry (billion US$2017/yr)", "ue_otherInd") # calculate and bind to out out <- mbind( c(list(out), # pass a list of magpie objects # as vm_cesIO was multiplied by TWa_2_EJ in the beginning of the # script, needs to be converted back to REMIND units here and then - # scaled by 1e3 for obtaining Mt or billion US$2005 + # scaled by 1e3 for obtaining Mt or billion US$2017 .select_sum_name_multiply(vm_cesIO, .mixer_to_selector(mixer), factor=1e3 / TWa_2_EJ), # report CES node of total industry as internal variable (for model @@ -1296,9 +1296,9 @@ reportFE <- function(gdx, regionSubsetList = NULL, 'FE|Industry|Steel|++|Secondary (EJ/yr)', 'Production|Industry|Steel|Secondary (Mt/yr)', 'FE|Industry|+++|Chemicals (EJ/yr)', - 'Value Added|Industry|Chemicals (billion US$2005/yr)', + 'Value Added|Industry|Chemicals (billion US$2017/yr)', 'FE|Industry|+++|Other Industry (EJ/yr)', - 'Value Added|Industry|Other Industry (billion US$2005/yr)') %>% + 'Value Added|Industry|Other Industry (billion US$2017/yr)') %>% `%in%`(getNames(out)))) { out <- mbind( @@ -1326,15 +1326,15 @@ reportFE <- function(gdx, regionSubsetList = NULL, setNames( ( out[,,'FE|Industry|+++|Chemicals (EJ/yr)'] - / out[,,'Value Added|Industry|Chemicals (billion US$2005/yr)'] + / out[,,'Value Added|Industry|Chemicals (billion US$2017/yr)'] ) * 1e3, - 'FE|Industry|Specific Energy Consumption|Chemicals (MJ/US$2005)'), + 'FE|Industry|Specific Energy Consumption|Chemicals (MJ/US$2017)'), setNames( ( out[,,'FE|Industry|+++|Other Industry (EJ/yr)'] - / out[,,'Value Added|Industry|Other Industry (billion US$2005/yr)'] + / out[,,'Value Added|Industry|Other Industry (billion US$2017/yr)'] ) * 1e3, - 'FE|Industry|Specific Energy Consumption|Other Industry (MJ/US$2005)') + 'FE|Industry|Specific Energy Consumption|Other Industry (MJ/US$2017)') ) } diff --git a/R/reportMacroEconomy.R b/R/reportMacroEconomy.R index af66de57..8c6560f2 100644 --- a/R/reportMacroEconomy.R +++ b/R/reportMacroEconomy.R @@ -73,12 +73,12 @@ reportMacroEconomy <- function(gdx, regionSubsetList = NULL, cons <- setNames(readGDX(gdx, name = "vm_cons", field = "l", format = "first_found")[, t2005to2150, ] * 1000, - "Consumption (billion US$2005/yr)") - gdp <- setNames(vm_cesIO[, , "inco"] * 1000, "GDP|MER (billion US$2005/yr)") + "Consumption (billion US$2017/yr)") + gdp <- setNames(vm_cesIO[, , "inco"] * 1000, "GDP|MER (billion US$2017/yr)") shPPPMER <- readGDX(gdx, c("pm_shPPPMER", "p_ratio_ppp"), format = "first_found") - gdp_ppp <- setNames(gdp / shPPPMER, "GDP|PPP (billion US$2005/yr)") + gdp_ppp <- setNames(gdp / shPPPMER, "GDP|PPP (billion US$2017/yr)") invE <- setNames(readGDX(gdx, name = c("v_costInv", "v_costin"), field = "l", format = "first_found") * 1000, - "Energy Investments (billion US$2005/yr)") + "Energy Investments (billion US$2017/yr)") pop <- setNames(readGDX(gdx, name = c("pm_pop", "pm_datapop"), format = "first_found")[, t2005to2150, ] * 1000, "Population (million)") @@ -89,8 +89,8 @@ reportMacroEconomy <- function(gdx, regionSubsetList = NULL, # Calculate net GDP using the damage factors tintersect <- intersect(getYears(gdp), getYears(damageFactor)) - gdp_net <- setNames(gdp[,tintersect,]*damageFactor[,tintersect,], "GDP|MER|Net_afterDamages (billion US$2005/yr)") - gdp_ppp_net <- setNames(gdp_ppp[,tintersect,]*damageFactor[,tintersect,], "GDP|PPP|Net_afterDamages (billion US$2005/yr)") + gdp_net <- setNames(gdp[,tintersect,]*damageFactor[,tintersect,], "GDP|MER|Net_afterDamages (billion US$2017/yr)") + gdp_ppp_net <- setNames(gdp_ppp[,tintersect,]*damageFactor[,tintersect,], "GDP|PPP|Net_afterDamages (billion US$2017/yr)") ies <- readGDX(gdx, c("pm_ies", "p_ies"), format = "first_found") c_damage <- readGDX(gdx, "cm_damage", "c_damage", format = "first_found", react = "silent") @@ -137,13 +137,11 @@ reportMacroEconomy <- function(gdx, regionSubsetList = NULL, } } - cap <- setNames(vm_cesIO[, , "kap"] * 1000, "Capital Stock|Non-ESM (billion US$2005)") - invM <- setNames(vm_invMacro[, , "kap"] * 1000, "Investments|Non-ESM (billion US$2005/yr)") + cap <- setNames(vm_cesIO[, , "kap"] * 1000, "Capital Stock|Non-ESM (billion US$2017)") + invM <- setNames(vm_invMacro[, , "kap"] * 1000, "Investments|Non-ESM (billion US$2017/yr)") + + inv <- setNames(invM[, , "Investments|Non-ESM (billion US$2017/yr)"] + invE, "Investments (billion US$2017/yr)") - inv <- setNames(invM[, , "Investments|Non-ESM (billion US$2005/yr)"] + invE, "Investments (billion US$2005/yr)") - # TODO: add p80_curracc - # curracc <- setNames(readGDX(gdx, 'p80_curracc', field = 'l', format = 'first_found') * 1000, - # "Current Account (billion US$2005/yr)") vm_welfare <- readGDX(gdx, c("v02_welfare", "v_welfare", "vm_welfare"), field = "l", format = "first_found", react = "warning") if (!is.null(vm_welfare)) { @@ -154,7 +152,7 @@ reportMacroEconomy <- function(gdx, regionSubsetList = NULL, # macro - ces <- mbind(ces, setNames(vm_cesIO[, , "kap"] * 1000, "CES_input|kap (billion US$2005)")) + ces <- mbind(ces, setNames(vm_cesIO[, , "kap"] * 1000, "CES_input|kap (billion US$2017)")) # transport ces <- mbind(ces, setNames(vm_cesIO[, , name_trsp[3]] * TWa_2_EJ, "CES_input|feelt (EJ/yr)")) @@ -168,7 +166,7 @@ reportMacroEconomy <- function(gdx, regionSubsetList = NULL, ces <- mbind(ces, setNames(vm_cesIO[, , "fesob"] * TWa_2_EJ, "CES_input|fesob (EJ/yr)")) ces <- mbind(ces, setNames(vm_cesIO[, , "feheb"] * TWa_2_EJ, "CES_input|feheb (EJ/yr)")) ces <- mbind(ces, setNames(vm_cesIO[, , "feh2b"] * TWa_2_EJ, "CES_input|feh2b (EJ/yr)")) - } + } if (indu_mod == "fixed_shares") { ces <- mbind(ces, setNames(vm_cesIO[, , "feeli"] * TWa_2_EJ, "CES_input|feeli (EJ/yr)")) @@ -184,7 +182,7 @@ reportMacroEconomy <- function(gdx, regionSubsetList = NULL, lapply(ppfkap_ind, function(x) { setNames(vm_cesIO[, , x] * 1000, - paste0("CES_input|", x, " (billion US$2005)")) + paste0("CES_input|", x, " (billion US$2017)")) } )), @@ -220,12 +218,12 @@ reportMacroEconomy <- function(gdx, regionSubsetList = NULL, # convert FE input prices to USD/GJ (like PE, SE, FE Prices) CES.price.fe <- setNames(CES.price[,,inputs.fe] / as.numeric(sm_DpGJ_2_TDpTWa), paste0("Internal|CES Function|CES Price|", - getNames(CES.price[,,inputs.fe]), " (US$2005/GJ)")) + getNames(CES.price[,,inputs.fe]), " (US$2017/GJ)")) # leave non-FE input prices generally as they are in trUSD/CES input CES.price.nofe <- setNames(CES.price[,,inputs.nofe], paste0("Internal|CES Function|CES Price|", - getNames(CES.price[,,inputs.nofe]), " (trUS$2005/Input)")) + getNames(CES.price[,,inputs.nofe]), " (trUS$2017/Input)")) # bind FE and non-FE CES prices to one array CES.price <- mbind(CES.price.fe, CES.price.nofe) @@ -282,25 +280,25 @@ reportMacroEconomy <- function(gdx, regionSubsetList = NULL, if (indu_mod == "subsectors") { CES.mrs <- mbind( CES.mrs, - setNames(CES.price[,,"Internal|CES Function|CES Price|feelhpb (US$2005/GJ)"] / - CES.price[,,"Internal|CES Function|CES Price|fegab (US$2005/GJ)"], + setNames(CES.price[,,"Internal|CES Function|CES Price|feelhpb (US$2017/GJ)"] / + CES.price[,,"Internal|CES Function|CES Price|fegab (US$2017/GJ)"], "Internal|CES Function|MRS|feelhpb|fegab (ratio)"), - setNames(CES.price[,,"Internal|CES Function|CES Price|feelhpb (US$2005/GJ)"] / - CES.price[,,"Internal|CES Function|CES Price|feh2b (US$2005/GJ)"], + setNames(CES.price[,,"Internal|CES Function|CES Price|feelhpb (US$2017/GJ)"] / + CES.price[,,"Internal|CES Function|CES Price|feh2b (US$2017/GJ)"], "Internal|CES Function|MRS|feelhpb|feh2b (ratio)")) if (!steel_process_based) { CES.mrs <- mbind( CES.mrs, - setNames(CES.price[,,"Internal|CES Function|CES Price|feel_steel_secondary (US$2005/GJ)"] / - CES.price[,,"Internal|CES Function|CES Price|feso_steel (US$2005/GJ)"], + setNames(CES.price[,,"Internal|CES Function|CES Price|feel_steel_secondary (US$2017/GJ)"] / + CES.price[,,"Internal|CES Function|CES Price|feso_steel (US$2017/GJ)"], "Internal|CES Function|MRS|feel_steel_secondary|feso_steel (ratio)")) } } ## 3.) Value generated by CES Inputs (price * quantity) CES.value <- setNames( mselect(o01_CESderivatives, all_in = "inco", all_in1 = inputs) * vm_cesIO[,getYears(o01_CESderivatives),inputs] * 1000, - paste0("Internal|CES Function|Value|",inputs, " (billion US$2005)")) + paste0("Internal|CES Function|Value|",inputs, " (billion US$2017)")) # bind all CES variables together in one array ces <- mbind(ces,CES.price,CES.mrs,CES.value) diff --git a/R/reportPolicyCosts.R b/R/reportPolicyCosts.R index 4985f929..4713abfb 100644 --- a/R/reportPolicyCosts.R +++ b/R/reportPolicyCosts.R @@ -1,9 +1,9 @@ #' Read in GDX and calculate policy costs, used in convGDX2MIF.R for the #' reporting -#' +#' #' Read in GDX and calculate policy costs functions -#' -#' +#' +#' #' @param gdx a GDX as created by readGDX, or the file name of a gdx #' @param gdx_ref a reference GDX as created by readGDX, or the file name of a gdx #' @param regionSubsetList a list containing regions to create report variables region @@ -11,12 +11,12 @@ #' be created. #' @param t temporal resolution of the reporting, default: #' t=c(seq(2005,2060,5),seq(2070,2110,10),2130,2150) -#' +#' #' @author Lavinia Baumstark #' @examples -#' +#' #' \dontrun{reportPolicyCosts(gdx)} -#' +#' #' @export #' @importFrom gdx readGDX #' @importFrom magclass getYears mbind setNames @@ -29,7 +29,7 @@ reportPolicyCosts <- function(gdx,gdx_ref,regionSubsetList=NULL,t=c(seq(2005,206 pm_pvp_bau<- readGDX(gdx_ref,name=c("pm_pvp"),format = "first_found") pm_pvp <- readGDX(gdx,name=c("pm_pvp"),format = "first_found") ## variables - cons_bau <- readGDX(gdx_ref,name=c("vm_cons"),field="l",restore_zeros=FALSE,format="first_found") + cons_bau <- readGDX(gdx_ref,name=c("vm_cons"),field="l",restore_zeros=FALSE,format="first_found") gdp_bau <- readGDX(gdx_ref,name=c("vm_cesIO"),field="l",restore_zeros=FALSE,format="first_found")[,,"inco"] Xport_bau <- readGDX(gdx_ref,name=c("vm_Xport"),field = "l",format = "first_found") Mport_bau <- readGDX(gdx_ref,name=c("vm_Mport"),field = "l",format = "first_found") @@ -43,7 +43,7 @@ reportPolicyCosts <- function(gdx,gdx_ref,regionSubsetList=NULL,t=c(seq(2005,206 v_costfu <- readGDX(gdx,name=c("v_costFu","v_costfu"), field="l",restore_zeros=FALSE,format="first_found") v_costom <- readGDX(gdx,name=c("v_costOM","v_costom"), field="l", format="first_found") v_costin <- readGDX(gdx,name=c("v_costInv","v_costin"), field = "l",format = "first_found") - + ####### calculate minimal temporal and regional resolution ##### y <- Reduce(intersect,list(getYears(cons),getYears(gdp),getYears(Xport),getYears(Mport),getYears(pm_pvp))) cons_bau <- cons_bau[,y,] @@ -81,16 +81,16 @@ reportPolicyCosts <- function(gdx,gdx_ref,regionSubsetList=NULL,t=c(seq(2005,206 currAcc_bau <- dimSums( (Xport_bau[,,trade] - Mport_bau[,,trade] ) * pm_pvp_bau[,,trade]/setNames(pm_pvp_bau[,,'good'],NULL),dim = 3) currAcc <- dimSums( (Xport[,,trade] - Mport[,,trade] ) * pm_pvp[,,trade]/setNames(pm_pvp[,,'good'],NULL),dim = 3) ####### calculate reporting parameters ############ - tmp <- NULL - tmp <- mbind(tmp,setNames((cons_bau - cons) * 1000, "Policy Cost|Consumption Loss (billion US$2005/yr)" )) - tmp <- mbind(tmp,setNames((cons_bau - cons)/(cons_bau + 1e-10) * 100, "Policy Cost|Consumption Loss|Relative to Reference Consumption (percent)")) - tmp <- mbind(tmp,setNames((gdp_bau - gdp) * 1000, "Policy Cost|GDP Loss (billion US$2005/yr)" )) - tmp <- mbind(tmp,setNames((gdp_bau - gdp)/(gdp_bau + 1e-10) * 100, "Policy Cost|GDP Loss|Relative to Reference GDP (percent)")) - tmp <- mbind(tmp,setNames((v_costfu +v_costin + v_costom - (v_costfu_bau + v_costin_bau + v_costom_bau)) * 1000, "Policy Cost|Additional Total Energy System Cost (billion US$2005/yr)" )) - # Policy costs calculated as consumption losses net the effect of climate-policy induced changes in the current account - tmp <- mbind(tmp,setNames(((cons_bau + currAcc_bau) - (cons + currAcc)) * 1000, "Policy Cost|Consumption + Current Account Loss (billion US$2005/yr)" )) + tmp <- NULL + tmp <- mbind(tmp,setNames((cons_bau - cons) * 1000, "Policy Cost|Consumption Loss (billion US$2017/yr)" )) + tmp <- mbind(tmp,setNames((cons_bau - cons)/(cons_bau + 1e-10) * 100, "Policy Cost|Consumption Loss|Relative to Reference Consumption (percent)")) + tmp <- mbind(tmp,setNames((gdp_bau - gdp) * 1000, "Policy Cost|GDP Loss (billion US$2017/yr)" )) + tmp <- mbind(tmp,setNames((gdp_bau - gdp)/(gdp_bau + 1e-10) * 100, "Policy Cost|GDP Loss|Relative to Reference GDP (percent)")) + tmp <- mbind(tmp,setNames((v_costfu +v_costin + v_costom - (v_costfu_bau + v_costin_bau + v_costom_bau)) * 1000, "Policy Cost|Additional Total Energy System Cost (billion US$2017/yr)" )) + # Policy costs calculated as consumption losses net the effect of climate-policy induced changes in the current account + tmp <- mbind(tmp,setNames(((cons_bau + currAcc_bau) - (cons + currAcc)) * 1000, "Policy Cost|Consumption + Current Account Loss (billion US$2017/yr)" )) tmp <- mbind(tmp,setNames(((cons_bau + currAcc_bau) - (cons + currAcc))/(cons_bau + currAcc_bau + 1e-10) * 100, "Policy Cost|Consumption + Current Account Loss|Relative to Reference Consumption + Current Account (percent)" )) - + # add other region aggregations if (!is.null(regionSubsetList)) tmp <- mbind(tmp, calc_regionSubset_sums(tmp, regionSubsetList)) diff --git a/R/reportSDPVariables.R b/R/reportSDPVariables.R index cb798d75..a4087a5e 100644 --- a/R/reportSDPVariables.R +++ b/R/reportSDPVariables.R @@ -95,21 +95,21 @@ reportSDPVariables <- function( + output[,,"FE|Transport|Pass|+|Hydrogen (EJ/yr)"] * 0.36), "UE|Electricity and Hydrogen|Share|Transport|Pass (%)")}, - if("Intensity|GDP|Final Energy|Transport (MJ/US$2005)" %!in% getNames(output)){ + if("Intensity|GDP|Final Energy|Transport (MJ/US$2017)" %!in% getNames(output)){ setNames( 1e3*(output[,,"FE|Transport|+|Electricity (EJ/yr)"] + output[,,"FE|Transport|+|Liquids (EJ/yr)"] + output[,,"FE|Transport|+|Hydrogen (EJ/yr)"]) - / output[,,"GDP|MER (billion US$2005/yr)"], - "Intensity|GDP|Final Energy|Transport (MJ/US$2005)")}, + / output[,,"GDP|MER (billion US$2017/yr)"], + "Intensity|GDP|Final Energy|Transport (MJ/US$2017)")}, - if("Intensity|GDP|Useful Energy|Transport (MJ/US$2005)" %!in% getNames(output)){ + if("Intensity|GDP|Useful Energy|Transport (MJ/US$2017)" %!in% getNames(output)){ setNames( 1e3 * (output[,,"FE|Transport|Pass|+|Liquids (EJ/yr)"] * 0.23 + output[,,"FE|Transport|Pass|+|Electricity (EJ/yr)"] * 0.64 + output[,,"FE|Transport|Pass|+|Hydrogen (EJ/yr)"] * 0.36) - / output[,,"GDP|MER (billion US$2005/yr)"], - "Intensity|GDP|Useful Energy|Transport (MJ/US$2005)")}) + / output[,,"GDP|MER (billion US$2017/yr)"], + "Intensity|GDP|Useful Energy|Transport (MJ/US$2017)")}) return(tmp) @@ -202,15 +202,15 @@ reportSDPVariables <- function( #SDG|SDG07|Intensity|GDP|UE addIntensityUE <- function(output){ - vars <- c("UE|per capita|Transport (GJ/cap/yr)","UE|per capita|Industry (GJ/cap/yr)","UE|per capita|Buildings (GJ/cap/yr)","Population (million)","GDP|MER (billion US$2005/yr)") + vars <- c("UE|per capita|Transport (GJ/cap/yr)","UE|per capita|Industry (GJ/cap/yr)","UE|per capita|Buildings (GJ/cap/yr)","Population (million)","GDP|MER (billion US$2017/yr)") if(!(all(vars %in% getNames(output)))) # required variables not found return() tmp <- mbind( - if("Intensity|GDP|UE (MJ/US$2005)" %!in% getNames(output)){ + if("Intensity|GDP|UE (MJ/US$2017)" %!in% getNames(output)){ setNames( - ((output[,,"UE|per capita|Transport (GJ/cap/yr)"] + output[,,"UE|per capita|Industry (GJ/cap/yr)"]+ output[,,"UE|per capita|Buildings (GJ/cap/yr)"]) / 1e3 *output[,,"Population (million)"]) / (output[,,"GDP|MER (billion US$2005/yr)"] * 1e9), - "Intensity|GDP|UE (MJ/US$2005)")}) + ((output[,,"UE|per capita|Transport (GJ/cap/yr)"] + output[,,"UE|per capita|Industry (GJ/cap/yr)"]+ output[,,"UE|per capita|Buildings (GJ/cap/yr)"]) / 1e3 *output[,,"Population (million)"]) / (output[,,"GDP|MER (billion US$2017/yr)"] * 1e9), + "Intensity|GDP|UE (MJ/US$2017)")}) return(tmp) } diff --git a/R/reportTax.R b/R/reportTax.R index e924178a..c65f13db 100644 --- a/R/reportTax.R +++ b/R/reportTax.R @@ -105,25 +105,25 @@ reportTax <- function(gdx,output=NULL,regionSubsetList=NULL,t=c(seq(2005,2060,5) setNames(dimSums(mselect(fe_tax,emi_sectors = sector_map[sector], all_enty = entyFe_map[[sector]][[FinalEnergy]]), dim = 3, na.rm = TRUE), - paste0("Tax rate|Final Energy|", sector, "|", FinalEnergy, " (US$2005/GJ)")), + paste0("Tax rate|Final Energy|", sector, "|", FinalEnergy, " (US$2017/GJ)")), setNames(dimSums(mselect(fe_sub,emi_sectors = sector_map[sector], all_enty = entyFe_map[[sector]][[FinalEnergy]]), dim = 3, na.rm = TRUE), - paste0("Subsidy Rate|Final Energy|", sector, "|", FinalEnergy, " (US$2005/GJ)")), + paste0("Subsidy Rate|Final Energy|", sector, "|", FinalEnergy, " (US$2017/GJ)")), setNames(dimSums(mselect(fe_tax,emi_sectors = sector_map[sector], all_enty = entyFe_map[[sector]][[FinalEnergy]]), dim = 3, na.rm = TRUE) * dimSums(mselect(vm_demFeSector, all_enty1 = entyFe_map[[sector]][FinalEnergy], emi_sectors = sector_map[sector]), dim = 3, na.rm = TRUE), - paste0("Taxes|Final Energy|", sector, "|", FinalEnergy, " (billion US$2005/yr)")), + paste0("Taxes|Final Energy|", sector, "|", FinalEnergy, " (billion US$2017/yr)")), setNames(dimSums(mselect(fe_sub, emi_sectors = sector_map[sector], all_enty = entyFe_map[[sector]][[FinalEnergy]]), dim = 3, na.rm = TRUE) * dimSums(mselect(vm_demFeSector, all_enty1 = entyFe_map[[sector]][FinalEnergy], emi_sectors = sector_map[sector]), dim = 3, na.rm = TRUE), - paste0("Subsidies|Final Energy|", sector, "|", FinalEnergy, " (billion US$2005/yr)")) + paste0("Subsidies|Final Energy|", sector, "|", FinalEnergy, " (billion US$2017/yr)")) ) }) ) @@ -138,11 +138,11 @@ reportTax <- function(gdx,output=NULL,regionSubsetList=NULL,t=c(seq(2005,2060,5) lapply(names(sector_map), function(sector){ mbind( setNames(dimSums(out[,,paste0("Taxes|Final Energy|", sector, "|", names(entyFe_map[[sector]]), - " (billion US$2005/yr)")],dim=3,na.rm=T), - paste0("Taxes|Final Energy|", sector, " (billion US$2005/yr)")), + " (billion US$2017/yr)")],dim=3,na.rm=T), + paste0("Taxes|Final Energy|", sector, " (billion US$2017/yr)")), setNames(dimSums(out[,,paste0("Subsidies|Final Energy|", sector, "|", names(entyFe_map[[sector]]), - " (billion US$2005/yr)")],dim=3,na.rm=T), - paste0("Subsidies|Final Energy|", sector, " (billion US$2005/yr)")) + " (billion US$2017/yr)")],dim=3,na.rm=T), + paste0("Subsidies|Final Energy|", sector, " (billion US$2017/yr)")) ) }) ) @@ -151,19 +151,19 @@ reportTax <- function(gdx,output=NULL,regionSubsetList=NULL,t=c(seq(2005,2060,5) # transportation liquids aggregations out <- mbind( out, - setNames(out[,,"Taxes|Final Energy|Transportation|Liquids|LDV (billion US$2005/yr)"] + out[,,"Taxes|Final Energy|Transportation|Liquids|non-LDV (billion US$2005/yr)"] , "Taxes|Final Energy|Transportation|Liquids (billion US$2005/yr)"), - setNames(out[,,"Subsidies|Final Energy|Transportation|Liquids|LDV (billion US$2005/yr)"] + out[,,"Subsidies|Final Energy|Transportation|Liquids|non-LDV (billion US$2005/yr)"], "Subsidies|Final Energy|Transportation|Liquids (billion US$2005/yr)"), - setNames((out[,,"Tax rate|Final Energy|Transportation|Liquids|LDV (US$2005/GJ)"]*out[,,"Taxes|Final Energy|Transportation|Liquids|LDV (billion US$2005/yr)"] + out[,,"Tax rate|Final Energy|Transportation|Liquids|non-LDV (US$2005/GJ)"]*out[,,"Taxes|Final Energy|Transportation|Liquids|non-LDV (billion US$2005/yr)"])/ - (out[,,"Taxes|Final Energy|Transportation|Liquids|LDV (billion US$2005/yr)"] + out[,,"Taxes|Final Energy|Transportation|Liquids|non-LDV (billion US$2005/yr)"]) , "Tax rate|Final Energy|Transportation|Liquids (US$2005/GJ)"), - setNames((out[,,"Subsidy Rate|Final Energy|Transportation|Liquids|LDV (US$2005/GJ)"]*out[,,"Subsidies|Final Energy|Transportation|Liquids|LDV (billion US$2005/yr)"] + out[,,"Subsidy Rate|Final Energy|Transportation|Liquids|non-LDV (US$2005/GJ)"]*out[,,"Subsidies|Final Energy|Transportation|Liquids|non-LDV (billion US$2005/yr)"])/ - (out[,,"Subsidies|Final Energy|Transportation|Liquids|LDV (billion US$2005/yr)"] + out[,,"Subsidies|Final Energy|Transportation|Liquids|non-LDV (billion US$2005/yr)"]) , "Subsidy Rate|Final Energy|Transportation|Liquids (US$2005/GJ)") + setNames(out[,,"Taxes|Final Energy|Transportation|Liquids|LDV (billion US$2017/yr)"] + out[,,"Taxes|Final Energy|Transportation|Liquids|non-LDV (billion US$2017/yr)"] , "Taxes|Final Energy|Transportation|Liquids (billion US$2017/yr)"), + setNames(out[,,"Subsidies|Final Energy|Transportation|Liquids|LDV (billion US$2017/yr)"] + out[,,"Subsidies|Final Energy|Transportation|Liquids|non-LDV (billion US$2017/yr)"], "Subsidies|Final Energy|Transportation|Liquids (billion US$2017/yr)"), + setNames((out[,,"Tax rate|Final Energy|Transportation|Liquids|LDV (US$2017/GJ)"]*out[,,"Taxes|Final Energy|Transportation|Liquids|LDV (billion US$2017/yr)"] + out[,,"Tax rate|Final Energy|Transportation|Liquids|non-LDV (US$2017/GJ)"]*out[,,"Taxes|Final Energy|Transportation|Liquids|non-LDV (billion US$2017/yr)"])/ + (out[,,"Taxes|Final Energy|Transportation|Liquids|LDV (billion US$2017/yr)"] + out[,,"Taxes|Final Energy|Transportation|Liquids|non-LDV (billion US$2017/yr)"]) , "Tax rate|Final Energy|Transportation|Liquids (US$2017/GJ)"), + setNames((out[,,"Subsidy Rate|Final Energy|Transportation|Liquids|LDV (US$2017/GJ)"]*out[,,"Subsidies|Final Energy|Transportation|Liquids|LDV (billion US$2017/yr)"] + out[,,"Subsidy Rate|Final Energy|Transportation|Liquids|non-LDV (US$2017/GJ)"]*out[,,"Subsidies|Final Energy|Transportation|Liquids|non-LDV (billion US$2017/yr)"])/ + (out[,,"Subsidies|Final Energy|Transportation|Liquids|LDV (billion US$2017/yr)"] + out[,,"Subsidies|Final Energy|Transportation|Liquids|non-LDV (billion US$2017/yr)"]) , "Subsidy Rate|Final Energy|Transportation|Liquids (US$2017/GJ)") ) # total taxes/subsidies final energy out <- mbind( out, - setNames(dimSums(out[,,paste0("Taxes|Final Energy|", names(sector_map), " (billion US$2005/yr)")],dim=3,na.rm=T), "Taxes|Final Energy (billion US$2005/yr)"), - setNames(dimSums(out[,,paste0("Subsidies|Final Energy|", names(sector_map), " (billion US$2005/yr)")],dim=3,na.rm=T), "Subsidies|Final Energy (billion US$2005/yr)") + setNames(dimSums(out[,,paste0("Taxes|Final Energy|", names(sector_map), " (billion US$2017/yr)")],dim=3,na.rm=T), "Taxes|Final Energy (billion US$2017/yr)"), + setNames(dimSums(out[,,paste0("Subsidies|Final Energy|", names(sector_map), " (billion US$2017/yr)")],dim=3,na.rm=T), "Subsidies|Final Energy (billion US$2017/yr)") ) @@ -175,102 +175,102 @@ reportTax <- function(gdx,output=NULL,regionSubsetList=NULL,t=c(seq(2005,2060,5) out <- mbind( out, - setNames(fuEx_sub[,,"pecoal"],"Subsidy Rate|Fuel Extraction|Coal (US$2005/GJ)"), - setNames(fuEx_sub[,,"peoil"],"Subsidy Rate|Fuel Extraction|Oil (US$2005/GJ)"), - setNames(fuEx_sub[,,"pegas"],"Subsidy Rate|Fuel Extraction|Natural Gas (US$2005/GJ)"), - setNames(fuEx_sub[,,"pecoal"]* dimSums(fuExtr[,,"pecoal"],dim=3, na.rm=T),"Subsidies|Fuel Extraction|Coal (billion US$2005/yr)"), - setNames(fuEx_sub[,,"peoil"]* dimSums(fuExtr[,,"peoil"] ,dim=3, na.rm=T),"Subsidies|Fuel Extraction|Oil (billion US$2005/yr)"), - setNames(fuEx_sub[,,"pegas"]* dimSums(fuExtr[,,"pegas"] ,dim=3, na.rm=T),"Subsidies|Fuel Extraction|Natural Gas (billion US$2005/yr)") + setNames(fuEx_sub[,,"pecoal"],"Subsidy Rate|Fuel Extraction|Coal (US$2017/GJ)"), + setNames(fuEx_sub[,,"peoil"],"Subsidy Rate|Fuel Extraction|Oil (US$2017/GJ)"), + setNames(fuEx_sub[,,"pegas"],"Subsidy Rate|Fuel Extraction|Natural Gas (US$2017/GJ)"), + setNames(fuEx_sub[,,"pecoal"]* dimSums(fuExtr[,,"pecoal"],dim=3, na.rm=T),"Subsidies|Fuel Extraction|Coal (billion US$2017/yr)"), + setNames(fuEx_sub[,,"peoil"]* dimSums(fuExtr[,,"peoil"] ,dim=3, na.rm=T),"Subsidies|Fuel Extraction|Oil (billion US$2017/yr)"), + setNames(fuEx_sub[,,"pegas"]* dimSums(fuExtr[,,"pegas"] ,dim=3, na.rm=T),"Subsidies|Fuel Extraction|Natural Gas (billion US$2017/yr)") ) - out <- mbind(out,setNames(out[,,"Subsidies|Fuel Extraction|Coal (billion US$2005/yr)"] + out[,,"Subsidies|Fuel Extraction|Oil (billion US$2005/yr)"] + out[,,"Subsidies|Fuel Extraction|Natural Gas (billion US$2005/yr)"] ,"Subsidies|Fuel Extraction (billion US$2005/yr)")) + out <- mbind(out,setNames(out[,,"Subsidies|Fuel Extraction|Coal (billion US$2017/yr)"] + out[,,"Subsidies|Fuel Extraction|Oil (billion US$2017/yr)"] + out[,,"Subsidies|Fuel Extraction|Natural Gas (billion US$2017/yr)"] ,"Subsidies|Fuel Extraction (billion US$2017/yr)")) # total subsidies - it only includes final energy and fuel extraction subsidies, it misses other subsidies like technology specific ones (BEV and FCEV for example). - out <- mbind(out,setNames(out[,,"Subsidies|Final Energy (billion US$2005/yr)"] + (out[,,"Subsidies|Fuel Extraction|Coal (billion US$2005/yr)"] + out[,,"Subsidies|Fuel Extraction|Oil (billion US$2005/yr)"] + out[,,"Subsidies|Fuel Extraction|Natural Gas (billion US$2005/yr)"]),"Subsidies (billion US$2005/yr)")) + out <- mbind(out,setNames(out[,,"Subsidies|Final Energy (billion US$2017/yr)"] + (out[,,"Subsidies|Fuel Extraction|Coal (billion US$2017/yr)"] + out[,,"Subsidies|Fuel Extraction|Oil (billion US$2017/yr)"] + out[,,"Subsidies|Fuel Extraction|Natural Gas (billion US$2017/yr)"]),"Subsidies (billion US$2017/yr)")) ### Other Taxes (net taxes = tax - subsidies) # GHG emission tax p21_taxrevGHG0 <- readGDX(gdx, name=c("pm_taxrevGHG0","p21_taxrevGHG0"), format= "first_found")[,t,]*1000 - out <- mbind(out, setNames(p21_taxrevGHG0, "Net Taxes|GHG emissions|w/o CO2 LUC (billion US$2005/yr)")) + out <- mbind(out, setNames(p21_taxrevGHG0, "Net Taxes|GHG emissions|w/o CO2 LUC (billion US$2017/yr)")) # co2luc emission tax p21_taxrevCO2luc0 <- readGDX(gdx, name=c("pm_taxrevCO2LUC0","p21_taxrevCO2luc0"), format= "first_found")[,t,]*1000 - out <- mbind(out, setNames(p21_taxrevCO2luc0, "Net Taxes|GHG emissions|CO2 LUC (billion US$2005/yr)")) + out <- mbind(out, setNames(p21_taxrevCO2luc0, "Net Taxes|GHG emissions|CO2 LUC (billion US$2017/yr)")) - out <- mbind(out, setNames((p21_taxrevGHG0+p21_taxrevCO2luc0),"Net Taxes|GHG emissions (billion US$2005/yr)")) + out <- mbind(out, setNames((p21_taxrevGHG0+p21_taxrevCO2luc0),"Net Taxes|GHG emissions (billion US$2017/yr)")) # CCS tax p21_taxrevCCS0 <- readGDX(gdx, name=c("p21_taxrevCCS0"), format= "first_found")[,t,]*1000 - out <- mbind(out, setNames(p21_taxrevCCS0,"Net Taxes|CCS (billion US$2005/yr)")) + out <- mbind(out, setNames(p21_taxrevCCS0,"Net Taxes|CCS (billion US$2017/yr)")) # net-negative emissions tax p21_taxrevNetNegEmi0 <- readGDX(gdx, name=c("pm_taxrevNetNegEmi0","p21_taxrevNetNegEmi0"), format= "first_found")[,t,]*1000 - out <- mbind(out, setNames(p21_taxrevNetNegEmi0,"Net Taxes|Net-negative emissions (billion US$2005/yr)")) + out <- mbind(out, setNames(p21_taxrevNetNegEmi0,"Net Taxes|Net-negative emissions (billion US$2017/yr)")) # negative CO2 emissions for taxes p21_emiALLco2neg0 <- readGDX(gdx, name=c("p21_emiALLco2neg0"), format= "first_found")[,t,]*1000 - out <- mbind(out, setNames(p21_emiALLco2neg0,"Net Taxes|Negative emissions (billion US$2005/yr)")) + out <- mbind(out, setNames(p21_emiALLco2neg0,"Net Taxes|Negative emissions (billion US$2017/yr)")) # final energy tax p21_taxrevFE0 <- readGDX(gdx, name=c("p21_taxrevFE0"), format= "first_found")[,t,]*1000 - out <- mbind(out, setNames(p21_taxrevFE0,"Net Taxes|Final Energy (billion US$2005/yr)")) + out <- mbind(out, setNames(p21_taxrevFE0,"Net Taxes|Final Energy (billion US$2017/yr)")) # resource extraction tax p21_taxrevResEx0 <- readGDX(gdx, name=c("p21_taxrevResEx0"), format= "first_found")[,t,]*1000 - out <- mbind(out, setNames(p21_taxrevResEx0,"Net Taxes|Fuel Extraction|Fossils (billion US$2005/yr)")) + out <- mbind(out, setNames(p21_taxrevResEx0,"Net Taxes|Fuel Extraction|Fossils (billion US$2017/yr)")) # pe2se technologies tax p21_taxrevPE2SE0 <- readGDX(gdx, name=c("p21_taxrevPE2SE0"), format= "first_found")[,t,]*1000 - out <- mbind(out, setNames(p21_taxrevPE2SE0,"Net Taxes|PE2SE Technologies (billion US$2005/yr)")) + out <- mbind(out, setNames(p21_taxrevPE2SE0,"Net Taxes|PE2SE Technologies (billion US$2017/yr)")) # exports tax p21_taxrevXport0 <- readGDX(gdx, name=c("p21_taxrevXport0"), format= "first_found")[,t,]*1000 - out <- mbind(out, setNames(p21_taxrevXport0,"Net Taxes|Exports (billion US$2005/yr)")) + out <- mbind(out, setNames(p21_taxrevXport0,"Net Taxes|Exports (billion US$2017/yr)")) # SO2 tax p21_taxrevSO20 <- readGDX(gdx, name=c("p21_taxrevSO20"), format= "first_found")[,t,]*1000 - out <- mbind(out, setNames(p21_taxrevSO20,"Net Taxes|SO2 (billion US$2005/yr)")) + out <- mbind(out, setNames(p21_taxrevSO20,"Net Taxes|SO2 (billion US$2017/yr)")) # bioenergy tax p21_taxrevBio0 <- readGDX(gdx, name=c("p21_taxrevBio0"), format= "first_found")[,t,]*1000 - out <- mbind(out, setNames(p21_taxrevBio0,"Net Taxes|Bioenergy (billion US$2005/yr)")) + out <- mbind(out, setNames(p21_taxrevBio0,"Net Taxes|Bioenergy (billion US$2017/yr)")) # implicit tax on energy efficient capital p21_implicitDiscRate0 <- readGDX(gdx, name=c("p21_implicitDiscRate0"), format= "first_found")[,t,]*1000 - out <- mbind(out, setNames(p21_implicitDiscRate0,"Net Taxes|Implicit efficiency target (billion US$2005/yr)")) + out <- mbind(out, setNames(p21_implicitDiscRate0,"Net Taxes|Implicit efficiency target (billion US$2017/yr)")) # co2 emission taxes per emission market p21_taxemiMkt0 <- readGDX(gdx, name=c("p21_taxemiMkt0"), format= "first_found")[,t,]*1000 out <- mbind(out, - setNames(p21_taxemiMkt0[,,"ES"] ,"Net Taxes|CO2 market|ESR (billion US$2005/yr)"), - setNames(p21_taxemiMkt0[,,"ETS"] ,"Net Taxes|CO2 market|ETS (billion US$2005/yr)"), - setNames(p21_taxemiMkt0[,,"other"],"Net Taxes|CO2 market|other (billion US$2005/yr)")) + setNames(p21_taxemiMkt0[,,"ES"] ,"Net Taxes|CO2 market|ESR (billion US$2017/yr)"), + setNames(p21_taxemiMkt0[,,"ETS"] ,"Net Taxes|CO2 market|ETS (billion US$2017/yr)"), + setNames(p21_taxemiMkt0[,,"other"],"Net Taxes|CO2 market|other (billion US$2017/yr)")) # flexibility tax p21_taxrevFlex0 <- readGDX(gdx, name=c("p21_taxrevFlex0"), format= "first_found")[,t,]*1000 - out <- mbind(out, setNames(p21_taxrevFlex0,"Net Taxes|electricity flexibility (billion US$2005/yr)")) + out <- mbind(out, setNames(p21_taxrevFlex0,"Net Taxes|electricity flexibility (billion US$2017/yr)")) # import tax p21_taxrevImport0 <- readGDX(gdx, name=c("p21_taxrevImport0","p21_taxrevBioImport0"), format= "first_found")[,t,]*1000 - out <- mbind(out, setNames(dimSums(p21_taxrevImport0,dim=3),"Net Taxes|Primary energy import (billion US$2005/yr)")) + out <- mbind(out, setNames(dimSums(p21_taxrevImport0,dim=3),"Net Taxes|Primary energy import (billion US$2017/yr)")) # report GHG tax revenues out <- mbind(out, - setNames(output_wo_GLO[, , "Price|Carbon|Demand|Buildings (US$2005/t CO2)"] * output_wo_GLO[, , "Emi|GHG|Energy|Demand|+|Buildings (Mt CO2eq/yr)"] / 1000, - "Revenue|Government|Tax|Carbon|+|Demand|Buildings (billion US$2005/yr)"), - setNames(output_wo_GLO[, , "Price|Carbon|Demand|Transport (US$2005/t CO2)"] * output_wo_GLO[, , "Emi|GHG|Energy|Demand|+|Transport (Mt CO2eq/yr)"] / 1000, - "Revenue|Government|Tax|Carbon|+|Demand|Transport (billion US$2005/yr)"), - setNames(output_wo_GLO[, , "Price|Carbon|Demand|Industry (US$2005/t CO2)"] * output_wo_GLO[, , "Emi|GHG|Industry (Mt CO2eq/yr)"] / 1000, - "Revenue|Government|Tax|Carbon|+|Demand|Industry (billion US$2005/yr)"), - setNames(output_wo_GLO[, , "Price|Carbon|Supply (US$2005/t CO2)"] * output_wo_GLO[, , "Emi|GHG|Energy|+|Supply (Mt CO2eq/yr)"] / 1000, - "Revenue|Government|Tax|Carbon|+|Supply (billion US$2005/yr)") + setNames(output_wo_GLO[, , "Price|Carbon|Demand|Buildings (US$2017/t CO2)"] * output_wo_GLO[, , "Emi|GHG|Energy|Demand|+|Buildings (Mt CO2eq/yr)"] / 1000, + "Revenue|Government|Tax|Carbon|+|Demand|Buildings (billion US$2017/yr)"), + setNames(output_wo_GLO[, , "Price|Carbon|Demand|Transport (US$2017/t CO2)"] * output_wo_GLO[, , "Emi|GHG|Energy|Demand|+|Transport (Mt CO2eq/yr)"] / 1000, + "Revenue|Government|Tax|Carbon|+|Demand|Transport (billion US$2017/yr)"), + setNames(output_wo_GLO[, , "Price|Carbon|Demand|Industry (US$2017/t CO2)"] * output_wo_GLO[, , "Emi|GHG|Industry (Mt CO2eq/yr)"] / 1000, + "Revenue|Government|Tax|Carbon|+|Demand|Industry (billion US$2017/yr)"), + setNames(output_wo_GLO[, , "Price|Carbon|Supply (US$2017/t CO2)"] * output_wo_GLO[, , "Emi|GHG|Energy|+|Supply (Mt CO2eq/yr)"] / 1000, + "Revenue|Government|Tax|Carbon|+|Supply (billion US$2017/yr)") ) - out <- mbind(out, setNames(out[, , "Revenue|Government|Tax|Carbon|+|Demand|Buildings (billion US$2005/yr)"] - + out[, , "Revenue|Government|Tax|Carbon|+|Demand|Transport (billion US$2005/yr)"] - + out[, , "Revenue|Government|Tax|Carbon|+|Demand|Industry (billion US$2005/yr)"] - + out[, , "Revenue|Government|Tax|Carbon|+|Supply (billion US$2005/yr)"], - "Revenue|Government|Tax|Carbon (billion US$2005/yr)") + out <- mbind(out, setNames(out[, , "Revenue|Government|Tax|Carbon|+|Demand|Buildings (billion US$2017/yr)"] + + out[, , "Revenue|Government|Tax|Carbon|+|Demand|Transport (billion US$2017/yr)"] + + out[, , "Revenue|Government|Tax|Carbon|+|Demand|Industry (billion US$2017/yr)"] + + out[, , "Revenue|Government|Tax|Carbon|+|Supply (billion US$2017/yr)"], + "Revenue|Government|Tax|Carbon (billion US$2017/yr)") ) # reporting subsidy or tax rate necessary to reach implicit set energy bounds @@ -289,9 +289,9 @@ reportTax <- function(gdx,output=NULL,regionSubsetList=NULL,t=c(seq(2005,2060,5) for (energyType in getNames(p47_implEnergyBoundTax,dim=2)){ if(!(all(p47_implEnergyBoundTax[,,carrier][,,energyType]==0))){ if(all(p47_implEnergyBoundTax[,,carrier][,,energyType]>=0)) - out <- mbind(out, setNames(p47_implEnergyBoundTax[,,carrier][,,energyType],paste0("Tax Rate|Implicit Energy Bounds|",energyCarrierLevel[carrier],"|",energyType, " (US$2005/GJ)"))) + out <- mbind(out, setNames(p47_implEnergyBoundTax[,,carrier][,,energyType],paste0("Tax Rate|Implicit Energy Bounds|",energyCarrierLevel[carrier],"|",energyType, " (US$2017/GJ)"))) else - out <- mbind(out, setNames(p47_implEnergyBoundTax[,,carrier][,,energyType],paste0("Subsidy Rate|Implicit Energy Bounds|",energyCarrierLevel[carrier],"|",energyType, " (US$2005/GJ)"))) + out <- mbind(out, setNames(p47_implEnergyBoundTax[,,carrier][,,energyType],paste0("Subsidy Rate|Implicit Energy Bounds|",energyCarrierLevel[carrier],"|",energyType, " (US$2017/GJ)"))) } } } diff --git a/R/reportTrade.R b/R/reportTrade.R index b8863069..75e935de 100644 --- a/R/reportTrade.R +++ b/R/reportTrade.R @@ -1,64 +1,64 @@ #' Read in GDX and calculate trade, used in convGDX2MIF.R for the reporting -#' +#' #' Read in trade information from GDX file, information used in convGDX2MIF.R #' for the reporting -#' -#' +#' +#' #' @param gdx a GDX object as created by readGDX, or the path to a gdx #' @param regionSubsetList a list containing regions to create report variables region #' aggregations. If NULL (default value) only the global region aggregation "GLO" will #' be created. #' @param t temporal resolution of the reporting, default: #' t=c(seq(2005,2060,5),seq(2070,2110,10),2130,2150) -#' +#' #' @return MAgPIE object - contains the price variables #' @author Lavinia Baumstark, Christoph Bertram, Anselm Schultes #' @seealso \code{\link{convGDX2MIF}} #' @examples -#' +#' #' \dontrun{reportTrade(gdx)} -#' +#' #' @export #' @importFrom gdx readGDX #' @importFrom magclass getYears setNames mbind reportTrade <- function(gdx,regionSubsetList=NULL,t=c(seq(2005,2060,5),seq(2070,2110,10),2130,2150)) { - + ####### get realisations ######### module2realisation <- readGDX(gdx, "module2realisation") rownames(module2realisation) <- module2realisation$modules - + TWa_2_EJ <- 31.536 sm_tdptwyr2dpgj <- 31.71 #TerraDollar per TWyear to Dollar per GJ - + p_eta_conv <- readGDX(gdx,name=c("pm_dataeta","p_eta_conv"),format = "first_found") p_costsPEtradeMp <- readGDX(gdx,name=c("pm_costsPEtradeMp","p_costsPEtradeMp"),format = "first_found") pm_pvp <- readGDX(gdx,name=c("pm_pvp"),format = "first_found") Xport <- readGDX(gdx,name=c("vm_Xport"),field = "l",format = "first_found") Mport <- readGDX(gdx,name=c("vm_Mport"),field = "l",format = "first_found") - + # calculate maximal temporal resolution y <- Reduce(intersect,list(getYears(pm_pvp),getYears(Xport))) Xport <- Xport[,y,] Mport <- Mport[,y,] pm_pvp <- pm_pvp[,y,] - p_eta_conv <- p_eta_conv[,y,] - - #AJS for current account + p_eta_conv <- p_eta_conv[,y,] + + #AJS for current account set_trade <- readGDX(gdx,name=c("trade"),types = 'sets',format="first_found") - + tradeMacro <- readGDX(gdx, "tradeMacro") tradePe <- readGDX(gdx, "tradePe") tradeSe <- readGDX(gdx, "tradeSe") - + # calculate variables trade <- Xport - Mport trade_net <- Xport - (1-p_costsPEtradeMp) * Mport price <- pm_pvp / setNames(pm_pvp[,,"good"],NULL) #so in TeraDollar per either TWyr (pecoal,pegas,peoil,pebiolc), Gt C (perm), and Mt Uran (peUr) respectively - - # build reporting - tmp <- NULL + + # build reporting + tmp <- NULL tmp <- mbind(tmp,setNames(trade_net[,,"pecoal"] * TWa_2_EJ, "Trade|Coal (EJ/yr)")) tmp <- mbind(tmp,setNames((1-p_costsPEtradeMp[,,"pecoal"]) * Mport[,,"pecoal"] * TWa_2_EJ, "Trade|Imports|Coal (EJ/yr)")) tmp <- mbind(tmp,setNames(Xport[,,"pecoal"] * TWa_2_EJ, "Trade|Exports|Coal (EJ/yr)")) @@ -68,52 +68,52 @@ reportTrade <- function(gdx,regionSubsetList=NULL,t=c(seq(2005,2060,5),seq(2070, tmp <- mbind(tmp,setNames(trade_net[,,"peoil"] * TWa_2_EJ, "Trade|Oil (EJ/yr)")) tmp <- mbind(tmp,setNames((1-p_costsPEtradeMp[,,"peoil"]) * Mport[,,"peoil"] * TWa_2_EJ, "Trade|Imports|Oil (EJ/yr)")) tmp <- mbind(tmp,setNames(Xport[,,"peoil"] * TWa_2_EJ, "Trade|Exports|Oil (EJ/yr)")) - + tmp <- mbind(tmp,setNames(trade_net[,,"peur"] * 1000, "Trade|Uranium|Mass (ktU/yr)")) tmp <- mbind(tmp,setNames(trade_net[,,"peur"] * p_eta_conv[,,"tnrs"] * TWa_2_EJ, "Trade|Uranium|seelEquivalent (EJ/yr)")) tmp <- mbind(tmp,setNames((1-p_costsPEtradeMp[,,"peur"]) * Mport[,,"peur"] * p_eta_conv[,,"tnrs"] * TWa_2_EJ, "Trade|Imports|Uranium (ktU/yr)")) tmp <- mbind(tmp,setNames(Xport[,,"peur"] * p_eta_conv[,,"tnrs"] * TWa_2_EJ, "Trade|Exports|Uranium (ktU/yr)")) - - tmp <- mbind(tmp,setNames(trade_net[,,"good"] * 1000, "Trade|Goods (billion US$2005/yr)")) - tmp <- mbind(tmp,setNames((1-p_costsPEtradeMp[,,"good"]) * Mport[,,"good"] * 1000, "Trade|Imports|Goods (billion US$2005/yr)")) - tmp <- mbind(tmp,setNames(Xport[,,"good"] * 1000, "Trade|Exports|Goods (billion US$2005/yr)")) - + + tmp <- mbind(tmp,setNames(trade_net[,,"good"] * 1000, "Trade|Goods (billion US$2017/yr)")) + tmp <- mbind(tmp,setNames((1-p_costsPEtradeMp[,,"good"]) * Mport[,,"good"] * 1000, "Trade|Imports|Goods (billion US$2017/yr)")) + tmp <- mbind(tmp,setNames(Xport[,,"good"] * 1000, "Trade|Exports|Goods (billion US$2017/yr)")) + tmp <- mbind(tmp,setNames(trade_net[,,"pebiolc"] * TWa_2_EJ, "Trade|Biomass (EJ/yr)") ) tmp <- mbind(tmp,setNames((1-p_costsPEtradeMp[,,"pebiolc"]) * Mport[,,"pebiolc"] * TWa_2_EJ,"Trade|Imports|Biomass (EJ/yr)") ) tmp <- mbind(tmp,setNames(Xport[,,"pebiolc"] * TWa_2_EJ, "Trade|Exports|Biomass (EJ/yr)")) - + tmp <- mbind(tmp,setNames(trade_net[,,"perm"] * 44 / 12 * 1000, "Trade|Emi Allowances|Volume (Mt CO2-equiv/yr)")) tmp <- mbind(tmp,setNames((1-p_costsPEtradeMp[,,"perm"]) * Mport[,,"perm"] * 44 / 12 * 1000,"Trade|Imports|Emi Allowances|Volume (Mt CO2-equiv/yr)")) tmp <- mbind(tmp,setNames(Xport[,,"perm"] * 44 / 12 * 1000, "Trade|Exports|Emi Allowances|Volume (Mt CO2-equiv/yr)")) - + # SE Trade if (module2realisation["trade",2] == "se_trade") { - + tmp <- mbind(tmp,setNames(trade_net[,,"seh2"] * TWa_2_EJ, "Trade|SE|Hydrogen (EJ/yr)")) # for now p_costsPEtradeMp is zero for SE trade, adapt once SE trade transport cost implemented tmp <- mbind(tmp,setNames((1-p_costsPEtradeMp[,,"seh2"]) * Mport[,,"seh2"] * TWa_2_EJ, "Trade|Imports|SE|Hydrogen (EJ/yr)")) tmp <- mbind(tmp,setNames(Xport[,,"seh2"] * TWa_2_EJ, "Trade|Exports|SE|Hydrogen (EJ/yr)")) - + tmp <- mbind(tmp,setNames(trade_net[,,"seel"] * TWa_2_EJ, "Trade|SE|Electricity (EJ/yr)")) # for now p_costsPEtradeMp is zero for SE trade, adapt once SE trade transport cost implemented tmp <- mbind(tmp,setNames((1-p_costsPEtradeMp[,,"seel"]) * Mport[,,"seel"] * TWa_2_EJ, "Trade|Imports|SE|Electricity (EJ/yr)")) tmp <- mbind(tmp,setNames(Xport[,,"seel"] * TWa_2_EJ, "Trade|Exports|SE|Electricity (EJ/yr)")) - + tmp <- mbind(tmp,setNames(trade_net[,,"seliqsyn"] * TWa_2_EJ, "Trade|SE|Liquids|Hydrogen (EJ/yr)")) # for now p_costsPEtradeMp is zero for SE trade, adapt once SE trade transport cost implemented tmp <- mbind(tmp,setNames((1-p_costsPEtradeMp[,,"seliqsyn"]) * Mport[,,"seliqsyn"] * TWa_2_EJ, "Trade|Imports|SE|Liquids|Hydrogen (EJ/yr)")) tmp <- mbind(tmp,setNames(Xport[,,"seliqsyn"] * TWa_2_EJ, "Trade|Exports|SE|Liquids|Hydrogen (EJ/yr)")) - + tmp <- mbind(tmp,setNames(trade_net[,,"segasyn"] * TWa_2_EJ, "Trade|SE|Gases|Hydrogen (EJ/yr)")) # for now p_costsPEtradeMp is zero for SE trade, adapt once SE trade transport cost implemented tmp <- mbind(tmp,setNames((1-p_costsPEtradeMp[,,"segasyn"]) * Mport[,,"segasyn"] * TWa_2_EJ, "Trade|Imports|SE|Gases|Hydrogen (EJ/yr)")) tmp <- mbind(tmp,setNames(Xport[,,"segasyn"] * TWa_2_EJ, "Trade|Exports|SE|Gases|Hydrogen (EJ/yr)")) - - + + } - - + + # add global values tmp <- mbind(tmp,dimSums(tmp,dim=1)) trade <- mbind(trade,dimSums(trade,dim=1)) @@ -122,16 +122,16 @@ reportTrade <- function(gdx,regionSubsetList=NULL,t=c(seq(2005,2060,5),seq(2070, tmp <- mbind(tmp, calc_regionSubset_sums(tmp, regionSubsetList)) trade <- mbind(trade, calc_regionSubset_sums(trade, regionSubsetList)) } - + # values use global prices - tmp <- mbind(tmp,setNames(trade[,,"pecoal"] * price[,,"pecoal"] * 1000, "Trade|Primary Energy|Coal|Value (billion US$2005/yr)")) - tmp <- mbind(tmp,setNames(trade[,,"pegas"] * price[,,"pegas"] * 1000, "Trade|Primary Energy|Gas|Value (billion US$2005/yr)")) - tmp <- mbind(tmp,setNames(trade[,,"peoil"] * price[,,"peoil"] * 1000, "Trade|Primary Energy|Oil|Value (billion US$2005/yr)")) - tmp <- mbind(tmp,setNames(trade[,,"peur"] * price[,,"peur"] * 1000, "Trade|Uranium|Value (billion US$2005/yr)")) - tmp <- mbind(tmp,setNames(trade[,,"pebiolc"] * price[,,"pebiolc"] * sm_tdptwyr2dpgj, "Trade|Biomass|Value (billion US$2005/yr)")) - tmp <- mbind(tmp,setNames(trade[,,"perm"] * price[,,"perm"] * 1000, "Trade|Emi Allowances|Value (billion US$2005/yr)")) - tmp <- mbind(tmp,setNames(dimSums( trade[,,set_trade] * price[,,set_trade],dim = 3) * 1000, "Trade|All|Value (billion US$2005/yr)")) - tmp <- mbind(tmp,setNames(dimSums( trade[,,set_trade] * price[,,set_trade],dim = 3), "Current Account (billion US$2005/yr)")) + tmp <- mbind(tmp,setNames(trade[,,"pecoal"] * price[,,"pecoal"] * 1000, "Trade|Primary Energy|Coal|Value (billion US$2017/yr)")) + tmp <- mbind(tmp,setNames(trade[,,"pegas"] * price[,,"pegas"] * 1000, "Trade|Primary Energy|Gas|Value (billion US$2017/yr)")) + tmp <- mbind(tmp,setNames(trade[,,"peoil"] * price[,,"peoil"] * 1000, "Trade|Primary Energy|Oil|Value (billion US$2017/yr)")) + tmp <- mbind(tmp,setNames(trade[,,"peur"] * price[,,"peur"] * 1000, "Trade|Uranium|Value (billion US$2017/yr)")) + tmp <- mbind(tmp,setNames(trade[,,"pebiolc"] * price[,,"pebiolc"] * sm_tdptwyr2dpgj, "Trade|Biomass|Value (billion US$2017/yr)")) + tmp <- mbind(tmp,setNames(trade[,,"perm"] * price[,,"perm"] * 1000, "Trade|Emi Allowances|Value (billion US$2017/yr)")) + tmp <- mbind(tmp,setNames(dimSums( trade[,,set_trade] * price[,,set_trade],dim = 3) * 1000, "Trade|All|Value (billion US$2017/yr)")) + tmp <- mbind(tmp,setNames(dimSums( trade[,,set_trade] * price[,,set_trade],dim = 3), "Current Account (billion US$2017/yr)")) # rename dimensions in the magpie object getSets(tmp)[3] <- "variable" From 9be36c168c05eecf1ff71cebf3b8fa874a6f2ca0 Mon Sep 17 00:00:00 2001 From: Falk Benke Date: Mon, 29 Jul 2024 11:46:57 +0200 Subject: [PATCH 2/6] switch to US017 in calculations for cs2 --- inst/compareScenarios/cs_02_macro.Rmd | 8 ++++---- inst/compareScenarios/preprocessing.R | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/inst/compareScenarios/cs_02_macro.Rmd b/inst/compareScenarios/cs_02_macro.Rmd index 322fc1a6..070f9380 100644 --- a/inst/compareScenarios/cs_02_macro.Rmd +++ b/inst/compareScenarios/cs_02_macro.Rmd @@ -265,10 +265,10 @@ kaya <- kayaUnits <- tribble( ~variable, ~unit, "Population", "million", - "GDP_MER_by_Pop", "billion US$2005/yr/million", - "GDP_PPP_by_Pop", "billion US$2005/yr/million", - "FE_by_GDP_MER", "EJ/billion US$2005", - "FE_by_GDP_PPP", "EJ/billion US$2005", + "GDP_MER_by_Pop", "billion US$2017/yr/million", + "GDP_PPP_by_Pop", "billion US$2017/yr/million", + "FE_by_GDP_MER", "EJ/billion US$2017", + "FE_by_GDP_PPP", "EJ/billion US$2017", "emiCO2_by_FE", "EJ/Mt CO2") kayaVars <- kayaUnits$variable kaya <- diff --git a/inst/compareScenarios/preprocessing.R b/inst/compareScenarios/preprocessing.R index 274a968c..4a57beab 100644 --- a/inst/compareScenarios/preprocessing.R +++ b/inst/compareScenarios/preprocessing.R @@ -18,8 +18,8 @@ options(mip.histRefModel = histRefModel) # nolint # The new variable "OldName pCap" will be available in the plot sections. pCapVariables <- tribble( ~variable, ~newUnit, ~conversionFactor, - "GDP|PPP", "kUS$2005/pCap", 1e6, # creates "GDP|PPP pCap" which is equal to reported variable "GDP|per capita|PPP" - "GDP|MER", "kUS$2005/pCap", 1e6, # creates "GDP|MER pCap" which is equal to reported variable "GDP|per capita|MER" + "GDP|PPP", "kUS$2017/pCap", 1e6, # creates "GDP|PPP pCap" which is equal to reported variable "GDP|per capita|PPP" + "GDP|MER", "kUS$2017/pCap", 1e6, # creates "GDP|MER pCap" which is equal to reported variable "GDP|per capita|MER" "FE", "GJ/yr/pCap", 1e9, "FE|CDR", "GJ/yr/pCap", 1e9, "FE|Transport", "GJ/yr/pCap", 1e9, @@ -133,11 +133,11 @@ dataGDP <- # The new variable "OldName pGDP_PPP" will be available in the plot sections. pGdpVariables <- tribble( ~variable, ~newUnit, ~conversionFactor, - "FE", "MJ/US$2005/pCap", 1e3, - "FE|CDR", "MJ/US$2005/pCap", 1e3, - "FE|Transport", "MJ/US$2005/pCap", 1e3, - "FE|Buildings", "MJ/US$2005/pCap", 1e3, - "FE|Industry", "MJ/US$2005/pCap", 1e3 + "FE", "MJ/US$2017/pCap", 1e3, + "FE|CDR", "MJ/US$2017/pCap", 1e3, + "FE|Transport", "MJ/US$2017/pCap", 1e3, + "FE|Buildings", "MJ/US$2017/pCap", 1e3, + "FE|Industry", "MJ/US$2017/pCap", 1e3 ) dataPGdp <- From 8a50da29f63005f081687427d967f66e6122069a Mon Sep 17 00:00:00 2001 From: Falk Benke Date: Fri, 20 Sep 2024 11:21:36 +0200 Subject: [PATCH 3/6] fix merge bug --- R/reportCosts.R | 43 +------------------------------------------ 1 file changed, 1 insertion(+), 42 deletions(-) diff --git a/R/reportCosts.R b/R/reportCosts.R index 6ceccf05..0fe467a5 100644 --- a/R/reportCosts.R +++ b/R/reportCosts.R @@ -268,6 +268,7 @@ reportCosts <- function(gdx,output=NULL,regionSubsetList=NULL,t=c(seq(2005,2060, tmp <- mbind(tmp,setNames(cost_emu_pre * 1000, "Costs|Biomass|Price integral presolve (billion US$2017/yr)")) tmp <- mbind(tmp,setNames(cost_emu * 1000, "Costs|Biomass|Price integral (billion US$2017/yr)")) tmp <- mbind(tmp,setNames(bio_cost_adjfac, "Costs|Biomass|Adjfactor (unitless)")) + if(!is.null(totLUcosts)) {tmp <- mbind(tmp,setNames(totLUcosts * 1000, "Costs|Land Use (billion US$2017/yr)"))} if(!is.null(totLUcostsWithMAC)) {tmp <- mbind(tmp,setNames(totLUcostsWithMAC * 1000, "Costs|Land Use with MAC-costs from MAgPIE (billion US$2017/yr)"))} if(!is.null(costsLuMACLookup)) {tmp <- mbind(tmp,setNames(costsLuMACLookup * 1000, "Costs|Land Use|MAC-costs Lookup (billion US$2017/yr)"))} @@ -399,48 +400,6 @@ reportCosts <- function(gdx,output=NULL,regionSubsetList=NULL,t=c(seq(2005,2060, ##### Electricity|Biomass cost <- op_costs(ei="pebiolc",eo="seel",te=pe2se$all_te,e2e=pe2se,teall2rlf=teall2rlf,vm_prodE=vm_prodSe,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) - tmp <- mbind(tmp,setNames(cost + output[regi_on_gdx,,"Energy Investments|Electricity|Biomass (billion US$2017/yr)"], "Total Energy costs|Electricity|Biomass (billion US$2017/yr)")) - - cost <- op_costs(ei="pebiolc",eo="seel",te=teccs,e2e=pe2se,teall2rlf=teall2rlf,vm_prodE=vm_prodSe,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) - tmp <- mbind(tmp,setNames(cost + output[regi_on_gdx,,"Energy Investments|Electricity|Biomass|w/ CC (billion US$2017/yr)"], "Total Energy costs|Electricity|Biomass|w/ CC (billion US$2017/yr)")) - - cost <- op_costs(ei="pebiolc",eo="seel",te=tenoccs,e2e=pe2se,teall2rlf=teall2rlf,vm_prodE=vm_prodSe,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) - tmp <- mbind(tmp,setNames(cost + output[regi_on_gdx,,"Energy Investments|Electricity|Biomass|w/o CC (billion US$2017/yr)"], "Total Energy costs|Electricity|Biomass|w/o CC (billion US$2017/yr)")) - - ##### Electricity|Coal - cost <- op_costs(ei="pecoal",eo="seel",te=pe2se$all_te,e2e=pe2se,teall2rlf=teall2rlf,vm_prodE=vm_prodSe,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) - cost <- cost + output[regi_on_gdx,,"Energy Investments|Electricity|Coal (billion US$2017/yr)"] - tmp <- mbind(tmp,setNames(cost, "Total Energy costs|Electricity|Coal (billion US$2017/yr)")) - - cost <- op_costs(ei="pecoal",eo="seel",te=teccs,e2e=pe2se,teall2rlf=teall2rlf,vm_prodE=vm_prodSe,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) - cost <- cost + output[regi_on_gdx,,"Energy Investments|Electricity|Coal|w/ CC (billion US$2017/yr)"] - tmp <- mbind(tmp,setNames(cost, "Total Energy costs|Electricity|Coal|w/ CC (billion US$2017/yr)")) - - cost <- op_costs(ei="pecoal",eo="seel",te=tenoccs,e2e=pe2se,teall2rlf=teall2rlf,vm_prodE=vm_prodSe,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) - cost <- cost + output[regi_on_gdx,,"Energy Investments|Electricity|Coal|w/o CC (billion US$2017/yr)"] - tmp <- mbind(tmp,setNames(cost, "Total Energy costs|Electricity|Coal|w/o CC (billion US$2017/yr)")) - - ##### Electricity|Gas - cost <- op_costs(ei="pegas",eo="seel",te=pe2se$all_te,e2e=pe2se,teall2rlf=teall2rlf,vm_prodE=vm_prodSe,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) - tmp <- mbind(tmp,setNames(cost + output[regi_on_gdx,,"Energy Investments|Electricity|Gas (billion US$2017/yr)"], "Total Energy costs|Electricity|Gas (billion US$2017/yr)")) - - cost <- op_costs(ei="pegas",eo="seel",te=teccs,e2e=pe2se,teall2rlf=teall2rlf,vm_prodE=vm_prodSe,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) - tmp <- mbind(tmp,setNames(cost + output[regi_on_gdx,,"Energy Investments|Electricity|Gas|w/ CC (billion US$2017/yr)"], "Total Energy costs|Electricity|Gas|w/ CC (billion US$2017/yr)")) - - cost <- op_costs(ei="pegas",eo="seel",te=tenoccs,e2e=pe2se,teall2rlf=teall2rlf,vm_prodE=vm_prodSe,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) - tmp <- mbind(tmp,setNames(cost + output[regi_on_gdx,,"Energy Investments|Electricity|Gas|w/o CC (billion US$2017/yr)"], "Total Energy costs|Electricity|Gas|w/o CC (billion US$2017/yr)")) - - ##### Electricity|Oil - cost <- op_costs(ei="peoil",eo="seel",te=pe2se$all_te,e2e=pe2se,teall2rlf=teall2rlf,vm_prodE=vm_prodSe,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) - tmp <- mbind(tmp,setNames(cost + output[regi_on_gdx,,"Energy Investments|Electricity|Oil (billion US$2017/yr)"], "Total Energy costs|Electricity|Oil (billion US$2017/yr)")) - - cost <- op_costs(ei="peoil",eo="seel",te=tenoccs,e2e=pe2se,teall2rlf=teall2rlf,vm_prodE=vm_prodSe,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) - tmp <- mbind(tmp,setNames(cost + output[regi_on_gdx,,"Energy Investments|Electricity|Oil|w/o CC (billion US$2017/yr)"], "Total Energy costs|Electricity|Oil|w/o CC (billion US$2017/yr)")) - - ##### Electricity|Nuclear - cost <- op_costs(ei="peur",eo="seel",te=pe2se$all_te,e2e=pe2se,teall2rlf=teall2rlf,vm_prodE=vm_prodSe,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) - tmp <- mbind(tmp,setNames(cost + output[regi_on_gdx,,"Energy Investments|Electricity|Nuclear (billion US$2017/yr)"], "Total Energy costs|Electricity|Nuclear (billion US$2017/yr)")) -======= tmp <- mbind(tmp,setNames(cost + output[regi_on_gdx,,"Energy Investments|Electricity|Biomass (billion US$2017/yr)"], "Total Energy costs|Electricity|+|Biomass (billion US$2017/yr)")) cost <- op_costs(ei="pebiolc",eo="seel",te=teccs,e2e=pe2se,teall2rlf=teall2rlf,vm_prodE=vm_prodSe,pm_data=pm_data,vm_cap=vm_cap,v_investcost=v_investcost) From b21fe348b79f82e4a87fa9e588f91ba25e2fa415 Mon Sep 17 00:00:00 2001 From: Falk Benke Date: Mon, 23 Sep 2024 11:22:19 +0200 Subject: [PATCH 4/6] change unit in price variables to US017 --- R/reportCapitalStock.R | 8 +- R/reportEmployment.R | 48 +-- R/reportMOFEX.R | 22 +- R/reportPrices.R | 536 +++++++++++++-------------- R/reportTechnology.R | 18 +- tests/testthat/test-addSubvariable.R | 6 +- 6 files changed, 319 insertions(+), 319 deletions(-) diff --git a/R/reportCapitalStock.R b/R/reportCapitalStock.R index abcb99dc..b8c67d59 100644 --- a/R/reportCapitalStock.R +++ b/R/reportCapitalStock.R @@ -54,15 +54,15 @@ reportCapitalStock <- function(gdx,regionSubsetList=NULL,t=c(seq(2005,2060,5),se if (tran_mod == "complex"){ LDV35 <- readGDX(gdx,name=c("LDV35"),format="first_found") tmp <- mbind(tmp,setNames(dimSums( (vm_cap * v_investcost)[teue2rlf] - ,dim=c(3.1,3.2)) * 1000, "Est Capital Stock|ESM|Transp vehic (billion US$2005)")) + ,dim=c(3.1,3.2)) * 1000, "Est Capital Stock|ESM|Transp vehic (billion US$2017)")) tmp <- mbind(tmp,setNames(dimSums( (vm_cap * v_investcost)[teall2rlf][,,LDV35] - ,dim=c(3.1,3.2)) * 1000, "Est Capital Stock|ESM|Pet/EV LDV (billion US$2005)")) + ,dim=c(3.1,3.2)) * 1000, "Est Capital Stock|ESM|Pet/EV LDV (billion US$2017)")) tmp <- mbind(tmp, setNames( dimSums(mbind(vm_cap * v_investcost), dim = 3) * 1000, - "Estimated Capital Stock|ESM (billion US$2005)" + "Estimated Capital Stock|ESM (billion US$2017)" ) ) @@ -124,7 +124,7 @@ reportCapitalStock <- function(gdx,regionSubsetList=NULL,t=c(seq(2005,2060,5),se eek_Ind <- setNames(vm_cesIO[,y,ppfKap_Ind], paste0('Capital|Energy Efficiency|Industry|', mixer[mixer$pf %in% ppfKap_Ind,][['name']], - ' (billion US$2005)')) + ' (billion US$2017)')) # add industry EEK and global totals tmp <- mbind(tmp, mbind(eek_Ind, dimSums(eek_Ind, dim = 1))) } diff --git a/R/reportEmployment.R b/R/reportEmployment.R index e6e91082..a9434e31 100644 --- a/R/reportEmployment.R +++ b/R/reportEmployment.R @@ -41,30 +41,30 @@ reportEmployment <- function(gdx, improvements, multiplier, subtype, shareManf, reportTech <- reportTechnology(gdx) reportTech <- collapseNames(reportTech) var <- c( - "Tech|Electricity|Coal|Pulverised Coal w/o CC|Capital Costs (US$2005/kW)", - "Tech|Electricity|Gas|Combined Cycle w/o CC|Capital Costs (US$2005/kW)", - "Tech|Electricity|Hydro|Capital Costs (US$2005/kW)", - "Tech|Electricity|Nuclear|Capital Costs (US$2005/kW)", - "Tech|Electricity|Solar|PV|Capital Costs (US$2005/kW)", - "Tech|Electricity|Solar|CSP|Capital Costs (US$2005/kW)", - "Tech|Electricity|Wind|Onshore|Capital Costs (US$2005/kW)", - "Tech|Electricity|Wind|Offshore|Capital Costs (US$2005/kW)", - "Tech|Electricity|Biomass|Combined Heat and Power w/o CC|Capital Costs (US$2005/kW)", - "Tech|Electricity|Storage|Battery|For PV|Capital Costs (US$2005/kW)", - "Tech|Electricity|Oil|DOT|Capital Costs (US$2005/kW)", - "Tech|Electricity|Geothermal|Capital Costs (US$2005/kW)", - "Tech|Electricity|Coal|Pulverised Coal w/o CC|OM Cost|fixed (US$2005/kW/yr)", - "Tech|Electricity|Gas|Combined Cycle w/o CC|OM Cost|fixed (US$2005/kW/yr)", - "Tech|Electricity|Hydro|OM Cost|fixed (US$2005/kW/yr)", - "Tech|Electricity|Nuclear|OM Cost|fixed (US$2005/kW/yr)", - "Tech|Electricity|Solar|PV|OM Cost|fixed (US$2005/kW/yr)", - "Tech|Electricity|Solar|CSP|OM Cost|fixed (US$2005/kW/yr)", - "Tech|Electricity|Wind|Onshore|OM Cost|fixed (US$2005/kW/yr)", - "Tech|Electricity|Wind|Offshore|OM Cost|fixed (US$2005/kW/yr)", - "Tech|Electricity|Biomass|Combined Heat and Power w/o CC|OM Cost|fixed (US$2005/kW/yr)", - "Tech|Electricity|Oil|DOT|OM Cost|fixed (US$2005/kW/yr)", - "Tech|Electricity|Geothermal|OM Cost|fixed (US$2005/kW/yr)", - "Tech|Electricity|Storage|Battery|For PV|OM Cost|fixed (US$2005/kW/yr)", + "Tech|Electricity|Coal|Pulverised Coal w/o CC|Capital Costs (U$2017/kW)", + "Tech|Electricity|Gas|Combined Cycle w/o CC|Capital Costs (U$2017/kW)", + "Tech|Electricity|Hydro|Capital Costs (U$2017/kW)", + "Tech|Electricity|Nuclear|Capital Costs (U$2017/kW)", + "Tech|Electricity|Solar|PV|Capital Costs (U$2017/kW)", + "Tech|Electricity|Solar|CSP|Capital Costs (U$2017/kW)", + "Tech|Electricity|Wind|Onshore|Capital Costs (U$2017/kW)", + "Tech|Electricity|Wind|Offshore|Capital Costs (U$2017/kW)", + "Tech|Electricity|Biomass|Combined Heat and Power w/o CC|Capital Costs (U$2017/kW)", + "Tech|Electricity|Storage|Battery|For PV|Capital Costs (U$2017/kW)", + "Tech|Electricity|Oil|DOT|Capital Costs (U$2017/kW)", + "Tech|Electricity|Geothermal|Capital Costs (U$2017/kW)", + "Tech|Electricity|Coal|Pulverised Coal w/o CC|OM Cost|fixed (U$2017/kW/yr)", + "Tech|Electricity|Gas|Combined Cycle w/o CC|OM Cost|fixed (U$2017/kW/yr)", + "Tech|Electricity|Hydro|OM Cost|fixed (U$2017/kW/yr)", + "Tech|Electricity|Nuclear|OM Cost|fixed (U$2017/kW/yr)", + "Tech|Electricity|Solar|PV|OM Cost|fixed (U$2017/kW/yr)", + "Tech|Electricity|Solar|CSP|OM Cost|fixed (U$2017/kW/yr)", + "Tech|Electricity|Wind|Onshore|OM Cost|fixed (U$2017/kW/yr)", + "Tech|Electricity|Wind|Offshore|OM Cost|fixed (U$2017/kW/yr)", + "Tech|Electricity|Biomass|Combined Heat and Power w/o CC|OM Cost|fixed (U$2017/kW/yr)", + "Tech|Electricity|Oil|DOT|OM Cost|fixed (U$2017/kW/yr)", + "Tech|Electricity|Geothermal|OM Cost|fixed (U$2017/kW/yr)", + "Tech|Electricity|Storage|Battery|For PV|OM Cost|fixed (U$2017/kW/yr)", NULL ) # only capital costs diff --git a/R/reportMOFEX.R b/R/reportMOFEX.R index bdba7786..a33642e3 100644 --- a/R/reportMOFEX.R +++ b/R/reportMOFEX.R @@ -218,16 +218,16 @@ reportMOFEX <- function(gdx, gdx_ref = NULL, file = NULL, scenario = "default") # Fossil Fuel Prices peFossilPrices <- NULL - peFossilPrices <- mbind(peFossilPrices, setNames(fuel2pe.m[, , "pecoal"] / ts * tdptwyr2dpgj, "Price|Coal|Primary Level (US$2005/GJ)")) - peFossilPrices <- mbind(peFossilPrices, setNames(fuel2pe.m[, , "peoil"] / ts * tdptwyr2dpgj, "Price|Crude Oil|Primary Level (US$2005/GJ)")) - peFossilPrices <- mbind(peFossilPrices, setNames(fuel2pe.m[, , "pegas"] / ts * tdptwyr2dpgj, "Price|Natural Gas|Primary Level (US$2005/GJ)")) - # peFossilPrices <- mbind(peFossilPrices,setNames(lowpass(fuel2pe.m[,,"pegas"]/(budget.m+1e-10), fix="both", altFilter=match(2010,t)) * tdptwyr2dpgj, "Price|Natural Gas|Primary Level|Moving Avg (US$2005/GJ)")) + peFossilPrices <- mbind(peFossilPrices, setNames(fuel2pe.m[, , "pecoal"] / ts * tdptwyr2dpgj, "Price|Coal|Primary Level (US$2017/GJ)")) + peFossilPrices <- mbind(peFossilPrices, setNames(fuel2pe.m[, , "peoil"] / ts * tdptwyr2dpgj, "Price|Crude Oil|Primary Level (US$2017/GJ)")) + peFossilPrices <- mbind(peFossilPrices, setNames(fuel2pe.m[, , "pegas"] / ts * tdptwyr2dpgj, "Price|Natural Gas|Primary Level (US$2017/GJ)")) + # peFossilPrices <- mbind(peFossilPrices,setNames(lowpass(fuel2pe.m[,,"pegas"]/(budget.m+1e-10), fix="both", altFilter=match(2010,t)) * tdptwyr2dpgj, "Price|Natural Gas|Primary Level|Moving Avg (US$2017/GJ)")) # mapping of weights for the variables for global aggregation int2ext <- c( - "Price|Coal|Primary Level (US$2005/GJ)" = "PE|Coal (EJ/yr)", - "Price|Crude Oil|Primary Level (US$2005/GJ)" = "PE|Oil (EJ/yr)", - "Price|Natural Gas|Primary Level (US$2005/GJ)" = "PE|Gas (EJ/yr)" - # "Price|Natural Gas|Primary Level|Moving Avg (US$2005/GJ)" = "PE|Production|Net|Gas (EJ/yr)" + "Price|Coal|Primary Level (US$2017/GJ)" = "PE|Coal (EJ/yr)", + "Price|Crude Oil|Primary Level (US$2017/GJ)" = "PE|Oil (EJ/yr)", + "Price|Natural Gas|Primary Level (US$2017/GJ)" = "PE|Gas (EJ/yr)" + # "Price|Natural Gas|Primary Level|Moving Avg (US$2017/GJ)" = "PE|Production|Net|Gas (EJ/yr)" ) map <- data.frame(region = getRegions(peFossilPrices), world = "GLO", stringsAsFactors = FALSE) peFossilPrices_GLO <- new.magpie("GLO", getYears(peFossilPrices), magclass::getNames(peFossilPrices), fill = 0) @@ -247,11 +247,11 @@ reportMOFEX <- function(gdx, gdx_ref = NULL, file = NULL, scenario = "default") peFossilGloPrices <- NULL glob_price <- new.magpie(getRegions(peQtys), getYears(peQtys), fill = 0) for (i in getRegions(glob_price)) glob_price[i, , ] <- tradebal.m[, , "peoil"] * tdptwyr2dpgj - peFossilGloPrices <- mbind(peFossilGloPrices, setNames(glob_price, "Price|Oil|World Market (US$2005/GJ)")) + peFossilGloPrices <- mbind(peFossilGloPrices, setNames(glob_price, "Price|Oil|World Market (US$2017/GJ)")) for (i in getRegions(glob_price)) glob_price[i, , ] <- tradebal.m[, , "pegas"] * tdptwyr2dpgj - peFossilGloPrices <- mbind(peFossilGloPrices, setNames(glob_price, "Price|Gas|World Market (US$2005/GJ)")) + peFossilGloPrices <- mbind(peFossilGloPrices, setNames(glob_price, "Price|Gas|World Market (US$2017/GJ)")) for (i in getRegions(glob_price)) glob_price[i, , ] <- tradebal.m[, , "pecoal"] * tdptwyr2dpgj - peFossilGloPrices <- mbind(peFossilGloPrices, setNames(glob_price, "Price|Coal|World Market (US$2005/GJ)")) + peFossilGloPrices <- mbind(peFossilGloPrices, setNames(glob_price, "Price|Coal|World Market (US$2017/GJ)")) for (i in getRegions(glob_price)) glob_price[i, , ] <- pm_pvp[, , "peoil"] * 1000 peFossilGloPrices <- mbind(peFossilGloPrices, setNames(glob_price, "PVP1|Oil (billionDpTWyr)")) for (i in getRegions(glob_price)) glob_price[i, , ] <- pm_pvp[, , "pegas"] * 1000 diff --git a/R/reportPrices.R b/R/reportPrices.R index 5966e984..44a37924 100644 --- a/R/reportPrices.R +++ b/R/reportPrices.R @@ -178,84 +178,84 @@ reportPrices <- function(gdx, output=NULL, regionSubsetList=NULL, out <- mbind( out, setNames( dimSums(mselect(p_weights_FEprice_mkt * pm_FEPrice, all_enty1="feelt", emi_sectors = "trans"), dim=3.3, na.rm = T)*tdptwyr2dpgj, - "Price|Final Energy|Transport|Electricity (US$2005/GJ)"), + "Price|Final Energy|Transport|Electricity (US$2017/GJ)"), ## in case of transport liquids: calculate weighted average of markets first, then calculate weighted average of fepet/fedie setNames( dimSums( p_weights_FEprice_diepet * dimSums(mselect(p_weights_FEprice_mkt * pm_FEPrice, all_enty1=c("fepet","fedie"), emi_sectors = "trans"), dim=3.3, na.rm = T), dim=3.1, na.rm = T)*tdptwyr2dpgj, - "Price|Final Energy|Transport|Liquids (US$2005/GJ)"), + "Price|Final Energy|Transport|Liquids (US$2017/GJ)"), setNames( dimSums(mselect(p_weights_FEprice_mkt * pm_FEPrice, all_enty1="feh2t", emi_sectors = "trans"), dim=3.3, na.rm = T)*tdptwyr2dpgj, - "Price|Final Energy|Transport|Hydrogen (US$2005/GJ)") + "Price|Final Energy|Transport|Hydrogen (US$2017/GJ)") ) if (module2realisation["transport",2] == "edge_esm") { out <- mbind( out, setNames( dimSums(mselect(p_weights_FEprice_mkt * pm_FEPrice, all_enty1="fegat", emi_sectors = "trans"), dim=3.3, na.rm = T)*tdptwyr2dpgj, - "Price|Final Energy|Transport|Gases (US$2005/GJ)")) + "Price|Final Energy|Transport|Gases (US$2017/GJ)")) } out <- mbind( out, setNames( dimSums(mselect(p_weights_FEprice_mkt * pm_FEPrice, all_enty1="fedie", emi_sectors = "trans"), dim=3.3, na.rm = T)*tdptwyr2dpgj, - "Price|Final Energy|Transport|Liquids|HDV (US$2005/GJ)"), + "Price|Final Energy|Transport|Liquids|HDV (US$2017/GJ)"), setNames( dimSums(mselect(p_weights_FEprice_mkt * pm_FEPrice, all_enty1="fepet", emi_sectors = "trans"), dim=3.3, na.rm = T)*tdptwyr2dpgj, - "Price|Final Energy|Transport|Liquids|LDV (US$2005/GJ)")) + "Price|Final Energy|Transport|Liquids|LDV (US$2017/GJ)")) ## FE Buildings Prices out <- mbind(out, setNames( dimSums(mselect(p_weights_FEprice_mkt * pm_FEPrice, all_enty1="feels", emi_sectors = "build"), dim=3.3, na.rm = T)*tdptwyr2dpgj, - "Price|Final Energy|Buildings|Electricity (US$2005/GJ)"), + "Price|Final Energy|Buildings|Electricity (US$2017/GJ)"), setNames( dimSums(mselect(p_weights_FEprice_mkt * pm_FEPrice, all_enty1="fegas", emi_sectors = "build"), dim=3.3, na.rm = T)*tdptwyr2dpgj, - "Price|Final Energy|Buildings|Gases (US$2005/GJ)"), + "Price|Final Energy|Buildings|Gases (US$2017/GJ)"), setNames( dimSums(mselect(p_weights_FEprice_mkt * pm_FEPrice, all_enty1="feh2s", emi_sectors = "build"), dim=3.3, na.rm = T)*tdptwyr2dpgj, - "Price|Final Energy|Buildings|Hydrogen (US$2005/GJ)"), + "Price|Final Energy|Buildings|Hydrogen (US$2017/GJ)"), setNames( dimSums(mselect(p_weights_FEprice_mkt * pm_FEPrice, all_enty1="fehos", emi_sectors = "build"), dim=3.3, na.rm = T)*tdptwyr2dpgj, - "Price|Final Energy|Buildings|Liquids (US$2005/GJ)"), + "Price|Final Energy|Buildings|Liquids (US$2017/GJ)"), setNames( dimSums(mselect(p_weights_FEprice_mkt * pm_FEPrice, all_enty1="fehes", emi_sectors = "build"), dim=3.3, na.rm = T)*tdptwyr2dpgj, - "Price|Final Energy|Buildings|Heat (US$2005/GJ)"), + "Price|Final Energy|Buildings|Heat (US$2017/GJ)"), setNames( dimSums(mselect(p_weights_FEprice_mkt * pm_FEPrice, all_enty1="fesos", emi_sectors = "build"), dim=3.3, na.rm = T)*tdptwyr2dpgj, - "Price|Final Energy|Buildings|Solids (US$2005/GJ)") + "Price|Final Energy|Buildings|Solids (US$2017/GJ)") ) ## FE Industry Prices out <- mbind(out, setNames( dimSums(mselect(p_weights_FEprice_mkt * pm_FEPrice, all_enty1="feels", emi_sectors = "indst"), dim=3.3, na.rm = T)*tdptwyr2dpgj, - "Price|Final Energy|Industry|Electricity (US$2005/GJ)"), + "Price|Final Energy|Industry|Electricity (US$2017/GJ)"), setNames( dimSums(mselect(p_weights_FEprice_mkt * pm_FEPrice, all_enty1="fegas", emi_sectors = "indst"), dim=3.3, na.rm = T)*tdptwyr2dpgj, - "Price|Final Energy|Industry|Gases (US$2005/GJ)"), + "Price|Final Energy|Industry|Gases (US$2017/GJ)"), setNames( dimSums(mselect(p_weights_FEprice_mkt * pm_FEPrice, all_enty1="feh2s", emi_sectors = "indst"), dim=3.3, na.rm = T)*tdptwyr2dpgj, - "Price|Final Energy|Industry|Hydrogen (US$2005/GJ)"), + "Price|Final Energy|Industry|Hydrogen (US$2017/GJ)"), setNames( dimSums(mselect(p_weights_FEprice_mkt * pm_FEPrice, all_enty1="fehos", emi_sectors = "indst"), dim=3.3, na.rm = T)*tdptwyr2dpgj, - "Price|Final Energy|Industry|Liquids (US$2005/GJ)"), + "Price|Final Energy|Industry|Liquids (US$2017/GJ)"), setNames( dimSums(mselect(p_weights_FEprice_mkt * pm_FEPrice, all_enty1="fehes", emi_sectors = "indst"), dim=3.3, na.rm = T)*tdptwyr2dpgj, - "Price|Final Energy|Industry|Heat (US$2005/GJ)"), + "Price|Final Energy|Industry|Heat (US$2017/GJ)"), setNames( dimSums(mselect(p_weights_FEprice_mkt * pm_FEPrice, all_enty1="fesos", emi_sectors = "indst"), dim=3.3, na.rm = T)*tdptwyr2dpgj, - "Price|Final Energy|Industry|Solids (US$2005/GJ)") + "Price|Final Energy|Industry|Solids (US$2017/GJ)") ) ## SE Prices out <- mbind(out, setNames(mselect(pm_SEPrice, all_enty="seliqfos")*tdptwyr2dpgj, - "Price|Secondary Energy|Liquids|Fossil (US$2005/GJ)"), + "Price|Secondary Energy|Liquids|Fossil (US$2017/GJ)"), setNames(mselect(pm_SEPrice, all_enty="seliqbio")*tdptwyr2dpgj, - "Price|Secondary Energy|Liquids|Biomass (US$2005/GJ)"), + "Price|Secondary Energy|Liquids|Biomass (US$2017/GJ)"), setNames(mselect(pm_SEPrice, all_enty="seliqsyn")*tdptwyr2dpgj, - "Price|Secondary Energy|Liquids|Hydrogen (US$2005/GJ)"), + "Price|Secondary Energy|Liquids|Hydrogen (US$2017/GJ)"), setNames(mselect(pm_SEPrice, all_enty="sesobio")*tdptwyr2dpgj, - "Price|Secondary Energy|Solids|Biomass (US$2005/GJ)"), + "Price|Secondary Energy|Solids|Biomass (US$2017/GJ)"), setNames(mselect(pm_SEPrice, all_enty="sesofos")*tdptwyr2dpgj, - "Price|Secondary Energy|Solids|Fossil (US$2005/GJ)"), + "Price|Secondary Energy|Solids|Fossil (US$2017/GJ)"), setNames(mselect(pm_SEPrice, all_enty="seel")*tdptwyr2dpgj, - "Price|Secondary Energy|Electricity (US$2005/GJ)"), + "Price|Secondary Energy|Electricity (US$2017/GJ)"), setNames(mselect(pm_SEPrice, all_enty="seh2")*tdptwyr2dpgj, - "Price|Secondary Energy|Hydrogen (US$2005/GJ)"), + "Price|Secondary Energy|Hydrogen (US$2017/GJ)"), setNames(mselect(pm_SEPrice, all_enty="segabio")*tdptwyr2dpgj, - "Price|Secondary Energy|Gases|Biomass (US$2005/GJ)"), + "Price|Secondary Energy|Gases|Biomass (US$2017/GJ)"), setNames(mselect(pm_SEPrice, all_enty="segafos")*tdptwyr2dpgj, - "Price|Secondary Energy|Gases|Fossil (US$2005/GJ)"), + "Price|Secondary Energy|Gases|Fossil (US$2017/GJ)"), setNames(mselect(pm_SEPrice, all_enty="segasyn")*tdptwyr2dpgj, - "Price|Secondary Energy|Gases|Hydrogen (US$2005/GJ)"), + "Price|Secondary Energy|Gases|Hydrogen (US$2017/GJ)"), setNames(mselect(pm_SEPrice, all_enty="sehe")*tdptwyr2dpgj, - "Price|Secondary Energy|Heat (US$2005/GJ)") + "Price|Secondary Energy|Heat (US$2017/GJ)") ) weightsSe <- NULL if (exists("seAgg")) { @@ -266,11 +266,11 @@ reportPrices <- function(gdx, output=NULL, regionSubsetList=NULL, weightsSe <- weightsSe[,intersect(getYears(weightsSe),getYears(pm_SEPrice)),intersect(getItems(weightsSe,dim=3),getItems(pm_SEPrice,dim=3))] out <- mbind(out, setNames(dimSums(mselect(weightsSe*pm_SEPrice[,,getItems(weightsSe,dim=3)], all_enty1=unique(filter(seAgg2se ,.data$all_enty=="all_seliq")[,"all_enty1"])))*tdptwyr2dpgj, - "Price|Secondary Energy|Liquids (US$2005/GJ)"), + "Price|Secondary Energy|Liquids (US$2017/GJ)"), setNames(dimSums(mselect(weightsSe*pm_SEPrice[,,getItems(weightsSe,dim=3)], all_enty1=unique(filter(seAgg2se ,.data$all_enty=="all_seso")[,"all_enty1"])))*tdptwyr2dpgj, - "Price|Secondary Energy|Solids (US$2005/GJ)"), + "Price|Secondary Energy|Solids (US$2017/GJ)"), setNames(dimSums(mselect(weightsSe*pm_SEPrice[,,getItems(weightsSe,dim=3)], all_enty1=unique(filter(seAgg2se ,.data$all_enty=="all_sega")[,"all_enty1"])))*tdptwyr2dpgj, - "Price|Secondary Energy|Gases (US$2005/GJ)") + "Price|Secondary Energy|Gases (US$2017/GJ)") ) } @@ -278,20 +278,20 @@ reportPrices <- function(gdx, output=NULL, regionSubsetList=NULL, ## PE Prices out <- mbind(out, setNames(mselect(pm_PEPrice, all_enty="peoil")*tdptwyr2dpgj, - "Price|Primary Energy|Oil (US$2005/GJ)"), + "Price|Primary Energy|Oil (US$2017/GJ)"), setNames(mselect(pm_PEPrice, all_enty="pegas")*tdptwyr2dpgj, - "Price|Primary Energy|Gas (US$2005/GJ)"), + "Price|Primary Energy|Gas (US$2017/GJ)"), setNames(mselect(pm_PEPrice, all_enty="pecoal")*tdptwyr2dpgj, - "Price|Primary Energy|Coal (US$2005/GJ)"), + "Price|Primary Energy|Coal (US$2017/GJ)"), setNames(mselect(pm_PEPrice, all_enty="peur")*tdptwyr2dpgj, - "Price|Primary Energy|Nuclear (US$2005/GJ)"), + "Price|Primary Energy|Nuclear (US$2017/GJ)"), ## only modern (ligno-cellulosic) biomass reported setNames(mselect(pm_PEPrice, all_enty="pebiolc")*tdptwyr2dpgj, - "Price|Primary Energy|Biomass|Modern (US$2005/GJ)"), + "Price|Primary Energy|Biomass|Modern (US$2017/GJ)"), setNames(mselect(pm_PEPrice, all_enty="pebios")*tdptwyr2dpgj, - "Price|Primary Energy|Biomass|1st Generation|Sugar and Starch (US$2005/GJ)"), + "Price|Primary Energy|Biomass|1st Generation|Sugar and Starch (US$2017/GJ)"), setNames(mselect(pm_PEPrice, all_enty="pebios")*tdptwyr2dpgj, - "Price|Primary Energy|Biomass|1st Generation|Oil-based (US$2005/GJ)") + "Price|Primary Energy|Biomass|1st Generation|Oil-based (US$2017/GJ)") ) @@ -380,7 +380,7 @@ reportPrices <- function(gdx, output=NULL, regionSubsetList=NULL, ## add rawdata price variables, calculated from marginals, to the reporting addVar <- function(input,var,namevector,fe,se,sector,emiMkt) { # function to add only variables if they were not saved already - name <- paste0("Price|Final Energy|", paste(namevector, collapse = "|"), " (US$2005/GJ)") + name <- paste0("Price|Final Energy|", paste(namevector, collapse = "|"), " (US$2017/GJ)") name <- gsub("||", "|", name, fixed = TRUE) name <- gsub("| (", " (", name, fixed = TRUE) if (any(is.na(namevector))) warning("In reportPrices, addVar called with a NA value: ", name) @@ -478,37 +478,37 @@ reportPrices <- function(gdx, output=NULL, regionSubsetList=NULL, out <- mbind( out, - setNames(price.td[, , "tdfospet"], "Price|Final Energy|Transport|Liquids|Petroleum|Transport and Distribution (US$2005/GJ)"), - setNames(price.td[, , "tdfosdie"], "Price|Final Energy|Transport|Liquids|Diesel|Transport and Distribution (US$2005/GJ)"), - setNames(price.td[, , "tdbiopet"], "Price|Final Energy|Transport|Liquids|Biomass|Transport and Distribution (US$2005/GJ)"), - setNames(price.td[, , "tdsynpet"], "Price|Final Energy|Transport|Liquids|Efuel|Transport and Distribution (US$2005/GJ)"), - setNames(price.td[, , "tdsyngat"], "Price|Final Energy|Transport|Gases|Efuel|Transport and Distribution (US$2005/GJ)"), - setNames(price.td[, , "tdfosgat"], "Price|Final Energy|Transport|Gases|Natural Gas|Transport and Distribution (US$2005/GJ)"), - setNames(price.td[, , "tdh2t"], "Price|Final Energy|Transport|Hydrogen|Transport and Distribution (US$2005/GJ)"), - setNames(price.td[, , "tdelt"], "Price|Final Energy|Transport|Electricity|Transport and Distribution (US$2005/GJ)"), - - setNames(price.td[, , "tdfoshos"], "Price|Final Energy|Buildings|Liquids|Oil|Transport and Distribution (US$2005/GJ)"), - setNames(price.td[, , "tdfosgas"], "Price|Final Energy|Buildings|Gases|Natural Gas|Transport and Distribution (US$2005/GJ)"), - setNames(price.td[, , "tdhes"], "Price|Final Energy|Buildings|Heat|Transport and Distribution (US$2005/GJ)"), - setNames(price.td[, , "tdbiopet"], "Price|Final Energy|Buildings|Liquids|Biomass|Transport and Distribution (US$2005/GJ)"), - setNames(price.td[, , "tdbiosos"], "Price|Final Energy|Buildings|Solids|Biomass|Transport and Distribution (US$2005/GJ)"), - setNames(price.td[, , "tdbiogas"], "Price|Final Energy|Buildings|Gases|Biomass|Transport and Distribution (US$2005/GJ)"), - setNames(price.td[, , "tdsynpet"], "Price|Final Energy|Buildings|Liquids|Efuel|Transport and Distribution (US$2005/GJ)"), - setNames(price.td[, , "tdsyngas"], "Price|Final Energy|Buildings|Gases|Efuel|Transport and Distribution (US$2005/GJ)"), - setNames(price.td[, , "tdh2s"], "Price|Final Energy|Buildings|Hydrogen|Transport and Distribution (US$2005/GJ)"), - setNames(price.td[, , "tdels"], "Price|Final Energy|Buildings|Electricity|Transport and Distribution (US$2005/GJ)"), - - setNames(price.td[, , "tdfoshos"], "Price|Final Energy|Industry|Liquids|Oil|Transport and Distribution (US$2005/GJ)"), - setNames(price.td[, , "tdfossos"], "Price|Final Energy|Industry|Solids|Coal|Transport and Distribution (US$2005/GJ)"), - setNames(price.td[, , "tdfosgas"], "Price|Final Energy|Industry|Gases|Natural Gas|Transport and Distribution (US$2005/GJ)"), - setNames(price.td[, , "tdhes"], "Price|Final Energy|Industry|Heat|Transport and Distribution (US$2005/GJ)"), - setNames(price.td[, , "tdbiopet"], "Price|Final Energy|Industry|Liquids|Biomass|Transport and Distribution (US$2005/GJ)"), - setNames(price.td[, , "tdbiosos"], "Price|Final Energy|Industry|Solids|Biomass|Transport and Distribution (US$2005/GJ)"), - setNames(price.td[, , "tdbiogas"], "Price|Final Energy|Industry|Gases|Biomass|Transport and Distribution (US$2005/GJ)"), - setNames(price.td[, , "tdsynpet"], "Price|Final Energy|Industry|Liquids|Efuel|Transport and Distribution (US$2005/GJ)"), - setNames(price.td[, , "tdsyngas"], "Price|Final Energy|Industry|Gases|Efuel|Transport and Distribution (US$2005/GJ)"), - setNames(price.td[, , "tdh2s"], "Price|Final Energy|Industry|Hydrogen|Transport and Distribution (US$2005/GJ)"), - setNames(price.td[, , "tdels"], "Price|Final Energy|Industry|Electricity|Transport and Distribution (US$2005/GJ)") + setNames(price.td[, , "tdfospet"], "Price|Final Energy|Transport|Liquids|Petroleum|Transport and Distribution (US$2017/GJ)"), + setNames(price.td[, , "tdfosdie"], "Price|Final Energy|Transport|Liquids|Diesel|Transport and Distribution (US$2017/GJ)"), + setNames(price.td[, , "tdbiopet"], "Price|Final Energy|Transport|Liquids|Biomass|Transport and Distribution (US$2017/GJ)"), + setNames(price.td[, , "tdsynpet"], "Price|Final Energy|Transport|Liquids|Efuel|Transport and Distribution (US$2017/GJ)"), + setNames(price.td[, , "tdsyngat"], "Price|Final Energy|Transport|Gases|Efuel|Transport and Distribution (US$2017/GJ)"), + setNames(price.td[, , "tdfosgat"], "Price|Final Energy|Transport|Gases|Natural Gas|Transport and Distribution (US$2017/GJ)"), + setNames(price.td[, , "tdh2t"], "Price|Final Energy|Transport|Hydrogen|Transport and Distribution (US$2017/GJ)"), + setNames(price.td[, , "tdelt"], "Price|Final Energy|Transport|Electricity|Transport and Distribution (US$2017/GJ)"), + + setNames(price.td[, , "tdfoshos"], "Price|Final Energy|Buildings|Liquids|Oil|Transport and Distribution (US$2017/GJ)"), + setNames(price.td[, , "tdfosgas"], "Price|Final Energy|Buildings|Gases|Natural Gas|Transport and Distribution (US$2017/GJ)"), + setNames(price.td[, , "tdhes"], "Price|Final Energy|Buildings|Heat|Transport and Distribution (US$2017/GJ)"), + setNames(price.td[, , "tdbiopet"], "Price|Final Energy|Buildings|Liquids|Biomass|Transport and Distribution (US$2017/GJ)"), + setNames(price.td[, , "tdbiosos"], "Price|Final Energy|Buildings|Solids|Biomass|Transport and Distribution (US$2017/GJ)"), + setNames(price.td[, , "tdbiogas"], "Price|Final Energy|Buildings|Gases|Biomass|Transport and Distribution (US$2017/GJ)"), + setNames(price.td[, , "tdsynpet"], "Price|Final Energy|Buildings|Liquids|Efuel|Transport and Distribution (US$2017/GJ)"), + setNames(price.td[, , "tdsyngas"], "Price|Final Energy|Buildings|Gases|Efuel|Transport and Distribution (US$2017/GJ)"), + setNames(price.td[, , "tdh2s"], "Price|Final Energy|Buildings|Hydrogen|Transport and Distribution (US$2017/GJ)"), + setNames(price.td[, , "tdels"], "Price|Final Energy|Buildings|Electricity|Transport and Distribution (US$2017/GJ)"), + + setNames(price.td[, , "tdfoshos"], "Price|Final Energy|Industry|Liquids|Oil|Transport and Distribution (US$2017/GJ)"), + setNames(price.td[, , "tdfossos"], "Price|Final Energy|Industry|Solids|Coal|Transport and Distribution (US$2017/GJ)"), + setNames(price.td[, , "tdfosgas"], "Price|Final Energy|Industry|Gases|Natural Gas|Transport and Distribution (US$2017/GJ)"), + setNames(price.td[, , "tdhes"], "Price|Final Energy|Industry|Heat|Transport and Distribution (US$2017/GJ)"), + setNames(price.td[, , "tdbiopet"], "Price|Final Energy|Industry|Liquids|Biomass|Transport and Distribution (US$2017/GJ)"), + setNames(price.td[, , "tdbiosos"], "Price|Final Energy|Industry|Solids|Biomass|Transport and Distribution (US$2017/GJ)"), + setNames(price.td[, , "tdbiogas"], "Price|Final Energy|Industry|Gases|Biomass|Transport and Distribution (US$2017/GJ)"), + setNames(price.td[, , "tdsynpet"], "Price|Final Energy|Industry|Liquids|Efuel|Transport and Distribution (US$2017/GJ)"), + setNames(price.td[, , "tdsyngas"], "Price|Final Energy|Industry|Gases|Efuel|Transport and Distribution (US$2017/GJ)"), + setNames(price.td[, , "tdh2s"], "Price|Final Energy|Industry|Hydrogen|Transport and Distribution (US$2017/GJ)"), + setNames(price.td[, , "tdels"], "Price|Final Energy|Industry|Electricity|Transport and Distribution (US$2017/GJ)") ) @@ -531,16 +531,16 @@ reportPrices <- function(gdx, output=NULL, regionSubsetList=NULL, out <- mbind( out, - setNames(price.carbon[, , "tdfospet"], "Price|Final Energy|Transport|Liquids|Petroleum|Carbon Price Component (US$2005/GJ)"), - setNames(price.carbon[, , "tdfosdie"], "Price|Final Energy|Transport|Liquids|Diesel|Carbon Price Component (US$2005/GJ)"), - setNames(price.carbon[, , "tdfosgas"], "Price|Final Energy|Transport|Gases|Natural Gas|Carbon Price Component (US$2005/GJ)"), + setNames(price.carbon[, , "tdfospet"], "Price|Final Energy|Transport|Liquids|Petroleum|Carbon Price Component (US$2017/GJ)"), + setNames(price.carbon[, , "tdfosdie"], "Price|Final Energy|Transport|Liquids|Diesel|Carbon Price Component (US$2017/GJ)"), + setNames(price.carbon[, , "tdfosgas"], "Price|Final Energy|Transport|Gases|Natural Gas|Carbon Price Component (US$2017/GJ)"), - setNames(price.carbon[, , "tdfoshos"], "Price|Final Energy|Buildings|Liquids|Oil|Carbon Price Component (US$2005/GJ)"), - setNames(price.carbon[, , "tdfosgas"], "Price|Final Energy|Buildings|Gases|Natural Gas|Carbon Price Component (US$2005/GJ)"), + setNames(price.carbon[, , "tdfoshos"], "Price|Final Energy|Buildings|Liquids|Oil|Carbon Price Component (US$2017/GJ)"), + setNames(price.carbon[, , "tdfosgas"], "Price|Final Energy|Buildings|Gases|Natural Gas|Carbon Price Component (US$2017/GJ)"), - setNames(price.carbon[, , "tdfoshos"], "Price|Final Energy|Industry|Liquids|Oil|Carbon Price Component (US$2005/GJ)"), - setNames(price.carbon[, , "tdfossos"], "Price|Final Energy|Industry|Solids|Coal|Carbon Price Component (US$2005/GJ)"), - setNames(price.carbon[, , "tdfosgas"], "Price|Final Energy|Industry|Gases|Natural Gas|Carbon Price Component (US$2005/GJ)") + setNames(price.carbon[, , "tdfoshos"], "Price|Final Energy|Industry|Liquids|Oil|Carbon Price Component (US$2017/GJ)"), + setNames(price.carbon[, , "tdfossos"], "Price|Final Energy|Industry|Solids|Coal|Carbon Price Component (US$2017/GJ)"), + setNames(price.carbon[, , "tdfosgas"], "Price|Final Energy|Industry|Gases|Natural Gas|Carbon Price Component (US$2017/GJ)") ) } @@ -557,37 +557,37 @@ reportPrices <- function(gdx, output=NULL, regionSubsetList=NULL, out <- mbind( out, - setNames(price.tax[, , "trans.fepet"], "Price|Final Energy|Transport|Liquids|Petroleum|Other Taxes (US$2005/GJ)"), - setNames(price.tax[, , "trans.fedie"], "Price|Final Energy|Transport|Liquids|Diesel|Other Taxes (US$2005/GJ)"), - setNames(price.tax[, , "trans.fegat"], "Price|Final Energy|Transport|Gases|Natural Gas|Other Taxes (US$2005/GJ)"), - setNames(price.tax[, , "trans.fepet"], "Price|Final Energy|Transport|Liquids|Biomass|Other Taxes (US$2005/GJ)"), - setNames(price.tax[, , "trans.fepet"], "Price|Final Energy|Transport|Liquids|Efuel|Other Taxes (US$2005/GJ)"), - setNames(price.tax[, , "trans.fegat"], "Price|Final Energy|Transport|Gases|Efuel|Other Taxes (US$2005/GJ)"), - setNames(price.tax[, , "trans.feh2t"], "Price|Final Energy|Transport|Hydrogen|Other Taxes (US$2005/GJ)"), - setNames(price.tax[, , "trans.feelt"], "Price|Final Energy|Transport|Electricity|Other Taxes (US$2005/GJ)"), - - setNames(price.tax[, , "build.fehos"], "Price|Final Energy|Buildings|Liquids|Oil|Other Taxes (US$2005/GJ)"), - setNames(price.tax[, , "build.fegas"], "Price|Final Energy|Buildings|Gases|Natural Gas|Other Taxes (US$2005/GJ)"), - setNames(price.tax[, , "build.fehos"], "Price|Final Energy|Buildings|Heat|Other Taxes (US$2005/GJ)"), - setNames(price.tax[, , "build.fepet"], "Price|Final Energy|Buildings|Liquids|Biomass|Other Taxes (US$2005/GJ)"), - setNames(price.tax[, , "build.fesos"], "Price|Final Energy|Buildings|Solids|Biomass|Other Taxes (US$2005/GJ)"), - setNames(price.tax[, , "build.fegas"], "Price|Final Energy|Buildings|Gases|Biomass|Other Taxes (US$2005/GJ)"), - setNames(price.tax[, , "build.fepet"], "Price|Final Energy|Buildings|Liquids|Efuel|Other Taxes (US$2005/GJ)"), - setNames(price.tax[, , "build.fegas"], "Price|Final Energy|Buildings|Gases|Efuel|Other Taxes (US$2005/GJ)"), - setNames(price.tax[, , "build.feh2s"], "Price|Final Energy|Buildings|Hydrogen|Other Taxes (US$2005/GJ)"), - setNames(price.tax[, , "build.feels"], "Price|Final Energy|Buildings|Electricity|Other Taxes (US$2005/GJ)"), - - setNames(price.tax[, , "indst.fehos"], "Price|Final Energy|Industry|Liquids|Oil|Other Taxes (US$2005/GJ)"), - setNames(price.tax[, , "indst.fesos"], "Price|Final Energy|Industry|Solids|Coal|Other Taxes (US$2005/GJ)"), - setNames(price.tax[, , "indst.fegas"], "Price|Final Energy|Industry|Gases|Natural Gas|Other Taxes (US$2005/GJ)"), - setNames(price.tax[, , "indst.fehos"], "Price|Final Energy|Industry|Heat|Other Taxes (US$2005/GJ)"), - setNames(price.tax[, , "indst.fepet"], "Price|Final Energy|Industry|Liquids|Biomass|Other Taxes (US$2005/GJ)"), - setNames(price.tax[, , "indst.fesos"], "Price|Final Energy|Industry|Solids|Biomass|Other Taxes (US$2005/GJ)"), - setNames(price.tax[, , "indst.fegas"], "Price|Final Energy|Industry|Gases|Biomass|Other Taxes (US$2005/GJ)"), - setNames(price.tax[, , "indst.fepet"], "Price|Final Energy|Industry|Liquids|Efuel|Other Taxes (US$2005/GJ)"), - setNames(price.tax[, , "indst.fegas"], "Price|Final Energy|Industry|Gases|Efuel|Other Taxes (US$2005/GJ)"), - setNames(price.tax[, , "indst.feh2s"], "Price|Final Energy|Industry|Hydrogen|Other Taxes (US$2005/GJ)"), - setNames(price.tax[, , "indst.feels"], "Price|Final Energy|Industry|Electricity|Other Taxes (US$2005/GJ)") + setNames(price.tax[, , "trans.fepet"], "Price|Final Energy|Transport|Liquids|Petroleum|Other Taxes (US$2017/GJ)"), + setNames(price.tax[, , "trans.fedie"], "Price|Final Energy|Transport|Liquids|Diesel|Other Taxes (US$2017/GJ)"), + setNames(price.tax[, , "trans.fegat"], "Price|Final Energy|Transport|Gases|Natural Gas|Other Taxes (US$2017/GJ)"), + setNames(price.tax[, , "trans.fepet"], "Price|Final Energy|Transport|Liquids|Biomass|Other Taxes (US$2017/GJ)"), + setNames(price.tax[, , "trans.fepet"], "Price|Final Energy|Transport|Liquids|Efuel|Other Taxes (US$2017/GJ)"), + setNames(price.tax[, , "trans.fegat"], "Price|Final Energy|Transport|Gases|Efuel|Other Taxes (US$2017/GJ)"), + setNames(price.tax[, , "trans.feh2t"], "Price|Final Energy|Transport|Hydrogen|Other Taxes (US$2017/GJ)"), + setNames(price.tax[, , "trans.feelt"], "Price|Final Energy|Transport|Electricity|Other Taxes (US$2017/GJ)"), + + setNames(price.tax[, , "build.fehos"], "Price|Final Energy|Buildings|Liquids|Oil|Other Taxes (US$2017/GJ)"), + setNames(price.tax[, , "build.fegas"], "Price|Final Energy|Buildings|Gases|Natural Gas|Other Taxes (US$2017/GJ)"), + setNames(price.tax[, , "build.fehos"], "Price|Final Energy|Buildings|Heat|Other Taxes (US$2017/GJ)"), + setNames(price.tax[, , "build.fepet"], "Price|Final Energy|Buildings|Liquids|Biomass|Other Taxes (US$2017/GJ)"), + setNames(price.tax[, , "build.fesos"], "Price|Final Energy|Buildings|Solids|Biomass|Other Taxes (US$2017/GJ)"), + setNames(price.tax[, , "build.fegas"], "Price|Final Energy|Buildings|Gases|Biomass|Other Taxes (US$2017/GJ)"), + setNames(price.tax[, , "build.fepet"], "Price|Final Energy|Buildings|Liquids|Efuel|Other Taxes (US$2017/GJ)"), + setNames(price.tax[, , "build.fegas"], "Price|Final Energy|Buildings|Gases|Efuel|Other Taxes (US$2017/GJ)"), + setNames(price.tax[, , "build.feh2s"], "Price|Final Energy|Buildings|Hydrogen|Other Taxes (US$2017/GJ)"), + setNames(price.tax[, , "build.feels"], "Price|Final Energy|Buildings|Electricity|Other Taxes (US$2017/GJ)"), + + setNames(price.tax[, , "indst.fehos"], "Price|Final Energy|Industry|Liquids|Oil|Other Taxes (US$2017/GJ)"), + setNames(price.tax[, , "indst.fesos"], "Price|Final Energy|Industry|Solids|Coal|Other Taxes (US$2017/GJ)"), + setNames(price.tax[, , "indst.fegas"], "Price|Final Energy|Industry|Gases|Natural Gas|Other Taxes (US$2017/GJ)"), + setNames(price.tax[, , "indst.fehos"], "Price|Final Energy|Industry|Heat|Other Taxes (US$2017/GJ)"), + setNames(price.tax[, , "indst.fepet"], "Price|Final Energy|Industry|Liquids|Biomass|Other Taxes (US$2017/GJ)"), + setNames(price.tax[, , "indst.fesos"], "Price|Final Energy|Industry|Solids|Biomass|Other Taxes (US$2017/GJ)"), + setNames(price.tax[, , "indst.fegas"], "Price|Final Energy|Industry|Gases|Biomass|Other Taxes (US$2017/GJ)"), + setNames(price.tax[, , "indst.fepet"], "Price|Final Energy|Industry|Liquids|Efuel|Other Taxes (US$2017/GJ)"), + setNames(price.tax[, , "indst.fegas"], "Price|Final Energy|Industry|Gases|Efuel|Other Taxes (US$2017/GJ)"), + setNames(price.tax[, , "indst.feh2s"], "Price|Final Energy|Industry|Hydrogen|Other Taxes (US$2017/GJ)"), + setNames(price.tax[, , "indst.feels"], "Price|Final Energy|Industry|Electricity|Other Taxes (US$2017/GJ)") ) @@ -601,44 +601,44 @@ reportPrices <- function(gdx, output=NULL, regionSubsetList=NULL, out <- mbind( out, - setNames(price.fuel[,,"seliqfos.tdfospet"], "Price|Final Energy|Transport|Liquids|Petroleum|Fuel Cost (US$2005/GJ)"), - setNames(price.fuel[,,"seliqfos.tdfosdie"], "Price|Final Energy|Transport|Liquids|Diesel|Fuel Cost (US$2005/GJ)"), - setNames(price.fuel[,,"segafos.tdfosgat"], "Price|Final Energy|Transport|Gases|Natural Gas|Fuel Cost (US$2005/GJ)"), - setNames(price.fuel[,,"seliqbio.tdbiopet"], "Price|Final Energy|Transport|Liquids|Biomass|Fuel Cost (US$2005/GJ)"), - setNames(price.fuel[,,"seliqsyn.tdsynpet"], "Price|Final Energy|Transport|Liquids|Efuel|Fuel Cost (US$2005/GJ)"), - setNames(price.fuel[,,"segasyn.tdsyngat"], "Price|Final Energy|Transport|Gases|Efuel|Fuel Cost (US$2005/GJ)"), - setNames(price.fuel[,,"seh2.tdh2t"], "Price|Final Energy|Transport|Hydrogen|Fuel Cost (US$2005/GJ)"), - setNames(price.fuel[,,"seel.tdelt"], "Price|Final Energy|Transport|Electricity|Fuel Cost (US$2005/GJ)"), - - setNames(price.fuel[,,"seliqfos.tdfoshos"], "Price|Final Energy|Buildings|Liquids|Oil|Fuel Cost (US$2005/GJ)"), - setNames(price.fuel[,,"segafos.tdfosgas"], "Price|Final Energy|Buildings|Gases|Natural Gas|Fuel Cost (US$2005/GJ)"), - setNames(price.fuel[,,"sehe.tdhes"], "Price|Final Energy|Buildings|Heat|Fuel Cost (US$2005/GJ)"), - setNames(price.fuel[,,"seliqbio.tdbiopet"], "Price|Final Energy|Buildings|Liquids|Biomass|Fuel Cost (US$2005/GJ)"), - setNames(price.fuel[,,"sesobio.tdbiosos"], "Price|Final Energy|Buildings|Solids|Biomass|Fuel Cost (US$2005/GJ)"), - setNames(price.fuel[,,"segabio.tdbiogas"], "Price|Final Energy|Buildings|Gases|Biomass|Fuel Cost (US$2005/GJ)"), - setNames(price.fuel[,,"seliqsyn.tdsynpet"], "Price|Final Energy|Buildings|Liquids|Efuel|Fuel Cost (US$2005/GJ)"), - setNames(price.fuel[,,"segasyn.tdsyngas"], "Price|Final Energy|Buildings|Gases|Efuel|Fuel Cost (US$2005/GJ)"), - setNames(price.fuel[,,"seh2.tdh2s"], "Price|Final Energy|Buildings|Hydrogen|Fuel Cost (US$2005/GJ)"), - setNames(price.fuel[,,"seel.tdels"], "Price|Final Energy|Buildings|Electricity|Fuel Cost (US$2005/GJ)"), - - setNames(price.fuel[,,"seliqfos.tdfoshos"], "Price|Final Energy|Industry|Liquids|Oil|Fuel Cost (US$2005/GJ)"), - setNames(price.fuel[,,"sesofos.tdfossos"], "Price|Final Energy|Industry|Solids|Coal|Fuel Cost (US$2005/GJ)"), - setNames(price.fuel[,,"segafos.tdfosgas"], "Price|Final Energy|Industry|Gases|Natural Gas|Fuel Cost (US$2005/GJ)"), - setNames(price.fuel[,,"seliqbio.tdbiopet"], "Price|Final Energy|Industry|Liquids|Biomass|Fuel Cost (US$2005/GJ)"), - setNames(price.fuel[,,"sesobio.tdbiosos"], "Price|Final Energy|Industry|Solids|Biomass|Fuel Cost (US$2005/GJ)"), - setNames(price.fuel[,,"segabio.tdbiogas"], "Price|Final Energy|Industry|Gases|Biomass|Fuel Cost (US$2005/GJ)"), - setNames(price.fuel[,,"seliqsyn.tdsynpet"], "Price|Final Energy|Industry|Liquids|Efuel|Fuel Cost (US$2005/GJ)"), - setNames(price.fuel[,,"segasyn.tdsyngas"], "Price|Final Energy|Industry|Gases|Efuel|Fuel Cost (US$2005/GJ)"), - - setNames(price.fuel[,,"seel.tdels"], "Price|Final Energy|Industry|Electricity|Fuel Cost (US$2005/GJ)"), - setNames(price.fuel[,,"seh2.tdh2s"], "Price|Final Energy|Industry|Hydrogen|Fuel Cost (US$2005/GJ)"), - setNames(price.fuel[,,"sehe.tdhes"], "Price|Final Energy|Industry|Heat|Fuel Cost (US$2005/GJ)") + setNames(price.fuel[,,"seliqfos.tdfospet"], "Price|Final Energy|Transport|Liquids|Petroleum|Fuel Cost (US$2017/GJ)"), + setNames(price.fuel[,,"seliqfos.tdfosdie"], "Price|Final Energy|Transport|Liquids|Diesel|Fuel Cost (US$2017/GJ)"), + setNames(price.fuel[,,"segafos.tdfosgat"], "Price|Final Energy|Transport|Gases|Natural Gas|Fuel Cost (US$2017/GJ)"), + setNames(price.fuel[,,"seliqbio.tdbiopet"], "Price|Final Energy|Transport|Liquids|Biomass|Fuel Cost (US$2017/GJ)"), + setNames(price.fuel[,,"seliqsyn.tdsynpet"], "Price|Final Energy|Transport|Liquids|Efuel|Fuel Cost (US$2017/GJ)"), + setNames(price.fuel[,,"segasyn.tdsyngat"], "Price|Final Energy|Transport|Gases|Efuel|Fuel Cost (US$2017/GJ)"), + setNames(price.fuel[,,"seh2.tdh2t"], "Price|Final Energy|Transport|Hydrogen|Fuel Cost (US$2017/GJ)"), + setNames(price.fuel[,,"seel.tdelt"], "Price|Final Energy|Transport|Electricity|Fuel Cost (US$2017/GJ)"), + + setNames(price.fuel[,,"seliqfos.tdfoshos"], "Price|Final Energy|Buildings|Liquids|Oil|Fuel Cost (US$2017/GJ)"), + setNames(price.fuel[,,"segafos.tdfosgas"], "Price|Final Energy|Buildings|Gases|Natural Gas|Fuel Cost (US$2017/GJ)"), + setNames(price.fuel[,,"sehe.tdhes"], "Price|Final Energy|Buildings|Heat|Fuel Cost (US$2017/GJ)"), + setNames(price.fuel[,,"seliqbio.tdbiopet"], "Price|Final Energy|Buildings|Liquids|Biomass|Fuel Cost (US$2017/GJ)"), + setNames(price.fuel[,,"sesobio.tdbiosos"], "Price|Final Energy|Buildings|Solids|Biomass|Fuel Cost (US$2017/GJ)"), + setNames(price.fuel[,,"segabio.tdbiogas"], "Price|Final Energy|Buildings|Gases|Biomass|Fuel Cost (US$2017/GJ)"), + setNames(price.fuel[,,"seliqsyn.tdsynpet"], "Price|Final Energy|Buildings|Liquids|Efuel|Fuel Cost (US$2017/GJ)"), + setNames(price.fuel[,,"segasyn.tdsyngas"], "Price|Final Energy|Buildings|Gases|Efuel|Fuel Cost (US$2017/GJ)"), + setNames(price.fuel[,,"seh2.tdh2s"], "Price|Final Energy|Buildings|Hydrogen|Fuel Cost (US$2017/GJ)"), + setNames(price.fuel[,,"seel.tdels"], "Price|Final Energy|Buildings|Electricity|Fuel Cost (US$2017/GJ)"), + + setNames(price.fuel[,,"seliqfos.tdfoshos"], "Price|Final Energy|Industry|Liquids|Oil|Fuel Cost (US$2017/GJ)"), + setNames(price.fuel[,,"sesofos.tdfossos"], "Price|Final Energy|Industry|Solids|Coal|Fuel Cost (US$2017/GJ)"), + setNames(price.fuel[,,"segafos.tdfosgas"], "Price|Final Energy|Industry|Gases|Natural Gas|Fuel Cost (US$2017/GJ)"), + setNames(price.fuel[,,"seliqbio.tdbiopet"], "Price|Final Energy|Industry|Liquids|Biomass|Fuel Cost (US$2017/GJ)"), + setNames(price.fuel[,,"sesobio.tdbiosos"], "Price|Final Energy|Industry|Solids|Biomass|Fuel Cost (US$2017/GJ)"), + setNames(price.fuel[,,"segabio.tdbiogas"], "Price|Final Energy|Industry|Gases|Biomass|Fuel Cost (US$2017/GJ)"), + setNames(price.fuel[,,"seliqsyn.tdsynpet"], "Price|Final Energy|Industry|Liquids|Efuel|Fuel Cost (US$2017/GJ)"), + setNames(price.fuel[,,"segasyn.tdsyngas"], "Price|Final Energy|Industry|Gases|Efuel|Fuel Cost (US$2017/GJ)"), + + setNames(price.fuel[,,"seel.tdels"], "Price|Final Energy|Industry|Electricity|Fuel Cost (US$2017/GJ)"), + setNames(price.fuel[,,"seh2.tdh2s"], "Price|Final Energy|Industry|Hydrogen|Fuel Cost (US$2017/GJ)"), + setNames(price.fuel[,,"sehe.tdhes"], "Price|Final Energy|Industry|Heat|Fuel Cost (US$2017/GJ)") ) ### Total LCOE ---- .calcLCOE <- function(out, var) { - return(setNames(dimSums(out[, , paste0(var,"|"), pmatch = T], dim = 3, na.rm = T), paste0(var, "|Total LCOE (US$2005/GJ)"))) + return(setNames(dimSums(out[, , paste0(var,"|"), pmatch = T], dim = 3, na.rm = T), paste0(var, "|Total LCOE (US$2017/GJ)"))) } out <- mbind( @@ -732,40 +732,40 @@ reportPrices <- function(gdx, output=NULL, regionSubsetList=NULL, out, setNames(shift_p, "Internal|Price|Biomass|Shiftfactor ()"), setNames(mult_p, "Internal|Price|Biomass|Multfactor ()"), - setNames(pric_mag * tdptwyr2dpgj, "Internal|Price|Biomass|MAgPIE (US$2005/GJ)"), - setNames(pric_emu_pre * tdptwyr2dpgj, "Internal|Price|Biomass|Emulator presolve (US$2005/GJ)"), - setNames(pric_emu_pre_shifted * tdptwyr2dpgj, "Internal|Price|Biomass|Emulator presolve shifted (US$2005/GJ)"), - setNames(pric_emu * tdptwyr2dpgj, "Internal|Price|Biomass|Emulator shifted (US$2005/GJ)"), - setNames(pric_emu * bio_tax_factor * tdptwyr2dpgj, "Internal|Price|Biomass|Bioenergy sustainability tax (US$2005/GJ)")) + setNames(pric_mag * tdptwyr2dpgj, "Internal|Price|Biomass|MAgPIE (US$2017/GJ)"), + setNames(pric_emu_pre * tdptwyr2dpgj, "Internal|Price|Biomass|Emulator presolve (US$2017/GJ)"), + setNames(pric_emu_pre_shifted * tdptwyr2dpgj, "Internal|Price|Biomass|Emulator presolve shifted (US$2017/GJ)"), + setNames(pric_emu * tdptwyr2dpgj, "Internal|Price|Biomass|Emulator shifted (US$2017/GJ)"), + setNames(pric_emu * bio_tax_factor * tdptwyr2dpgj, "Internal|Price|Biomass|Bioenergy sustainability tax (US$2017/GJ)")) # energy services if (!is.null(esm2macro.m)) { out <- mbind( out, - setNames(abs(esm2macro.m[,,name_trsp[2]]/(budget.m+1e-10)) * tdptwyr2dpgj , "Price|Energy Service|Transport nonLDV (US$2005/GJ)"), - setNames(abs(esm2macro.m[,,name_trsp[1]]/(budget.m+1e-10)) * tdptwyr2dpgj , "Price|Energy Service|Transport LDV (US$2005/GJ)")) + setNames(abs(esm2macro.m[,,name_trsp[2]]/(budget.m+1e-10)) * tdptwyr2dpgj , "Price|Energy Service|Transport nonLDV (US$2017/GJ)"), + setNames(abs(esm2macro.m[,,name_trsp[1]]/(budget.m+1e-10)) * tdptwyr2dpgj , "Price|Energy Service|Transport LDV (US$2017/GJ)")) } # report GHG taxes, differentiated by sector # WARNING: the below sector markup code calculation does not consider regipol sector and emission market specific CO2eq prices. If you use both markups and the model 47 formulations, you will have wrongly reported CO2 sectoral and regional prices. if (all(p21_CO2TaxSectorMarkup == 0)) { # then all are identical - out <- mbind(out, setNames(pm_taxCO2eqSum * 1000 * 12/44, "Price|Carbon (US$2005/t CO2)")) - for (pcname in c("Price|Carbon|Demand|Buildings (US$2005/t CO2)", "Price|Carbon|Demand|Transport (US$2005/t CO2)", - "Price|Carbon|Demand|Industry (US$2005/t CO2)", "Price|Carbon|Supply (US$2005/t CO2)", - "Price|Carbon|AggregatedByGrossCO2 (US$2005/t CO2)")) { - out <- mbind(out, setNames(out[, , "Price|Carbon (US$2005/t CO2)"], pcname)) + out <- mbind(out, setNames(pm_taxCO2eqSum * 1000 * 12/44, "Price|Carbon (US$2017/t CO2)")) + for (pcname in c("Price|Carbon|Demand|Buildings (US$2017/t CO2)", "Price|Carbon|Demand|Transport (US$2017/t CO2)", + "Price|Carbon|Demand|Industry (US$2017/t CO2)", "Price|Carbon|Supply (US$2017/t CO2)", + "Price|Carbon|AggregatedByGrossCO2 (US$2017/t CO2)")) { + out <- mbind(out, setNames(out[, , "Price|Carbon (US$2017/t CO2)"], pcname)) } } else { # currently p21_CO2TaxSectorMarkup is only implemented for build and trans in REMIND out <- mbind(out, setNames((1 + p21_CO2TaxSectorMarkup[, , "build"]) * pm_taxCO2eqSum * 1000 * 12/44, - "Price|Carbon|Demand|Buildings (US$2005/t CO2)"), + "Price|Carbon|Demand|Buildings (US$2017/t CO2)"), setNames((1 + p21_CO2TaxSectorMarkup[, , "trans"]) * pm_taxCO2eqSum * 1000 * 12/44, - "Price|Carbon|Demand|Transport (US$2005/t CO2)"), + "Price|Carbon|Demand|Transport (US$2017/t CO2)"), setNames(pm_taxCO2eqSum * 1000 * 12/44, - "Price|Carbon|Demand|Industry (US$2005/t CO2)"), + "Price|Carbon|Demand|Industry (US$2017/t CO2)"), setNames(pm_taxCO2eqSum * 1000 * 12/44, - "Price|Carbon|Supply (US$2005/t CO2)") + "Price|Carbon|Supply (US$2017/t CO2)") ) pm_taxCO2eq_FE <- collapseNames( pm_taxCO2eqSum * (1 + ( @@ -781,9 +781,9 @@ reportPrices <- function(gdx, output=NULL, regionSubsetList=NULL, ) ) out <- mbind(out, setNames(pm_taxCO2eq_FE * 1000 * 12/44, - "Price|Carbon (US$2005/t CO2)")) # AggregatedbyFE + "Price|Carbon (US$2017/t CO2)")) # AggregatedbyFE out <- mbind(out, setNames(pm_taxCO2eq_Emi * 1000 * 12/44, - "Price|Carbon|AggregatedByGrossCO2 (US$2005/t CO2)")) # AggregatedByEmiGHGGross + "Price|Carbon|AggregatedByGrossCO2 (US$2017/t CO2)")) # AggregatedByEmiGHGGross } peFos <- readGDX(gdx, "peFos") # fossil PE carriers @@ -799,17 +799,17 @@ reportPrices <- function(gdx, output=NULL, regionSubsetList=NULL, } pm_taxCO2eqMport <- pm_taxCO2eqMport * 1000 * 12/44 # use unweighted average, because weighing according to import volumes might lead to big jumps - out <- mbind(out, setNames(dimSums(pm_taxCO2eqMport, dim = 3.1)/length(peFos), "Price|Carbon|Imported (US$2005/t CO2)")) + out <- mbind(out, setNames(dimSums(pm_taxCO2eqMport, dim = 3.1)/length(peFos), "Price|Carbon|Imported (US$2017/t CO2)")) } # CaptureBal_tmp <- new.magpie(getRegions(out), getYears(out), fill = NA) CaptureBal_tmp[,getYears(balcapture.m),] <- balcapture.m out <- mbind(out, setNames(CaptureBal_tmp / (budget.m+1e-10) / 3.66 * 1e3, - "Price|Carbon|Captured (US$2005/t CO2)")) + "Price|Carbon|Captured (US$2017/t CO2)")) if (is.null(regionSubsetList$EUR)) { - out <- mbind(out,setNames(pm_taxCO2eq * 1000 * 12/44, "Price|Carbon|EU-wide Regulation For All Sectors (US$2005/t CO2)")) + out <- mbind(out,setNames(pm_taxCO2eq * 1000 * 12/44, "Price|Carbon|EU-wide Regulation For All Sectors (US$2017/t CO2)")) } else { co2EUprice <- pm_taxCO2eq * 1000 * 12/44 co2EUprice[getRegions(pm_taxCO2eq)[!getRegions(pm_taxCO2eq) %in% regionSubsetList$EUR],,] <- 0 @@ -817,104 +817,104 @@ reportPrices <- function(gdx, output=NULL, regionSubsetList=NULL, for (r in regionSubsetList$EUR){ co2EUprice[r,,] <- as.vector(co2EUprice[priceReg,,]) } - out <- mbind(out,setNames(co2EUprice, "Price|Carbon|EU-wide Regulation For All Sectors (US$2005/t CO2)")) + out <- mbind(out,setNames(co2EUprice, "Price|Carbon|EU-wide Regulation For All Sectors (US$2017/t CO2)")) } # reporting carbon prices considering sectoral and emission market differentiated taxes (it does not consider sectoral CO2 markup formulations) if (!is.null(pm_taxemiMkt)) { - out <- mbind(out,setNames(pm_taxemiMkt[,,"ETS"] * 1000 * 12/44, "Price|Carbon|ETS (US$2005/t CO2)")) - out <- mbind(out,setNames(pm_taxemiMkt[,,"ES"] * 1000 * 12/44, "Price|Carbon|ESR (US$2005/t CO2)")) + out <- mbind(out,setNames(pm_taxemiMkt[,,"ETS"] * 1000 * 12/44, "Price|Carbon|ETS (US$2017/t CO2)")) + out <- mbind(out,setNames(pm_taxemiMkt[,,"ES"] * 1000 * 12/44, "Price|Carbon|ESR (US$2017/t CO2)")) if(!is.null(p47_taxCO2eq_AggFE)) { # recalculating carbon prices to take into account emi Mkt taxes - out <- out[,,setdiff(getNames(out), c("Price|Carbon|Demand|Buildings (US$2005/t CO2)","Price|Carbon|Demand|Industry (US$2005/t CO2)", - "Price|Carbon|Demand|Transport (US$2005/t CO2)","Price|Carbon|Supply (US$2005/t CO2)","Price|Carbon (US$2005/t CO2)"))] - out <- mbind(out,setNames(p47_taxCO2eq_SectorAggFE[,,"build"] * 1000 * 12/44, "Price|Carbon|Demand|Buildings (US$2005/t CO2)")) - out <- mbind(out,setNames(p47_taxCO2eq_SectorAggFE[,,"indst"] * 1000 * 12/44, "Price|Carbon|Demand|Industry (US$2005/t CO2)")) - out <- mbind(out,setNames(p47_taxCO2eq_SectorAggFE[,,"trans"] * 1000 * 12/44, "Price|Carbon|Demand|Transport (US$2005/t CO2)")) - out <- mbind(out,setNames(p47_taxCO2eq_AggFE * 1000 * 12/44, "Price|Carbon (US$2005/t CO2)")) - out <- mbind(out,setNames(p47_taxCO2eq_AggFE * 1000 * 12/44, "Price|Carbon|Supply (US$2005/t CO2)")) + out <- out[,,setdiff(getNames(out), c("Price|Carbon|Demand|Buildings (US$2017/t CO2)","Price|Carbon|Demand|Industry (US$2017/t CO2)", + "Price|Carbon|Demand|Transport (US$2017/t CO2)","Price|Carbon|Supply (US$2017/t CO2)","Price|Carbon (US$2017/t CO2)"))] + out <- mbind(out,setNames(p47_taxCO2eq_SectorAggFE[,,"build"] * 1000 * 12/44, "Price|Carbon|Demand|Buildings (US$2017/t CO2)")) + out <- mbind(out,setNames(p47_taxCO2eq_SectorAggFE[,,"indst"] * 1000 * 12/44, "Price|Carbon|Demand|Industry (US$2017/t CO2)")) + out <- mbind(out,setNames(p47_taxCO2eq_SectorAggFE[,,"trans"] * 1000 * 12/44, "Price|Carbon|Demand|Transport (US$2017/t CO2)")) + out <- mbind(out,setNames(p47_taxCO2eq_AggFE * 1000 * 12/44, "Price|Carbon (US$2017/t CO2)")) + out <- mbind(out,setNames(p47_taxCO2eq_AggFE * 1000 * 12/44, "Price|Carbon|Supply (US$2017/t CO2)")) } } if (!is.null(pm_taxCO2eqSCC)) { - out <- mbind(out,setNames(abs(pm_taxCO2eqSCC) * 1000 * 12/44, "Price|Carbon|SCC (US$2005/t CO2)")) - out <- mbind(out,setNames(out[, , "Price|Carbon (US$2005/t CO2)"] - out[, , "Price|Carbon|SCC (US$2005/t CO2)"], "Price|Carbon|Guardrail (US$2005/t CO2)")) + out <- mbind(out,setNames(abs(pm_taxCO2eqSCC) * 1000 * 12/44, "Price|Carbon|SCC (US$2017/t CO2)")) + out <- mbind(out,setNames(out[, , "Price|Carbon (US$2017/t CO2)"] - out[, , "Price|Carbon|SCC (US$2017/t CO2)"], "Price|Carbon|Guardrail (US$2017/t CO2)")) } else { - out <- mbind(out,setNames(out[, , "Price|Carbon (US$2005/t CO2)"], "Price|Carbon|Guardrail (US$2005/t CO2)")) + out <- mbind(out,setNames(out[, , "Price|Carbon (US$2017/t CO2)"], "Price|Carbon|Guardrail (US$2017/t CO2)")) } - out <- mbind(out,setNames(out[,,"Price|Carbon (US$2005/t CO2)"] * s_GWP_N2O, "Price|N2O (US$2005/t N2O)")) - out <- mbind(out,setNames(out[,,"Price|Carbon (US$2005/t CO2)"] * s_GWP_CH4, "Price|CH4 (US$2005/t CH4)")) + out <- mbind(out,setNames(out[,,"Price|Carbon (US$2017/t CO2)"] * s_GWP_N2O, "Price|N2O (US$2017/t N2O)")) + out <- mbind(out,setNames(out[,,"Price|Carbon (US$2017/t CO2)"] * s_GWP_CH4, "Price|CH4 (US$2017/t CH4)")) # adding extra variables for alternative carbon price aggregation weights - out <- mbind(out,setNames(out[,,"Price|Carbon|Captured (US$2005/t CO2)"], - "Price|Carbon|Captured|AggregatedByGrossCO2 (US$2005/t CO2)")) - out <- mbind(out,setNames(out[,,"Price|Carbon|EU-wide Regulation For All Sectors (US$2005/t CO2)"], - "Price|Carbon|EU-wide Regulation For All Sectors|AggregatedByGrossCO2 (US$2005/t CO2)")) - out <- mbind(out,setNames(out[,,"Price|Carbon|Guardrail (US$2005/t CO2)"], - "Price|Carbon|Guardrail|AggregatedByGrossCO2 (US$2005/t CO2)")) - out <- mbind(out,setNames(out[,,"Price|Carbon|SCC (US$2005/t CO2)"], - "Price|Carbon|SCC|AggregatedByGrossCO2 (US$2005/t CO2)")) + out <- mbind(out,setNames(out[,,"Price|Carbon|Captured (US$2017/t CO2)"], + "Price|Carbon|Captured|AggregatedByGrossCO2 (US$2017/t CO2)")) + out <- mbind(out,setNames(out[,,"Price|Carbon|EU-wide Regulation For All Sectors (US$2017/t CO2)"], + "Price|Carbon|EU-wide Regulation For All Sectors|AggregatedByGrossCO2 (US$2017/t CO2)")) + out <- mbind(out,setNames(out[,,"Price|Carbon|Guardrail (US$2017/t CO2)"], + "Price|Carbon|Guardrail|AggregatedByGrossCO2 (US$2017/t CO2)")) + out <- mbind(out,setNames(out[,,"Price|Carbon|SCC (US$2017/t CO2)"], + "Price|Carbon|SCC|AggregatedByGrossCO2 (US$2017/t CO2)")) # ---- mapping of weights for the variables for global aggregation ---- int2ext <- c( - "Price|Primary Energy|Biomass|Modern (US$2005/GJ)" = "PE|Biomass|Modern (EJ/yr)", - "Price|Primary Energy|Oil (US$2005/GJ)" = "PE|Oil (EJ/yr)", - "Price|Primary Energy|Gas (US$2005/GJ)" = "PE|Gas (EJ/yr)", - "Price|Primary Energy|Coal (US$2005/GJ)" = "PE|Coal (EJ/yr)", - "Price|Primary Energy|Nuclear (US$2005/GJ)" = "PE|Nuclear (EJ/yr)", - "Price|Primary Energy|Biomass|1st Generation|Sugar and Starch (US$2005/GJ)" = "PE|Biomass|1st Generation (EJ/yr)", - "Price|Primary Energy|Biomass|1st Generation|Oil-based (US$2005/GJ)" = "PE|Biomass|1st Generation (EJ/yr)", - - "Internal|Price|Biomass|Emulator presolve (US$2005/GJ)" = "Primary Energy Production|Biomass|Energy Crops MAgPIE (EJ/yr)", - "Internal|Price|Biomass|Emulator presolve shifted (US$2005/GJ)" = "Primary Energy Production|Biomass|Energy Crops MAgPIE (EJ/yr)", - "Internal|Price|Biomass|Emulator shifted (US$2005/GJ)" = "Primary Energy Production|Biomass|Energy Crops (EJ/yr)", - "Internal|Price|Biomass|MAgPIE (US$2005/GJ)" = "Primary Energy Production|Biomass|Energy Crops MAgPIE (EJ/yr)", - "Internal|Price|Biomass|Bioenergy sustainability tax (US$2005/GJ)" = "Primary Energy Production|Biomass|Energy Crops (EJ/yr)", - "Price|N2O (US$2005/t N2O)" = "Emi|N2O (kt N2O/yr)", - "Price|CH4 (US$2005/t CH4)" = "Emi|CH4 (Mt CH4/yr)", - "Price|Secondary Energy|Electricity (US$2005/GJ)" = "SE|Electricity (EJ/yr)", - "Price|Secondary Energy|Hydrogen (US$2005/GJ)" = "SE|Hydrogen (EJ/yr)", - "Price|Secondary Energy|Heat (US$2005/GJ)" = "SE|Heat (EJ/yr)", - "Price|Secondary Energy|Solids|Biomass (US$2005/GJ)" = "SE|Solids|Biomass (EJ/yr)", - "Price|Secondary Energy|Liquids|Biomass (US$2005/GJ)" = "SE|Liquids|Biomass (EJ/yr)", - "Price|Secondary Energy|Gases|Biomass (US$2005/GJ)" = "SE|Gases|Biomass (EJ/yr)", - "Price|Secondary Energy|Solids|Fossil (US$2005/GJ)" = "SE|Solids|Coal (EJ/yr)", - "Price|Secondary Energy|Liquids|Fossil (US$2005/GJ)" = "SE|Liquids|Fossil|Oil (EJ/yr)", - "Price|Secondary Energy|Gases|Fossil (US$2005/GJ)" = "SE|Gases|Fossil (EJ/yr)", - "Price|Secondary Energy|Liquids|Hydrogen (US$2005/GJ)" = "SE|Liquids|Hydrogen (EJ/yr)", - "Price|Secondary Energy|Gases|Hydrogen (US$2005/GJ)" = "SE|Gases|Hydrogen (EJ/yr)", - "Price|Secondary Energy|Solids (US$2005/GJ)" = "SE|Solids (EJ/yr)", - "Price|Secondary Energy|Liquids (US$2005/GJ)" = "SE|Liquids (EJ/yr)", - "Price|Secondary Energy|Gases (US$2005/GJ)" = "SE|Gases (EJ/yr)", - - "Price|Carbon|ETS (US$2005/t CO2)" = "FE|ETS (EJ/yr)", - "Price|Carbon|ESR (US$2005/t CO2)" = "FE|ESR (EJ/yr)", - - "Price|Carbon (US$2005/t CO2)" = "FE (EJ/yr)", - "Price|Carbon|Captured (US$2005/t CO2)" = "FE (EJ/yr)", - "Price|Carbon|EU-wide Regulation For All Sectors (US$2005/t CO2)" = "FE (EJ/yr)", - "Price|Carbon|Guardrail (US$2005/t CO2)" = "FE (EJ/yr)", - "Price|Carbon|SCC (US$2005/t CO2)" = "FE (EJ/yr)", - - "Price|Carbon|Demand|Buildings (US$2005/t CO2)" = "FE (EJ/yr)", - "Price|Carbon|Demand|Transport (US$2005/t CO2)" = "FE (EJ/yr)", - "Price|Carbon|Demand|Industry (US$2005/t CO2)" = "FE (EJ/yr)", - "Price|Carbon|Supply (US$2005/t CO2)" = "FE (EJ/yr)", - "Price|Carbon|Imported (US$2005/t CO2)" = "FE (EJ/yr)", - - "Price|Carbon|AggregatedByGrossCO2 (US$2005/t CO2)" = "Emi|GHG|Gross|Energy (Mt CO2eq/yr)", - "Price|Carbon|Captured|AggregatedByGrossCO2 (US$2005/t CO2)" = "Emi|GHG|Gross|Energy (Mt CO2eq/yr)", - "Price|Carbon|EU-wide Regulation For All Sectors|AggregatedByGrossCO2 (US$2005/t CO2)" = "Emi|GHG|Gross|Energy (Mt CO2eq/yr)", - "Price|Carbon|Guardrail|AggregatedByGrossCO2 (US$2005/t CO2)" = "Emi|GHG|Gross|Energy (Mt CO2eq/yr)", - "Price|Carbon|SCC|AggregatedByGrossCO2 (US$2005/t CO2)" = "Emi|GHG|Gross|Energy (Mt CO2eq/yr)" + "Price|Primary Energy|Biomass|Modern (US$2017/GJ)" = "PE|Biomass|Modern (EJ/yr)", + "Price|Primary Energy|Oil (US$2017/GJ)" = "PE|Oil (EJ/yr)", + "Price|Primary Energy|Gas (US$2017/GJ)" = "PE|Gas (EJ/yr)", + "Price|Primary Energy|Coal (US$2017/GJ)" = "PE|Coal (EJ/yr)", + "Price|Primary Energy|Nuclear (US$2017/GJ)" = "PE|Nuclear (EJ/yr)", + "Price|Primary Energy|Biomass|1st Generation|Sugar and Starch (US$2017/GJ)" = "PE|Biomass|1st Generation (EJ/yr)", + "Price|Primary Energy|Biomass|1st Generation|Oil-based (US$2017/GJ)" = "PE|Biomass|1st Generation (EJ/yr)", + + "Internal|Price|Biomass|Emulator presolve (US$2017/GJ)" = "Primary Energy Production|Biomass|Energy Crops MAgPIE (EJ/yr)", + "Internal|Price|Biomass|Emulator presolve shifted (US$2017/GJ)" = "Primary Energy Production|Biomass|Energy Crops MAgPIE (EJ/yr)", + "Internal|Price|Biomass|Emulator shifted (US$2017/GJ)" = "Primary Energy Production|Biomass|Energy Crops (EJ/yr)", + "Internal|Price|Biomass|MAgPIE (US$2017/GJ)" = "Primary Energy Production|Biomass|Energy Crops MAgPIE (EJ/yr)", + "Internal|Price|Biomass|Bioenergy sustainability tax (US$2017/GJ)" = "Primary Energy Production|Biomass|Energy Crops (EJ/yr)", + "Price|N2O (US$2017/t N2O)" = "Emi|N2O (kt N2O/yr)", + "Price|CH4 (US$2017/t CH4)" = "Emi|CH4 (Mt CH4/yr)", + "Price|Secondary Energy|Electricity (US$2017/GJ)" = "SE|Electricity (EJ/yr)", + "Price|Secondary Energy|Hydrogen (US$2017/GJ)" = "SE|Hydrogen (EJ/yr)", + "Price|Secondary Energy|Heat (US$2017/GJ)" = "SE|Heat (EJ/yr)", + "Price|Secondary Energy|Solids|Biomass (US$2017/GJ)" = "SE|Solids|Biomass (EJ/yr)", + "Price|Secondary Energy|Liquids|Biomass (US$2017/GJ)" = "SE|Liquids|Biomass (EJ/yr)", + "Price|Secondary Energy|Gases|Biomass (US$2017/GJ)" = "SE|Gases|Biomass (EJ/yr)", + "Price|Secondary Energy|Solids|Fossil (US$2017/GJ)" = "SE|Solids|Coal (EJ/yr)", + "Price|Secondary Energy|Liquids|Fossil (US$2017/GJ)" = "SE|Liquids|Fossil|Oil (EJ/yr)", + "Price|Secondary Energy|Gases|Fossil (US$2017/GJ)" = "SE|Gases|Fossil (EJ/yr)", + "Price|Secondary Energy|Liquids|Hydrogen (US$2017/GJ)" = "SE|Liquids|Hydrogen (EJ/yr)", + "Price|Secondary Energy|Gases|Hydrogen (US$2017/GJ)" = "SE|Gases|Hydrogen (EJ/yr)", + "Price|Secondary Energy|Solids (US$2017/GJ)" = "SE|Solids (EJ/yr)", + "Price|Secondary Energy|Liquids (US$2017/GJ)" = "SE|Liquids (EJ/yr)", + "Price|Secondary Energy|Gases (US$2017/GJ)" = "SE|Gases (EJ/yr)", + + "Price|Carbon|ETS (US$2017/t CO2)" = "FE|ETS (EJ/yr)", + "Price|Carbon|ESR (US$2017/t CO2)" = "FE|ESR (EJ/yr)", + + "Price|Carbon (US$2017/t CO2)" = "FE (EJ/yr)", + "Price|Carbon|Captured (US$2017/t CO2)" = "FE (EJ/yr)", + "Price|Carbon|EU-wide Regulation For All Sectors (US$2017/t CO2)" = "FE (EJ/yr)", + "Price|Carbon|Guardrail (US$2017/t CO2)" = "FE (EJ/yr)", + "Price|Carbon|SCC (US$2017/t CO2)" = "FE (EJ/yr)", + + "Price|Carbon|Demand|Buildings (US$2017/t CO2)" = "FE (EJ/yr)", + "Price|Carbon|Demand|Transport (US$2017/t CO2)" = "FE (EJ/yr)", + "Price|Carbon|Demand|Industry (US$2017/t CO2)" = "FE (EJ/yr)", + "Price|Carbon|Supply (US$2017/t CO2)" = "FE (EJ/yr)", + "Price|Carbon|Imported (US$2017/t CO2)" = "FE (EJ/yr)", + + "Price|Carbon|AggregatedByGrossCO2 (US$2017/t CO2)" = "Emi|GHG|Gross|Energy (Mt CO2eq/yr)", + "Price|Carbon|Captured|AggregatedByGrossCO2 (US$2017/t CO2)" = "Emi|GHG|Gross|Energy (Mt CO2eq/yr)", + "Price|Carbon|EU-wide Regulation For All Sectors|AggregatedByGrossCO2 (US$2017/t CO2)" = "Emi|GHG|Gross|Energy (Mt CO2eq/yr)", + "Price|Carbon|Guardrail|AggregatedByGrossCO2 (US$2017/t CO2)" = "Emi|GHG|Gross|Energy (Mt CO2eq/yr)", + "Price|Carbon|SCC|AggregatedByGrossCO2 (US$2017/t CO2)" = "Emi|GHG|Gross|Energy (Mt CO2eq/yr)" ) if (!is.null(esm2macro.m)) { int2ext <- c(int2ext, - "Price|Energy Service|Transport LDV (US$2005/GJ)" = "CES_input|fepet (EJ/yr)", ## TODO: check units - "Price|Energy Service|Transport nonLDV (US$2005/GJ)" = "CES_input|fedie (EJ/yr)" ## TODO: check units + "Price|Energy Service|Transport LDV (US$2017/GJ)" = "CES_input|fepet (EJ/yr)", ## TODO: check units + "Price|Energy Service|Transport nonLDV (US$2017/GJ)" = "CES_input|fedie (EJ/yr)" ## TODO: check units ) } @@ -922,36 +922,36 @@ reportPrices <- function(gdx, output=NULL, regionSubsetList=NULL, int2ext <- c(int2ext, ## transport prices - "Price|Final Energy|Transport|Electricity (US$2005/GJ)" = "FE|Transport|Electricity (EJ/yr)", - "Price|Final Energy|Transport|Liquids (US$2005/GJ)" = "FE|Transport|Liquids (EJ/yr)", - "Price|Final Energy|Transport|Hydrogen (US$2005/GJ)" = "FE|Transport|Hydrogen (EJ/yr)", + "Price|Final Energy|Transport|Electricity (US$2017/GJ)" = "FE|Transport|Electricity (EJ/yr)", + "Price|Final Energy|Transport|Liquids (US$2017/GJ)" = "FE|Transport|Liquids (EJ/yr)", + "Price|Final Energy|Transport|Hydrogen (US$2017/GJ)" = "FE|Transport|Hydrogen (EJ/yr)", ## buildings prices - "Price|Final Energy|Buildings|Electricity (US$2005/GJ)" = "FE|Buildings|Electricity (EJ/yr)", - "Price|Final Energy|Buildings|Liquids (US$2005/GJ)" = "FE|Buildings|Liquids (EJ/yr)", - "Price|Final Energy|Buildings|Gases (US$2005/GJ)" = "FE|Buildings|Gases (EJ/yr)", - "Price|Final Energy|Buildings|Hydrogen (US$2005/GJ)" = "FE|Buildings|Hydrogen (EJ/yr)", - "Price|Final Energy|Buildings|Heat (US$2005/GJ)" = "FE|Buildings|Heat (EJ/yr)", - "Price|Final Energy|Buildings|Solids (US$2005/GJ)" = "FE|Buildings|Solids (EJ/yr)", + "Price|Final Energy|Buildings|Electricity (US$2017/GJ)" = "FE|Buildings|Electricity (EJ/yr)", + "Price|Final Energy|Buildings|Liquids (US$2017/GJ)" = "FE|Buildings|Liquids (EJ/yr)", + "Price|Final Energy|Buildings|Gases (US$2017/GJ)" = "FE|Buildings|Gases (EJ/yr)", + "Price|Final Energy|Buildings|Hydrogen (US$2017/GJ)" = "FE|Buildings|Hydrogen (EJ/yr)", + "Price|Final Energy|Buildings|Heat (US$2017/GJ)" = "FE|Buildings|Heat (EJ/yr)", + "Price|Final Energy|Buildings|Solids (US$2017/GJ)" = "FE|Buildings|Solids (EJ/yr)", ## industry prices - "Price|Final Energy|Industry|Electricity (US$2005/GJ)" = "FE|Industry|Electricity (EJ/yr)", - "Price|Final Energy|Industry|Liquids (US$2005/GJ)" = "FE|Industry|Liquids (EJ/yr)", - "Price|Final Energy|Industry|Gases (US$2005/GJ)" = "FE|Industry|Gases (EJ/yr)", - "Price|Final Energy|Industry|Hydrogen (US$2005/GJ)" = "FE|Industry|Hydrogen (EJ/yr)", - "Price|Final Energy|Industry|Heat (US$2005/GJ)" = "FE|Industry|Heat (EJ/yr)", - "Price|Final Energy|Industry|Solids (US$2005/GJ)" = "FE|Industry|Solids (EJ/yr)" + "Price|Final Energy|Industry|Electricity (US$2017/GJ)" = "FE|Industry|Electricity (EJ/yr)", + "Price|Final Energy|Industry|Liquids (US$2017/GJ)" = "FE|Industry|Liquids (EJ/yr)", + "Price|Final Energy|Industry|Gases (US$2017/GJ)" = "FE|Industry|Gases (EJ/yr)", + "Price|Final Energy|Industry|Hydrogen (US$2017/GJ)" = "FE|Industry|Hydrogen (EJ/yr)", + "Price|Final Energy|Industry|Heat (US$2017/GJ)" = "FE|Industry|Heat (EJ/yr)", + "Price|Final Energy|Industry|Solids (US$2017/GJ)" = "FE|Industry|Solids (EJ/yr)" ) # transport-specific mappings depending on realization if (module2realisation["transport",2] == "complex") { int2ext <- c(int2ext, - "Price|Final Energy|Transport|Liquids|HDV (US$2005/GJ)" = "FE|Transport|non-LDV|Liquids (EJ/yr)", - "Price|Final Energy|Transport|Liquids|LDV (US$2005/GJ)" = "FE|Transport|LDV|Liquids (EJ/yr)") + "Price|Final Energy|Transport|Liquids|HDV (US$2017/GJ)" = "FE|Transport|non-LDV|Liquids (EJ/yr)", + "Price|Final Energy|Transport|Liquids|LDV (US$2017/GJ)" = "FE|Transport|LDV|Liquids (EJ/yr)") } else if (module2realisation["transport",2] == "edge_esm") { int2ext <- c(int2ext, - "Price|Final Energy|Transport|Liquids|HDV (US$2005/GJ)" = "FE|Transport|Diesel Liquids (EJ/yr)", - "Price|Final Energy|Transport|Liquids|LDV (US$2005/GJ)" = "FE|Transport|Pass|Liquids (EJ/yr)") + "Price|Final Energy|Transport|Liquids|HDV (US$2017/GJ)" = "FE|Transport|Diesel Liquids (EJ/yr)", + "Price|Final Energy|Transport|Liquids|LDV (US$2017/GJ)" = "FE|Transport|Pass|Liquids (EJ/yr)") } ## add weights definition for region aggregation for FE prices that were added automatically @@ -999,7 +999,7 @@ reportPrices <- function(gdx, output=NULL, regionSubsetList=NULL, # choose derivative of GDP (inco) with respect to input ces_price <- collapseDim(mselect(o01_CESderivatives, all_in = "inco", all_in1 = ppfen)) # variable names - ces_price <- setNames(ces_price, paste0("Internal|Price|CES|",getNames(ces_price)," (tr US$2005/input unit)")) + ces_price <- setNames(ces_price, paste0("Internal|Price|CES|",getNames(ces_price)," (tr US$2017/input unit)")) # CES Markup Cost p37_CESMkup <- readGDX(gdx, "p37_CESMkup") # markup in industry @@ -1010,7 +1010,7 @@ reportPrices <- function(gdx, output=NULL, regionSubsetList=NULL, mselect(p36_CESMkup[,YearsFrom2005,], all_in = ppfen_buildings_dyn36), mselect(p37_CESMkup[,YearsFrom2005,], all_in = ppfen_industry_dyn37)) - CESMkup <- setNames( CESMkup, paste0("Internal|CES Markup Cost|",getNames(CESMkup)," (tr US$2005/input unit)")) + CESMkup <- setNames( CESMkup, paste0("Internal|CES Markup Cost|",getNames(CESMkup)," (tr US$2017/input unit)")) out <- mbind(out, ces_price, CESMkup) @@ -1066,15 +1066,15 @@ reportPrices <- function(gdx, output=NULL, regionSubsetList=NULL, out <- mbind(out,setNames(glob_price, "PVP3|Permit ()")) for(i in getRegions(out)) glob_price[i,,] <- pm_pvp[,,"peur"]/pm_pvp[,,"good"] * tdptwyr2dpgj - out <- mbind(out,setNames(glob_price, "Price|Uranium|World Market (US$2005/GJ)")) + out <- mbind(out,setNames(glob_price, "Price|Uranium|World Market (US$2017/GJ)")) for(i in getRegions(out)) glob_price[i,,] <- pm_pvp[,,"peoil"]/pm_pvp[,,"good"] * tdptwyr2dpgj - out <- mbind(out,setNames(glob_price, "Price|Oil|World Market (US$2005/GJ)")) + out <- mbind(out,setNames(glob_price, "Price|Oil|World Market (US$2017/GJ)")) for(i in getRegions(out)) glob_price[i,,] <- pm_pvp[,,"pegas"]/pm_pvp[,,"good"] * tdptwyr2dpgj - out <- mbind(out,setNames(glob_price, "Price|Gas|World Market (US$2005/GJ)")) + out <- mbind(out,setNames(glob_price, "Price|Gas|World Market (US$2017/GJ)")) for(i in getRegions(out)) glob_price[i,,] <- pm_pvp[,,"pecoal"]/pm_pvp[,,"good"] * tdptwyr2dpgj - out <- mbind(out,setNames(glob_price, "Price|Coal|World Market (US$2005/GJ)")) + out <- mbind(out,setNames(glob_price, "Price|Coal|World Market (US$2017/GJ)")) for(i in getRegions(out)) glob_price[i,,] <- pm_pvp[,,"pebiolc"]/pm_pvp[,,"good"] * tdptwyr2dpgj - out <- mbind(out,setNames(glob_price, "Price|Biomass|World Market (US$2005/GJ)")) + out <- mbind(out,setNames(glob_price, "Price|Biomass|World Market (US$2017/GJ)")) ## special global prices @@ -1082,7 +1082,7 @@ reportPrices <- function(gdx, output=NULL, regionSubsetList=NULL, out["GLO",,"Internal|Price|Biomass|Shiftfactor ()"] <- NA if (!is.null(regionSubsetList$EUR)) - out["EUR",,"Price|Carbon|EU-wide Regulation For All Sectors (US$2005/t CO2)"] <- as.vector(co2EUprice[priceReg,,]) + out["EUR",,"Price|Carbon|EU-wide Regulation For All Sectors (US$2017/t CO2)"] <- as.vector(co2EUprice[priceReg,,]) ## not meaningful region aggregation prices set to NA if (!is.null(regionSubsetList)){ @@ -1105,7 +1105,7 @@ reportPrices <- function(gdx, output=NULL, regionSubsetList=NULL, # # fake some GLO data # setNames( # mbind(.x, dimSums(.x * NA, dim = 1)), - # 'Debug|Industry|Secondary Steel Premium (US$2005)'), + # 'Debug|Industry|Secondary Steel Premium (US$2017)'), # # mbind( # lapply( @@ -1122,7 +1122,7 @@ reportPrices <- function(gdx, output=NULL, regionSubsetList=NULL, # ( out[,,paste0('Price|CES_input|', x[1], ' ('), pmatch = 'left'] # * as.numeric(x[4]) # ), - # paste0('Debug|Price|Industry', x[2], ' (US$2005/', x[3], ')')) + # paste0('Debug|Price|Industry', x[2], ' (US$2017/', x[3], ')')) # }) # ) # ) diff --git a/R/reportTechnology.R b/R/reportTechnology.R index 5e201554..5c4019af 100644 --- a/R/reportTechnology.R +++ b/R/reportTechnology.R @@ -243,14 +243,14 @@ reportTechnology <- function(gdx, output = NULL, regionSubsetList = NULL, t = c( ## capital costs ---- category <- "Capital Costs" - unit <- "US$2005/kW" + unit <- "US$2017/kW" factor <- 1000. tmp <- bind_category(tmp, v_investcost, category, unit, factor, techmap) int2ext <- get_global_mapping(category, unit, techmap) if (CDR_mod != "off") { - unit <- "US$2005/t CO2/yr" + unit <- "US$2017/t CO2/yr" factor <- 1000 / 3.6 tmp <- bind_category(tmp, v_investcost, category, unit, factor, cdrmap) int2ext <- c(int2ext, get_global_mapping(category, unit, cdrmap)) @@ -259,7 +259,7 @@ reportTechnology <- function(gdx, output = NULL, regionSubsetList = NULL, t = c( ### Capital cost including adjustment cost ---- if (!is.null(v_adjustteinv_avg)) { category <- "Capital Costs|w/ Adj Costs" - unit <- "US$2005/kW" + unit <- "US$2017/kW" factor <- 1000. tmp <- bind_category(tmp, v_investcost + v_adjustteinv_avg, category, unit, factor, techmap) @@ -267,13 +267,13 @@ reportTechnology <- function(gdx, output = NULL, regionSubsetList = NULL, t = c( } if (tran_mod == "complex") { - unit <- "US$2005/veh" + unit <- "US$2017/veh" tmp <- bind_category(tmp, v_investcost + v_adjustteinv_avg, category, unit, factor, carmap) int2ext <- c(int2ext, get_global_mapping(category, unit, carmap)) } if (CDR_mod != "off") { - unit <- "US$2005/t CO2/yr" + unit <- "US$2017/t CO2/yr" factor <- 1000 / 3.6 tmp <- bind_category(tmp, v_investcost + v_adjustteinv_avg, category, unit, factor, cdrmap) int2ext <- c(int2ext, get_global_mapping(category, unit, cdrmap)) @@ -322,14 +322,14 @@ reportTechnology <- function(gdx, output = NULL, regionSubsetList = NULL, t = c( ## o&m fix costs ---- category <- "OM Cost|fixed" - unit <- "US$2005/kW/yr" + unit <- "US$2017/kW/yr" tmp <- bind_category(tmp, omf * v_investcost, category, unit, 1000.) int2ext <- c(int2ext, get_global_mapping(category, unit, techmap)) if (tran_mod == "complex") { ## op costs for cars ### category <- "Op Costs" - unit <- "US$2005/veh/yr" + unit <- "US$2017/veh/yr" tmp <- bind_category(tmp, omf * v_investcost, category, unit, 1000., carmap) int2ext <- c(int2ext, get_global_mapping(category, unit, carmap)) } @@ -337,14 +337,14 @@ reportTechnology <- function(gdx, output = NULL, regionSubsetList = NULL, t = c( if (CDR_mod != "off") { ## op costs for CDR technologies ### category <- "OM Cost|fixed" - unit <- "US$2005/t CO2/yr" + unit <- "US$2017/t CO2/yr" tmp <- bind_category(tmp, omf * v_investcost, category, unit, 1000 / 3.66, cdrmap) int2ext <- c(int2ext, get_global_mapping(category, unit, cdrmap)) } ## o&m variable costs ---- category <- "OM Cost|variable" - unit <- "US$2005/GJ" + unit <- "US$2017/GJ" tmp <- bind_category(tmp, omv, category, unit, 1000. / 31.7098) int2ext <- c(int2ext, get_global_mapping(category, unit, techmap)) diff --git a/tests/testthat/test-addSubvariable.R b/tests/testthat/test-addSubvariable.R index 33fecd88..9b7c9a9e 100644 --- a/tests/testthat/test-addSubvariable.R +++ b/tests/testthat/test-addSubvariable.R @@ -1,7 +1,7 @@ test_that(".addSubvariable works", { - int2ext <- c("Price|Final Energy (US$2005/GJ)" = "FE (EJ)") - int2extafter <- c("Price|Final Energy (US$2005/GJ)" = "FE (EJ)", - "Price|Final Energy|Rawdata (US$2005/GJ)" = "FE (EJ)") + int2ext <- c("Price|Final Energy (US$2017/GJ)" = "FE (EJ)") + int2extafter <- c("Price|Final Energy (US$2017/GJ)" = "FE (EJ)", + "Price|Final Energy|Rawdata (US$2017/GJ)" = "FE (EJ)") expect_equal(int2extafter, .addSubvariable(int2ext, "|Rawdata")) }) From 4819d9def919078262813420e2094d9cc63d08a3 Mon Sep 17 00:00:00 2001 From: Falk Benke Date: Mon, 23 Sep 2024 11:28:37 +0200 Subject: [PATCH 5/6] increase version --- .buildlibrary | 2 +- CITATION.cff | 4 ++-- DESCRIPTION | 4 ++-- README.md | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.buildlibrary b/.buildlibrary index f6082d2d..40c14da4 100644 --- a/.buildlibrary +++ b/.buildlibrary @@ -1,4 +1,4 @@ -ValidationKey: '231038160' +ValidationKey: '231092829' AcceptedWarnings: - 'Warning: package ''.*'' was built under R version' - 'Warning: namespace ''.*'' is not available and has been replaced' diff --git a/CITATION.cff b/CITATION.cff index 2facf532..2aafe0d3 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -2,8 +2,8 @@ cff-version: 1.2.0 message: If you use this software, please cite it using the metadata from this file. type: software title: 'remind2: The REMIND R package (2nd generation)' -version: 1.156.0 -date-released: '2024-09-20' +version: 1.156.1 +date-released: '2024-09-23' abstract: Contains the REMIND-specific routines for data and model output manipulation. authors: - family-names: Rodrigues diff --git a/DESCRIPTION b/DESCRIPTION index 2b66dc0b..99510c9d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Type: Package Package: remind2 Title: The REMIND R package (2nd generation) -Version: 1.156.0 -Date: 2024-09-20 +Version: 1.156.1 +Date: 2024-09-23 Authors@R: c( person("Renato", "Rodrigues", , "renato.rodrigues@pik-potsdam.de", role = c("aut", "cre")), person("Lavinia", "Baumstark", role = "aut"), diff --git a/README.md b/README.md index 605897da..42160569 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # The REMIND R package (2nd generation) -R package **remind2**, version **1.156.0** +R package **remind2**, version **1.156.1** [![CRAN status](https://www.r-pkg.org/badges/version/remind2)](https://cran.r-project.org/package=remind2) [![R build status](https://github.com/pik-piam/remind2/workflows/check/badge.svg)](https://github.com/pik-piam/remind2/actions) [![codecov](https://codecov.io/gh/pik-piam/remind2/branch/master/graph/badge.svg)](https://app.codecov.io/gh/pik-piam/remind2) [![r-universe](https://pik-piam.r-universe.dev/badges/remind2)](https://pik-piam.r-universe.dev/builds) @@ -49,7 +49,7 @@ In case of questions / problems please contact Renato Rodrigues . +Rodrigues R, Baumstark L, Benke F, Dietrich J, Dirnaichner A, Duerrwaechter J, Führlich P, Giannousakis A, Hasse R, Hilaire J, Klein D, Koch J, Kowalczyk K, Levesque A, Malik A, Merfort A, Merfort L, Morena-Leiva S, Pehl M, Pietzcker R, Rauner S, Richters O, Rottoli M, Schötz C, Schreyer F, Siala K, Sörgel B, Spahr M, Strefler J, Verpoort P, Weigmann P, Rüter T (2024). _remind2: The REMIND R package (2nd generation)_. R package version 1.156.1, . A BibTeX entry for LaTeX users is @@ -58,7 +58,7 @@ A BibTeX entry for LaTeX users is title = {remind2: The REMIND R package (2nd generation)}, author = {Renato Rodrigues and Lavinia Baumstark and Falk Benke and Jan Philipp Dietrich and Alois Dirnaichner and Jakob Duerrwaechter and Pascal Führlich and Anastasis Giannousakis and Robin Hasse and Jérome Hilaire and David Klein and Johannes Koch and Katarzyna Kowalczyk and Antoine Levesque and Aman Malik and Anne Merfort and Leon Merfort and Simón Morena-Leiva and Michaja Pehl and Robert Pietzcker and Sebastian Rauner and Oliver Richters and Marianna Rottoli and Christof Schötz and Felix Schreyer and Kais Siala and Björn Sörgel and Mike Spahr and Jessica Strefler and Philipp Verpoort and Pascal Weigmann and Tonn Rüter}, year = {2024}, - note = {R package version 1.156.0}, + note = {R package version 1.156.1}, url = {https://github.com/pik-piam/remind2}, } ``` From 9e98c8bffeb7df1a15ce6ffece7f87e02fb5fbc7 Mon Sep 17 00:00:00 2001 From: Falk Benke Date: Mon, 23 Sep 2024 14:02:11 +0200 Subject: [PATCH 6/6] fix bug in reportEmployment --- R/reportEmployment.R | 48 ++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/R/reportEmployment.R b/R/reportEmployment.R index a9434e31..08f1f22d 100644 --- a/R/reportEmployment.R +++ b/R/reportEmployment.R @@ -41,30 +41,30 @@ reportEmployment <- function(gdx, improvements, multiplier, subtype, shareManf, reportTech <- reportTechnology(gdx) reportTech <- collapseNames(reportTech) var <- c( - "Tech|Electricity|Coal|Pulverised Coal w/o CC|Capital Costs (U$2017/kW)", - "Tech|Electricity|Gas|Combined Cycle w/o CC|Capital Costs (U$2017/kW)", - "Tech|Electricity|Hydro|Capital Costs (U$2017/kW)", - "Tech|Electricity|Nuclear|Capital Costs (U$2017/kW)", - "Tech|Electricity|Solar|PV|Capital Costs (U$2017/kW)", - "Tech|Electricity|Solar|CSP|Capital Costs (U$2017/kW)", - "Tech|Electricity|Wind|Onshore|Capital Costs (U$2017/kW)", - "Tech|Electricity|Wind|Offshore|Capital Costs (U$2017/kW)", - "Tech|Electricity|Biomass|Combined Heat and Power w/o CC|Capital Costs (U$2017/kW)", - "Tech|Electricity|Storage|Battery|For PV|Capital Costs (U$2017/kW)", - "Tech|Electricity|Oil|DOT|Capital Costs (U$2017/kW)", - "Tech|Electricity|Geothermal|Capital Costs (U$2017/kW)", - "Tech|Electricity|Coal|Pulverised Coal w/o CC|OM Cost|fixed (U$2017/kW/yr)", - "Tech|Electricity|Gas|Combined Cycle w/o CC|OM Cost|fixed (U$2017/kW/yr)", - "Tech|Electricity|Hydro|OM Cost|fixed (U$2017/kW/yr)", - "Tech|Electricity|Nuclear|OM Cost|fixed (U$2017/kW/yr)", - "Tech|Electricity|Solar|PV|OM Cost|fixed (U$2017/kW/yr)", - "Tech|Electricity|Solar|CSP|OM Cost|fixed (U$2017/kW/yr)", - "Tech|Electricity|Wind|Onshore|OM Cost|fixed (U$2017/kW/yr)", - "Tech|Electricity|Wind|Offshore|OM Cost|fixed (U$2017/kW/yr)", - "Tech|Electricity|Biomass|Combined Heat and Power w/o CC|OM Cost|fixed (U$2017/kW/yr)", - "Tech|Electricity|Oil|DOT|OM Cost|fixed (U$2017/kW/yr)", - "Tech|Electricity|Geothermal|OM Cost|fixed (U$2017/kW/yr)", - "Tech|Electricity|Storage|Battery|For PV|OM Cost|fixed (U$2017/kW/yr)", + "Tech|Electricity|Coal|Pulverised Coal w/o CC|Capital Costs (US$2017/kW)", + "Tech|Electricity|Gas|Combined Cycle w/o CC|Capital Costs (US$2017/kW)", + "Tech|Electricity|Hydro|Capital Costs (US$2017/kW)", + "Tech|Electricity|Nuclear|Capital Costs (US$2017/kW)", + "Tech|Electricity|Solar|PV|Capital Costs (US$2017/kW)", + "Tech|Electricity|Solar|CSP|Capital Costs (US$2017/kW)", + "Tech|Electricity|Wind|Onshore|Capital Costs (US$2017/kW)", + "Tech|Electricity|Wind|Offshore|Capital Costs (US$2017/kW)", + "Tech|Electricity|Biomass|Combined Heat and Power w/o CC|Capital Costs (US$2017/kW)", + "Tech|Electricity|Storage|Battery|For PV|Capital Costs (US$2017/kW)", + "Tech|Electricity|Oil|DOT|Capital Costs (US$2017/kW)", + "Tech|Electricity|Geothermal|Capital Costs (US$2017/kW)", + "Tech|Electricity|Coal|Pulverised Coal w/o CC|OM Cost|fixed (US$2017/kW/yr)", + "Tech|Electricity|Gas|Combined Cycle w/o CC|OM Cost|fixed (US$2017/kW/yr)", + "Tech|Electricity|Hydro|OM Cost|fixed (US$2017/kW/yr)", + "Tech|Electricity|Nuclear|OM Cost|fixed (US$2017/kW/yr)", + "Tech|Electricity|Solar|PV|OM Cost|fixed (US$2017/kW/yr)", + "Tech|Electricity|Solar|CSP|OM Cost|fixed (US$2017/kW/yr)", + "Tech|Electricity|Wind|Onshore|OM Cost|fixed (US$2017/kW/yr)", + "Tech|Electricity|Wind|Offshore|OM Cost|fixed (US$2017/kW/yr)", + "Tech|Electricity|Biomass|Combined Heat and Power w/o CC|OM Cost|fixed (US$2017/kW/yr)", + "Tech|Electricity|Oil|DOT|OM Cost|fixed (US$2017/kW/yr)", + "Tech|Electricity|Geothermal|OM Cost|fixed (US$2017/kW/yr)", + "Tech|Electricity|Storage|Battery|For PV|OM Cost|fixed (US$2017/kW/yr)", NULL ) # only capital costs