Skip to content

Commit

Permalink
adding fail safe to make sure this does not affect runs without wind …
Browse files Browse the repository at this point in the history
…offshore
  • Loading branch information
Renato-Rodrigues committed Oct 6, 2023
1 parent 13d9546 commit 3e9d762
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions R/reportPE.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ reportPE <- function(gdx,regionSubsetList=NULL,t=c(seq(2005,2060,5),seq(2070,211
####### read in needed data #########
## sets
pe2se <- readGDX(gdx,"pe2se")
te <- readGDX(gdx, "te")
tefosccs <- readGDX(gdx,c("teFosCCS","tefosccs"),format="first_found")
teccs <- readGDX(gdx,c("teCCS","teccs"),format="first_found")
tenoccs <- readGDX(gdx,c("teNoCCS","tenoccs"),format="first_found")
Expand Down Expand Up @@ -117,8 +118,10 @@ reportPE <- function(gdx,regionSubsetList=NULL,t=c(seq(2005,2060,5),seq(2070,211
tmp2 <- mbind(tmp2,setNames(dimSums(mselect(prodSE,all_enty=c("pegeo","pehyd","pewin","pesol")),dim=3),"PE|Non-Biomass Renewables (EJ/yr)"))
tmp2 <- mbind(tmp2,setNames(dimSums(mselect(prodSE,all_enty="pehyd"),dim=3), "PE|+|Hydro (EJ/yr)"))
tmp2 <- mbind(tmp2,setNames(dimSums(mselect(prodSE,all_enty="pewin"),dim=3), "PE|+|Wind (EJ/yr)"))
tmp2 <- mbind(tmp2,setNames(dimSums(mselect(prodSE,all_enty="pewin",all_te="wind"),dim=3), "PE|Wind|+|Onshore (EJ/yr)"))
tmp2 <- mbind(tmp2,setNames(dimSums(mselect(prodSE,all_enty="pewin",all_te="windoff"),dim=3), "PE|Wind|+|Offshore (EJ/yr)"))
if ("windoff" %in% te) {
tmp2 <- mbind(tmp2,setNames(dimSums(mselect(prodSE,all_enty="pewin",all_te="wind"),dim=3), "PE|Wind|+|Onshore (EJ/yr)"))
tmp2 <- mbind(tmp2,setNames(dimSums(mselect(prodSE,all_enty="pewin",all_te="windoff"),dim=3), "PE|Wind|+|Offshore (EJ/yr)"))
}
tmp2 <- mbind(tmp2,setNames(dimSums(mselect(prodSE,all_enty="pesol"),dim=3), "PE|+|Solar (EJ/yr)"))
tmp2 <- mbind(tmp2,setNames(dimSums(mselect(prodSE,all_enty="pegeo"),dim=3), "PE|+|Geothermal (EJ/yr)"))

Expand Down

0 comments on commit 3e9d762

Please sign in to comment.