From deae9d87623f3f25e57a8efe2de0df9c674f35aa Mon Sep 17 00:00:00 2001 From: "Patel, Pralit L" Date: Sat, 10 Jul 2021 01:18:02 -0700 Subject: [PATCH] Pull request #207: Jgf/feature/dac Merge in JGCRI/gcam-core from jgf/feature/dac to master Squashed commit of the following: commit 4da38a4ab0ef700ba7f5345fc800c0907254cc02 Author: Pralit Patel Date: Fri Jul 9 13:56:50 2021 -0400 Drop GCAM-USA DAC changes as they will come in under it's own PR commit 963dcef1ccdbcd6747aeda036efc07eabafe5ea3 Author: Pralit Patel Date: Fri Jul 9 13:43:10 2021 -0400 Manually revert transportation changes commit 5e4dffa93d22b1dbc6d7b9c647dcfc052bfec8be Author: Pralit Patel Date: Fri Jul 9 13:34:29 2021 -0400 Revert configuration / batch files to ensure DAC is not enabled by default commit 9d9ffb3d6f519a8a0353a2f4e1092d3e303d4b47 Merge: 20f61b9ae 86a6d1aa6 Author: Pralit Patel Date: Fri Jul 9 13:33:30 2021 -0400 Merge remote-tracking branch 'origin/master' into Jgf/feature/dac commit 20f61b9ae80f4b97313b3938b86d7f1b58827782 Author: fuhr472 Date: Wed Jul 7 12:36:01 2021 -0400 correct filepath issue in ssp5 dac read-in commit bd87976b745f9be82e2c0524bc5316e3b65f6897 Author: fuhr472 Date: Wed Jul 7 10:43:51 2021 -0400 Temporarily add back dac read-in to config files for validation commit 3ddd25bcdcc3a38f4fec1dacd47b7de1789d0b81 Author: Patel Date: Tue Jul 6 16:32:47 2021 -0400 Change numbering scheme for dac from `999` to `62` commit 705e2908e2012b849d63a1f9d046b3df9e5284f7 Author: fuhr472 Date: Tue Jul 6 14:35:33 2021 -0400 Adjust calibration to linearly scale based on each region's cumulative geologic carbon storage supply. commit cd7e6cf14f9d64d14d1ba459211c6de328418ecf Author: jayfuhrman Date: Wed Jun 30 11:53:25 2021 -0400 Remove DAC read-in from config files to keep DAC as an optional add-on commit 61e52eab5029577134c6b444e5a1f38e6c88319d Author: jayfuhrman Date: Tue Jun 29 12:12:10 2021 -0400 Change "ces" sector name to "CO2 removal" (cdr) commit eec60bea604c14a39fc6d957134e3a57156b2d83 Author: jayfuhrman Date: Tue Jun 29 11:17:35 2021 -0400 Revise config files to comment out DAC read-in such that it is optional rather than available by default commit 04e24c712d81a753c76b536a8c05b954b4761fa0 Author: fuhr472 Date: Thu Jun 24 11:28:45 2021 -0400 Merge branch 'jgf/feature/dac-usa' into jgf/feature/dac commit ccb752cfee909bac9d042a8ff80a3334620b129a Author: fuhr472 Date: Wed Jun 23 10:33:56 2021 -0400 Remove commented out code commit 6ca1c70a292f31226bcea9cbc23f34f832fd5a98 Merge: ddbc0d962 da8b9e64d Author: fuhr472 Date: Tue Jun 22 17:25:28 2021 -0400 Merge branch 'jgf/feature/dac-usa' into jgf/feature/dac commit da8b9e64d05a762662095c25b4133ee9bfc9caa6 Author: fuhr472 Date: Tue Jun 22 17:16:47 2021 -0400 update configuration_usa.xml to include dac commit 749297078877941120e22d2c38fed74d88a9a4dc Author: fuhr472 Date: Tue Jun 22 17:13:36 2021 -0400 Correct airCO2 to come from market USA to ensure it has a defined carbon coefficient (from Ccoef). commit 1487a02e057332d95051c4f0aec16b79ae46ad10 Author: fuhr472 Date: Thu Jun 17 13:02:53 2021 -0400 correct state-level market for airCO2 commit a808f5ad735d47009e8d1dc86b8e02ec1e5df990 Author: fuhr472 Date: Wed Jun 16 10:06:29 2021 -0400 correct merge issue commit ddbc0d96271e4638c113d6cadba130c6b3fbbf1f Author: Matthew Binsted Date: Sat May 15 14:48:54 2021 -0400 Correcting merge issue with A_PrimaryFuelCCoef.csv. commit 44205a382878c9d5d6d14814c8d376a8cda40ad4 Author: fuhr472 Date: Fri May 14 14:23:00 2021 -0400 update configuration_policy.xml to include DAC input file. ... and 21 more commits --- input/gcamdata/R/zchunk_L262.dac.R | 554 ++++++++++++++++++ input/gcamdata/R/zchunk_L270.limits.R | 31 +- input/gcamdata/R/zchunk_LA162.dac.R | 62 ++ input/gcamdata/R/zchunk_batch_dac_xml.R | 125 ++++ .../inst/extdata/emissions/A_CDRU.csv | 8 + .../extdata/emissions/A_PrimaryFuelCCoef.csv | 4 +- .../inst/extdata/energy/A62.calibration.csv | 38 ++ .../inst/extdata/energy/A62.demand.csv | 8 + .../energy/A62.globaltech_co2capture.csv | 10 + .../energy/A62.globaltech_coef_ssp1.csv | 21 + .../energy/A62.globaltech_coef_ssp2.csv | 21 + .../energy/A62.globaltech_coef_ssp3.csv | 21 + .../energy/A62.globaltech_coef_ssp4.csv | 21 + .../energy/A62.globaltech_coef_ssp5.csv | 21 + .../energy/A62.globaltech_cost_ssp1.csv | 11 + .../energy/A62.globaltech_cost_ssp2.csv | 11 + .../energy/A62.globaltech_cost_ssp3.csv | 11 + .../energy/A62.globaltech_cost_ssp4.csv | 11 + .../energy/A62.globaltech_cost_ssp5.csv | 11 + .../energy/A62.globaltech_retirement.csv | 15 + .../energy/A62.globaltech_shrwt_ssp1.csv | 12 + .../energy/A62.globaltech_shrwt_ssp2.csv | 12 + .../energy/A62.globaltech_shrwt_ssp3.csv | 12 + .../energy/A62.globaltech_shrwt_ssp4.csv | 12 + .../energy/A62.globaltech_shrwt_ssp5.csv | 12 + .../inst/extdata/energy/A62.sector.csv | 9 + .../extdata/energy/A62.subsector_interp.csv | 8 + .../extdata/energy/A62.subsector_logit.csv | 9 + .../extdata/energy/A62.subsector_shrwt.csv | 9 + .../extdata/energy/calibrated_techs_cdr.csv | 9 + 30 files changed, 1117 insertions(+), 2 deletions(-) create mode 100644 input/gcamdata/R/zchunk_L262.dac.R create mode 100644 input/gcamdata/R/zchunk_LA162.dac.R create mode 100644 input/gcamdata/R/zchunk_batch_dac_xml.R create mode 100644 input/gcamdata/inst/extdata/emissions/A_CDRU.csv create mode 100644 input/gcamdata/inst/extdata/energy/A62.calibration.csv create mode 100644 input/gcamdata/inst/extdata/energy/A62.demand.csv create mode 100644 input/gcamdata/inst/extdata/energy/A62.globaltech_co2capture.csv create mode 100644 input/gcamdata/inst/extdata/energy/A62.globaltech_coef_ssp1.csv create mode 100644 input/gcamdata/inst/extdata/energy/A62.globaltech_coef_ssp2.csv create mode 100644 input/gcamdata/inst/extdata/energy/A62.globaltech_coef_ssp3.csv create mode 100644 input/gcamdata/inst/extdata/energy/A62.globaltech_coef_ssp4.csv create mode 100644 input/gcamdata/inst/extdata/energy/A62.globaltech_coef_ssp5.csv create mode 100644 input/gcamdata/inst/extdata/energy/A62.globaltech_cost_ssp1.csv create mode 100644 input/gcamdata/inst/extdata/energy/A62.globaltech_cost_ssp2.csv create mode 100644 input/gcamdata/inst/extdata/energy/A62.globaltech_cost_ssp3.csv create mode 100644 input/gcamdata/inst/extdata/energy/A62.globaltech_cost_ssp4.csv create mode 100644 input/gcamdata/inst/extdata/energy/A62.globaltech_cost_ssp5.csv create mode 100644 input/gcamdata/inst/extdata/energy/A62.globaltech_retirement.csv create mode 100644 input/gcamdata/inst/extdata/energy/A62.globaltech_shrwt_ssp1.csv create mode 100644 input/gcamdata/inst/extdata/energy/A62.globaltech_shrwt_ssp2.csv create mode 100644 input/gcamdata/inst/extdata/energy/A62.globaltech_shrwt_ssp3.csv create mode 100644 input/gcamdata/inst/extdata/energy/A62.globaltech_shrwt_ssp4.csv create mode 100644 input/gcamdata/inst/extdata/energy/A62.globaltech_shrwt_ssp5.csv create mode 100644 input/gcamdata/inst/extdata/energy/A62.sector.csv create mode 100644 input/gcamdata/inst/extdata/energy/A62.subsector_interp.csv create mode 100644 input/gcamdata/inst/extdata/energy/A62.subsector_logit.csv create mode 100644 input/gcamdata/inst/extdata/energy/A62.subsector_shrwt.csv create mode 100644 input/gcamdata/inst/extdata/energy/calibrated_techs_cdr.csv diff --git a/input/gcamdata/R/zchunk_L262.dac.R b/input/gcamdata/R/zchunk_L262.dac.R new file mode 100644 index 0000000000..72a74d1ffa --- /dev/null +++ b/input/gcamdata/R/zchunk_L262.dac.R @@ -0,0 +1,554 @@ +# Copyright 2019 Battelle Memorial Institute; see the LICENSE file. + +#' module_energy_L262.dac +#' +#' Compute a variety of final energy keyword, sector, share weight, and technology information for dac-related GCAM inputs. +#' +#' @param command API command to execute +#' @param ... other optional parameters, depending on command +#' @return Depends on \code{command}: either a vector of required inputs, +#' a vector of output names, or (if \code{command} is "MAKE") all +#' the generated outputs: \code{L262.SectorLogitTables[[ curr_table ]]$data}, \code{L262.Supplysector_dac}, \code{L262.FinalEnergyKeyword_dac}, +#' \code{L262.SubsectorLogitTables[[ curr_table ]]$data}, \code{L262.SubsectorLogit_dac}, \code{L262.SubsectorShrwtFllt_dac}, +#' \code{L262.SubsectorInterp_dac}, \code{L262.StubTech_dac}, \code{L262.GlobalTechShrwt_dac}, \code{L262.GlobalTechCoef_dac}, +#' \code{L262.GlobalTechCost_dac}, \code{L262.GlobalTechCapture_dac}, \code{L262.StubTechProd_dac}, \code{L262.StubTechCalInput_dac_heat}, +#' \code{L262.StubTechCoef_dac}, \code{L262.PerCapitaBased_dac}, \code{L262.BaseService_dac}, \code{L262.PriceElasticity_dac}, \code{object}. +#' The corresponding file in the original data system was \code{L262.dac.R} (energy level2). +#' @details The chunk provides final energy keyword, supplysector/subsector information, supplysector/subsector interpolation information, global technology share weight, global technology efficiency, global technology coefficients, global technology cost, price elasticity, stub technology information, stub technology interpolation information, stub technology calibrated inputs, and etc for dac sector. +#' @importFrom assertthat assert_that +#' @importFrom dplyr arrange bind_rows distinct filter if_else group_by lag left_join mutate pull select +#' @importFrom tidyr complete nesting +#' @author JF March 2021 +module_energy_L262.dac <- function(command, ...) { + + TECH_PARAMETRIZATION_OUTPUTS <- paste0("ssp", 1:5) + + if(command == driver.DECLARE_INPUTS) { + return(c(FILE = "common/GCAM_region_names", + FILE = "energy/calibrated_techs_cdr", + + FILE = "energy/A62.sector", + FILE = "energy/A62.subsector_interp", + FILE = "energy/A62.subsector_logit", + FILE = "energy/A62.subsector_shrwt", + + FILE = "energy/A62.globaltech_coef_ssp1", + FILE = "energy/A62.globaltech_coef_ssp2", + FILE = "energy/A62.globaltech_coef_ssp3", + FILE = "energy/A62.globaltech_coef_ssp4", + FILE = "energy/A62.globaltech_coef_ssp5", + + FILE = "energy/A62.globaltech_cost_ssp1", + FILE = "energy/A62.globaltech_cost_ssp2", + FILE = "energy/A62.globaltech_cost_ssp3", + FILE = "energy/A62.globaltech_cost_ssp4", + FILE = "energy/A62.globaltech_cost_ssp5", + + FILE = "energy/A62.globaltech_shrwt_ssp1", + FILE = "energy/A62.globaltech_shrwt_ssp2", + FILE = "energy/A62.globaltech_shrwt_ssp3", + FILE = "energy/A62.globaltech_shrwt_ssp4", + FILE = "energy/A62.globaltech_shrwt_ssp5", + + + FILE = "energy/A62.globaltech_co2capture", + FILE = "energy/A62.demand", + FILE = "energy/A62.globaltech_retirement", + "L162.out_Mt_R_dac_Yh")) + } else if(command == driver.DECLARE_OUTPUTS) { + return(c("L262.Supplysector_dac", + "L262.FinalEnergyKeyword_dac", + "L262.SubsectorLogit_dac", + "L262.SubsectorShrwtFllt_dac", + "L262.SubsectorInterp_dac", + + "L262.GlobalTechCost_dac", + + "L262.GlobalTechCost_dac_ssp1", + "L262.GlobalTechCost_dac_ssp2", + "L262.GlobalTechCost_dac_ssp3", + "L262.GlobalTechCost_dac_ssp4", + "L262.GlobalTechCost_dac_ssp5", + + "L262.StubTech_dac", + "L262.GlobalTechShrwt_dac", + + "L262.GlobalTechShrwt_dac_ssp1", + "L262.GlobalTechShrwt_dac_ssp2", + "L262.GlobalTechShrwt_dac_ssp3", + "L262.GlobalTechShrwt_dac_ssp4", + "L262.GlobalTechShrwt_dac_ssp5", + + + 'L262.GlobalTechCoef_dac', + + "L262.GlobalTechCoef_dac_ssp1", + "L262.GlobalTechCoef_dac_ssp2", + "L262.GlobalTechCoef_dac_ssp3", + "L262.GlobalTechCoef_dac_ssp4", + "L262.GlobalTechCoef_dac_ssp5", + + "L262.GlobalTechCapture_dac", + "L262.PerCapitaBased_dac", + "L262.PriceElasticity_dac", + "L262.StubTechProd_dac", + "L262.BaseService_dac", + "L262.GlobalTechSCurve_dac", + "L262.GlobalTechProfitShutdown_dac")) + } else if(command == driver.MAKE) { + + all_data <- list(...)[[1]] + + # Load required inputs + GCAM_region_names <- get_data(all_data, "common/GCAM_region_names") + calibrated_techs <- get_data(all_data, "energy/calibrated_techs_cdr") + A62.sector <- get_data(all_data, "energy/A62.sector", strip_attributes = TRUE) + A62.subsector_interp <- get_data(all_data, "energy/A62.subsector_interp", strip_attributes = TRUE) + A62.subsector_logit <- get_data(all_data, "energy/A62.subsector_logit", strip_attributes = TRUE) + A62.subsector_shrwt <- get_data(all_data, "energy/A62.subsector_shrwt", strip_attributes = TRUE) + A62.globaltech_co2capture <- get_data(all_data, "energy/A62.globaltech_co2capture") + A62.demand <- get_data(all_data, "energy/A62.demand", strip_attributes = TRUE) + A62.globaltech_retirement <- get_data(all_data, "energy/A62.globaltech_retirement", strip_attributes = TRUE) + L162.out_Mt_R_dac_Yh <- get_data(all_data, "L162.out_Mt_R_dac_Yh", strip_attributes = TRUE) + + + + #load ssp parametrizations + A62.globaltech_coef_ssp1 <- get_data(all_data, "energy/A62.globaltech_coef_ssp1")%>% gather_years %>% mutate(scenario=paste0("ssp1")) + A62.globaltech_coef_ssp2 <- get_data(all_data, "energy/A62.globaltech_coef_ssp2")%>% gather_years %>% mutate(scenario=paste0("ssp2")) + A62.globaltech_coef_ssp3 <- get_data(all_data, "energy/A62.globaltech_coef_ssp3")%>% gather_years %>% mutate(scenario=paste0("ssp3")) + A62.globaltech_coef_ssp4 <- get_data(all_data, "energy/A62.globaltech_coef_ssp4")%>% gather_years %>% mutate(scenario=paste0("ssp4")) + A62.globaltech_coef_ssp5 <- get_data(all_data, "energy/A62.globaltech_coef_ssp5")%>% gather_years %>% mutate(scenario=paste0("ssp5")) + + A62.globaltech_cost_ssp1 <- get_data(all_data, "energy/A62.globaltech_cost_ssp1")%>% gather_years %>% mutate(scenario=paste0("ssp1")) + A62.globaltech_cost_ssp2 <- get_data(all_data, "energy/A62.globaltech_cost_ssp2")%>% gather_years %>% mutate(scenario=paste0("ssp2")) + A62.globaltech_cost_ssp3 <- get_data(all_data, "energy/A62.globaltech_cost_ssp3")%>% gather_years %>% mutate(scenario=paste0("ssp3")) + A62.globaltech_cost_ssp4 <- get_data(all_data, "energy/A62.globaltech_cost_ssp4")%>% gather_years %>% mutate(scenario=paste0("ssp4")) + A62.globaltech_cost_ssp5 <- get_data(all_data, "energy/A62.globaltech_cost_ssp5")%>% gather_years %>% mutate(scenario=paste0("ssp5")) + + A62.globaltech_shrwt_ssp1 <- get_data(all_data, "energy/A62.globaltech_shrwt_ssp1")%>% gather_years %>% mutate(scenario=paste0("ssp1")) + A62.globaltech_shrwt_ssp2 <- get_data(all_data, "energy/A62.globaltech_shrwt_ssp2")%>% gather_years %>% mutate(scenario=paste0("ssp2")) + A62.globaltech_shrwt_ssp3 <- get_data(all_data, "energy/A62.globaltech_shrwt_ssp3")%>% gather_years %>% mutate(scenario=paste0("ssp3")) + A62.globaltech_shrwt_ssp4 <- get_data(all_data, "energy/A62.globaltech_shrwt_ssp4")%>% gather_years %>% mutate(scenario=paste0("ssp4")) + A62.globaltech_shrwt_ssp5 <- get_data(all_data, "energy/A62.globaltech_shrwt_ssp5")%>% gather_years %>% mutate(scenario=paste0("ssp5")) + + + # =================================================== + # 0. Give binding for variable names used in pipeline + year <- value <- GCAM_region_ID <- sector <- fuel <- year.fillout <- to.value <- + technology <- supplysector <- subsector <- minicam.energy.input <- coefficient <- + remove.fraction <- minicam.non.energy.input <- input.cost <- PrimaryFuelCO2Coef.name <- + PrimaryFuelCO2Coef <- calibration <- calOutputValue <- subs.share.weight <- region <- + calibrated.value <- . <- scenario <- temp_lag <- base.service <- energy.final.demand <- + value.x <- value.y <- parameter <- half.life <- median.shutdown.point <- + L262.GlobalTechCoef_dac_ssp1 <- L262.GlobalTechCoef_dac_ssp2 <-L262.GlobalTechCoef_dac_ssp3 <-L262.GlobalTechCoef_dac_ssp4 <-L262.GlobalTechCoef_dac_ssp5 <-NULL + + + # =================================================== + # 1. Perform computations + # 1a. Supplysector information + # L262.Supplysector_dac: Supply sector information for CO2 removal sector containing dac subsectors and technologies + A62.sector %>% + write_to_all_regions(c(LEVEL2_DATA_NAMES[["Supplysector"]], LOGIT_TYPE_COLNAME), GCAM_region_names) -> + L262.Supplysector_dac + + # L262.FinalEnergyKeyword_dac: Supply sector keywords for CO2 removal sector + A62.sector %>% + write_to_all_regions(LEVEL2_DATA_NAMES[["FinalEnergyKeyword"]], GCAM_region_names) %>% + na.omit -> + L262.FinalEnergyKeyword_dac + + # 1b. Subsector information + # L262.SubsectorLogit_dac: Subsector logit exponents of CO2 removal sector + A62.subsector_logit %>% + write_to_all_regions(c(LEVEL2_DATA_NAMES[["SubsectorLogit"]], LOGIT_TYPE_COLNAME), GCAM_region_names) -> + L262.SubsectorLogit_dac + + # and L262.SubsectorShrwtFllt_dac: Subsector shareweights of CO2 removal sector + A62.subsector_shrwt %>% + filter(!is.na(year.fillout)) %>% + write_to_all_regions(LEVEL2_DATA_NAMES[["SubsectorShrwtFllt"]], GCAM_region_names) -> + L262.SubsectorShrwtFllt_dac + + # L262.SubsectorInterp_dac: Subsector shareweight interpolation of CO2 removal sector + A62.subsector_interp %>% + filter(is.na(to.value)) %>% + write_to_all_regions(LEVEL2_DATA_NAMES[["SubsectorInterp"]], GCAM_region_names) -> + L262.SubsectorInterp_dac + + # 1c. Technology information + # L262.StubTech_dac: Identification of stub technologies of dac + # Note: assuming that technology list in the shareweight table includes the full set (any others would default to a 0 shareweight) + + A62.globaltech_shrwt <- bind_rows(A62.globaltech_shrwt_ssp1,A62.globaltech_shrwt_ssp2,A62.globaltech_shrwt_ssp3,A62.globaltech_shrwt_ssp4,A62.globaltech_shrwt_ssp5) + + A62.globaltech_shrwt %>% + write_to_all_regions(LEVEL2_DATA_NAMES[["Tech"]], GCAM_region_names) %>% + rename(stub.technology = technology) -> + L262.StubTech_dac + + # L262.GlobalTechShrwt_dac: Shareweights of global dac technologies + A62.globaltech_shrwt %>% + gather_years %>% + complete(nesting(supplysector, subsector, technology,scenario), year = c(year, MODEL_BASE_YEARS, MODEL_FUTURE_YEARS)) %>% + arrange(supplysector, subsector, technology, scenario,year) %>% + group_by(scenario,supplysector, subsector, technology) %>% + mutate(share.weight = approx_fun(year, value, rule = 1)) %>% + ungroup %>% + filter(year %in% c(MODEL_BASE_YEARS, MODEL_FUTURE_YEARS)) %>% + rename(sector.name = supplysector, + subsector.name = subsector) %>% + select(LEVEL2_DATA_NAMES[["GlobalTechYr"]], "share.weight","scenario") -> + L262.GlobalTechShrwt_dac + + #L262.GlobalTechCoef_dac: Energy inputs and coefficients of dac technologies + #concatenate tables of all ssps into one table for later filtering + A62.globaltech_coef <- bind_rows(A62.globaltech_coef_ssp1,A62.globaltech_coef_ssp2,A62.globaltech_coef_ssp3,A62.globaltech_coef_ssp4,A62.globaltech_coef_ssp5) + + A62.globaltech_coef %>% + gather_years %>% + complete(nesting(supplysector, subsector, technology, minicam.energy.input,scenario), year = c(year, MODEL_BASE_YEARS, MODEL_FUTURE_YEARS)) %>% + arrange(supplysector, subsector, technology, minicam.energy.input, scenario,year) %>% + group_by(scenario,supplysector, subsector, technology, minicam.energy.input) %>% + mutate(coefficient = approx_fun(year, value, rule = 1), + coefficient = round(coefficient, energy.DIGITS_COEFFICIENT)) %>% + ungroup %>% + filter(year %in% c(MODEL_BASE_YEARS, MODEL_FUTURE_YEARS)) %>% + rename(sector.name = supplysector, + subsector.name = subsector) %>% + select(LEVEL2_DATA_NAMES[["GlobalTechCoef"]],'scenario') -> + L262.GlobalTechCoef_dac + + # Carbon capture rates for dac. + # L262.GlobalTechCapture_dac: defines CO2 capture fractions for dac (by definition 1, as all inputs are defined per tonne C removed from the atmosphere), + # as well as a separately-defined process heat dac sector, which has slightly lower capture rates for natural gas combustion emissions. + # This allows separate consideration of the capture fraction of any combustion emissions resulting from the process heat input + # No need to consider historical periods here + A62.globaltech_co2capture %>% + gather_years %>% + complete(nesting(supplysector, subsector, technology), year = c(year, MODEL_FUTURE_YEARS)) %>% + arrange(supplysector, subsector, technology, year) %>% + group_by(supplysector, subsector, technology) %>% + mutate(remove.fraction = approx_fun(year, value, rule = 1), + remove.fraction = round(remove.fraction, energy.DIGITS_REMOVE.FRACTION)) %>% + ungroup %>% + filter(year %in% MODEL_FUTURE_YEARS) %>% + rename(sector.name = supplysector, + subsector.name = subsector) %>% + select(LEVEL2_DATA_NAMES[["GlobalTechYr"]], "remove.fraction") %>% + mutate(storage.market = energy.CO2.STORAGE.MARKET) -> + L262.GlobalTechCapture_dac + + + # L262.GlobalTechCost_dac: Non-energy costs of global dac technologies + #first we concatenate all the ssp cost parametrizations into one table, for later filtering + A62.globaltech_cost <- bind_rows(A62.globaltech_cost_ssp1,A62.globaltech_cost_ssp2,A62.globaltech_cost_ssp3,A62.globaltech_cost_ssp4,A62.globaltech_cost_ssp5) + + + A62.globaltech_cost %>% + gather_years %>% + complete(nesting(supplysector, subsector, technology, minicam.non.energy.input,scenario), year = c(year, MODEL_BASE_YEARS, MODEL_FUTURE_YEARS)) %>% + arrange(supplysector, subsector, technology, minicam.non.energy.input, scenario,year) %>% + group_by(scenario,supplysector, subsector, technology, minicam.non.energy.input) %>% + mutate(input.cost = approx_fun(year, value, rule = 1), + input.cost = round(input.cost, energy.DIGITS_COST)) %>% + ungroup %>% + filter(year %in% c(MODEL_BASE_YEARS, MODEL_FUTURE_YEARS)) %>% + rename(sector.name = supplysector, + subsector.name = subsector) %>% + select(LEVEL2_DATA_NAMES[["GlobalTechCost"]],'scenario') -> + L262.GlobalTechCost_dac # intermediate tibble + + + + L262.GlobalTechCapture_dac %>% + pull(remove.fraction) %>% + mean -> dac_CO2_capture_frac + + L262.GlobalTechCoef_dac %>% + filter(minicam.energy.input == "airCO2") %>% + pull(coefficient) %>% + mean -> + coef_mean # temporary value + + + #Calibration and region-specific data + # L262.StubTechProd_dac: calibrated CO2 removal (cdr) production (arbitrarily high value met entirely by no-capture technology in history) + calibrated_techs %>% + filter(calibration == "output") %>% # Only take the tech IDs where the calibration is identified as output + select(sector, supplysector, subsector, technology) %>% + distinct -> + calibrated_techs_export # temporary tibble + + L162.out_Mt_R_dac_Yh %>% + filter(year %in% MODEL_BASE_YEARS) %>% + mutate(calOutputValue = round(value, energy.DIGITS_CALOUTPUT)) %>% + left_join_error_no_match(GCAM_region_names, by = "GCAM_region_ID") %>% + left_join_error_no_match(calibrated_techs_export, by = "sector") %>% + mutate(stub.technology = technology, + share.weight.year = year, + subs.share.weight = if_else(calOutputValue > 0, 1, 0), + tech.share.weight = subs.share.weight) %>% + select(LEVEL2_DATA_NAMES[["StubTechProd"]]) -> + L262.StubTechProd_dac + + + # L262.PerCapitaBased_dac: per-capita based flag for dac exports final demand. Note that this should be zero as the amount of DAC shouldn't be explicitly tied to population + A62.demand %>% + write_to_all_regions(LEVEL2_DATA_NAMES[["PerCapitaBased"]], GCAM_region_names) -> + L262.PerCapitaBased_dac + + +# L262.BaseService_dac: base-year service output of dac (arbitrarily high) + L262.StubTechProd_dac %>% + select(region, year, base.service = calOutputValue) %>% + mutate(energy.final.demand = A62.demand[["energy.final.demand"]]) -> + L262.BaseService_dac + + # L262.PriceElasticity_dac: price elasticity (zero to represent the backstop nature of dac technology) + A62.demand %>% + write_to_all_regions(LEVEL2_DATA_NAMES[["PriceElasticity"]][LEVEL2_DATA_NAMES[["PriceElasticity"]] != "year"], GCAM_region_names) %>% + repeat_add_columns(tibble(year = MODEL_FUTURE_YEARS)) %>% + select(LEVEL2_DATA_NAMES[["PriceElasticity"]]) -> + L262.PriceElasticity_dac + + + # Retirement information + A62.globaltech_retirement %>% + set_years %>% + mutate(year = as.integer(year)) %>% + rename(sector.name = supplysector, subsector.name = subsector) -> + A62.globaltech_retirement_with_years + + # Copy the data in the last base year period through to the end year + A62.globaltech_retirement_with_years %>% + filter(year == max(MODEL_BASE_YEARS)) -> + A62.globaltech_retirement_max_baseyear + + A62.globaltech_retirement_with_years %>% + filter(year == min(MODEL_FUTURE_YEARS)) %>% + select(-year) %>% + repeat_add_columns(tibble(year = MODEL_FUTURE_YEARS)) %>% + bind_rows(A62.globaltech_retirement_max_baseyear) -> + L262.globaltech_retirement + + # Retirement may consist of any of three types of retirement function (phased, s-curve, or none) + # All of these options have different headers, and all are allowed + + # L262.GlobalTechSCurve_dac: Global tech lifetime and s-curve retirement function + L262.globaltech_retirement %>% + filter(!is.na(half.life)) %>% + select(LEVEL2_DATA_NAMES[["GlobalTechYr"]], "lifetime", "steepness", "half.life") -> + L262.GlobalTechSCurve_dac + + # L262.GlobalTechProfitShutdown_dac: Global tech profit shutdown decider. + L262.globaltech_retirement %>% + filter(!is.na(median.shutdown.point)) %>% + select(LEVEL2_DATA_NAMES[["GlobalTechYr"]], "median.shutdown.point", "profit.shutdown.steepness") -> + L262.GlobalTechProfitShutdown_dac + + + + + + + + # =================================================== + # Produce outputs + + # Extract SSP data and assign to separate tables + + for(sce in TECH_PARAMETRIZATION_OUTPUTS) { + L262.GlobalTechCost_dac %>% + filter(scenario == sce) %>% + select(-c(scenario))%>% + add_title(paste("Cost coefficients of dac -", sce)) %>% + add_units("1975$/kg for supplysector dac; 1975$/GJ for supplysector process heat dac") %>% + add_comments(sce) %>% + add_comments("Includes non-energy related capture costs only per kgC captured from the atmosphere. Storage costs will be computed endogenously through the carbon storage markets. Additional non-energy cost of process heat dac assumed zero.") %>% + add_legacy_name(paste0("L262.GlobalTechCost_dac_", tolower(sce))) %>% + add_precursors(paste0("energy/A62.globaltech_cost_", tolower(sce))) -> + x + assign(paste0("L262.GlobalTechCost_dac_", tolower(sce)), x) + } + + + + for(sce in TECH_PARAMETRIZATION_OUTPUTS) { + L262.GlobalTechCoef_dac %>% + filter(scenario == sce) %>% + select(-c(scenario))%>% + add_title(paste("Tech coefficients of dac -", sce)) %>% + add_units("airCO2 input is unitless (Mt airCO2 per Mt dac); all others are GJ per kg (EJ of energy per Mt of dac)") %>% + add_comments(sce) %>% + add_comments("For dac sector, the energy use coefficients from A62.globaltech_coef are interpolated into all model years") %>% + add_legacy_name(paste0("L262.GlobalTechCoef_dac_", tolower(sce))) %>% + add_precursors(paste0("energy/A62.globaltech_coef_", tolower(sce))) -> + x + assign(paste0("L262.GlobalTechCoef_dac_", tolower(sce)), x) + } + + + for(sce in TECH_PARAMETRIZATION_OUTPUTS) { + L262.GlobalTechShrwt_dac %>% + filter(scenario == sce) %>% + select(-c(scenario))%>% + add_title("Shareweights of global dac technologies") %>% + add_units("Unitless") %>% + add_comments("For dac sector, the share weights from A62.globaltech_shrwt are interpolated into all base years and future years") %>% + add_legacy_name(paste0("L262.GlobalTechShrwt_dac_",tolower(sce))) %>% + add_precursors(paste0("energy/A62.globaltech_shrwt_",tolower(sce))) -> + x + assign(paste0("L262.GlobalTechShrwt_dac_", tolower(sce)), x) + } + + + + + L262.Supplysector_dac %>% + add_title("Supply sector information for CO2 removal sector") %>% + add_units("NA") %>% + add_comments("For dac sector, the supply sector information (output.unit, input.unit, price.unit, logit.year.fillout, logit.exponent) from A62.sector is expended into all GCAM regions") %>% + add_legacy_name("L262.Supplysector_dac") %>% + add_precursors("energy/A62.sector", "common/GCAM_region_names") -> + L262.Supplysector_dac + + L262.FinalEnergyKeyword_dac %>% + add_title("Supply sector keywords for dac sector") %>% + add_units("NA") %>% + add_comments("For dac sector, the supply sector final energy keywords from A62.sector are expended into all GCAM regions") %>% + add_legacy_name("L262.FinalEnergyKeyword_dac") %>% + add_precursors("energy/A62.sector", "common/GCAM_region_names") -> + L262.FinalEnergyKeyword_dac + + L262.SubsectorLogit_dac %>% + add_title("Subsector logit exponents of dac sector") %>% + add_units("Unitless") %>% + add_comments("For dac sector, the subsector logit exponents from A62.subsector_logit are expanded into all GCAM regions") %>% + add_legacy_name("L262.SubsectorLogit_dac") %>% + add_precursors("energy/A62.subsector_logit", "common/GCAM_region_names") -> + L262.SubsectorLogit_dac + + L262.SubsectorShrwtFllt_dac %>% + add_title("Subsector shareweights of dac sector") %>% + add_units("unitless") %>% + add_comments("For dac sector, the subsector shareweights from A62.subsector_shrwt are expanded into all GCAM regions") %>% + add_legacy_name("L262.SubsectorShrwtFllt_dac") %>% + add_precursors("energy/A62.subsector_shrwt", "common/GCAM_region_names") -> + L262.SubsectorShrwtFllt_dac + + L262.SubsectorInterp_dac %>% + add_title("Subsector shareweight interpolation of dac sector") %>% + add_units("NA") %>% + add_comments("For dac sector, the subsector shareweight interpolation function infromation from A62.subsector_interp is expanded into all GCAM regions") %>% + add_legacy_name("L262.SubsectorInterp_dac") %>% + add_precursors("energy/A62.subsector_interp", "common/GCAM_region_names") -> + L262.SubsectorInterp_dac + + L262.StubTech_dac %>% + add_title("Identification of stub technologies of dac") %>% + add_units("NA") %>% + add_comments("For dac sector, the stub technologies from A62.globaltech_shrwt are expanded into all GCAM regions") %>% + add_legacy_name("L262.StubTech_dac") %>% + add_precursors("energy/A62.globaltech_shrwt_ssp1", "energy/A62.globaltech_shrwt_ssp2","energy/A62.globaltech_shrwt_ssp3","energy/A62.globaltech_shrwt_ssp4","energy/A62.globaltech_shrwt_ssp5", + "common/GCAM_region_names") -> + L262.StubTech_dac + + L262.GlobalTechShrwt_dac %>% + add_title("Shareweights of global dac technologies") %>% + add_units("Unitless") %>% + add_comments("For dac sector, the share weights from A62.globaltech_shrwt are interpolated into all base years and future years") %>% + add_precursors("energy/A62.globaltech_shrwt_ssp1","energy/A62.globaltech_shrwt_ssp2","energy/A62.globaltech_shrwt_ssp3","energy/A62.globaltech_shrwt_ssp4","energy/A62.globaltech_shrwt_ssp5") -> + L262.GlobalTechShrwt_dac + + L262.GlobalTechCoef_dac %>% + add_title("Energy inputs and coefficients of dac technologies") %>% + add_units("airCO2 input is unitless (Mt airCO2 per Mt dac); all others are GJ per kg (EJ of energy per Mt of dac)") %>% + add_comments("For dac sector, the energy use coefficients from A62.globaltech_coef are interpolated into all model years") %>% + add_precursors("energy/A62.globaltech_coef_ssp1","energy/A62.globaltech_coef_ssp2","energy/A62.globaltech_coef_ssp3","energy/A62.globaltech_coef_ssp4","energy/A62.globaltech_coef_ssp5") -> + L262.GlobalTechCoef_dac + + + + L262.GlobalTechCost_dac %>% + add_title("Non-energy costs of global dac manufacturing technologies") %>% + add_units("1975$/kg for supplysector dac; 1975$/GJ for supplysector process heat dac") %>% + add_comments("Includes non-energy related capture costs only per kgC captured from the atmosphere. Storage costs will be computed endogenously through the carbon storage markets. Additional non-energy cost of process heat dac assumed zero.") %>% + add_precursors("energy/A62.globaltech_cost_ssp1","energy/A62.globaltech_cost_ssp2","energy/A62.globaltech_cost_ssp3","energy/A62.globaltech_cost_ssp4","energy/A62.globaltech_cost_ssp5") -> + L262.GlobalTechCost_dac + + L262.GlobalTechCapture_dac %>% + add_title("CO2 capture fractions from global dac production technologies with CCS") %>% + add_units("Unitless") %>% + add_comments("For dac sector, the remove fractions from A62.globaltech_co2capture are interpolated into all model years") %>% + add_legacy_name("L262.GlobalTechCapture_dac") %>% + add_precursors("energy/A62.globaltech_co2capture") -> + L262.GlobalTechCapture_dac + + + L262.PerCapitaBased_dac %>% + add_title("per-capita based flag for dac exports final demand") %>% + add_units("NA") %>% + add_comments("Per-capita based flags for dac from A62.demand are expanded into all GCAM regions") %>% + add_legacy_name("L262.PerCapitaBased_dac") %>% + add_precursors("energy/A62.demand", "common/GCAM_region_names") -> + L262.PerCapitaBased_dac + + + L262.PriceElasticity_dac %>% + add_title("price elasticity for dac") %>% + add_units("Unitless") %>% + add_comments("The elasticity values from A62.demand are expanded into all GCAM_regions") %>% + add_legacy_name("L262.PriceElasticity_dac") %>% + add_precursors("energy/A62.demand", "common/GCAM_region_names") -> + L262.PriceElasticity_dac + + L262.StubTechProd_dac %>% + add_title("calibrated cdr values") %>% + add_units("Mt") %>% + add_comments("Values are calculated using L162.out_Mt_R_dac_Yh then added GCAM region information and supplysector, subsector, and technology information") %>% + add_legacy_name("L262.StubTechProd_dac") %>% + add_precursors("energy/calibrated_techs_cdr", "L162.out_Mt_R_dac_Yh", "common/GCAM_region_names") -> + L262.StubTechProd_dac + + L262.BaseService_dac %>% + add_title("base-year service output of dac") %>% + add_units("Mt") %>% + add_comments("Transformed from L262.StubTechProd_dac by adding energy.final.demand from A62.demand") %>% + add_legacy_name("L262.BaseService_dac") %>% + add_precursors("energy/A62.demand", "energy/calibrated_techs_cdr", "L162.out_Mt_R_dac_Yh", "common/GCAM_region_names") -> + L262.BaseService_dac + + L262.GlobalTechSCurve_dac %>% + add_title("Global tech lifetime and s-curve retirement function") %>% + add_units("year for lifetime and halflife; Unitless for steepness") %>% + add_comments("The values are extracted from L262.globaltech_retirement for entries that half life value is not NA") %>% + add_legacy_name("L262.GlobalTechSCurve_dac") %>% + add_precursors("energy/A62.globaltech_retirement") -> + L262.GlobalTechSCurve_dac + + L262.GlobalTechProfitShutdown_dac %>% + add_title("Global tech profit shutdown decider") %>% + add_units("Unitless") %>% + add_comments("The values are extracted from L262.globaltech_retirement for entries that median shutdown point is not NA") %>% + add_legacy_name("L262.GlobalTechProfitShutdown_dac") %>% + add_precursors("energy/A62.globaltech_retirement") -> + L262.GlobalTechProfitShutdown_dac + + return_data(L262.Supplysector_dac, L262.FinalEnergyKeyword_dac, L262.SubsectorLogit_dac, + L262.SubsectorShrwtFllt_dac, L262.SubsectorInterp_dac, + L262.GlobalTechCost_dac, + L262.GlobalTechCost_dac_ssp1,L262.GlobalTechCost_dac_ssp2,L262.GlobalTechCost_dac_ssp3,L262.GlobalTechCost_dac_ssp4,L262.GlobalTechCost_dac_ssp5, + L262.StubTech_dac, + L262.GlobalTechShrwt_dac_ssp1,L262.GlobalTechShrwt_dac_ssp2,L262.GlobalTechShrwt_dac_ssp3,L262.GlobalTechShrwt_dac_ssp4,L262.GlobalTechShrwt_dac_ssp5, + L262.GlobalTechShrwt_dac, + L262.GlobalTechCoef_dac, + L262.GlobalTechCoef_dac_ssp1, L262.GlobalTechCoef_dac_ssp2, L262.GlobalTechCoef_dac_ssp3, L262.GlobalTechCoef_dac_ssp4, L262.GlobalTechCoef_dac_ssp5, + L262.GlobalTechCapture_dac, + L262.PerCapitaBased_dac, + L262.PriceElasticity_dac,L262.StubTechProd_dac,L262.BaseService_dac,L262.GlobalTechSCurve_dac, + L262.GlobalTechProfitShutdown_dac) + } else { + stop("Unknown command") + } +} diff --git a/input/gcamdata/R/zchunk_L270.limits.R b/input/gcamdata/R/zchunk_L270.limits.R index 42ca3a2904..98a948182f 100644 --- a/input/gcamdata/R/zchunk_L270.limits.R +++ b/input/gcamdata/R/zchunk_L270.limits.R @@ -24,6 +24,7 @@ module_energy_L270.limits <- function(command, ...) { if(command == driver.DECLARE_INPUTS) { return(c(FILE = "common/GCAM_region_names", FILE = "energy/A23.globaltech_eff", + FILE = "emissions/A_CDRU", "L102.gdp_mil90usd_GCAM3_R_Y", "L102.gdp_mil90usd_Scen_R_Y", "L221.GlobalTechCoef_en", @@ -52,6 +53,7 @@ module_energy_L270.limits <- function(command, ...) { # Load required inputs GCAM_region_names <- get_data(all_data, "common/GCAM_region_names") A23.globaltech_eff <- get_data(all_data, "energy/A23.globaltech_eff") + A_CDRU <- get_data(all_data, "emissions/A_CDRU") L102.gdp_mil90usd_GCAM3_R_Y <- get_data(all_data, "L102.gdp_mil90usd_GCAM3_R_Y", strip_attributes = TRUE) L102.gdp_mil90usd_Scen_R_Y <- get_data(all_data, "L102.gdp_mil90usd_Scen_R_Y") L102.gdp_mil90usd_Scen_R_Y <- get_data(all_data, "L102.gdp_mil90usd_Scen_R_Y") @@ -125,6 +127,31 @@ module_energy_L270.limits <- function(command, ...) { L270.CTaxInput <- L270.CTaxInput[, c(LEVEL2_DATA_NAMES[["GlobalTechYr"]], "ctax.input", "fuel.C.coef")] + + A_CDRU %>% + gather_years("coef") -> A_CDRU + + #create a coefficient table for airCO2 only, analogous to L221.GlobalTechCoef_en (where we don't want airCO2 showing up), which will be appended to L270.CTaxInput + A_CDRU %>% + select(supplysector, subsector, technology) %>% + distinct %>% + # Interpolate to all years + repeat_add_columns(tibble(year = c(HISTORICAL_YEARS, MODEL_FUTURE_YEARS))) %>% + left_join(A_CDRU, by = c("supplysector", "subsector", "technology", "year")) %>% + group_by(supplysector, subsector, technology) %>% + mutate(coefficient = approx_fun(year, value = coef, rule = 1)) %>% + ungroup() %>% + filter(year %in% MODEL_YEARS) %>% + select(sector.name = supplysector, subsector.name = subsector, technology, year, coefficient) -> L270.GlobalTechCoef_cdr + + L270.GlobalTechCoef_cdr %>% + mutate(ctax.input = energy.NEG_EMISS_POLICY_NAME) %>% + rename(fuel.C.coef = coefficient)-> L270.GlobalTechCoef_cdr + + L270.CTaxInput %>% + bind_rows(L270.GlobalTechCoef_cdr) -> L270.CTaxInput + + # L270.LandRootNegEmissMkt: set the negative emissions policy name into the LandAllocator root # so it can make it available to all land leaves under a UCT tibble(region = GCAM_region_names$region, @@ -216,9 +243,11 @@ module_energy_L270.limits <- function(command, ...) { add_comments("Add ctax-input to all of the bio-energy supply sectors") %>% add_comments("by using L221.GlobalTechCoef_en filtered by biomass|ethanol") %>% add_comments("and joining carbon coefficients from L202.CarbonCoef") %>% + add_comments("airCO2 is also appended for direct air capture (i.e. negative emissions not from biomass)") %>% add_legacy_name("L270.CTaxInput") %>% add_precursors("L221.GlobalTechCoef_en", - "L202.CarbonCoef") -> + "L202.CarbonCoef", + "emissions/A_CDRU") -> L270.CTaxInput L270.LandRootNegEmissMkt %>% diff --git a/input/gcamdata/R/zchunk_LA162.dac.R b/input/gcamdata/R/zchunk_LA162.dac.R new file mode 100644 index 0000000000..51643ecc33 --- /dev/null +++ b/input/gcamdata/R/zchunk_LA162.dac.R @@ -0,0 +1,62 @@ +# Copyright 2019 Battelle Memorial Institute; see the LICENSE file. + +#' module_energy_LA162.dac +#' +#' Sets up input, output, and IO coefficients for dac +#' +#' @param command API command to execute +#' @param ... other optional parameters, depending on command +#' @return Depends on \code{command}: either a vector of required inputs, +#' a vector of output names, or (if \code{command} is "MAKE") all +#' the generated outputs: \code{L162.out_Mt_R_dac_Yh}, +#' @details This chunk defines historical demand for the climate engineering services sector, setting up structure for future competition. +#' For all historical years, is met entirely by "no DAC" technology +#' @importFrom assertthat assert_that +#' @importFrom dplyr arrange bind_rows filter group_by left_join mutate select semi_join summarise summarise_all +#' @importFrom tidyr complete gather nesting +#' @author JF March 2021 +module_energy_LA162.dac <- function(command, ...) { + if(command == driver.DECLARE_INPUTS) { + return(c(FILE = "energy/A62.calibration")) + } else if(command == driver.DECLARE_OUTPUTS) { + return(c("L162.out_Mt_R_dac_Yh")) + } else if(command == driver.MAKE) { + + # Silence global variable package check + . <- Biomass <- Biomass_EJ <- Coal <- Coal_EJ <- Country <- GCAM_region_ID <- Gas <- Gas_EJ <- + IEA_fuelshare_region <- IEA_intensity_region <- IOelec <- Oil <- Oil_EJ <- TPE_GJkg <- + Worrell_region <- cement_prod_Mt <- country_name <- elec_EJ <- elec_GJkg <- + emiss_ktC <- fuel <- heat_EJ <- heat_GJkg <- in.value <- ind.value <- iso <- + old.year <- out.value <- process_emissions_MtC <- process_emissions_ktC <- + prod_Mt <- prod_emiss_ratio <- reg_process_emissions <- region_GCAM3 <- sector <- + share <- value <- cement <- year <- value.y <- value.x <- NULL + + all_data <- list(...)[[1]] + + # Load required inputs + + ces_calibration <- get_data(all_data, "energy/A62.calibration") + + + # =================================================== + # 2. Perform computations + + # Set constants used for this chunk + # --------------------------------- + + ces_calibration -> L162.out_Mt_R_dac_Yh + + + L162.out_Mt_R_dac_Yh %>% + add_units("Mt C") %>% + add_comments("Outputs are calculated by simply transposing the calibration matrix, which contains arbitrarily high values for dac+noDAC") %>% + add_legacy_name("L162.out_Mt_R_dac_Yh") %>% + add_precursors("energy/A62.calibration") -> + L162.out_Mt_R_dac_Yh + + + return_data(L162.out_Mt_R_dac_Yh) + } else { + stop("Unknown command") + } +} diff --git a/input/gcamdata/R/zchunk_batch_dac_xml.R b/input/gcamdata/R/zchunk_batch_dac_xml.R new file mode 100644 index 0000000000..905a21f30d --- /dev/null +++ b/input/gcamdata/R/zchunk_batch_dac_xml.R @@ -0,0 +1,125 @@ +# Copyright 2019 Battelle Memorial Institute; see the LICENSE file. + +#' module_energy_batch_dac_xml +#' +#' Construct XML data structure for \code{dac.xml}. +#' +#' @param command API command to execute +#' @param ... other optional parameters, depending on command +#' @return Depends on \code{command}: either a vector of required inputs, +#' a vector of output names, or (if \code{command} is "MAKE") all +#' the generated outputs: \code{dac.xml}. The corresponding file in the +#' original data system was \code{batch_dac_xml.R} (energy XML). +#' @author JF March 2021 +module_energy_batch_dac_xml <- function(command, ...) { + + + TECH_PARAMETRIZATION_INPUTS <- paste0("ssp", 1:5) + if(command == driver.DECLARE_INPUTS) { + return(c("L262.Supplysector_dac", + "L262.FinalEnergyKeyword_dac", + "L262.SubsectorLogit_dac", + "L262.SubsectorShrwtFllt_dac", + "L262.SubsectorInterp_dac", + "L262.StubTech_dac", + "L262.GlobalTechShrwt_dac", + c(paste("L262.GlobalTechShrwt_dac", tolower(TECH_PARAMETRIZATION_INPUTS), sep = "_")), + c(paste("L262.GlobalTechCoef_dac", tolower(TECH_PARAMETRIZATION_INPUTS), sep = "_")), + c(paste("L262.GlobalTechCost_dac", tolower(TECH_PARAMETRIZATION_INPUTS), sep = "_")), + "L262.GlobalTechCapture_dac", + "L262.StubTechProd_dac", + "L262.PerCapitaBased_dac", + "L262.BaseService_dac", + "L262.PriceElasticity_dac", + "L262.GlobalTechSCurve_dac", + "L262.GlobalTechProfitShutdown_dac")) + } else if(command == driver.DECLARE_OUTPUTS) { + return(c(XML = "dac_ssp1.xml", + XML = "dac_ssp2.xml", + XML = "dac_ssp3.xml", + XML = "dac_ssp4.xml", + XML = "dac_ssp5.xml")) + } else if(command == driver.MAKE) { + + all_data <- list(...)[[1]] + + for(sce in TECH_PARAMETRIZATION_INPUTS){ + # Load required inputs + L262.Supplysector_dac <- get_data(all_data, "L262.Supplysector_dac") + L262.FinalEnergyKeyword_dac <- get_data(all_data, "L262.FinalEnergyKeyword_dac") + L262.SubsectorLogit_dac <- get_data(all_data, "L262.SubsectorLogit_dac") + L262.SubsectorShrwtFllt_dac <- get_data(all_data, "L262.SubsectorShrwtFllt_dac") + L262.SubsectorInterp_dac <- get_data(all_data, "L262.SubsectorInterp_dac") + L262.StubTech_dac <- get_data(all_data, "L262.StubTech_dac") + L262.GlobalTechShrwt_dac <- get_data(all_data, "L262.GlobalTechShrwt_dac") + + coef_name <- paste0("L262.GlobalTechCoef_dac_",tolower(sce)) + cost_name <- paste0("L262.GlobalTechCost_dac_",tolower(sce)) + shwt_name <- paste0("L262.GlobalTechShrwt_dac_",tolower(sce)) + + L262.GlobalTechCoef_dac <- get_data(all_data, coef_name) + L262.GlobalTechCost_dac <- get_data(all_data, cost_name) + L262.GlobalTechShrwt_dac <- get_data(all_data, shwt_name) + + L262.GlobalTechCapture_dac <- get_data(all_data, "L262.GlobalTechCapture_dac") + L262.StubTechProd_dac <- get_data(all_data, "L262.StubTechProd_dac") + L262.PerCapitaBased_dac <- get_data(all_data, "L262.PerCapitaBased_dac") + L262.BaseService_dac <- get_data(all_data, "L262.BaseService_dac") + L262.PriceElasticity_dac <- get_data(all_data, "L262.PriceElasticity_dac") + L262.GlobalTechSCurve_dac <- get_data(all_data, "L262.GlobalTechSCurve_dac") + L262.GlobalTechProfitShutdown_dac <- get_data(all_data, "L262.GlobalTechProfitShutdown_dac") + + + + xmlfn <- paste0("dac_",tolower(sce), '.xml') + + # =================================================== + # Produce outputs + create_xml(xmlfn) %>% + add_logit_tables_xml(L262.Supplysector_dac, "Supplysector") %>% + add_xml_data(L262.FinalEnergyKeyword_dac, "FinalEnergyKeyword") %>% + add_logit_tables_xml(L262.SubsectorLogit_dac, "SubsectorLogit") %>% + add_xml_data(L262.SubsectorShrwtFllt_dac, "SubsectorShrwtFllt") %>% + add_xml_data(L262.SubsectorInterp_dac, "SubsectorInterp") %>% + add_xml_data(L262.StubTech_dac, "StubTech") %>% + add_xml_data(L262.GlobalTechShrwt_dac, "GlobalTechShrwt") %>% + add_xml_data(L262.GlobalTechCoef_dac, "GlobalTechCoef") %>% + add_xml_data(L262.GlobalTechCost_dac, "GlobalTechCost") %>% + add_xml_data(L262.GlobalTechCapture_dac, "GlobalTechCapture") %>% + add_xml_data(L262.StubTechProd_dac, "StubTechProd") %>% + add_xml_data(L262.PerCapitaBased_dac, "PerCapitaBased") %>% + add_xml_data(L262.BaseService_dac, "BaseService") %>% + add_xml_data(L262.PriceElasticity_dac, "PriceElasticity") %>% + add_xml_data(L262.GlobalTechSCurve_dac, "GlobalTechSCurve") %>% + add_xml_data(L262.GlobalTechProfitShutdown_dac, "GlobalTechProfitShutdown") %>% + add_precursors("L262.Supplysector_dac", + "L262.FinalEnergyKeyword_dac", + "L262.SubsectorLogit_dac", + "L262.SubsectorShrwtFllt_dac", + "L262.SubsectorInterp_dac", + "L262.StubTechProd_dac", + "L262.StubTech_dac", + "L262.GlobalTechShrwt_dac", + paste0("L262.GlobalTechShrwt_dac_",tolower(sce)), + paste0("L262.GlobalTechCoef_dac_",tolower(sce)), + paste0("L262.GlobalTechCost_dac_",tolower(sce)), + "L262.GlobalTechCapture_dac", + "L262.PerCapitaBased_dac", + "L262.BaseService_dac", + "L262.PriceElasticity_dac", + "L262.GlobalTechSCurve_dac", + "L262.GlobalTechProfitShutdown_dac") -> + xmlobj + assign(xmlfn, xmlobj) + + + } + return_data(dac_ssp1.xml, + dac_ssp2.xml, + dac_ssp3.xml, + dac_ssp4.xml, + dac_ssp5.xml)} + else { + stop("Unknown command") + } +} diff --git a/input/gcamdata/inst/extdata/emissions/A_CDRU.csv b/input/gcamdata/inst/extdata/emissions/A_CDRU.csv new file mode 100644 index 0000000000..48b88eea81 --- /dev/null +++ b/input/gcamdata/inst/extdata/emissions/A_CDRU.csv @@ -0,0 +1,8 @@ +# File: A_CDRU.csv +# Title: Primary energy handling default coefficients +# Units: Unitless +#Description: Defines dummy coefficient table for atmospheric carbon stocks +# Column types: ccccnnn +# ---------- +supplysector,subsector,technology,minicam.energy.input,1971,2010,2100 +airCO2,airCO2,airCO2,atmospheric carbon stocks,1,1,1 diff --git a/input/gcamdata/inst/extdata/emissions/A_PrimaryFuelCCoef.csv b/input/gcamdata/inst/extdata/emissions/A_PrimaryFuelCCoef.csv index bc9c8c210c..3038da5e68 100644 --- a/input/gcamdata/inst/extdata/emissions/A_PrimaryFuelCCoef.csv +++ b/input/gcamdata/inst/extdata/emissions/A_PrimaryFuelCCoef.csv @@ -3,7 +3,7 @@ # Description: assumed global default emissions factors # Units: kg C per GJ # Source: CDIAC inventory IEA energy balance some manual adjustments -# Column types: cni +# Column types: cni # ---------- PrimaryFuelCO2Coef.name,PrimaryFuelCO2Coef,traded biomass,0,0 @@ -28,4 +28,6 @@ refining,19.6,0 refined liquids industrial,19.6,0 refined liquids enduse,19.6,0 limestone,0.08,0 +airCO2,1,0 unconventional oil upscaling,1.5,0 + diff --git a/input/gcamdata/inst/extdata/energy/A62.calibration.csv b/input/gcamdata/inst/extdata/energy/A62.calibration.csv new file mode 100644 index 0000000000..8215c87b97 --- /dev/null +++ b/input/gcamdata/inst/extdata/energy/A62.calibration.csv @@ -0,0 +1,38 @@ +# File: A62.calibration.csv +# Title: Calibration values for the CO2 removal sector +# Units: MtC +# Column types: icin +# ---------- +GCAM_region_ID,sector,year,value +1,CO2 removal,2015,2000 +2,CO2 removal,2015,26.58921908 +3,CO2 removal,2015,26.30296292 +4,CO2 removal,2015,25.52156095 +5,CO2 removal,2015,51.65929106 +6,CO2 removal,2015,417.4775416 +7,CO2 removal,2015,1012.357646 +8,CO2 removal,2015,79.87707563 +9,CO2 removal,2015,86.18576367 +10,CO2 removal,2015,429.8246874 +11,CO2 removal,2015,2116.541628 +12,CO2 removal,2015,22.06217174 +13,CO2 removal,2015,71.77458929 +14,CO2 removal,2015,15.81592955 +15,CO2 removal,2015,15.84963925 +16,CO2 removal,2015,6.342950362 +17,CO2 removal,2015,87.41423367 +18,CO2 removal,2015,16.37849476 +19,CO2 removal,2015,66.31417001 +20,CO2 removal,2015,232.7632894 +21,CO2 removal,2015,334.5848291 +22,CO2 removal,2015,7.458686272 +23,CO2 removal,2015,313.0929592 +24,CO2 removal,2015,5.567627191 +25,CO2 removal,2015,161.9684919 +26,CO2 removal,2015,470.9671038 +27,CO2 removal,2015,8.830836973 +28,CO2 removal,2015,0 +29,CO2 removal,2015,165.6920326 +30,CO2 removal,2015,0.307808272 +31,CO2 removal,2015,331.3724602 +32,CO2 removal,2015,136.5132452 diff --git a/input/gcamdata/inst/extdata/energy/A62.demand.csv b/input/gcamdata/inst/extdata/energy/A62.demand.csv new file mode 100644 index 0000000000..ccede03cb6 --- /dev/null +++ b/input/gcamdata/inst/extdata/energy/A62.demand.csv @@ -0,0 +1,8 @@ +# File: A62.demand.csv +# Title: dac final demand perCapitaBased and price elasticity +# Units: NA for perCapitaBased; Unitless for price.elasticity +# Comments: perCapitaBased is a logical (Boolean) indicating whether to use a per-capita or per-GDP based demand function +# Column types: cin +# ---------- +energy.final.demand,perCapitaBased,price.elasticity +CO2 removal,0,0 diff --git a/input/gcamdata/inst/extdata/energy/A62.globaltech_co2capture.csv b/input/gcamdata/inst/extdata/energy/A62.globaltech_co2capture.csv new file mode 100644 index 0000000000..183b532186 --- /dev/null +++ b/input/gcamdata/inst/extdata/energy/A62.globaltech_co2capture.csv @@ -0,0 +1,10 @@ +# File: A62.globaltech_co2capture.csv +# Title: CO2 capture rates for dac and process heat dac technology +# Units: Unitless +# Column types: cccnn +# ---------- +supplysector,subsector,technology,1971,2100 +process heat dac,gas CCS,gas CCS,0.95,0.95 +CO2 removal,dac,hightemp DAC NG,1,1 +CO2 removal,dac,hightemp DAC elec,1,1 +CO2 removal,dac,lowtemp DAC heatpump,1,1 diff --git a/input/gcamdata/inst/extdata/energy/A62.globaltech_coef_ssp1.csv b/input/gcamdata/inst/extdata/energy/A62.globaltech_coef_ssp1.csv new file mode 100644 index 0000000000..8e9779bebb --- /dev/null +++ b/input/gcamdata/inst/extdata/energy/A62.globaltech_coef_ssp1.csv @@ -0,0 +1,21 @@ +# File: A62.globaltech_coef_ssp1.csv +# Title: Default coefficients for DAC +# Units: airCO2 input is unitless (MtC from the atmosphere per Mt dac demand); all others are GJ per kg C (EJ of energy per Mt C) +# Column types: ccccnnnn +# ---------- +supplysector,subsector,technology,minicam.energy.input,1971,2020,2050,2100 +CO2 removal,dac,hightemp DAC NG,process heat dac,0.0297,0.0297,0.019433333,0.019433333 +CO2 removal,dac,hightemp DAC NG,elect_td_ind,0.006526667,0.006526667,0.004766667,0.004766667 +CO2 removal,dac,hightemp DAC NG,airCO2,1,1,1,1 +CO2 removal,dac,hightemp DAC NG,water_td_ind_C,0.017233333,0.017233333,0.017233333,0.017233333 +CO2 removal,dac,hightemp DAC NG,water_td_ind_W,0.017233333,0.017233333,0.017233333,0.017233333 +CO2 removal,dac,no DAC,process heat dac,0,0,0,0 +CO2 removal,dac,no DAC,elect_td_ind,0,0,0,0 +CO2 removal,dac,no DAC,airCO2,0,0,0,0 +process heat dac,gas CCS,gas CCS,wholesale gas,1,1,1,1 +CO2 removal,dac,hightemp DAC elec,elect_td_ind,0.0220044,0.0220044,0.0186384,0.0186384 +CO2 removal,dac,hightemp DAC elec,airCO2,1,1,1,1 +CO2 removal,dac,hightemp DAC elec,water_td_ind_C,0.017233333,0.017233333,0.017233333,0.017233333 +CO2 removal,dac,hightemp DAC elec,water_td_ind_W,0.017233333,0.017233333,0.017233333,0.017233333 +CO2 removal,dac,lowtemp DAC heatpump,elect_td_ind,0.0200684,0.0200684,0.009320178,0.009320178 +CO2 removal,dac,lowtemp DAC heatpump,airCO2,1,1,1,1 diff --git a/input/gcamdata/inst/extdata/energy/A62.globaltech_coef_ssp2.csv b/input/gcamdata/inst/extdata/energy/A62.globaltech_coef_ssp2.csv new file mode 100644 index 0000000000..7b1eaf77e7 --- /dev/null +++ b/input/gcamdata/inst/extdata/energy/A62.globaltech_coef_ssp2.csv @@ -0,0 +1,21 @@ +# File: A62.globaltech_coef_ssp2.csv +# Title: Default coefficients for DAC +# Units: airCO2 input is unitless (MtC from the atmosphere per Mt dac demand); all others are GJ per kg C (EJ of energy per Mt C) +# Column types: ccccnnnn +# ---------- +supplysector,subsector,technology,minicam.energy.input,1971,2020,2050,2100 +CO2 removal,dac,hightemp DAC NG,process heat dac,0.0297,0.0297,0.019433333,0.019433333 +CO2 removal,dac,hightemp DAC NG,elect_td_ind,0.006526667,0.006526667,0.004766667,0.004766667 +CO2 removal,dac,hightemp DAC NG,airCO2,1,1,1,1 +CO2 removal,dac,hightemp DAC NG,water_td_ind_C,0.017233333,0.017233333,0.017233333,0.017233333 +CO2 removal,dac,hightemp DAC NG,water_td_ind_W,0.017233333,0.017233333,0.017233333,0.017233333 +CO2 removal,dac,no DAC,process heat dac,0,0,0,0 +CO2 removal,dac,no DAC,elect_td_ind,0,0,0,0 +CO2 removal,dac,no DAC,airCO2,0,0,0,0 +process heat dac,gas CCS,gas CCS,wholesale gas,1,1,1,1 +CO2 removal,dac,hightemp DAC elec,elect_td_ind,0.0220044,0.0220044,0.0186384,0.0186384 +CO2 removal,dac,hightemp DAC elec,airCO2,1,1,1,1 +CO2 removal,dac,hightemp DAC elec,water_td_ind_C,0.017233333,0.017233333,0.017233333,0.017233333 +CO2 removal,dac,hightemp DAC elec,water_td_ind_W,0.017233333,0.017233333,0.017233333,0.017233333 +CO2 removal,dac,lowtemp DAC heatpump,elect_td_ind,0.0200684,0.0200684,0.009320178,0.009320178 +CO2 removal,dac,lowtemp DAC heatpump,airCO2,1,1,1,1 diff --git a/input/gcamdata/inst/extdata/energy/A62.globaltech_coef_ssp3.csv b/input/gcamdata/inst/extdata/energy/A62.globaltech_coef_ssp3.csv new file mode 100644 index 0000000000..8b41d53272 --- /dev/null +++ b/input/gcamdata/inst/extdata/energy/A62.globaltech_coef_ssp3.csv @@ -0,0 +1,21 @@ +# File: A62.globaltech_coef_ssp3.csv +# Title: Default coefficients for DAC +# Units: airCO2 input is unitless (MtC from the atmosphere per Mt dac demand); all others are GJ per kg C (EJ of energy per Mt C) +# Column types: ccccnnnn +# ---------- +supplysector,subsector,technology,minicam.energy.input,1971,2020,2050,2100 +CO2 removal,dac,hightemp DAC NG,process heat dac,0.0297,0.0297,0.0297,0.0297 +CO2 removal,dac,hightemp DAC NG,elect_td_ind,0.006526667,0.006526667,0.006526667,0.006526667 +CO2 removal,dac,hightemp DAC NG,airCO2,1,1,1,1 +CO2 removal,dac,hightemp DAC NG,water_td_ind_C,0.017233333,0.017233333,0.017233333,0.017233333 +CO2 removal,dac,hightemp DAC NG,water_td_ind_W,0.017233333,0.017233333,0.017233333,0.017233333 +CO2 removal,dac,no DAC,process heat dac,0,0,0,0 +CO2 removal,dac,no DAC,elect_td_ind,0,0,0,0 +CO2 removal,dac,no DAC,airCO2,0,0,0,0 +process heat dac,gas CCS,gas CCS,wholesale gas,1,1,1,1 +CO2 removal,dac,hightemp DAC elec,elect_td_ind,0.0220044,0.0220044,0.0220044,0.0220044 +CO2 removal,dac,hightemp DAC elec,airCO2,1,1,1,1 +CO2 removal,dac,hightemp DAC elec,water_td_ind_C,0.017233333,0.017233333,0.017233333,0.017233333 +CO2 removal,dac,hightemp DAC elec,water_td_ind_W,0.017233333,0.017233333,0.017233333,0.017233333 +CO2 removal,dac,lowtemp DAC heatpump,elect_td_ind,0.0200684,0.0200684,0.0200684,0.0200684 +CO2 removal,dac,lowtemp DAC heatpump,airCO2,1,1,1,1 diff --git a/input/gcamdata/inst/extdata/energy/A62.globaltech_coef_ssp4.csv b/input/gcamdata/inst/extdata/energy/A62.globaltech_coef_ssp4.csv new file mode 100644 index 0000000000..e700052a0f --- /dev/null +++ b/input/gcamdata/inst/extdata/energy/A62.globaltech_coef_ssp4.csv @@ -0,0 +1,21 @@ +# File: A62.globaltech_coef_ssp4.csv +# Title: Default coefficients for DAC +# Units: airCO2 input is unitless (MtC from the atmosphere per Mt dac demand); all others are GJ per kg C (EJ of energy per Mt C) +# Column types: ccccnnnn +# ---------- +supplysector,subsector,technology,minicam.energy.input,1971,2020,2050,2100 +CO2 removal,dac,hightemp DAC NG,process heat dac,0.0297,0.0297,0.019433333,0.019433333 +CO2 removal,dac,hightemp DAC NG,elect_td_ind,0.006526667,0.006526667,0.004766667,0.004766667 +CO2 removal,dac,hightemp DAC NG,airCO2,1,1,1,1 +CO2 removal,dac,hightemp DAC NG,water_td_ind_C,0.017233333,0.017233333,0.017233333,0.017233333 +CO2 removal,dac,hightemp DAC NG,water_td_ind_W,0.017233333,0.017233333,0.017233333,0.017233333 +CO2 removal,dac,no DAC,process heat dac,0,0,0,0 +CO2 removal,dac,no DAC,elect_td_ind,0,0,0,0 +CO2 removal,dac,no DAC,airCO2,0,0,0,0 +process heat dac,gas CCS,gas CCS,wholesale gas,1,1,1,1 +CO2 removal,dac,hightemp DAC elec,elect_td_ind,0.0220044,0.0220044,0.0186384,0.0186384 +CO2 removal,dac,hightemp DAC elec,airCO2,1,1,1,1 +CO2 removal,dac,hightemp DAC elec,water_td_ind_C,0.017233333,0.017233333,0.017233333,0.017233333 +CO2 removal,dac,hightemp DAC elec,water_td_ind_W,0.017233333,0.017233333,0.017233333,0.017233333 +CO2 removal,dac,lowtemp DAC heatpump,elect_td_ind,0.0200684,0.0200684,0.009320178,0.009320178 +CO2 removal,dac,lowtemp DAC heatpump,airCO2,1,1,1,1 diff --git a/input/gcamdata/inst/extdata/energy/A62.globaltech_coef_ssp5.csv b/input/gcamdata/inst/extdata/energy/A62.globaltech_coef_ssp5.csv new file mode 100644 index 0000000000..7a6136c369 --- /dev/null +++ b/input/gcamdata/inst/extdata/energy/A62.globaltech_coef_ssp5.csv @@ -0,0 +1,21 @@ +# File: A62.globaltech_coef_ssp5.csv +# Title: Default coefficients for DAC +# Units: airCO2 input is unitless (MtC from the atmosphere per Mt dac demand); all others are GJ per kg C (EJ of energy per Mt C) +# Column types: ccccnnnn +# ---------- +supplysector,subsector,technology,minicam.energy.input,1971,2020,2050,2100 +CO2 removal,dac,hightemp DAC NG,process heat dac,0.0297,0.0297,0.019433333,0.019433333 +CO2 removal,dac,hightemp DAC NG,elect_td_ind,0.006526667,0.006526667,0.004766667,0.004766667 +CO2 removal,dac,hightemp DAC NG,airCO2,1,1,1,1 +CO2 removal,dac,hightemp DAC NG,water_td_ind_C,0.017233333,0.017233333,0.017233333,0.017233333 +CO2 removal,dac,hightemp DAC NG,water_td_ind_W,0.017233333,0.017233333,0.017233333,0.017233333 +CO2 removal,dac,no DAC,process heat dac,0,0,0,0 +CO2 removal,dac,no DAC,elect_td_ind,0,0,0,0 +CO2 removal,dac,no DAC,airCO2,0,0,0,0 +process heat dac,gas CCS,gas CCS,wholesale gas,1,1,1,1 +CO2 removal,dac,hightemp DAC elec,elect_td_ind,0.0220044,0.0220044,0.0186384,0.0186384 +CO2 removal,dac,hightemp DAC elec,airCO2,1,1,1,1 +CO2 removal,dac,hightemp DAC elec,water_td_ind_C,0.017233333,0.017233333,0.017233333,0.017233333 +CO2 removal,dac,hightemp DAC elec,water_td_ind_W,0.017233333,0.017233333,0.017233333,0.017233333 +CO2 removal,dac,lowtemp DAC heatpump,elect_td_ind,0.0200684,0.0200684,0.009320178,0.009320178 +CO2 removal,dac,lowtemp DAC heatpump,airCO2,1,1,1,1 diff --git a/input/gcamdata/inst/extdata/energy/A62.globaltech_cost_ssp1.csv b/input/gcamdata/inst/extdata/energy/A62.globaltech_cost_ssp1.csv new file mode 100644 index 0000000000..07b231981d --- /dev/null +++ b/input/gcamdata/inst/extdata/energy/A62.globaltech_cost_ssp1.csv @@ -0,0 +1,11 @@ +# File: A62.globaltech_cost_ssp1.csv +# Title: dac default costs +# Units: 1975$/kgC for dac, 1975$/GJ for process heat dac +# Column types: ccccnnnn +# ---------- +supplysector,subsector,technology,minicam.non.energy.input,1971,2020,2050,2100 +CO2 removal,dac,hightemp DAC NG,non-energy,0.297615642,0.297615642,0.178569385,0.178569385 +CO2 removal,dac,hightemp DAC elec,non-energy,0.381047227,0.381047227,0.184176464,0.184176464 +CO2 removal,dac,lowtemp DAC heatpump,non-energy,0.423419501,0.423419501,0.203535766,0.203535766 +CO2 removal,dac,no DAC,non-energy,0.001,0.001,0.001,0.001 +process heat dac,gas CCS,gas CCS,non-energy,0,0,0,0 diff --git a/input/gcamdata/inst/extdata/energy/A62.globaltech_cost_ssp2.csv b/input/gcamdata/inst/extdata/energy/A62.globaltech_cost_ssp2.csv new file mode 100644 index 0000000000..43114f8973 --- /dev/null +++ b/input/gcamdata/inst/extdata/energy/A62.globaltech_cost_ssp2.csv @@ -0,0 +1,11 @@ +# File: A62.globaltech_cost_ssp2.csv +# Title: dac default costs +# Units: 1975$/kgC for dac, 1975$/GJ for process heat dac +# Column types: ccccnnnn +# ---------- +supplysector,subsector,technology,minicam.non.energy.input,1971,2020,2050,2100 +CO2 removal,dac,hightemp DAC NG,non-energy,0.297615642,0.297615642,0.178569385,0.178569385 +CO2 removal,dac,hightemp DAC elec,non-energy,0.381047227,0.381047227,0.184176464,0.184176464 +CO2 removal,dac,lowtemp DAC heatpump,non-energy,0.423419501,0.423419501,0.203535766,0.203535766 +CO2 removal,dac,no DAC,non-energy,0.001,0.001,0.001,0.001 +process heat dac,gas CCS,gas CCS,non-energy,0,0,0,0 diff --git a/input/gcamdata/inst/extdata/energy/A62.globaltech_cost_ssp3.csv b/input/gcamdata/inst/extdata/energy/A62.globaltech_cost_ssp3.csv new file mode 100644 index 0000000000..16e44b667c --- /dev/null +++ b/input/gcamdata/inst/extdata/energy/A62.globaltech_cost_ssp3.csv @@ -0,0 +1,11 @@ +# File: A62.globaltech_cost_ssp3.csv +# Title: dac default costs +# Units: 1975$/kgC for dac, 1975$/GJ for process heat dac +# Column types: ccccnnnn +# ---------- +supplysector,subsector,technology,minicam.non.energy.input,1971,2020,2050,2100 +CO2 removal,dac,hightemp DAC NG,non-energy,0.297615642,0.297615642,0.297615642,0.297615642 +CO2 removal,dac,hightemp DAC elec,non-energy,0.381047227,0.381047227,0.381047227,0.381047227 +CO2 removal,dac,lowtemp DAC heatpump,non-energy,0.423419501,0.423419501,0.423419501,0.423419501 +CO2 removal,dac,no DAC,non-energy,0.001,0.001,0.001,0.001 +process heat dac,gas CCS,gas CCS,non-energy,0,0,0,0 diff --git a/input/gcamdata/inst/extdata/energy/A62.globaltech_cost_ssp4.csv b/input/gcamdata/inst/extdata/energy/A62.globaltech_cost_ssp4.csv new file mode 100644 index 0000000000..67f282b88f --- /dev/null +++ b/input/gcamdata/inst/extdata/energy/A62.globaltech_cost_ssp4.csv @@ -0,0 +1,11 @@ +# File: A62.globaltech_cost_ssp4.csv +# Title: dac default costs +# Units: 1975$/kgC for dac, 1975$/GJ for process heat dac +# Column types: ccccnnnn +# ---------- +supplysector,subsector,technology,minicam.non.energy.input,1971,2020,2050,2100 +CO2 removal,dac,hightemp DAC NG,non-energy,0.297615642,0.297615642,0.07742967,0.07742967 +CO2 removal,dac,hightemp DAC elec,non-energy,0.381047227,0.381047227,0.096028217,0.096028217 +CO2 removal,dac,lowtemp DAC heatpump,non-energy,0.423419501,0.423419501,0.1356294,0.1356294 +CO2 removal,dac,no DAC,non-energy,0.001,0.001,0.001,0.001 +process heat dac,gas CCS,gas CCS,non-energy,0,0,0,0 diff --git a/input/gcamdata/inst/extdata/energy/A62.globaltech_cost_ssp5.csv b/input/gcamdata/inst/extdata/energy/A62.globaltech_cost_ssp5.csv new file mode 100644 index 0000000000..712a3859bf --- /dev/null +++ b/input/gcamdata/inst/extdata/energy/A62.globaltech_cost_ssp5.csv @@ -0,0 +1,11 @@ +# File: A62.globaltech_cost_ssp5.csv +# Title: dac default costs +# Units: 1975$/kgC for dac, 1975$/GJ for process heat dac +# Column types: ccccnnnn +# ---------- +supplysector,subsector,technology,minicam.non.energy.input,1971,2020,2050,2100 +CO2 removal,dac,hightemp DAC NG,non-energy,0.297615642,0.297615642,0.07742967,0.07742967 +CO2 removal,dac,hightemp DAC elec,non-energy,0.381047227,0.381047227,0.096028217,0.096028217 +CO2 removal,dac,lowtemp DAC heatpump,non-energy,0.423419501,0.423419501,0.1356294,0.1356294 +CO2 removal,dac,no DAC,non-energy,0.001,0.001,0.001,0.001 +process heat dac,gas CCS,gas CCS,non-energy,0,0,0,0 diff --git a/input/gcamdata/inst/extdata/energy/A62.globaltech_retirement.csv b/input/gcamdata/inst/extdata/energy/A62.globaltech_retirement.csv new file mode 100644 index 0000000000..a8c8f941a8 --- /dev/null +++ b/input/gcamdata/inst/extdata/energy/A62.globaltech_retirement.csv @@ -0,0 +1,15 @@ +# File: A62.globaltech_retirement.csv +# Title: Primary energy transformation technology lifetimes and shutdown rates +# Units: Years for lifetime and half.life; Unitless for shutdown.rate; steepness; median.shutdown.point; profit.shutdown.steepness +# Comments: maximum lifetime of cohort. If no retirement function is used; the entire cohort is retired in this number of years. +# shutdown.rate: portion of cohort retired each year; used by the phased-shutdown-decider retirement function. +# half.life: number of years at which 50% of the cohort is retired; using the s-curve-shutdown-decider retirement function. +# steepness: shape parameter used by the s-curve-shutdown-decider retirement function. +# median.shutdown.point: profit-ratio at which 50% of the cohort is shut down for lack of profitability. +# profit.shutdown.steepness: shape parameter of profit-shutdown-decider function. +# Column types: ccccicinni +# ---------- +supplysector,subsector,technology,year,lifetime,shutdown.rate,half.life,steepness,median.shutdown.point,profit.shutdown.steepness +CO2 removal,dac,hightemp DAC NG,initial-future-year,80,,40,0.1,-0.1,6 +CO2 removal,dac,hightemp DAC elec,initial-future-year,80,,40,0.1,-0.1,6 +CO2 removal,dac,lowtemp DAC heatpump,initial-future-year,60,,30,0.1,-0.1,6 diff --git a/input/gcamdata/inst/extdata/energy/A62.globaltech_shrwt_ssp1.csv b/input/gcamdata/inst/extdata/energy/A62.globaltech_shrwt_ssp1.csv new file mode 100644 index 0000000000..4592b8479f --- /dev/null +++ b/input/gcamdata/inst/extdata/energy/A62.globaltech_shrwt_ssp1.csv @@ -0,0 +1,12 @@ +# File: A62.globaltech_shrwt_ssp1.csv +# Title: dac default shareweights +# Units: Unitless +# Column types: ccciiinn +# ---------- +supplysector,subsector,technology,1971,2019,2020,2050,2100 +CO2 removal,dac,hightemp DAC NG,0,0,0,0.375,1 +CO2 removal,dac,hightemp DAC elec,0,0,0,0.375,1 +CO2 removal,dac,lowtemp DAC heatpump,0,0,0,0.375,1 +CO2 removal,dac,no DAC,1,1,1,1,1 +process heat dac,gas CCS,gas CCS,1,1,1,1,1 +airCO2,airCO2,airCO2,1,1,1,1,1 diff --git a/input/gcamdata/inst/extdata/energy/A62.globaltech_shrwt_ssp2.csv b/input/gcamdata/inst/extdata/energy/A62.globaltech_shrwt_ssp2.csv new file mode 100644 index 0000000000..238f35c60f --- /dev/null +++ b/input/gcamdata/inst/extdata/energy/A62.globaltech_shrwt_ssp2.csv @@ -0,0 +1,12 @@ +# File: A62.globaltech_shrwt_ssp2.csv +# Title: dac default shareweights +# Units: Unitless +# Column types: ccciiiii +# ---------- +supplysector,subsector,technology,1971,2019,2020,2050,2100 +CO2 removal,dac,hightemp DAC NG,0,0,0,1,1 +CO2 removal,dac,hightemp DAC elec,0,0,0,1,1 +CO2 removal,dac,lowtemp DAC heatpump,0,0,0,1,1 +CO2 removal,dac,no DAC,1,1,1,1,1 +process heat dac,gas CCS,gas CCS,1,1,1,1,1 +airCO2,airCO2,airCO2,1,1,1,1,1 diff --git a/input/gcamdata/inst/extdata/energy/A62.globaltech_shrwt_ssp3.csv b/input/gcamdata/inst/extdata/energy/A62.globaltech_shrwt_ssp3.csv new file mode 100644 index 0000000000..70e9128345 --- /dev/null +++ b/input/gcamdata/inst/extdata/energy/A62.globaltech_shrwt_ssp3.csv @@ -0,0 +1,12 @@ +# File: A62.globaltech_shrwt_ssp3.csv +# Title: dac default shareweights +# Units: Unitless +# Column types: ccciiiii +# ---------- +supplysector,subsector,technology,1971,2019,2020,2050,2100 +CO2 removal,dac,hightemp DAC NG,0,0,0,1,1 +CO2 removal,dac,hightemp DAC elec,0,0,0,1,1 +CO2 removal,dac,lowtemp DAC heatpump,0,0,0,1,1 +CO2 removal,dac,no DAC,1,1,1,1,1 +process heat dac,gas CCS,gas CCS,1,1,1,1,1 +airCO2,airCO2,airCO2,1,1,1,1,1 diff --git a/input/gcamdata/inst/extdata/energy/A62.globaltech_shrwt_ssp4.csv b/input/gcamdata/inst/extdata/energy/A62.globaltech_shrwt_ssp4.csv new file mode 100644 index 0000000000..c721b986c0 --- /dev/null +++ b/input/gcamdata/inst/extdata/energy/A62.globaltech_shrwt_ssp4.csv @@ -0,0 +1,12 @@ +# File: A62.globaltech_shrwt_ssp4.csv +# Title: dac default shareweights +# Units: Unitless +# Column types: ccciiiii +# ---------- +supplysector,subsector,technology,1971,2019,2020,2050,2100 +CO2 removal,dac,hightemp DAC NG,0,0,0,1,1 +CO2 removal,dac,hightemp DAC elec,0,0,0,1,1 +CO2 removal,dac,lowtemp DAC heatpump,0,0,0,1,1 +CO2 removal,dac,no DAC,1,1,1,1,1 +process heat dac,gas CCS,gas CCS,1,1,1,1,1 +airCO2,airCO2,airCO2,1,1,1,1,1 diff --git a/input/gcamdata/inst/extdata/energy/A62.globaltech_shrwt_ssp5.csv b/input/gcamdata/inst/extdata/energy/A62.globaltech_shrwt_ssp5.csv new file mode 100644 index 0000000000..f10093631f --- /dev/null +++ b/input/gcamdata/inst/extdata/energy/A62.globaltech_shrwt_ssp5.csv @@ -0,0 +1,12 @@ +# File: A62.globaltech_shrwt_ssp5.csv +# Title: dac default shareweights +# Units: Unitless +# Column types: ccciiiii +# ---------- +supplysector,subsector,technology,1971,2019,2020,2050,2100 +CO2 removal,dac,hightemp DAC NG,0,0,0,1,1 +CO2 removal,dac,hightemp DAC elec,0,0,0,1,1 +CO2 removal,dac,lowtemp DAC heatpump,0,0,0,1,1 +CO2 removal,dac,no DAC,1,1,1,1,1 +process heat dac,gas CCS,gas CCS,1,1,1,1,1 +airCO2,airCO2,airCO2,1,1,1,1,1 diff --git a/input/gcamdata/inst/extdata/energy/A62.sector.csv b/input/gcamdata/inst/extdata/energy/A62.sector.csv new file mode 100644 index 0000000000..b718adb810 --- /dev/null +++ b/input/gcamdata/inst/extdata/energy/A62.sector.csv @@ -0,0 +1,9 @@ +# File: A62.sector.csv +# Title: dac default supplysector information (units and logit exponents) +# Units: Units-in-table +# Column types: ccccicc +# ---------- +supplysector,output.unit,input.unit,price.unit,logit.exponent,final.energy,logit.type +CO2 removal,Mt,EJ or Mt,1975$/kg,-3,industry, +process heat dac,EJ,EJ,1975$/GJ,-3,industry, +airCO2,Mt,EJ or Mt,1975$/kg,-3,industry, diff --git a/input/gcamdata/inst/extdata/energy/A62.subsector_interp.csv b/input/gcamdata/inst/extdata/energy/A62.subsector_interp.csv new file mode 100644 index 0000000000..1dd3461b46 --- /dev/null +++ b/input/gcamdata/inst/extdata/energy/A62.subsector_interp.csv @@ -0,0 +1,8 @@ +# File: A62.subsector_interp.csv +# Title: dac subsector shareweight interpolation +# Units: NA +# Column types: ccccccc +# ---------- +supplysector,subsector,apply.to,from.year,to.year,to.value,interpolation.function +CO2 removal,dac,share-weight,final-calibration-year,end-year,,fixed +process heat dac,gas CCS,share-weight,final-calibration-year,end-year,,fixed diff --git a/input/gcamdata/inst/extdata/energy/A62.subsector_logit.csv b/input/gcamdata/inst/extdata/energy/A62.subsector_logit.csv new file mode 100644 index 0000000000..61d9f1b2b5 --- /dev/null +++ b/input/gcamdata/inst/extdata/energy/A62.subsector_logit.csv @@ -0,0 +1,9 @@ +# File: A62.subsector_logit.csv +# Title: DAC default technology logit exponents +# Units: Unitless +# Column types: ccnc +# ---------- +supplysector,subsector,logit.exponent,logit.type +airCO2,airCO2,-6, +process heat dac,gas CCS,-6, +CO2 removal,dac,-0.036,absolute-cost-logit diff --git a/input/gcamdata/inst/extdata/energy/A62.subsector_shrwt.csv b/input/gcamdata/inst/extdata/energy/A62.subsector_shrwt.csv new file mode 100644 index 0000000000..86c837ee46 --- /dev/null +++ b/input/gcamdata/inst/extdata/energy/A62.subsector_shrwt.csv @@ -0,0 +1,9 @@ +# File: A62.subsector_shrwt.csv +# Title: dac default subsector shareweights +# Units: Unitless +# Column types: cccci +# ---------- +supplysector,subsector,year.fillout,year,share.weight +CO2 removal,dac,start-year,,1 +process heat dac,gas CCS,start-year,,1 +airCO2,airCO2,start-year,,1 diff --git a/input/gcamdata/inst/extdata/energy/calibrated_techs_cdr.csv b/input/gcamdata/inst/extdata/energy/calibrated_techs_cdr.csv new file mode 100644 index 0000000000..dd64bf92ba --- /dev/null +++ b/input/gcamdata/inst/extdata/energy/calibrated_techs_cdr.csv @@ -0,0 +1,9 @@ +# File: calibrated_techs_cdr.csv +# Title: For cdr technologies in the CO2 removal sector we separately define dummy calibration for cdr + noCDR +# Units: n/a +# Column types: cccccccc +# ---------- +sector,fuel,supplysector,subsector,technology,minicam.energy.input,calibration,secondary.output +CO2 removal,electricity,CO2 removal,dac,no DAC,elect_td_ind,output, +CO2 removal,heat,CO2 removal,dac,no DAC,process heat dac,output, +CO2 removal,airCO2,CO2 removal,dac,no DAC,airCO2,output,