From a9a634d801e49a255c5b7dd0dc814d87e03eaa4b Mon Sep 17 00:00:00 2001 From: Falk Benke Date: Tue, 3 Sep 2024 11:10:10 +0200 Subject: [PATCH] remove ppc and pco from 'calcEmissionFactors' --- R/calcEmissionFactors.R | 316 ++++++++++-------- inst/extdata/regional/regionmappingGAINS.csv | 251 ++++++++++++++ .../mappingECLIPSEtoREMINDsectors.csv | 65 ++++ 3 files changed, 501 insertions(+), 131 deletions(-) create mode 100755 inst/extdata/regional/regionmappingGAINS.csv create mode 100755 inst/extdata/sectoral/mappingECLIPSEtoREMINDsectors.csv diff --git a/R/calcEmissionFactors.R b/R/calcEmissionFactors.R index e929b14c..eef2e434 100644 --- a/R/calcEmissionFactors.R +++ b/R/calcEmissionFactors.R @@ -3,7 +3,6 @@ #' @importFrom quitte as.quitte calcEmissionFactors <- function(subtype = "emission_factors", sectoral_resolution = "aggregated") { - if (!(subtype %in% c("emission_factors", "activities", "emissions"))) { stop('subtype must be in c("emission_factors", "activities", "emissions")') } @@ -20,15 +19,14 @@ calcEmissionFactors <- function(subtype = "emission_factors", sectoral_resolutio } allocate_min2r_ef <- function(id_ef, ip_region, ip_countryGroup, ip_year, ip_scenario) { - dummy <- id_ef[ip_region, ip_year, ip_scenario] # Get minimum values across country group tmp <- as.quitte(id_ef[ip_countryGroup, ip_year, ip_scenario]) %>% group_by(!!!syms(c("data1", "data2"))) %>% summarise(value = ifelse(all(.data$value == 0), 0, - min(.data$value[.data$value > 0], na.rm = TRUE)) - ) %>% # a value 0 is often a sign for a NA that has been replaced with 0 for small countries + min(.data$value[.data$value > 0], na.rm = TRUE) + )) %>% # a value 0 is often a sign for a NA that has been replaced with 0 for small countries ungroup() %>% as.data.frame() %>% as.quitte() %>% @@ -45,29 +43,41 @@ calcEmissionFactors <- function(subtype = "emission_factors", sectoral_resolutio conv_kt_per_PJ_to_Tg_per_TWa <- 1e-3 / (1e15 / (365 * 24 * 60 * 60) * 1e-12) # user-defined parameters - time <- c(seq(2005, 2055, 5), seq(2060, 2110, 10), 2130, 2150) - scenario <- c("SSP1", "SSP2", "SSP3", "SSP4", "SSP5", "FLE", "MFR", "CLE", "MFR_Transports", "GlobalEURO6", "FLE_building_transport", "SLCF_building_transport") # These are additional scenarios to the CLE and MFR + time <- c(seq(2005, 2055, 5), seq(2060, 2110, 10), 2130, 2150) - p_dagg_year <- 2005 - p_dagg_pop <- "pop_SSP2" - p_dagg_gdp <- "gdp_SSP2" + # These are additional scenarios to the CLE and MFR + scenario <- c( + "SSP1", "SSP2", "SSP3", "SSP4", "SSP5", "FLE", "MFR", "CLE", + "MFR_Transports", "GlobalEURO6", "FLE_building_transport", + "SLCF_building_transport" + ) p_countryCategories <- "useGAINSregions" # list of OECD countries # TODO: may want to place this in a mapping file or in a R library - r_oecd <- c("AUS", "AUT", "BEL", "CAN", "CHL", "CZE", "DNK", "EST", "FIN", "FRA", "DEU", "GRC", "HUN", "ISL", "IRL", "ISR", "ITA", - "JPN", "KOR", "LUX", "MEX", "NLD", "NZL", "NOR", "POL", "PRT", "SVK", "SVN", "ESP", "SWE", "CHE", "TUR", "GBR", "USA") - - # set of sectors for which no emission factor will be computed (because there is no activity reported, or not in terms of energy) - dimSector_skipEF <- c("AACID", "CEMENT", "CHEM", "CHEMBULK", "CUSM", "NACID", "PAPER", "STEEL", - "Losses_Coal", "Losses_Distribution_Use", "Losses_Vent_Flare", - "Transformations_Coal", "Transformations_HLF", "Transformations_HLF_Refinery", "Transformations_LLF", "Transformations_NatGas") - - dimSector_skipEF_edge <- c("End_Use_Industry_Bio_Trad", "End_Use_Industry_Coal", "End_Use_Industry_HLF", "End_Use_Industry_LLF", - "End_Use_Industry_NatGas", "End_Use_Residential_Bio_Mod", "End_Use_Residential_Bio_Trad", "End_Use_Residential_Coal", - "End_Use_Residential_HLF", "End_Use_Residential_LLF", "End_Use_Residential_NatGas", "End_Use_Services_Bio_Trad", - "End_Use_Services_Coal") + r_oecd <- c( + "AUS", "AUT", "BEL", "CAN", "CHL", "CZE", "DNK", "EST", "FIN", "FRA", "DEU", + "GRC", "HUN", "ISL", "IRL", "ISR", "ITA", "JPN", "KOR", "LUX", "MEX", "NLD", + "NZL", "NOR", "POL", "PRT", "SVK", "SVN", "ESP", "SWE", "CHE", "TUR", "GBR", "USA" + ) + + # set of sectors for which no emission factor will be computed + # (because there is no activity reported, or not in terms of energy) + dimSector_skipEF <- c( + "AACID", "CEMENT", "CHEM", "CHEMBULK", "CUSM", "NACID", "PAPER", "STEEL", + "Losses_Coal", "Losses_Distribution_Use", "Losses_Vent_Flare", + "Transformations_Coal", "Transformations_HLF", "Transformations_HLF_Refinery", + "Transformations_LLF", "Transformations_NatGas" + ) + + dimSector_skipEF_edge <- c( + "End_Use_Industry_Bio_Trad", "End_Use_Industry_Coal", "End_Use_Industry_HLF", + "End_Use_Industry_LLF", "End_Use_Industry_NatGas", "End_Use_Residential_Bio_Mod", + "End_Use_Residential_Bio_Trad", "End_Use_Residential_Coal", "End_Use_Residential_HLF", + "End_Use_Residential_LLF", "End_Use_Residential_NatGas", "End_Use_Services_Bio_Trad", + "End_Use_Services_Coal" + ) dimSector_skipEF_edge <- c("") #-- READ IN DATA ------------------ @@ -81,50 +91,50 @@ calcEmissionFactors <- function(subtype = "emission_factors", sectoral_resolutio emissions <- emissions[, c(2005, 2010, 2020, 2030, 2050), ] # read in sectoral mapping (ECLIPSE (IMAGE) <> REMIND) - map_sectors_ECLIPSE2REMIND <- read.csv(toolGetMapping(type = "sectoral", name = "mappingECLIPSEtoREMINDsectors.csv", - returnPathOnly = TRUE, where = "mappingfolder"), - stringsAsFactors = TRUE) + map_sectors_ECLIPSE2REMIND <- toolGetMapping( + type = "sectoral", name = "mappingECLIPSEtoREMINDsectors.csv", + where = "mrremind" + ) # read in regional map (select ISO and GAINS codes only). This is required for the construction of the SSPs - map_regions <- read.csv2(toolGetMapping(type = "regional", name = "regionmappingGAINS.csv", returnPathOnly = TRUE, - where = "mappingfolder"), - stringsAsFactors = TRUE)[, c(2, 3)] - map_regions <- map_regions %>% + map_regions <- read.csv2( + toolGetMapping(type = "regional", name = "regionmappingGAINS.csv", returnPathOnly = TRUE, where = "mrremind"), + stringsAsFactors = TRUE + )[, c(2, 3)] + + map_regions <- map_regions %>% filter(.data$CountryCode != "ANT") %>% # Remove Netherland Antilles (not in REMIND regional mapping) filter(.data$RegionCode != "") %>% - mutate(RegionCode = gsub("\\ \\+", "\\+", - gsub("^\\s+|\\s+$", "", - gsub("[0-9]", "", .data$RegionCode)))) %>% + mutate(RegionCode = gsub( + "\\ \\+", "\\+", + gsub( + "^\\s+|\\s+$", "", + gsub("[0-9]", "", .data$RegionCode) + ) + )) %>% mutate(CountryCode = factor(.data$CountryCode)) - # read in population and GDP data. required to compute gdp per cap - pop <- calcOutput("Population", aggregate = FALSE)[, p_dagg_year, p_dagg_pop] - gdp <- calcOutput("GDP", aggregate = FALSE)[, p_dagg_year, p_dagg_gdp] - + gdp_cap <- calcOutput("GDPpc", aggregate = FALSE)[, 2005, "gdppc_SSP2"] #-- PROCESS DATA ------------------ vcat(2, ">> Process data... \n") # set of sectors for which emission factors are computed dimSector_EF <- getNames(activities)[!getNames(activities) %in% c(dimSector_skipEF, dimSector_skipEF_edge)] - # calculate gdp per capita - gdp_cap <- gdp / pop - gdp_cap[is.na(gdp_cap)] <- 0 # set NA to 0 - # Regional selections # select one country pertaining to WEU (all WEU countries should have the same EF). Used for SSP scenario rules select_weu <- paste(map_regions[which(map_regions$RegionCode == "Western Europe")[1], 1]) # Retrieve Transport names transportNames <- getNames(activities)[grepl("End_Use_Transport", getNames(activities))] - - buildingNames <- getNames(activities)[grepl("End_Use_Industry|End_Use_Residential|End_Use_Services", getNames(activities))] + buildingNames <- getNames(activities)[grepl("End_Use_Industry|End_Use_Residential|End_Use_Services", getNames(activities))] # convert SO2 emission from TgSO2 to TgS emissions[, , "SO2"] <- emissions[, , "SO2"] * conv_ktSO2_to_ktS - # define missing SLE scenario (assumed to be 3/4 of the distance between CLE and MFR, according to discussion with Zig Klimont on 18th Feb 2016) + # define missing SLE scenario (assumed to be 3/4 of the distance between CLE and MFR, + # according to discussion with Zig Klimont on 18th Feb 2016) cle <- emissions[, , "CLE"] getNames(cle) <- gsub("CLE", "MFR", getNames(cle)) sle <- cle - (cle - emissions[, , "MFR"]) * 0.75 @@ -132,38 +142,43 @@ calcEmissionFactors <- function(subtype = "emission_factors", sectoral_resolutio emissions <- mbind(emissions, sle) rm(cle, sle) - # calculate emission factors (only for power and end-use sectors, and not empty activities) and convert from kt/PJ to Tg/Twa - ef_eclipse <- emissions[, , dimSector_EF] / + # calculate emission factors (only for power and end-use sectors, and not empty activities) + # and convert from kt/PJ to Tg/Twa + ef_eclipse <- emissions[, , dimSector_EF] / activities[, , dimSector_EF] * conv_kt_per_PJ_to_Tg_per_TWa - getSets(ef_eclipse) <- c("region", "year", "data1", "data2", "data3") + getSets(ef_eclipse) <- c("region", "year", "data1", "data2", "data3") - # some regions/countries have NA values everywhere. Allocate EF of the region to which they belong (except for Antartica) - # NAregions <- which(sapply(getRegions(which(is.na(ef_eclipse), arr.ind = TRUE)), function(k) all(is.na(as.numeric(ef_eclipse[k,,]))))) - NAregions <- c("AIA", "ATF", "BVT", "CCK", "COK", "CXR", "ESH", "FLK", "GIB", "GLP", "GUF", - "HMD", "IOT", "MSR", "MTQ", "MYT", "NFK", "NIU", "NRU", "PCN", - "REU", "SGS", "SHN", "SJM", "SPM", "TKL", "TWN", "UMI", "VAT", "VGB", "WLF") + # some regions/countries have NA values everywhere. Allocate EF of the region to which they belong (except for Antarctica) + NAregions <- c( + "AIA", "ATF", "BVT", "CCK", "COK", "CXR", "ESH", "FLK", "GIB", "GLP", "GUF", + "HMD", "IOT", "MSR", "MTQ", "MYT", "NFK", "NIU", "NRU", "PCN", + "REU", "SGS", "SHN", "SJM", "SPM", "TKL", "TWN", "UMI", "VAT", "VGB", "WLF" + ) MissingRegions <- c("ALA", "BES", "BLM", "CUW", "GGY", "IMN", "JEY", "MAF", "PSE", "SSD", "SXM") - AssociatedGAINSregions <- c("Western Europe", "Rest Central America", "Rest Central America", "Rest Central America", "Western Europe", "Western Europe", "Western Europe", - "Rest Central America", "Middle East", "Northern Africa", "Rest Central America") - ef_eclipse["ATA", , ] <- 0 # Antartica -> 0 + AssociatedGAINSregions <- c( + "Western Europe", "Rest Central America", "Rest Central America", "Rest Central America", + "Western Europe", "Western Europe", "Western Europe", + "Rest Central America", "Middle East", "Northern Africa", "Rest Central America" + ) + ef_eclipse["ATA", , ] <- 0 # Antartica -> 0 for (kregi in NAregions) { subsitute_region <- map_regions$CountryCode[map_regions$RegionCode == map_regions$RegionCode[map_regions$CountryCode == kregi] & !map_regions$CountryCode %in% c(NAregions, MissingRegions)][1] tmp <- ef_eclipse[subsitute_region, , ] - getRegions(tmp) <- kregi + getItems(tmp, dim = 1) <- kregi ef_eclipse[kregi, , ] <- tmp } # some regions have no population data when disaggregating. for (kregi in MissingRegions) { substitute_region <- map_regions$CountryCode[map_regions$RegionCode == AssociatedGAINSregions[which(MissingRegions == kregi)] & - !map_regions$CountryCode %in% MissingRegions][1] + !map_regions$CountryCode %in% MissingRegions][1] tmp <- ef_eclipse[substitute_region, , ] - getRegions(tmp) <- kregi + getItems(tmp, dim = 1) <- kregi ef_eclipse[kregi, , ] <- tmp } # for the remaining NAs just set EF to 0 (activity levels are 0) - ef_eclipse[is.na(ef_eclipse)] <- 0 + ef_eclipse[is.na(ef_eclipse)] <- 0 rm(NAregions, MissingRegions, AssociatedGAINSregions) # define exogenous emission data @@ -176,7 +191,7 @@ calcEmissionFactors <- function(subtype = "emission_factors", sectoral_resolutio scenario, function(s) { new.magpie( - getRegions(ef_eclipse), + getItems(ef_eclipse, dim = 1), c(2005, 2010, 2030, 2050, 2100), gsub("CLE", s, getNames(ef_eclipse[, , "CLE"])) ) @@ -192,7 +207,7 @@ calcEmissionFactors <- function(subtype = "emission_factors", sectoral_resolutio scenario, function(s) { new.magpie( - getRegions(emissions_exogenous), + getItems(emissions_exogenous, dim = 1), c(2005, 2010, 2030, 2050, 2100), gsub("CLE", s, getNames(emissions_exogenous[, , "CLE"])) ) @@ -203,13 +218,13 @@ calcEmissionFactors <- function(subtype = "emission_factors", sectoral_resolutio # define country categories if (p_countryCategories == "perCountry") { # low income countries (using World Bank definition < 2750 US$(2010)/Cap) - r_L <- dimnames(gdp_cap[getRegions(ef), , ])$ISO3[which(gdp_cap[getRegions(ef), , ] <= 2750)] + r_L <- dimnames(gdp_cap[getItems(ef, dim = 1), , ])$ISO3[which(gdp_cap[getItems(ef, dim = 1), , ] <= 2750)] # high and medium income countries - r_HM <- setdiff(getRegions(ef), r_L) + r_HM <- setdiff(getItems(ef, dim = 1), r_L) # High-Medium income countries with strong pollution policies in place - r_HMStrong <- c("AUS", "CAN", "USA", "JPN") # FIXME which definition??? + r_HMStrong <- c("AUS", "CAN", "USA", "JPN") # FIXME which definition??? # High-Medium income countries with lower emissions goals - r_HMRest <- setdiff(r_HM, r_HMStrong) + r_HMRest <- setdiff(r_HM, r_HMStrong) } else { # Compute mean GDP/Cap per GAINS region regionMean_gdppcap <- sapply(unique(map_regions$RegionCode), function(x) { @@ -217,88 +232,118 @@ calcEmissionFactors <- function(subtype = "emission_factors", sectoral_resolutio }) # low income countries (using World Bank definition < 2750 US$(2010)/Cap) - r_L <- levels(map_regions$CountryCode[map_regions$RegionCode %in% names(regionMean_gdppcap[regionMean_gdppcap <= 2750])]) + r_L <- levels(map_regions$CountryCode[map_regions$RegionCode %in% names(regionMean_gdppcap[regionMean_gdppcap <= 2750])]) # high and medium income countries - r_HM <- setdiff(getRegions(ef), r_L) + r_HM <- setdiff(getItems(ef, dim = 1), r_L) # High-Medium income countries with strong pollution policies in place - r_HMStrong <- map_regions$CountryCode[map_regions$RegionCode %in% c("Western Europe", "Japan")] # FIXME definition taken from JeS matlab script + r_HMStrong <- map_regions$CountryCode[map_regions$RegionCode %in% c("Western Europe", "Japan")] # FIXME definition taken from JeS matlab script # High-Medium income countries with lower emissions goals - r_HMRest <- setdiff(r_HM, r_HMStrong) + r_HMRest <- setdiff(r_HM, r_HMStrong) } # generate FLE and SSP scenarios # -------- Fix all scenarios to CLE in 2005 and 2010 ---------- - ef[, c(2005, 2010), ] <- ef_eclipse[, c(2005, 2010), "CLE"] + ef[, c(2005, 2010), ] <- ef_eclipse[, c(2005, 2010), "CLE"] emi[, c(2005, 2010), ] <- emissions_exogenous[, c(2005, 2010), "CLE"] # ---------------- FLE ---------------------------------------- # FLE: CLE 2010 emission factors and emissions are held constant - ef[, , "FLE"] <- setYears(ef[, 2010, "FLE"], NULL) # NULL is actually the default value, skipping afterwards + ef[, , "FLE"] <- setYears(ef[, 2010, "FLE"], NULL) # NULL is actually the default value, skipping afterwards emi[, , "FLE"] <- setYears(emi[, 2010, "FLE"], NULL) # ---------------- SSP1 --------------------------------------- # Emission factors # low income countries - ef[r_L, 2030, "SSP1"] <- ef_eclipse[r_L, 2030, "CLE"] # 2030: CLE30 - ef[r_L, 2050, "SSP1"] <- pmin(setYears(ef[r_L, 2030, "SSP1"]), - setYears(allocate_c2r_ef(ef_eclipse, r_L, select_weu, 2030, "CLE"))) # 2050: CLE30 WEU, if not higher than 2030 value - ef[r_L, 2100, "SSP1"] <- pmin(setYears(ef[r_L, 2050, "SSP1"]), setYears(ef_eclipse[r_L, 2030, "SLE"])) # 2100: SLE30, if not higher than 2050 value + ef[r_L, 2030, "SSP1"] <- ef_eclipse[r_L, 2030, "CLE"] # 2030: CLE30 + ef[r_L, 2050, "SSP1"] <- pmin( + setYears(ef[r_L, 2030, "SSP1"]), + setYears(allocate_c2r_ef(ef_eclipse, r_L, select_weu, 2030, "CLE")) + ) # 2050: CLE30 WEU, if not higher than 2030 value + + # 2100: SLE30, if not higher than 2050 value + ef[r_L, 2100, "SSP1"] <- pmin(setYears(ef[r_L, 2050, "SSP1"]), setYears(ef_eclipse[r_L, 2030, "SLE"])) # high income countries - ef[r_HM, 2030, "SSP1"] <- 0.75 * ef_eclipse[r_HM, 2030, "CLE"] # 2030: 75% of CLE30 - ef[r_HM, 2050, "SSP1"] <- pmin(setYears(ef[r_HM, 2030, "SSP1"]), setYears(ef_eclipse[r_HM, 2030, "SLE"])) # 2050: SLE30, if not higher than 2030 value - ef[r_HM, 2100, "SSP1"] <- pmin(setYears(ef[r_HM, 2050, "SSP1"]), setYears(ef_eclipse[r_HM, 2030, "MFR"])) # 2100: MFR, if not higher than 2050 value + ef[r_HM, 2030, "SSP1"] <- 0.75 * ef_eclipse[r_HM, 2030, "CLE"] # 2030: 75% of CLE30 + # 2050: SLE30, if not higher than 2030 value + ef[r_HM, 2050, "SSP1"] <- pmin(setYears(ef[r_HM, 2030, "SSP1"]), setYears(ef_eclipse[r_HM, 2030, "SLE"])) + # 2100: MFR, if not higher than 2050 value + ef[r_HM, 2100, "SSP1"] <- pmin(setYears(ef[r_HM, 2050, "SSP1"]), setYears(ef_eclipse[r_HM, 2030, "MFR"])) # Emissions # low income countries - emi[r_L, 2030, "SSP1"] <- emissions_exogenous[r_L, 2030, "CLE"] # 2030: CLE30 - emi[r_L, 2050, "SSP1"] <- pmin(setYears(emi[r_L, 2030, "SSP1"]), setYears(0.5 * emissions_exogenous[r_L, 2030, "CLE"] - + 0.5 * emissions_exogenous[r_L, 2030, "SLE"])) # 2050: CLE30 WEU, if not higher than 2030 value - emi[r_L, 2100, "SSP1"] <- pmin(setYears(emi[r_L, 2050, "SSP1"]), setYears(emissions_exogenous[r_L, 2030, "SLE"])) # 2100: SLE30, if not higher than 2050 value + emi[r_L, 2030, "SSP1"] <- emissions_exogenous[r_L, 2030, "CLE"] # 2030: CLE30 + emi[r_L, 2050, "SSP1"] <- pmin(setYears(emi[r_L, 2030, "SSP1"]), setYears(0.5 * emissions_exogenous[r_L, 2030, "CLE"] + + 0.5 * emissions_exogenous[r_L, 2030, "SLE"])) # 2050: CLE30 WEU, if not higher than 2030 value + emi[r_L, 2100, "SSP1"] <- pmin(setYears(emi[r_L, 2050, "SSP1"]), setYears(emissions_exogenous[r_L, 2030, "SLE"])) # 2100: SLE30, if not higher than 2050 value # high income countries - emi[r_HM, 2030, "SSP1"] <- 0.75 * emissions_exogenous[r_HM, 2030, "CLE"] # 2030: 75% of CLE30 - emi[r_HM, 2050, "SSP1"] <- pmin(setYears(emi[r_HM, 2030, "SSP1"]), setYears(emissions_exogenous[r_HM, 2030, "SLE"])) # 2050: SLE30, if not higher than 2030 value - emi[r_HM, 2100, "SSP1"] <- pmin(setYears(emi[r_HM, 2050, "SSP1"]), setYears(emissions_exogenous[r_HM, 2030, "MFR"])) # 2100: MFR, if not higher than 2050 value + emi[r_HM, 2030, "SSP1"] <- 0.75 * emissions_exogenous[r_HM, 2030, "CLE"] # 2030: 75% of CLE30 + emi[r_HM, 2050, "SSP1"] <- pmin(setYears(emi[r_HM, 2030, "SSP1"]), setYears(emissions_exogenous[r_HM, 2030, "SLE"])) # 2050: SLE30, if not higher than 2030 value + emi[r_HM, 2100, "SSP1"] <- pmin(setYears(emi[r_HM, 2050, "SSP1"]), setYears(emissions_exogenous[r_HM, 2030, "MFR"])) # 2100: MFR, if not higher than 2050 value # ----------------- SSP2 -------------------------------------- # Emission factors # High-Medium income countries with strong pollution policies in place - ef[r_HMStrong, 2030, "SSP2"] <- ef_eclipse[r_HMStrong, 2030, "CLE"] # 2030: CLE30 - ef[r_HMStrong, 2050, "SSP2"] <- pmin(setYears(ef[r_HMStrong, 2030, "SSP2"]), - setYears(ef_eclipse[r_HMStrong, 2030, "SLE"])) # 2050: SLE30 - ef[r_HMStrong, 2100, "SSP2"] <- pmin(setYears(ef[r_HMStrong, 2050, "SSP2"]), - setYears(allocate_min2r_ef(ef_eclipse, r_HMStrong, r_oecd, 2030, "SLE"))) # 2100: Lowest SLE30 or lower + ef[r_HMStrong, 2030, "SSP2"] <- ef_eclipse[r_HMStrong, 2030, "CLE"] # 2030: CLE30 + ef[r_HMStrong, 2050, "SSP2"] <- pmin( + setYears(ef[r_HMStrong, 2030, "SSP2"]), + setYears(ef_eclipse[r_HMStrong, 2030, "SLE"]) + ) # 2050: SLE30 + ef[r_HMStrong, 2100, "SSP2"] <- pmin( + setYears(ef[r_HMStrong, 2050, "SSP2"]), + setYears(allocate_min2r_ef(ef_eclipse, r_HMStrong, r_oecd, 2030, "SLE")) + ) # 2100: Lowest SLE30 or lower # High-Medium income countries with lower emissions goals - ef[r_HMRest, 2030, "SSP2"] <- ef_eclipse[r_HMRest, 2030, "CLE"] # 2030: CLE30 - ef[r_HMRest, 2050, "SSP2"] <- pmin(setYears(ef[r_HMRest, 2030, "SSP2"]), - setYears(allocate_min2r_ef(ef_eclipse, r_HMRest, r_HMRest, 2030, "CLE"))) # 2050: Min CLE30 - ef[r_HMRest, 2100, "SSP2"] <- pmin(setYears(ef[r_HMRest, 2050, "SSP2"]), - setYears(allocate_c2r_ef(ef_eclipse, r_HMRest, select_weu, 2030, "SLE"))) # 2100: SLE30 WEU + ef[r_HMRest, 2030, "SSP2"] <- ef_eclipse[r_HMRest, 2030, "CLE"] # 2030: CLE30 + ef[r_HMRest, 2050, "SSP2"] <- pmin( + setYears(ef[r_HMRest, 2030, "SSP2"]), + setYears(allocate_min2r_ef(ef_eclipse, r_HMRest, r_HMRest, 2030, "CLE")) + ) # 2050: Min CLE30 + ef[r_HMRest, 2100, "SSP2"] <- pmin( + setYears(ef[r_HMRest, 2050, "SSP2"]), + setYears(allocate_c2r_ef(ef_eclipse, r_HMRest, select_weu, 2030, "SLE")) + ) # 2100: SLE30 WEU # low income countries - ef[r_L, 2030, "SSP2"] <- setYears(ef_eclipse[r_L, 2020, "CLE"]) # 2030: CLE20 - ef[r_L, 2050, "SSP2"] <- pmin(setYears(ef[r_L, 2030, "SSP2"]), - setYears(allocate_min2r_ef(ef_eclipse, r_L, r_L, 2030, "CLE"))) # 2050: Min CLE30 - ef[r_L, 2100, "SSP2"] <- pmin(setYears(ef[r_L, 2050, "SSP2"]), - setYears(allocate_c2r_ef(ef_eclipse, r_L, select_weu, 2030, "CLE"))) # 2100: CLE30 WEU + ef[r_L, 2030, "SSP2"] <- setYears(ef_eclipse[r_L, 2020, "CLE"]) # 2030: CLE20 + ef[r_L, 2050, "SSP2"] <- pmin( + setYears(ef[r_L, 2030, "SSP2"]), + setYears(allocate_min2r_ef(ef_eclipse, r_L, r_L, 2030, "CLE")) + ) # 2050: Min CLE30 + ef[r_L, 2100, "SSP2"] <- pmin( + setYears(ef[r_L, 2050, "SSP2"]), + setYears(allocate_c2r_ef(ef_eclipse, r_L, select_weu, 2030, "CLE")) + ) # 2100: CLE30 WEU # Emissions # High-Medium income countries with strong pollution policies in place - emi[r_HMStrong, 2030, "SSP2"] <- emissions_exogenous[r_HMStrong, 2030, "CLE"] # 2030: CLE30 - emi[r_HMStrong, 2050, "SSP2"] <- pmin(setYears(emi[r_HMStrong, 2030, "SSP2"]), - setYears(emissions_exogenous[r_HMStrong, 2030, "SLE"])) # 2050: SLE30 - emi[r_HMStrong, 2100, "SSP2"] <- pmin(setYears(emi[r_HMStrong, 2050, "SSP2"]), - setYears(emissions_exogenous[r_HMStrong, 2030, "SLE"] * 0.8)) # 2100: Lowest SLE30 or lower -> 0.8*SLE30 + emi[r_HMStrong, 2030, "SSP2"] <- emissions_exogenous[r_HMStrong, 2030, "CLE"] # 2030: CLE30 + emi[r_HMStrong, 2050, "SSP2"] <- pmin( + setYears(emi[r_HMStrong, 2030, "SSP2"]), + setYears(emissions_exogenous[r_HMStrong, 2030, "SLE"]) + ) # 2050: SLE30 + emi[r_HMStrong, 2100, "SSP2"] <- pmin( + setYears(emi[r_HMStrong, 2050, "SSP2"]), + setYears(emissions_exogenous[r_HMStrong, 2030, "SLE"] * 0.8) + ) # 2100: Lowest SLE30 or lower -> 0.8*SLE30 # High-Medium income countries with lower emissions goals - emi[r_HMRest, 2030, "SSP2"] <- emissions_exogenous[r_HMRest, 2030, "CLE"] # 2030: CLE30 - emi[r_HMRest, 2050, "SSP2"] <- pmin(setYears(emi[r_HMRest, 2030, "SSP2"]), - setYears(emissions_exogenous[r_HMRest, 2030, "SLE"])) # 2050: Min CLE30 -> SLE30 - emi[r_HMRest, 2100, "SSP2"] <- pmin(setYears(emi[r_HMRest, 2050, "SSP2"]), - setYears(emissions_exogenous[r_HMRest, 2030, "SLE"] * 0.8)) # 2100: SLE30 WEU -> 0.8*SLE30 + emi[r_HMRest, 2030, "SSP2"] <- emissions_exogenous[r_HMRest, 2030, "CLE"] # 2030: CLE30 + emi[r_HMRest, 2050, "SSP2"] <- pmin( + setYears(emi[r_HMRest, 2030, "SSP2"]), + setYears(emissions_exogenous[r_HMRest, 2030, "SLE"]) + ) # 2050: Min CLE30 -> SLE30 + emi[r_HMRest, 2100, "SSP2"] <- pmin( + setYears(emi[r_HMRest, 2050, "SSP2"]), + setYears(emissions_exogenous[r_HMRest, 2030, "SLE"] * 0.8) + ) # 2100: SLE30 WEU -> 0.8*SLE30 # low income countries - emi[r_L, 2030, "SSP2"] <- setYears(emissions_exogenous[r_L, 2020, "CLE"]) # 2030: CLE20 - emi[r_L, 2050, "SSP2"] <- pmin(setYears(emi[r_L, 2030, "SSP2"]), - setYears(emissions_exogenous[r_L, 2030, "CLE"])) # 2050: Min CLE30 -> CLE30 - emi[r_L, 2100, "SSP2"] <- pmin(setYears(emi[r_L, 2050, "SSP2"]), - setYears(emissions_exogenous[r_L, 2030, "SLE"] * 0.95)) # 2100: CLE30 WEU -> 0.95*SLE30 + emi[r_L, 2030, "SSP2"] <- setYears(emissions_exogenous[r_L, 2020, "CLE"]) # 2030: CLE20 + emi[r_L, 2050, "SSP2"] <- pmin( + setYears(emi[r_L, 2030, "SSP2"]), + setYears(emissions_exogenous[r_L, 2030, "CLE"]) + ) # 2050: Min CLE30 -> CLE30 + emi[r_L, 2100, "SSP2"] <- pmin( + setYears(emi[r_L, 2050, "SSP2"]), + setYears(emissions_exogenous[r_L, 2030, "SLE"] * 0.95) + ) # 2100: CLE30 WEU -> 0.95*SLE30 # H-M-Strong: 2030 CLE30; 2050 SLE30; 2100 Lowest SLE30 or lower [EUR, JPN] = [3 5] # H-M-Rest: 2030 CLE30; 2050 Min CLE30; 2100 EUR SLE30 [CHN, LAM, MEA, ROW, RUS, USA] = [2 6 7 9 10 11] @@ -312,7 +357,7 @@ calcEmissionFactors <- function(subtype = "emission_factors", sectoral_resolutio # ----------------- SSP5 -------------------------------------- # set SSP5 to the values of SSP1 - ef[, , "SSP5"] <- ef[, , "SSP1"] + ef[, , "SSP5"] <- ef[, , "SSP1"] emi[, , "SSP5"] <- emi[, , "SSP1"] # does not really make sense... # filter all regions and sectors that are constant between 2030 and 2050 and continue to decline afterwards. Replace by linear interpolation @@ -320,10 +365,10 @@ calcEmissionFactors <- function(subtype = "emission_factors", sectoral_resolutio # ----------------- CLE and MFR ------------------------------- ef[, c(2005, 2010, 2030, 2050), c("CLE", "MFR")] <- ef_eclipse[, c(2005, 2010, 2030, 2050), c("CLE", "MFR")] - ef[, 2100, c("CLE", "MFR")] <- setYears(ef_eclipse[, 2050, c("CLE", "MFR")]) # for 2100, take the same values as in 2050 + ef[, 2100, c("CLE", "MFR")] <- setYears(ef_eclipse[, 2050, c("CLE", "MFR")]) # for 2100, take the same values as in 2050 emi[, c(2005, 2010, 2030, 2050), c("CLE", "MFR")] <- emissions_exogenous[, c(2005, 2010, 2030, 2050), c("CLE", "MFR")] - emi[, 2100, c("CLE", "MFR")] <- setYears(emissions_exogenous[, 2050, c("CLE", "MFR")]) # for 2100, take the same values as in 2050 + emi[, 2100, c("CLE", "MFR")] <- setYears(emissions_exogenous[, 2050, c("CLE", "MFR")]) # for 2100, take the same values as in 2050 # ---------------- Global EURO6 for Transports ----------------------------- ef[, c(2030, 2050, 2100), "GlobalEURO6"] <- ef[, c(2030, 2050, 2100), "SSP2"] @@ -339,14 +384,14 @@ calcEmissionFactors <- function(subtype = "emission_factors", sectoral_resolutio # ---------------- FLE_building_transport ------------------------------ ef[, c(2030, 2050, 2100), "FLE_building_transport"] <- ef[, c(2030, 2050, 2100), "SSP2"] - mselect(ef, year = c("y2030", "y2050", "y2100"), data1 = buildingNames, data3 = "FLE_building_transport") <- mselect(ef, year = c("y2030", "y2050", "y2100"), data1 = buildingNames, data3 = "FLE") + mselect(ef, year = c("y2030", "y2050", "y2100"), data1 = buildingNames, data3 = "FLE_building_transport") <- mselect(ef, year = c("y2030", "y2050", "y2100"), data1 = buildingNames, data3 = "FLE") mselect(ef, year = c("y2030", "y2050", "y2100"), data1 = transportNames, data3 = "FLE_building_transport") <- mselect(ef, year = c("y2030", "y2050", "y2100"), data1 = transportNames, data3 = "FLE") emi[, c(2030, 2050, 2100), "FLE_building_transport"] <- emi[, c(2030, 2050, 2100), "SSP2"] # ---------------- SLCF_building_transport ------------------------------ ef[, c(2030, 2050, 2100), "SLCF_building_transport"] <- ef[, c(2030, 2050, 2100), "SSP2"] - mselect(ef, year = c("y2030", "y2050", "y2100"), data1 = buildingNames, data2 = c("BC", "OC"), data3 = "SLCF_building_transport") <- mselect(ef, year = c("y2030", "y2050", "y2100"), data1 = buildingNames, data2 = c("BC", "OC"), data3 = "FLE") + mselect(ef, year = c("y2030", "y2050", "y2100"), data1 = buildingNames, data2 = c("BC", "OC"), data3 = "SLCF_building_transport") <- mselect(ef, year = c("y2030", "y2050", "y2100"), data1 = buildingNames, data2 = c("BC", "OC"), data3 = "FLE") mselect(ef, year = c("y2030", "y2050", "y2100"), data1 = transportNames, data2 = c("BC", "OC"), data3 = "SLCF_building_transport") <- mselect(ef, year = c("y2030", "y2050", "y2100"), data1 = transportNames, data2 = c("BC", "OC"), data3 = "FLE") emi[, c(2030, 2050, 2100), "SLCF_building_transport"] <- emi[, c(2030, 2050, 2100), "SSP2"] @@ -355,8 +400,11 @@ calcEmissionFactors <- function(subtype = "emission_factors", sectoral_resolutio emiNam <- getNames(ef, TRUE)[2:3] newdim <- apply( sapply( - do.call("expand.grid", emiNam), as.character), - 1, paste, collapse = ".") + do.call("expand.grid", emiNam), as.character + ), + 1, paste, + collapse = "." + ) activities.EF <- do.call( "mbind", @@ -375,10 +423,13 @@ calcEmissionFactors <- function(subtype = "emission_factors", sectoral_resolutio mapsec <- map_sectors_ECLIPSE2REMIND[map_sectors_ECLIPSE2REMIND$eclipse %in% getNames(ef, dim = 1), c(1, 3)] ef <- toolAggregate(ef, mapsec, dim = 3.1) - adv_techs <- c("igcc", "igccc", "pcc", "pco", "coalgas", "bioigcc", "bioigccc", "biogas") - adv_coaltechs <- c("igcc", "igccc", "pcc", "pco") - adv_specs <- c("NOx", "SO2", "BC", "OC") - adv_factor <- c(0.85, 0.6, 0.6, 0.6) + # remove no longer used technologies pcc and pco + ef <- ef[, , c("pcc", "pco"), invert = TRUE] + + adv_techs <- c("igcc", "igccc", "coalgas", "bioigcc", "bioigccc", "biogas") + adv_coaltechs <- c("igcc", "igccc") + adv_specs <- c("NOx", "SO2", "BC", "OC") + adv_factor <- c(0.85, 0.6, 0.6, 0.6) for (kscen in getNames(ef, dim = 6)) { for (ktech in adv_techs) { @@ -404,7 +455,7 @@ calcEmissionFactors <- function(subtype = "emission_factors", sectoral_resolutio # interpolate data (EFs and activities) over time. Remove y2000 from activities (this is the first time item hence -1) vcat(2, " > Interpolate data over time... \n") - ef <- time_interpolate(ef, interpolated_year = time, integrate_interpolated_years = TRUE, extrapolation_type = "constant") + ef <- time_interpolate(ef, interpolated_year = time, integrate_interpolated_years = TRUE, extrapolation_type = "constant") emi <- time_interpolate(emi, interpolated_year = time, integrate_interpolated_years = TRUE, extrapolation_type = "constant") if (subtype == "emissions") { @@ -415,11 +466,14 @@ calcEmissionFactors <- function(subtype = "emission_factors", sectoral_resolutio w <- setYears(activities.EF[, 2010, dimSector_EF]) mapsec <- map_sectors_ECLIPSE2REMIND[map_sectors_ECLIPSE2REMIND$eclipse %in% getNames(w, dim = 1), c(1, 3)] w <- toolAggregate(w, mapsec, dim = 3.1) - } else (stop("do not know which weight to use for acrivities")) + } else { + stop("do not know which weight to use for activities") + } - return(list(x = x, - weight = w, - unit = "unit", - description = "calcECLIPSE substitute" - )) + return(list( + x = x, + weight = w, + unit = "unit", + description = "calcECLIPSE substitute" + )) } diff --git a/inst/extdata/regional/regionmappingGAINS.csv b/inst/extdata/regional/regionmappingGAINS.csv new file mode 100755 index 00000000..86437351 --- /dev/null +++ b/inst/extdata/regional/regionmappingGAINS.csv @@ -0,0 +1,251 @@ +CountryName;CountryCode;RegionCode;RegionName;;;; +Aruba ;ABW;4 Rest Central America;Rest Central America;;Aruba;ABW;LAM +Afghanistan ;AFG;25 Rest South Asia;Rest South Asia;;Afghanistan;AFG;OAS +Angola;AGO;8 Western Africa;Western Africa;Added manually by JH;Angola;AGO;AFR +Anguilla ;AIA;4 Rest Central America;Rest Central America;;Anguilla;AIA;LAM +Aland Islands;ALA;11 Western Europe;Western Europe;Added manually by JH;Aland Islands;ALA;EUR +Albania ;ALB;12 Central Europe;Central Europe;;Albania;ALB;ROW +Andorra ;AND;11 Western Europe;Western Europe;;Andorra;AND;ROW +Netherlands Antilles ;ANT;4 Rest Central America;Rest Central America;Removed afterwards in R scripts;;; +United Arab Emirates ;ARE;17 Middle East;Middle East;;United Arab Emirates;ARE;MEA +Argentina;ARG;6 Rest South America;Rest South America;;Argentina;ARG;LAM +Armenia ;ARM;16 Russia +;Russia +;;Armenia;ARM;MEA +American Samoa ;ASM;24 Oceania;Oceania;;American Samoa;ASM;OAS +Antarctica;ATA;;;Set to 0 afterwards in R scripts;Antarctica;ATA;ROW +French Southern Territories ;ATF;24 Oceania;Oceania;;French Southern Territories;ATF;OAS +Antigua and Barbuda ;ATG;4 Rest Central America;Rest Central America;;Antigua and Barbuda;ATG;LAM +Australia ;AUS;24 Oceania;Oceania;;Australia;AUS;ROW +Austria ;AUT;11 Western Europe;Western Europe;;Austria;AUT;EUR +Azerbaijan;AZE;16 Russia +;Russia +;;Azerbaijan;AZE;MEA +Burundi ;BDI;8 Western Africa;Eastern Africa;;Burundi;BDI;AFR +Belgium ;BEL;11 Western Europe;Western Europe;;Belgium;BEL;EUR +Benin ;BEN;8 Western Africa;Western Africa;;Benin;BEN;AFR +Bonaire Sint Eustatius and Saba;BES;4 Rest Central America;Rest Central America;Added manually by JH;Bonaire Sint Eustatius and Saba;BES;LAM +Burkina Faso ;BFA;8 Western Africa;Western Africa;;Burkina Faso;BFA;AFR +Bangladesh;BGD;25 Rest South Asia;Rest South Asia;;Bangladesh;BGD;OAS +Bulgaria ;BGR;12 Central Europe;Central Europe;;Bulgaria;BGR;EUR +Bahrain ;BHR;17 Middle East;Middle East;;Bahrain;BHR;MEA +Bahamas ;BHS;4 Rest Central America;Rest Central America;;Bahamas;BHS;LAM +Bosnia and Herzegovina ;BIH;12 Central Europe;Central Europe;;Bosnia and Herzegovina;BIH;ROW +Saint Barthelemy;BLM;4 Rest Central America;Rest Central America;Added manually by JH;Saint Barthelemy;BLM;LAM +Belarus ;BLR;14 Ukraine +;Ukraine +;;Belarus;BLR;ROW +Belize ;BLZ;4 Rest Central America;Rest Central America;;Belize;BLZ;LAM +Bermuda ;BMU;4 Rest Central America;Rest Central America;;Bermuda;BMU;LAM +Bolivia;BOL;6 Rest South America;Rest South America;;Bolivia Plurinational State of;BOL;LAM +Brazil ;BRA;5 Brazil;Brazil;;Brazil;BRA;LAM +Barbados ;BRB;4 Rest Central America;Rest Central America;;Barbados;BRB;LAM +Brunei Darussalam ;BRN;21 Southeastern Asia;Southeastern Asia;;Brunei Darussalam;BRN;OAS +Bhutan ;BTN;25 Rest South Asia;Rest South Asia;;Bhutan;BTN;OAS +Bouvet Island;BVT;6 Rest South America;Rest South America;;Bouvet Island;BVT;ROW +Botswana ;BWA;8 Western Africa;Rest Southern Africa;;Botswana;BWA;AFR +Central African Republic ;CAF;8 Western Africa;Western Africa;;Central African Republic;CAF;AFR +Canada ;CAN;1 Canada;Canada;;Canada;CAN;ROW +Cocos (Keeling) Islands ;CCK;24 Oceania;Oceania;;Cocos (Keeling) Islands;CCK;OAS +Switzerland;CHE;11 Western Europe;Western Europe;;Switzerland;CHE;ROW +Chile ;CHL;6 Rest South America;Rest South America;;Chile;CHL;LAM +China;CHN;20 China +;China +;;China;CHN;CHN +Côte d'Ivoire ;CIV;8 Western Africa;Western Africa;;Cote d Ivoire;CIV;AFR +Cameroon ;CMR;8 Western Africa;Western Africa;;Cameroon;CMR;AFR +Congo, the Democratic Republic of the;COD;8 Western Africa;Western Africa;;Congo the Democratic Republic of the;COD;AFR +Congo ;COG;8 Western Africa;Western Africa;;Congo;COG;AFR +Cook Islands ;COK;24 Oceania;Oceania;;Cook Islands;COK;OAS +Colombia ;COL;6 Rest South America;Rest South America;;Colombia;COL;LAM +Comoros ;COM;8 Western Africa;Eastern Africa;;Comoros;COM;AFR +Cape Verde ;CPV;8 Western Africa;Western Africa;;Cape Verde;CPV;AFR +Costa Rica ;CRI;4 Rest Central America;Rest Central America;;Costa Rica;CRI;LAM +Cuba ;CUB;4 Rest Central America;Rest Central America;;Cuba;CUB;LAM +Curacao;CUW;4 Rest Central America;Rest Central America;Added manually by JH;Curacao;CUW;LAM +Christmas Island ;CXR;24 Oceania;Oceania;;Christmas Island;CXR;OAS +Cayman Islands ;CYM;4 Rest Central America;Rest Central America;;Cayman Islands;CYM;LAM +Cyprus ;CYP;12 Central Europe;Central Europe;;Cyprus;CYP;EUR +Czech Republic ;CZE;12 Central Europe;Central Europe;;Czech Republic;CZE;EUR +Germany ;DEU;11 Western Europe;Western Europe;;Germany;DEU;EUR +Djibouti ;DJI;8 Western Africa;Eastern Africa;;Djibouti;DJI;AFR +Dominica ;DMA;4 Rest Central America;Rest Central America;;Dominica;DMA;LAM +Denmark ;DNK;11 Western Europe;Western Europe;;Denmark;DNK;EUR +Dominican Republic ;DOM;4 Rest Central America;Rest Central America;;Dominican Republic;DOM;LAM +Algeria ;DZA;7 Northern Africa;Northern Africa;;Algeria;DZA;MEA +Ecuador ;ECU;6 Rest South America;Rest South America;;Ecuador;ECU;LAM +Egypt ;EGY;7 Northern Africa;Northern Africa;;Egypt;EGY;MEA +Eritrea ;ERI;8 Western Africa;Eastern Africa;;Eritrea;ERI;AFR +Western Sahara ;ESH;7 Northern Africa;Northern Africa;;Western Sahara;ESH;MEA +Spain ;ESP;11 Western Europe;Western Europe;;Spain;ESP;EUR +Estonia ;EST;12 Central Europe;Central Europe;;Estonia;EST;EUR +Ethiopia;ETH;8 Western Africa;Eastern Africa;;Ethiopia;ETH;AFR +Finland ;FIN;11 Western Europe;Western Europe;;Finland;FIN;EUR +Fiji ;FJI;24 Oceania;Oceania;;Fiji;FJI;OAS +Falklands Islands (Malvinas);FLK;6 Rest South America;Rest South America;;Falkland Islands (Malvinas);FLK;LAM +France;FRA;11 Western Europe;Western Europe;;France;FRA;EUR +Faroe Islands;FRO;11 Western Europe;Western Europe;;Faroe Islands;FRO;EUR +Micronesia, Federated States of;FSM;24 Oceania;Oceania;;Micronesia Federated States of;FSM;OAS +Gabon;GAB;8 Western Africa;Western Africa;;Gabon;GAB;AFR +United Kingdom;GBR;11 Western Europe;Western Europe;;United Kingdom;GBR;EUR +Georgia ;GEO;16 Russia +;Russia +;;Georgia;GEO;MEA +Guernsey;GGY;11 Western Europe;Western Europe;Added manually by JH;Guernsey;GGY;ROW +Ghana ;GHA;8 Western Africa;Western Africa;;Ghana;GHA;AFR +Gibraltar ;GIB;11 Western Europe;Western Europe;;Gibraltar;GIB;EUR +Guinea ;GIN;8 Western Africa;Western Africa;;Guinea;GIN;AFR +Guadeloupe ;GLP;4 Rest Central America;Rest Central America;;Guadeloupe;GLP;LAM +Gambia ;GMB;8 Western Africa;Western Africa;;Gambia;GMB;AFR +Guinea-Bissau ;GNB;8 Western Africa;Western Africa;;Guinea-Bissau;GNB;AFR +Equatorial Guinea ;GNQ;8 Western Africa;Western Africa;;Equatorial Guinea;GNQ;AFR +Greece;GRC;11 Western Europe;Western Europe;;Greece;GRC;EUR +Grenada ;GRD;4 Rest Central America;Rest Central America;;Grenada;GRD;LAM +Greenland;GRL;11 Western Europe;Western Europe;Added manually by JH;Greenland;GRL;EUR +Guatemala ;GTM;4 Rest Central America;Rest Central America;;Guatemala;GTM;LAM +French Guiana ;GUF;4 Rest Central America;Rest South America;;French Guiana;GUF;LAM +Guam ;GUM;24 Oceania;Oceania;;Guam;GUM;OAS +Guyana ;GUY;4 Rest Central America;Rest South America;;Guyana;GUY;LAM +Hong Kong ;HKG;20 China +;China +;;Hong Kong;HKG;CHN +Heard Island and McDonald Islands ;HMD;24 Oceania;Oceania;;Heard Island and McDonald Islands;HMD;ROW +Honduras ;HND;4 Rest Central America;Rest Central America;;Honduras;HND;LAM +Croatia ;HRV;12 Central Europe;Central Europe;;Croatia;HRV;ROW +Haiti ;HTI;4 Rest Central America;Rest Central America;;Haiti;HTI;LAM +Hungary ;HUN;12 Central Europe;Central Europe;;Hungary;HUN;EUR +Indonesia ;IDN;22 Indonesia +;Indonesia +;;Indonesia;IDN;OAS +Isle of Man;IMN;11 Western Europe;Western Europe;Added manually by JH;Isle of Man;IMN;EUR +India ;IND;18 India ;India ;;India;IND;IND +British Indian Ocean Territory;IOT;25 Rest South Asia;Rest South Asia;;British Indian Ocean Territory;IOT;OAS +Ireland ;IRL;11 Western Europe;Western Europe;;Ireland;IRL;EUR +Iran, Islamic Republic of;IRN;17 Middle East;Middle East;;Iran Islamic Republic of;IRN;MEA +Iraq ;IRQ;17 Middle East;Middle East;;Iraq;IRQ;MEA +Iceland ;ISL;11 Western Europe;Western Europe;;Iceland;ISL;ROW +Israel ;ISR;17 Middle East;Middle East;;Israel;ISR;MEA +Italy;ITA;11 Western Europe;Western Europe;;Italy;ITA;EUR +Jamaica ;JAM;4 Rest Central America;Rest Central America;;Jamaica;JAM;LAM +Jersey;JEY;11 Western Europe;Western Europe;Added manually by JH;Jersey;JEY;EUR +Jordan ;JOR;17 Middle East;Middle East;;Jordan;JOR;MEA +Japan ;JPN;23 Japan;Japan;;Japan;JPN;JPN +Kazakstan ;KAZ;15 Asia-Stan;Asia-Stan;;Kazakhstan;KAZ;MEA +Kenya ;KEN;8 Western Africa;Eastern Africa;;Kenya;KEN;AFR +Kyrgyzstan;KGZ;15 Asia-Stan;Asia-Stan;;Kyrgyzstan;KGZ;MEA +Cambodia ;KHM;21 Southeastern Asia;Southeastern Asia;;Cambodia;KHM;OAS +Kiribati ;KIR;24 Oceania;Oceania;;Kiribati;KIR;OAS +Saint Kitts and Nevis ;KNA;4 Rest Central America;Rest Central America;;Saint Kitts and Nevis;KNA;LAM +Korea, Republic of;KOR;19 Korea;Korea;;Korea Republic of;KOR;OAS +Kuwait ;KWT;17 Middle East;Middle East;;Kuwait;KWT;MEA +Lao People's Democratic Republic;LAO;21 Southeastern Asia;Southeastern Asia;;Lao People's Democratic Republic;LAO;OAS +Lebanon;LBN;17 Middle East;Middle East;;Lebanon;LBN;MEA +Liberia ;LBR;8 Western Africa;Western Africa;;Liberia;LBR;AFR +Libyan Arab Jamahiriya;LBY;7 Northern Africa;Northern Africa;;Libya;LBY;MEA +Saint Lucia ;LCA;4 Rest Central America;Rest Central America;;Saint Lucia;LCA;LAM +Liechtenstein ;LIE;11 Western Europe;Western Europe;;Liechtenstein;LIE;ROW +Sri Lanka ;LKA;25 Rest South Asia;Rest South Asia;;Sri Lanka;LKA;OAS +Lesotho ;LSO;8 Western Africa;Rest Southern Africa;;Lesotho;LSO;AFR +Lithuania ;LTU;12 Central Europe;Central Europe;;Lithuania;LTU;EUR +Luxembourg ;LUX;11 Western Europe;Western Europe;;Luxembourg;LUX;EUR +Latvia ;LVA;12 Central Europe;Central Europe;;Latvia;LVA;EUR +Macau ;MAC;20 China +;China +;;Macao;MAC;CHN +Saint Martin (French part);MAF;4 Rest Central America;Rest Central America;Added manually by JH;Saint Martin (French part);MAF;ROW +Morocco ;MAR;7 Northern Africa;Northern Africa;;Morocco;MAR;MEA +Monaco ;MCO;11 Western Europe;Western Europe;;Monaco;MCO;ROW +Moldova, Republic of;MDA;14 Ukraine +;Ukraine +;;Moldova Republic of;MDA;ROW +Madagascar ;MDG;8 Western Africa;Eastern Africa;;Madagascar;MDG;AFR +Maldives ;MDV;25 Rest South Asia;Rest South Asia;;Maldives;MDV;OAS +Mexico;MEX;3 Mexico;Mexico;;Mexico;MEX;LAM +Marshall Islands ;MHL;24 Oceania;Oceania;;Marshall Islands;MHL;OAS +Macedonia, the former Yugoslav Republic of;MKD;12 Central Europe;Central Europe;;Macedonia the former Yugoslav Republic of;MKD;ROW +Mali ;MLI;8 Western Africa;Western Africa;;Mali;MLI;AFR +Malta ;MLT;12 Central Europe;Central Europe;;Malta;MLT;EUR +Myanmar ;MMR;21 Southeastern Asia;Southeastern Asia;;Myanmar;MMR;OAS +Yugoslavia ;MNE;12 Central Europe;Central Europe;;Montenegro;MNE;ROW +Mongolia ;MNG;20 China +;China +;;Mongolia;MNG;OAS +Northern Mariana Islands ;MNP;24 Oceania;Oceania;;Northern Mariana Islands;MNP;OAS +Mozambique ;MOZ;8 Western Africa;Rest Southern Africa;;Mozambique;MOZ;AFR +Mauritania ;MRT;8 Western Africa;Western Africa;;Mauritania;MRT;AFR +Montserrat ;MSR;4 Rest Central America;Rest Central America;;Montserrat;MSR;LAM +Martinique ;MTQ;4 Rest Central America;Rest Central America;;Martinique;MTQ;LAM +Mauritius ;MUS;8 Western Africa;Eastern Africa;;Mauritius;MUS;AFR +Malawi ;MWI;8 Western Africa;Rest Southern Africa;;Malawi;MWI;AFR +Malaysia ;MYS;21 Southeastern Asia;Southeastern Asia;;Malaysia;MYS;OAS +Mayotte ;MYT;8 Western Africa;Eastern Africa;;Mayotte;MYT;AFR +Namibia ;NAM;8 Western Africa;Rest Southern Africa;;Namibia;NAM;AFR +New Caledonia ;NCL;24 Oceania;Oceania;;New Caledonia;NCL;OAS +Niger ;NER;8 Western Africa;Western Africa;;Niger;NER;AFR +Norfolk Island ;NFK;24 Oceania;Oceania;;Norfolk Island;NFK;OAS +Nigeria ;NGA;8 Western Africa;Western Africa;;Nigeria;NGA;AFR +Nicaragua ;NIC;4 Rest Central America;Rest Central America;;Nicaragua;NIC;LAM +Niue ;NIU;24 Oceania;Oceania;;Niue;NIU;OAS +Netherlands ;NLD;11 Western Europe;Western Europe;;Netherlands;NLD;EUR +Norway ;NOR;11 Western Europe;Western Europe;;Norway;NOR;ROW +Nepal ;NPL;25 Rest South Asia;Rest South Asia;;Nepal;NPL;OAS +Nauru ;NRU;24 Oceania;Oceania;;Nauru;NRU;ROW +New Zealand ;NZL;24 Oceania;Oceania;;New Zealand;NZL;ROW +Oman ;OMN;17 Middle East;Middle East;;Oman;OMN;MEA +Pakistan ;PAK;25 Rest South Asia;Rest South Asia;;Pakistan;PAK;OAS +Panama ;PAN;4 Rest Central America;Rest Central America;;Panama;PAN;LAM +Pitcairn ;PCN;24 Oceania;Oceania;;Pitcairn;PCN;OAS +Peru ;PER;6 Rest South America;Rest South America;;Peru;PER;LAM +Philippines ;PHL;21 Southeastern Asia;Southeastern Asia;;Philippines;PHL;OAS +Palau ;PLW;24 Oceania;Oceania;;Palau;PLW;OAS +Papua New Guinea ;PNG;22 Indonesia +;Indonesia +;;Papua New Guinea;PNG;OAS +Poland ;POL;12 Central Europe;Central Europe;;Poland;POL;EUR +Puerto Rico ;PRI;4 Rest Central America;Rest Central America;;Puerto Rico;PRI;LAM +Korea, Democratic People's Republic of;PRK;19 Korea;Korea;;Korea Democratic People's Republic of;PRK;OAS +Portugal;PRT;11 Western Europe;Western Europe;;Portugal;PRT;EUR +Paraguay ;PRY;6 Rest South America;Rest South America;;Paraguay;PRY;LAM +Palestine, State of;PSE;17 Middle East;Middle East;Added manually by JH;Palestine State of;PSE;MEA +French Polynesia;PYF;24 Oceania;Oceania;;French Polynesia;PYF;OAS +Qatar ;QAT;17 Middle East;Middle East;;Qatar;QAT;MEA +Réunion ;REU;8 Western Africa;Eastern Africa;;Reunion;REU;AFR +Romania ;ROU;12 Central Europe;Central Europe;;Romania;ROU;EUR +Russian Federation ;RUS;16 Russia +;Russia +;;Russian Federation;RUS;RUS +Rwanda;RWA;8 Western Africa;Eastern Africa;;Rwanda;RWA;AFR +Saudi Arabia ;SAU;17 Middle East;Middle East;;Saudi Arabia;SAU;MEA +Sudan ;SDN;7 Northern Africa;Eastern Africa;;Sudan;SDN;AFR +Senegal ;SEN;8 Western Africa;Western Africa;;Senegal;SEN;AFR +Singapore ;SGP;21 Southeastern Asia;Southeastern Asia;;Singapore;SGP;OAS +South Georgia and the South Sandwich Islands;SGS;6 Rest South America;Rest South America;;South Georgia and the South Sandwich Islands;SGS;ROW +Saint Helena ;SHN;8 Western Africa;Western Africa;;Saint Helena Ascension and Tristan da Cunha;SHN;AFR +Svalbard and Jan Mayen ;SJM;11 Western Europe;Western Europe;;Svalbard and Jan Mayen;SJM;ROW +Solomon Islands ;SLB;24 Oceania;Oceania;;Solomon Islands;SLB;OAS +Sierra Leone ;SLE;8 Western Africa;Western Africa;;Sierra Leone;SLE;AFR +El Salvador ;SLV;4 Rest Central America;Rest Central America;;El Salvador;SLV;LAM +San Marino ;SMR;11 Western Europe;Western Europe;;San Marino;SMR;ROW +Somalia;SOM;8 Western Africa;Eastern Africa;;Somalia;SOM;AFR +Saint Pierre and Miquelon ;SPM;2 USA;USA;;Saint Pierre and Miquelon;SPM;ROW +Yugoslavia ;SRB;12 Central Europe;Central Europe;;Serbia;SRB;ROW +South Sudan;SSD;8 Western Africa;Western Africa;Added manually by JH;South Sudan;SSD;AFR +Sao Tome and Principe ;STP;8 Western Africa;Western Africa;;Sao Tome and Principe;STP;AFR +Suriname ;SUR;4 Rest Central America;Rest Central America;;Suriname;SUR;LAM +Slovakia;SVK;12 Central Europe;Central Europe;;Slovakia;SVK;EUR +Slovenia ;SVN;12 Central Europe;Central Europe;;Slovenia;SVN;EUR +Sweden ;SWE;11 Western Europe;Western Europe;;Sweden;SWE;EUR +Swaziland ;SWZ;8 Western Africa;Rest Southern Africa;;Swaziland;SWZ;AFR +Sint Maarten (Dutch part);SXM;4 Rest Central America;Rest Central America;Added manually by JH;Sint Maarten (Dutch part);SXM;LAM +Seychelles ;SYC;8 Western Africa;Eastern Africa;;Seychelles;SYC;AFR +Syrian Arab Republic;SYR;17 Middle East;Middle East;;Syrian Arab Republic;SYR;MEA +Turks and Caicos Islands ;TCA;4 Rest Central America;Rest Central America;;Turks and Caicos Islands;TCA;LAM +Chad ;TCD;8 Western Africa;Western Africa;;Chad;TCD;AFR +Togo;TGO;8 Western Africa;Western Africa;;Togo;TGO;AFR +Thailand ;THA;21 Southeastern Asia;Southeastern Asia;;Thailand;THA;OAS +Tajikistan ;TJK;15 Asia-Stan;Asia-Stan;;Tajikistan;TJK;MEA +Tokelau ;TKL;24 Oceania;Oceania;;Tokelau;TKL;OAS +Turkmenistan ;TKM;15 Asia-Stan;Asia-Stan;;Turkmenistan;TKM;MEA +East Timor;TLS;22 Indonesia +;Indonesia +;;Timor-Leste;TLS;OAS +Tonga ;TON;24 Oceania;Oceania;;Tonga;TON;OAS +Trinidad and Tobago ;TTO;4 Rest Central America;Rest Central America;;Trinidad and Tobago;TTO;LAM +Tunisia ;TUN;7 Northern Africa;Northern Africa;;Tunisia;TUN;MEA +Turkey ;TUR;13 Turkey;Turkey;;Turkey;TUR;ROW +Tuvalu ;TUV;24 Oceania;Oceania;;Tuvalu;TUV;OAS +Taiwan, Province of China ;TWN;20 China +;China +;;Taiwan Province of China;TWN;OAS +Tanzania, United Republic of;TZA;8 Western Africa;Rest Southern Africa;;Tanzania United Republic of;TZA;AFR +Uganda ;UGA;8 Western Africa;Eastern Africa;;Uganda;UGA;AFR +Ukraine ;UKR;14 Ukraine +;Ukraine +;;Ukraine;UKR;ROW +United States Minor Outlying Islands ;UMI;2 USA;USA;;United States Minor Outlying Islands;UMI;OAS +Uruguay ;URY;6 Rest South America;Rest South America;;Uruguay;URY;LAM +United States;USA;2 USA;USA;;United States;USA;USA +Uzbekistan ;UZB;15 Asia-Stan;Asia-Stan;;Uzbekistan;UZB;MEA +Holy See (Vatican City State);VAT;11 Western Europe;Western Europe;;Holy See (Vatican City State);VAT;ROW +Saint Vincent and the Grenadines;VCT;4 Rest Central America;Rest Central America;;Saint Vincent and the Grenadines;VCT;LAM +Venezuela ;VEN;6 Rest South America;Rest South America;;Venezuela Bolivarian Republic of;VEN;LAM +Virgin Islands, British ;VGB;4 Rest Central America;Rest Central America;;Virgin Islands British;VGB;LAM +Virgin Islands, U.S.;VIR;4 Rest Central America;Rest Central America;;Virgin Islands U.S.;VIR;LAM +Viet Nam ;VNM;21 Southeastern Asia;Southeastern Asia;;Viet Nam;VNM;OAS +Vanuatu ;VUT;24 Oceania;Oceania;;Vanuatu;VUT;OAS +Wallis and Futuna;WLF;24 Oceania;Oceania;;Wallis and Futuna;WLF;OAS +Samoa ;WSM;24 Oceania;Oceania;;Samoa;WSM;OAS +Yemen ;YEM;17 Middle East;Middle East;;Yemen;YEM;MEA +South Africa ;ZAF;10 South Africa;South Africa;;South Africa;ZAF;ROW +Zambia ;ZMB;8 Western Africa;Rest Southern Africa;;Zambia;ZMB;AFR +Zimbabwe ;ZWE;8 Western Africa;Rest Southern Africa;;Zimbabwe;ZWE;AFR diff --git a/inst/extdata/sectoral/mappingECLIPSEtoREMINDsectors.csv b/inst/extdata/sectoral/mappingECLIPSEtoREMINDsectors.csv new file mode 100755 index 00000000..f9da1287 --- /dev/null +++ b/inst/extdata/sectoral/mappingECLIPSEtoREMINDsectors.csv @@ -0,0 +1,65 @@ +"eclipse";"agg";"remind" +"AACID";"indprocess";"indprocess" +"CEMENT";"indprocess";"indprocess" +"CHEM";"solvents";"solvents" +"CHEMBULK";"indprocess";"indprocess" +"CUSM";"indprocess";"indprocess" +"End_Use_Industry_Bio_Trad";"bioind";"pebiolc.sesobio.biotr.indst" +"End_Use_Industry_Coal";"coalind";"pecoal.sesofos.coaltr.indst" +"End_Use_Industry_HLF";"fehosind";"peoil.seliqfos.refliq.indst" +"End_Use_Industry_LLF";"fehosind";"peoil.seliqfos.refliq.indst" +"End_Use_Industry_NatGas";"gasind";"pegas.segafos.gastr.indst" +"End_Use_Others_Bio_Mod";"biotrmod";"pebiolc.sesobio.biotrmod.indst" +"End_Use_Others_Bio_Trad";"bioind";"pebiolc.sesobio.biotr.indst" +"End_Use_Others_Coal";"coalind";"pecoal.sesofos.coaltr.indst" +"End_Use_Others_HLF";"fehosind";"peoil.seliqfos.refliq.indst" +"End_Use_Others_LLF";"fehosind";"peoil.seliqfos.refliq.indst" +"End_Use_Others_NatGas";"gasind";"pegas.segafos.gastr.indst" +"End_Use_Residential_Bio_Mod";"biotrmod";"pebiolc.sesobio.biotrmod.res" +"End_Use_Residential_Bio_Trad";"biores";"pebiolc.sesobio.biotr.res" +"End_Use_Residential_Coal";"coalres";"pecoal.sesofos.coaltr.res" +"End_Use_Residential_HLF";"fehosres";"peoil.seliqfos.refliq.res" +"End_Use_Residential_LLF";"fehosres";"peoil.seliqfos.refliq.res" +"End_Use_Residential_NatGas";"gasres";"pegas.segafos.gastr.res" +"End_Use_Services_Bio_Mod";"biotrmod";"pebiolc.sesobio.biotrmod.indst" +"End_Use_Services_Bio_Trad";"bioind";"pebiolc.sesobio.biotr.indst" +"End_Use_Services_Coal";"coalind";"pecoal.sesofos.coaltr.indst" +"End_Use_Services_HLF";"fehosind";"peoil.seliqfos.refliq.indst" +"End_Use_Services_LLF";"fehosind";"peoil.seliqfos.refliq.indst" +"End_Use_Services_NatGas";"gasind";"pegas.segafos.gastr.indst" +"End_Use_Transport_Air_Domestic";"fedie";"peoil.seliqfos.refliq.trans" +"End_Use_Transport_Air_LTO";"fedie";"peoil.seliqfos.refliq.trans" +"End_Use_Transport_Coal";"coalind";"pecoal.sesofos.coaltr.indst" +"End_Use_Transport_HLF";"fedie";"peoil.seliqfos.refliq.trans" +"End_Use_Transport_LLF";"fepet";"peoil.seliqfos.refliq.trans" +"End_Use_Transport_NatGas";"gasind";"pegas.segafos.gastr.indst" +"Losses_Coal";"extraction";"extraction" +"Losses_Distribution_Use";"extraction";"extraction" +"Losses_Vent_Flare";"extraction";"extraction" +"NACID";"indprocess";"indprocess" +"PAPER";"indprocess";"indprocess" +"Power_Gen_Bio_Trad";"bio_el";"pebiolc.seel.biochp.power" +"Power_Gen_Bio_Trad";"bio_el";"pebiolc.sehe.biohp.power" +"Power_Gen_Bio_Trad";"bio_el_adv";"pebiolc.seel.bioigcc.power" +"Power_Gen_Bio_Trad";"bio_el_adv";"pebiolc.seel.bioigccc.power" +"Power_Gen_Bio_Trad";"bio_el_adv";"pebiolc.segabio.biogas.power" +"Power_Gen_Coal";"coal_el";"pecoal.seel.pc.power" +"Power_Gen_Coal";"coal_el";"pecoal.seel.coalchp.power" +"Power_Gen_Coal";"coal_el";"pecoal.sehe.coalhp.power" +"Power_Gen_Coal";"coal_el_adv";"pecoal.seel.igcc.power" +"Power_Gen_Coal";"coal_el_adv";"pecoal.seel.igccc.power" +"Power_Gen_Coal";"coal_el_adv";"pecoal.seel.pcc.power" +"Power_Gen_Coal";"coal_el_adv";"pecoal.seel.pco.power" +"Power_Gen_Coal";"coal_el_adv";"pecoal.segafos.coalgas.power" +"Power_Gen_HLF";"dot";"peoil.seel.dot.power" +"Power_Gen_LLF";"dot";"peoil.seel.dot.power" +"Power_Gen_NatGas";"gas_el";"pegas.seel.ngcc.power" +"Power_Gen_NatGas";"gas_el";"pegas.seel.ngt.power" +"Power_Gen_NatGas";"gas_el";"pegas.seel.gaschp.power" +"Power_Gen_NatGas";"gas_el";"pegas.sehe.gashp.power" +"STEEL";"indprocess";"indprocess" +"Transformations_Coal";"extraction";"extraction" +"Transformations_HLF";"extraction";"extraction" +"Transformations_HLF_Refinery";"extraction";"extraction" +"Transformations_LLF";"extraction";"extraction" +"Transformations_NatGas";"extraction";"extraction"