-
Notifications
You must be signed in to change notification settings - Fork 45
/
calcCoolingSharesAll.R
58 lines (54 loc) · 2.02 KB
/
calcCoolingSharesAll.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#' Calculate Cooling Type Shares
#'
#' This function merges the output of two other functions that calculate REMIND
#' input data for the shares of cooling types per electricity technology and
#' REMIND region, using as initial information the Davies (2013) data per
#' electricity technology and GCAM region. The two other functions separately
#' calculate data for the base year and for future time steps. The source data
#' provide most required information but some assumptions on missing data are
#' also made.
#'
#'
#' @return MAgPIE object on cooling type shares per elecricity technology and
#' REMIND region
#' @author Ioanna Mouratiadou
#' @seealso \code{\link{calcOutput}}, \code{\link{readDaviesCooling}},
#' \code{\link{convertDaviesCooling}},
#' \code{\link{calcCoolingSharesBase}},\code{\link{calcCoolingSharesFuture}}
#' @examples
#' \dontrun{
#'
#' a <- calcOutput("CoolingSharesAll")
#' }
#'
calcCoolingSharesAll <- function() {
cooloutputBase <- calcOutput("CoolingSharesBase", aggregate = FALSE)
cooloutputFuture <- calcOutput("CoolingSharesFuture", aggregate = FALSE)
# merge two datasets
outputAll <- mbind(cooloutputBase, cooloutputFuture)
# assign aggregation weight
weight <- dimSums(calcOutput("IO", subtype = "output", aggregate = FALSE)[, 2010, c("feelb", "feeli")], dim = 3)
# set weights to zero for countries that were not contained in the GCAM2ISO mapping
weight["ALA", , ] <- 0
weight["ATA", , ] <- 0
weight["BES", , ] <- 0
weight["BLM", , ] <- 0
weight["CUW", , ] <- 0
weight["GGY", , ] <- 0
weight["IMN", , ] <- 0
weight["JEY", , ] <- 0
weight["MAF", , ] <- 0
weight["PSE", , ] <- 0
weight["SSD", , ] <- 0
weight["SXM", , ] <- 0
return(list(
x = outputAll,
weight = weight,
unit = "% of cooling type technologies",
description = c(
"Cooling shares for different cooling technologies based on ",
"Davies et al. (2013) publication and using electricity use weights (aggregated ",
"based on IEA World Energy Balances, 2014) for regional mapping"
)
))
}