Skip to content

Commit

Permalink
make readGDX calls robust to renaming of vm_co2capture to v_co2capture
Browse files Browse the repository at this point in the history
  • Loading branch information
Felix Schreyer authored and Felix Schreyer committed Nov 15, 2024
1 parent 31ef29b commit 0695798
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion R/reportEmi.R
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ reportEmi <- function(gdx, output = NULL, regionSubsetList = NULL,

### Carbon management variables
# total captured CO2
vm_co2capture <- readGDX(gdx, "vm_co2capture", field = "l", restore_zeros = F)[, t, ]
vm_co2capture <- readGDX(gdx, c("vm_co2capture","v_co2capture"), field = "l", restore_zeros = F)[, t, ]
vm_emiCdr_co2 <- readGDX(gdx, "vm_emiCdr", field = "l", restore_zeros = F)[, t, "co2"]
vm_emiCdrTeDetail <- readGDX(gdx, c("vm_emiCdrTeDetail","v33_emi"), field = "l", restore_zeros = F, react = "silent")[, t, ]

Expand Down
6 changes: 3 additions & 3 deletions R/reportLCOE.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ reportLCOE <- function(gdx, output.type = "both") {
vm_capFac <- readGDX(gdx, "vm_capFac", field = "l", restore_zeros = FALSE)
qm_balcapture <- readGDX(gdx, "q_balcapture", field = "m", restore_zeros = FALSE)
vm_co2CCS <- readGDX(gdx, "vm_co2CCS", field = "l", restore_zeros = FALSE)
vm_co2capture <- readGDX(gdx, "vm_co2capture", field = "l", restore_zeros = FALSE)
vm_co2capture <- readGDX(gdx, c("vm_co2capture","v_co2capture"), field = "l", restore_zeros = FALSE)
pm_emifac <- readGDX(gdx, "pm_emiFac", field = "l", restore_zeros = FALSE)
v32_storloss <- readGDX(gdx, "v32_storloss", field = "l")

Expand Down Expand Up @@ -1215,7 +1215,7 @@ reportLCOE <- function(gdx, output.type = "both") {

### 13. calculate share stored carbon from capture carbon
vm_co2CCS <- readGDX(gdx, "vm_co2CCS", field = "l", restore_zeros = FALSE)
vm_co2capture <- readGDX(gdx, "vm_co2capture", field = "l", restore_zeros = FALSE)
vm_co2capture <- readGDX(gdx, c("vm_co2capture","v_co2capture"), field = "l", restore_zeros = FALSE)

if (getSets(vm_co2capture)[[3]] == "emiAll") {
sel_vm_co2capture_cco2 <- mselect(vm_co2capture, emiAll = "cco2")
Expand Down Expand Up @@ -1294,7 +1294,7 @@ reportLCOE <- function(gdx, output.type = "both") {
# for now take the storage share of the construction year of plant, it will not change much over time
# (if CCS, then no CCU and v_capturevalve is mostly small)
vm_co2CCS <- readGDX(gdx, "vm_co2CCS", field = "l", restore_zeros = FALSE)
vm_co2capture <- readGDX(gdx, "vm_co2capture", field = "l", restore_zeros = FALSE)
vm_co2capture <- readGDX(gdx, c("vm_co2capture","v_co2capture"), field = "l", restore_zeros = FALSE)


# calculate stored CO2 per output of capture technology (GtC/TWa)
Expand Down

0 comments on commit 0695798

Please sign in to comment.