Skip to content

Commit

Permalink
remove ppc and pco from 'calcWaterConsCoef'
Browse files Browse the repository at this point in the history
  • Loading branch information
fbenke-pik committed Sep 2, 2024
1 parent d7a27a6 commit 4ab9591
Show file tree
Hide file tree
Showing 2 changed files with 136 additions and 53 deletions.
119 changes: 66 additions & 53 deletions R/calcWaterConsCoef.R
Original file line number Diff line number Diff line change
@@ -1,77 +1,90 @@
#' Calculate Water Consumption Coefficients
#'
#'
#' This function calculates REMIND input data on water consumption coefficients
#' per electricity technology, using as initial information the Macknick (2011)
#' data per electricity technology. The source data provide most required
#' information but some assumptions on missing data are also made.
#'
#'
#'
#'
#' @return MAgPIE object on water consumption coefficients per elecricity
#' technology
#' @author Ioanna Mouratiadou
#' @seealso \code{\link{calcOutput}}, \code{\link{readMacknickIntensities}},
#' \code{\link{calcWaterWithCoef}}
#' @examples
#'
#' \dontrun{
#' \dontrun{
#' calcOutput("WaterConsCoef")
#'
#' }
#'
#'
calcWaterConsCoef <- function() {

# read in data
data <- readSource("MacknickIntensities","data")

#use data for median withdrawal
data <- collapseNames(data[,,"Water consumption median (gal/MWh)",drop=FALSE])
data <- readSource("MacknickIntensities", "data")

# use data for median withdrawal
data <- collapseNames(data[, , "Water consumption median (gal/MWh)", drop = FALSE])

# convert from gal/MWh into m3/MWh
data <- data * 0.0037854

#convert from gal/MWh into m3/MWh
data <- data * 0.0037854

# read in mapping to REMIND technologies
map_table <- read_excel(toolGetMapping(type = "sectoral", name = "TechnologyMappingMacknick2REMIND.xlsx",
returnPathOnly = TRUE, where = "mappingfolder"))
map_table <- toolGetMapping(
type = "sectoral",
name = "mappingMacknicktoREMIND.csv",
where = "mrremind"
)
map <- list()
map$macknick <- paste(map_table$'Macknick Source',map_table$'Macknick Technology',map_table$'Macknick Cooling',sep=".")
map$remind <- paste(map_table$`REMIND Technology`,map_table$`REMIND Cooling`,sep=".")

map$macknick <- paste(map_table$Macknick.Source,
map_table$Macknick.Technology, map_table$Macknick.Cooling,
sep = "."
)

map$remind <- paste(map_table$REMIND.Technology, map_table$REMIND.Cooling, sep = ".")

# calculate REMIND input in REMIND categories
output <- new.magpie(getRegions(data),getYears(data),map$remind)
output[,,] <- 0
for(d in 1:length(map$macknick)){
if( !map$macknick[d] == "-.-.-"){
output[,,map$remind[d]] <- data[,,map$macknick[d]]
output <- new.magpie(getRegions(data), getYears(data), map$remind)
output[, , ] <- 0
for (d in 1:length(map$macknick)) {
if (!map$macknick[d] == "-.-.-") {
output[, , map$remind[d]] <- data[, , map$macknick[d]]
}
}


# remove no longer used technologies pcc and pco
output <- output[, , c("pcc", "pco"), invert = TRUE]

# add some assumed data
assudata <- readSource("MacknickIntensities","missingAssumed")
assudata <- collapseNames(assudata[,,"Water consumption median (gal/MWh)",drop=TRUE],1)
assudata <- assudata * 0.0037854

# add assumed data to data (by overrighting)
output[,,getNames(assudata)] <- assudata[,,getNames(assudata)]
output[,,"ngcc.once"] <- 0.66 * output[,,"ngcc.once"] + 0.34 * output[,,"dot.once"]
output[,,"ngcc.tower"] <- 0.66 * output[,,"ngcc.tower"] + 0.34 * output[,,"dot.tower"]
output[,,"ngcc.pond"] <- 0.66 * output[,,"ngcc.pond"] + 0.34 * output[,,"dot.pond"]
output[,,"ngcc.dry"] <- 0.66 * output[,,"ngcc.dry"] + 0.34 * output[,,"dot.dry"]
output[,,"gaschp.once"] <- 0.50 * output[,,"dot.once"]
output[,,"gaschp.tower"] <- 0.50 * output[,,"dot.tower"]
output[,,"gaschp.pond"] <- 0.50 * output[,,"dot.pond"]
output[,,"gaschp.dry"] <- 0.50 * output[,,"dot.dry"]
output[,,"coalchp.once"] <- 0.50 * output[,,"pc.once"]
output[,,"coalchp.tower"] <- 0.50 * output[,,"pc.tower"]
output[,,"coalchp.pond"] <- 0.50 * output[,,"pc.pond"]
output[,,"coalchp.dry"] <- 0.50 * output[,,"pc.dry"]
output[,,"biochp.once"] <- 0.50 * output[,,"pc.once"]
output[,,"biochp.tower"] <- 0.50 * output[,,"pc.tower"]
output[,,"biochp.pond"] <- 0.50 * output[,,"pc.pond"]
output[,,"biochp.dry"] <- 0.50 * output[,,"pc.dry"]

return(list(x=output,weight=NULL,
unit="m3/MWh",
description="Water Consumption coefficients for different electricity and cooling technologies based on Macknick et al. (2011) report",
isocountries=FALSE
assudata <- readSource("MacknickIntensities", "missingAssumed")
assudata <- assudata[, , c("pcc", "pco"), invert = TRUE]
assudata <- collapseNames(assudata[, , "Water consumption median (gal/MWh)", drop = TRUE], 1)
assudata <- assudata * 0.0037854

# add assumed data to data (by overwriting)
output[, , getNames(assudata)] <- assudata[, , getNames(assudata)]
output[, , "ngcc.once"] <- 0.66 * output[, , "ngcc.once"] + 0.34 * output[, , "dot.once"]
output[, , "ngcc.tower"] <- 0.66 * output[, , "ngcc.tower"] + 0.34 * output[, , "dot.tower"]
output[, , "ngcc.pond"] <- 0.66 * output[, , "ngcc.pond"] + 0.34 * output[, , "dot.pond"]
output[, , "ngcc.dry"] <- 0.66 * output[, , "ngcc.dry"] + 0.34 * output[, , "dot.dry"]
output[, , "gaschp.once"] <- 0.50 * output[, , "dot.once"]
output[, , "gaschp.tower"] <- 0.50 * output[, , "dot.tower"]
output[, , "gaschp.pond"] <- 0.50 * output[, , "dot.pond"]
output[, , "gaschp.dry"] <- 0.50 * output[, , "dot.dry"]
output[, , "coalchp.once"] <- 0.50 * output[, , "pc.once"]
output[, , "coalchp.tower"] <- 0.50 * output[, , "pc.tower"]
output[, , "coalchp.pond"] <- 0.50 * output[, , "pc.pond"]
output[, , "coalchp.dry"] <- 0.50 * output[, , "pc.dry"]
output[, , "biochp.once"] <- 0.50 * output[, , "pc.once"]
output[, , "biochp.tower"] <- 0.50 * output[, , "pc.tower"]
output[, , "biochp.pond"] <- 0.50 * output[, , "pc.pond"]
output[, , "biochp.dry"] <- 0.50 * output[, , "pc.dry"]

return(list(
x = output,
weight = NULL,
unit = "m3/MWh",
description = c(
"Water Consumption coefficients for different electricity and cooling technologies ",
"based on Macknick et al. (2011) report"
),
isocountries = FALSE
))
}
70 changes: 70 additions & 0 deletions inst/extdata/sectoral/mappingMacknicktoREMIND.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
"REMIND Source";"REMIND Technology";"REMIND Cooling";"Macknick Source";"Macknick Technology";"Macknick Cooling"
"pegas";"ngcc";"tower";"Natural Gas";"Combined Cycle";"Tower"
"pegas";"ngcc";"once";"Natural Gas";"Combined Cycle";"Once-through"
"pegas";"ngcc";"pond";"Natural Gas";"Combined Cycle";"Pond"
"pegas";"ngcc";"dry";"Natural Gas";"Combined Cycle";"Dry"
"pegas";"ngccc";"tower";"Natural Gas";"Combined Cycle with CCS";"Tower"
"pegas";"ngccc";"once";"-";"-";"-"
"pegas";"ngccc";"pond";"-";"-";"-"
"pegas";"ngccc";"dry";"-";"-";"-"
"pegas";"ngt";"tower";"-";"-";"-"
"pegas";"ngt";"once";"-";"-";"-"
"pegas";"ngt";"pond";"-";"-";"-"
"pegas";"ngt";"dry";"-";"-";"-"
"pegas";"gaschp";"tower";"-";"-";"-"
"pegas";"gaschp";"once";"-";"-";"-"
"pegas";"gaschp";"pond";"-";"-";"-"
"pegas";"gaschp";"dry";"-";"-";"-"
"pecoal";"igcc";"tower";"Coal";"IGCC";"Tower"
"pecoal";"igcc";"once";"-";"-";"-"
"pecoal";"igcc";"pond";"-";"-";"-"
"pecoal";"igcc";"dry";"-";"-";"-"
"pecoal";"igccc";"tower";"Coal";"IGCC with CCS";"Tower"
"pecoal";"igccc";"once";"-";"-";"-"
"pecoal";"igccc";"pond";"-";"-";"-"
"pecoal";"igccc";"dry";"-";"-";"-"
"pecoal";"pc";"tower";"Coal";"Generic";"Tower"
"pecoal";"pc";"once";"Coal";"Generic";"Once-through"
"pecoal";"pc";"pond";"Coal";"Generic";"Pond"
"pecoal";"pc";"dry";"-";"-";"-"
"pecoal";"pcc";"tower";"Coal";"Supercritical with CCS";"Tower"
"pecoal";"pcc";"once";"-";"-";"-"
"pecoal";"pcc";"pond";"-";"-";"-"
"pecoal";"pcc";"dry";"-";"-";"-"
"pecoal";"pco";"tower";"Coal";"Supercritical with CCS";"Tower"
"pecoal";"pco";"once";"-";"-";"-"
"pecoal";"pco";"pond";"-";"-";"-"
"pecoal";"pco";"dry";"-";"-";"-"
"pecoal";"coalchp";"tower";"-";"-";"-"
"pecoal";"coalchp";"once";"-";"-";"-"
"pecoal";"coalchp";"pond";"-";"-";"-"
"pecoal";"coalchp";"dry";"-";"-";"-"
"peoil";"dot";"tower";"Natural Gas";"Steam";"Tower"
"peoil";"dot";"once";"Natural Gas";"Steam";"Once-through"
"peoil";"dot";"pond";"Natural Gas";"Steam";"Tower"
"peoil";"dot";"dry";"-";"-";"-"
"peur";"tnrs";"tower";"Nuclear";"Generic";"Tower"
"peur";"tnrs";"once";"Nuclear";"Generic";"Once-through"
"peur";"tnrs";"pond";"Nuclear";"Generic";"Pond"
"peur";"tnrs";"dry";"-";"-";"-"
"pebiolc";"biochp";"tower";"-";"-";"-"
"pebiolc";"biochp";"once";"-";"-";"-"
"pebiolc";"biochp";"pond";"-";"-";"-"
"pebiolc";"biochp";"dry";"-";"-";"-"
"pebiolc";"bioigcc";"tower";"Coal";"IGCC";"Tower"
"pebiolc";"bioigcc";"once";"-";"-";"-"
"pebiolc";"bioigcc";"pond";"-";"-";"-"
"pebiolc";"bioigcc";"dry";"-";"-";"-"
"pebiolc";"bioigccc";"tower";"Coal";"IGCC with CCS";"Tower"
"pebiolc";"bioigccc";"once";"-";"-";"-"
"pebiolc";"bioigccc";"pond";"-";"-";"-"
"pebiolc";"bioigccc";"dry";"-";"-";"-"
"pegeo";"geohdr";"tower";"Geothermal";"EGS";"Tower"
"pegeo";"geohdr";"dry";"Geothermal";"EGS";"Dry"
"pegeo";"geohdr";"hybrid";"Geothermal";"EGS";"Hybrid"
"pehyd";"hydro";"default";"Hydropower";"Aggregated in-stream and reservoir";"n/a"
"pewin";"wind";"default";"Wind";"Wind Turbine";"n/a"
"pesol";"spv";"default";"PV";"Utility Scale PV";"n/a"
"pesol";"csp";"tower";"CSP";"Trough";"Tower"
"pesol";"csp";"dry";"CSP";"Trough";"Dry"
"pesol";"csp";"hybrid";"CSP";"Trough";"Hybrid"

0 comments on commit 4ab9591

Please sign in to comment.