Skip to content

Commit d330871

Browse files
committed
Pull request JGCRI#262: Pw/feature/hydrogen det ind
Merge in JGCRI/gcam-core from pw/feature/hydrogen_det_ind to master Squashed commit of the following: commit bf1f88b Merge: 4fd8bbb 631cf61 Author: Pralit Patel <[email protected]> Date: Fri Jun 3 18:02:10 2022 -0400 Merge remote-tracking branch 'origin/master' into pw/feature/hydrogen_det_ind commit 4fd8bbb Author: fuhr472 <[email protected]> Date: Wed Jun 1 11:11:23 2022 -0400 Clarify comments per reviewer requests, mostly by moving down summary comments from the top of the code block, down to the lines where they are actually applied commit 30abc96 Author: Page Kyle <[email protected]> Date: Wed Jun 1 00:49:38 2022 -0600 improve code commenting and delete unnecessary (commented out) rows, as per pull request review comments commit 2860a2d Author: Page Kyle <[email protected]> Date: Tue May 31 20:40:08 2022 -0600 silence R package checks of un-binded variable names in gcamdata/R code commit 2d6a852 Author: Page Kyle <[email protected]> Date: Tue May 31 15:22:40 2022 -0600 drop international aviation BEV technology terminal share-weight to 0.1 (speculative technology, was becoming dominant in 2.6 scenarios) commit 3b4ff65 Author: Page Kyle <[email protected]> Date: Tue May 31 14:22:36 2022 -0600 clean up comments and re-build documentation (no changes to XML files from this commit) commit ef95138 Author: Page Kyle <[email protected]> Date: Fri May 27 18:10:38 2022 -0600 remove EMF-37 hydrogen T&D infrastructure XML files that were not intended to be on this branch re-build GCAM_DATA_MAP after recent revisions commit 2b2f04a Author: Page Kyle <[email protected]> Date: Fri May 27 15:19:20 2022 -0600 remove EMF37 policy and transport R code files that were unintentionally migrated from sha/projects/gcam-policy branch commit 45a2e9f Author: Page Kyle <[email protected]> Date: Fri May 27 11:34:54 2022 -0600 revise A25.globaltech_coef to specify that the electricity input to NGSR is for compression and refrigeration (this energy requirement had been getting dropped, supplanted with the electricity requirements of NGSR production only) commit b0f6475 Author: Page Kyle <[email protected]> Date: Wed May 11 13:50:40 2022 -0600 reduce coefficient of hydrogen liquefaction from 9.2 kwh/kg in 2025 to 8 kwh/kg in 2040 and 7 kwh/kg in 2060 based on email exchange with Amgad Elgowainy 5/11/2022 commit a69bc10 Author: Page Kyle <[email protected]> Date: Wed May 11 13:38:57 2022 -0600 revise representation of renewable electrolysis to assign a ratio of electrolyzer:renewable capacity that is less than 1 commit a583e96 Author: Patrick O'Rourke <[email protected]> Date: Sat May 7 14:34:56 2022 -0400 Update green hydrogen minicam.non.energy.input name - Change from "non-energy" to "electrolyzer" commit 38d9b20 Author: Page Kyle <[email protected]> Date: Fri May 6 15:25:46 2022 -0600 remove A25.stubtech_cost and replace with calculations performed in zchunk_L225.hydrogen and zchunk_LA125.hydrogen commit dd11833 Author: Patrick O'Rourke <[email protected]> Date: Tue May 3 16:56:14 2022 -0400 Regionalize Green H2 - Add regional wind and solar assumptions, with electrolzer separated from wind turbines or solar panels - Set global green H2 to USA regional values commit 9b047c9 Author: Page Kyle <[email protected]> Date: Mon May 2 10:10:40 2022 -0600 move airCO2 PrimaryFuelCO2Coef from Ccoef.xml to the dac_*.xml files. Avoids warning message in model run about not being able to find the airCO2 market when DAC is not read in commit 4ea40c4 Author: Page Kyle <[email protected]> Date: Sun May 1 23:18:58 2022 -0600 revise emission_factor_controls.xml to only delete gdp-control functions from technologies that have them this avoids error messages XML parsing commit 78282a5 Author: Page Kyle <[email protected]> Date: Wed Apr 27 23:15:25 2022 -0600 modify zchunk_L253.emission_controls.R to avoid trying to assign emissions factors to district heat in Taiwan (which is not modeled) commit 9a9cd06 Author: Page Kyle <[email protected]> Date: Wed Apr 27 17:43:18 2022 -0600 revise "industrial energy use" to "other industrial energy use" in A53.em_ctrl_param_china_industry.csv commit 081d0a8 Merge: f0ea4a0 952b050 Author: Page Kyle <[email protected]> Date: Wed Apr 27 12:41:18 2022 -0600 Merge branch 'master' into pw/feature/hydrogen_det_ind NOT YET TESTED Resolve all conflicts Rebuild package data Use master version of util/testing-framework commit f0ea4a0 Merge: 0b368f7 ae27b64 Author: Page Kyle <[email protected]> Date: Tue Apr 26 15:36:57 2022 -0600 Merge branch 'pw/feature/hydrogen_det_ind' into pw/feature/hydrogen_usa ... and 158 more commits
1 parent 631cf61 commit d330871

File tree

146 files changed

+8194
-10120
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

146 files changed

+8194
-10120
lines changed

input/gcamdata/R/constants.R

+17-1
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ CONV_TONNE_GJ_RFO <- 40.87 # tons to GJ residual fuel oil
135135
# Time
136136
CONV_YEAR_HOURS <- 24 * 365.25
137137
CONV_DAYS_YEAR <- 1 / 365.25
138+
CONV_DAY_HOURS <- 24
138139

139140
# Energy
140141
CONV_MWH_GJ <- 3.6 # Megawatt hours to Gigajoules
@@ -150,6 +151,8 @@ CONV_KBTU_EJ <- 1.0551e-12 # KiloBTU to EJ
150151
CONV_TBTU_EJ <- 0.0010551 # TeraBTU to EJ
151152
CONV_MJ_BTU <- 947.777
152153
CONV_BTU_KJ <- 1.0551
154+
CONV_MMBTU_KGH2 <- 0.113939965425114 # MMBTU/kg H2 - LHV Source: H2 CCTP Workbook.xls (Used for older GCAM assumptions)
155+
CONV_GJ_KGH2 <- 0.12021 #GJ/kg H2 - LHV
153156

154157
# Distance
155158
CONV_MILE_KM <- 1.60934 # Mile to km
@@ -164,6 +167,7 @@ CONV_HA_M2 <- 1e4 # ha to m2
164167
CONV_BM2_M2 <- 1e9
165168
CONV_MILFT2_M2 <- 92900 # Million square feet to square meters
166169
CONV_FT2_M2 <- 0.0929 # Square feet to square meters
170+
CONV_GAL_M3 <- 0.00378541 #gallons to m3
167171
CONV_MI_KM <- 1.60934
168172
CONV_PERS_MILPERS <- 1000000 #Person to million-passengers
169173

@@ -496,10 +500,13 @@ energy.PV_LIFETIME <- 30 # years
496500
energy.PV_RESID_INSTALLED_COST <- 9500 # 2005USD per kw
497501
energy.PV_RESID_OM <- 100 # 2005USD per kw per year
498502
energy.CSP_STORAGE_CF_DIFF <- 0.25 # capacity factor difference between CSP_storage (0.5) and CSP (0.25)
503+
energy.SOLAR_ELECTROLYSIS_KGH2_D <- 50000 # kg of h2 produced per day at a solar-electrolysis plant
504+
energy.ELECTROLYZER_RENEWABLE_CAPACITY_RATIO <- 0.618 # unitless capacity ratio of electrolyzers to renewable-electric equipment
499505

500506
# Wind related constants
501507
energy.WIND_CURVE_MIDPOINT <- 0.5
502508
energy.WIND_MIN_POTENTIAL <- 0.001
509+
energy.WIND_ELECTROLYSIS_KGH2_D <- 50000 # kg of h2 produced per day at a wind-electrolysis plant
503510

504511
# Digits for rounding into XMLs
505512
energy.DIGITS_CALOUTPUT <- 7
@@ -527,6 +534,11 @@ energy.DIGITS_SHRWT <- 4
527534
energy.DIGITS_SPEED <- 1
528535
energy.DIGITS_TECHCHANGE <- 4
529536

537+
#jf 2021-10-21
538+
#defines fraction of liquid fuel consumption used for off-road vehicles in agriculture, mining, and construction energy use.
539+
#the remainder is allocated to stationary equipment (e.g., generators)
540+
energy.LIQUID_FUEL_MOBILE_FRAC <- 0.8
541+
530542
# Policy assumptions for module_energy_L270.limits
531543
energy.NEG_EMISS_POLICY_NAME <- "negative_emiss_budget"
532544
energy.NEG_EMISS_TARGET_GAS <- "CO2_LTG" # the name of the gas to target in the negative emiss budget
@@ -565,7 +577,7 @@ income.param.usa<-0.4875
565577

566578
# Constants for global detailed industry
567579
energy.OFF_ROAD.BIOMASS_GROWTH <- c("Africa_Eastern","Africa_Southern","Africa_Western") #limit fast growth of biomass in agriculture energy use
568-
energy.IRON_STEEL.DEFAULT_COEF <- c("Biomass-based","scrap","H2 enduse") #assign iron & steel global technology coefficients
580+
energy.IRON_STEEL.DEFAULT_COEF <- c("Biomass-based","scrap","H2 wholesale delivery") #assign iron & steel global technology coefficients
569581

570582
# Socioeconomics constants ======================================================================
571583

@@ -852,6 +864,10 @@ gcamusa.GEOTHERMAL_DEFAULT_EFFICIENCY <- 0.1
852864

853865
gcamusa.ELECT_TD_SECTORS <- c("elect_td_bld", "elect_td_ind", "elect_td_trn")
854866

867+
#Fuels whose markets will be represented with state-specific prices
868+
gcamusa.STATE_FUEL_MARKETS <- c(gcamusa.ELECT_TD_SECTORS, "H2 industrial", "H2 retail delivery", "H2 retail dispensing",
869+
"H2 wholesale delivery", "H2 wholesale dispensing","H2 central production","H2 pipeline","H2 liquid truck")
870+
855871
# Indicate whether to use regional ?cost adders? to differentiate
856872
# fuel prices by grid region in GCAM-USA (FALSE = same prices in all states)
857873
gcamusa.USE_REGIONAL_FUEL_MARKETS <- TRUE

input/gcamdata/R/sysdata.rda

47 Bytes
Binary file not shown.

input/gcamdata/R/zchunk_L101.water_supply_groundwater.R

+2-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ module_water_L101.water_supply_groundwater <- function(command, ...) {
3939
lower_cost <- upper_cost <-
4040
grade <- elec_EJ <- elec_coef <- Superwell_country <-
4141
GCAM_region_ID <- minNEcost <- available <-
42-
minNEcost_bilUSD <- maxNEcost_bilUSD <- maxNEcost <- NULL
42+
minNEcost_bilUSD <- maxNEcost_bilUSD <- maxNEcost <-
43+
lower <- upper <- range_mult <- NULL
4344

4445
all_data <- list(...)[[1]]
4546

input/gcamdata/R/zchunk_L112.ceds_ghg_en_R_S_T_Y.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ module_emissions_L112.ceds_ghg_en_R_S_T_Y <- function(command, ...) {
103103
emiss_share <- prod_share <- total_prod <- crop_area_share <- prod_share_GLU <- GLU <- Prod_R_C <- crop_area_total <- scalar <- EPA_emissions <-
104104
CEDS_emissions <- epa_emissions <- ch4_em_factor <- production <- feed <- GCAM_commodity <- input.emissions <- EPA_agg_fuel_ghg <- EPA_agg_sector <-
105105
EDGAR_agg_sector <- globalemfact <- emfact <- value <- em_fact <- . <- FF_driver <- natural_gas <- UCD_category <- Non.co2 <-
106-
quantile <- upper <- GCAM_subsector <- value_median <- NULL
106+
quantile <- upper <- GCAM_subsector <- value_median <- share_in_global_ship <- main.fuel <- CEDS_agg_fuel_remapped <- NULL
107107

108108

109109
#Get CEDS_GFED data

input/gcamdata/R/zchunk_L201.en_nonco2.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ module_emissions_L201.en_nonco2 <- function(command, ...) {
5757
input.emissions <- `2000` <- emiss.coef <- ctrl.name <- max_reduction <- variable <-
5858
steepness <- SO2 <- NOx <- CO <- BC <- OC <- NMVOC <- resource <- has_district_heat <-
5959
. <- region <- supplysector <- max.reduction <- technology <- minicam.energy.input <-
60-
tranSubsector <- tranTechnology <- input.name <- efficiency <- NULL # silence package check notes
60+
tranSubsector <- tranTechnology <- input.name <- efficiency <- fuel <- subsector_orig <- NULL # silence package check notes
6161

6262
# Load required inputs
6363
GCAM_region_names <- get_data(all_data, "common/GCAM_region_names")

input/gcamdata/R/zchunk_L212.unmgd_nonco2.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ module_emissions_L212.unmgd_nonco2 <- function(command, ...) {
6262
# Silencing package checks
6363
GCAM_region_ID <- region <- AgSupplySubsector <- GLU <- itemName <- AgSupplySector <-
6464
UnmanagedLandTechnology <- year <- value <- Non.CO2 <- em_factor <- technology <-
65-
emiss.coef <- input.emissions <- input.name <- NULL
65+
emiss.coef <- input.emissions <- input.name <- Land_Type <- prot_frac <- NULL
6666

6767
all_data <- list(...)[[1]]
6868

input/gcamdata/R/zchunk_L222.en_transformation_USA.R

+3-3
Original file line numberDiff line numberDiff line change
@@ -350,9 +350,9 @@ module_gcamusa_L222.en_transformation_USA <- function(command, ...) {
350350
grid_region, market.name)) %>%
351351
select(-grid_region) -> L222.StubTechMarket_en_USA
352352

353-
# Finish L222.StubTechMarket_en_USA by Setting electricity to the state markets
353+
# Finish L222.StubTechMarket_en_USA by assigning state fuel markets
354354
L222.StubTechMarket_en_USA %>%
355-
filter(minicam.energy.input %in% gcamusa.ELECT_TD_SECTORS) %>%
355+
filter(minicam.energy.input %in% gcamusa.STATE_FUEL_MARKETS) %>%
356356
mutate(market.name = region) ->
357357
tmp
358358

@@ -364,7 +364,7 @@ module_gcamusa_L222.en_transformation_USA <- function(command, ...) {
364364
L222.StubTech_en_USA_key
365365

366366
L222.StubTechMarket_en_USA %>%
367-
filter(!(minicam.energy.input %in% gcamusa.ELECT_TD_SECTORS)) %>%
367+
filter(!(minicam.energy.input %in% gcamusa.STATE_FUEL_MARKETS)) %>%
368368
bind_rows(tmp) %>%
369369
select(one_of(LEVEL2_DATA_NAMES[["StubTechMarket"]])) %>%
370370
unite(key, supplysector, subsector, stub.technology, sep = "~") %>%

input/gcamdata/R/zchunk_L2231.nonewcoal_USA.R

+5-13
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ module_gcamusa_L2231.nonewcoal_USA <- function(command, ...) {
2323
FILE = "gcam-usa/A23.elecS_tech_availability",
2424
FILE = "gcam-usa/A23.elecS_tech_mapping_cool",
2525
"L222.StubTechMarket_en_USA",
26-
"L222.StubTech_en",
27-
"L225.StubTech_h2"))
26+
"L222.StubTech_en"))
2827
} else if(command == driver.DECLARE_OUTPUTS) {
2928
return(c("L2231.SubsectorShrwt_nonewcoal_elecS_cool_USA",
3029
"L2231.StubTechShrwt_nonewcoal_nongen_USA",
@@ -40,7 +39,6 @@ module_gcamusa_L2231.nonewcoal_USA <- function(command, ...) {
4039
# Load required inputs
4140
L222.StubTechMarket_en_USA <- get_data(all_data, "L222.StubTechMarket_en_USA")
4241
L222.StubTech_en <- get_data(all_data, "L222.StubTech_en")
43-
L225.StubTech_h2 <- get_data(all_data, "L225.StubTech_h2")
4442
A23.elecS_tech_mapping <- get_data(all_data, "gcam-usa/A23.elecS_tech_mapping", strip_attributes = TRUE)
4543
A23.elecS_tech_availability <- get_data(all_data, "gcam-usa/A23.elecS_tech_availability")
4644
A23.elecS_tech_mapping_cool <- get_data(all_data, "gcam-usa/A23.elecS_tech_mapping_cool")
@@ -71,8 +69,6 @@ module_gcamusa_L2231.nonewcoal_USA <- function(command, ...) {
7169

7270
L222.StubTech_en %>%
7371
filter(region == gcam.USA_REGION, subsector == "coal gasification", !grepl("CCS",stub.technology)) %>%
74-
bind_rows(L225.StubTech_h2 %>%
75-
filter(region == gcam.USA_REGION, subsector == "coal", !grepl("CCS",stub.technology))) %>%
7672
repeat_add_columns(tibble(year = MODEL_FUTURE_YEARS)) %>%
7773
mutate(share.weight = 0) %>%
7874
select(LEVEL2_DATA_NAMES[["StubTechYr"]], share.weight) ->
@@ -121,8 +117,7 @@ module_gcamusa_L2231.nonewcoal_USA <- function(command, ...) {
121117
"gcam-usa/A23.elecS_tech_availability",
122118
"gcam-usa/A23.elecS_tech_mapping_cool",
123119
"L222.StubTechMarket_en_USA",
124-
"L222.StubTech_en",
125-
"L225.StubTech_h2") ->
120+
"L222.StubTech_en") ->
126121
L2231.SubsectorShrwt_nonewcoal_elecS_cool_USA
127122

128123
L2231.StubTechShrwt_nonewcoal_nongen_USA %>%
@@ -133,8 +128,7 @@ module_gcamusa_L2231.nonewcoal_USA <- function(command, ...) {
133128
add_precursors("gcam-usa/A23.elecS_tech_mapping",
134129
"gcam-usa/A23.elecS_tech_availability",
135130
"L222.StubTechMarket_en_USA",
136-
"L222.StubTech_en",
137-
"L225.StubTech_h2") ->
131+
"L222.StubTech_en") ->
138132
L2231.StubTechShrwt_nonewcoal_nongen_USA
139133

140134
L2231.SubsectorShrwt_coal_delay_elecS_cool_USA %>%
@@ -147,8 +141,7 @@ module_gcamusa_L2231.nonewcoal_USA <- function(command, ...) {
147141
"gcam-usa/A23.elecS_tech_availability",
148142
"gcam-usa/A23.elecS_tech_mapping_cool",
149143
"L222.StubTechMarket_en_USA",
150-
"L222.StubTech_en",
151-
"L225.StubTech_h2") ->
144+
"L222.StubTech_en") ->
152145
L2231.SubsectorShrwt_coal_delay_elecS_cool_USA
153146

154147
L2231.StubTechShrwt_coal_delay_nongen_USA %>%
@@ -160,8 +153,7 @@ module_gcamusa_L2231.nonewcoal_USA <- function(command, ...) {
160153
"gcam-usa/A23.elecS_tech_availability",
161154
"gcam-usa/A23.elecS_tech_mapping_cool",
162155
"L222.StubTechMarket_en_USA",
163-
"L222.StubTech_en",
164-
"L225.StubTech_h2") ->
156+
"L222.StubTech_en") ->
165157
L2231.StubTechShrwt_coal_delay_nongen_USA
166158

167159
L2231.SubsectorShrwt_coal_delay_elecS_cool_USA

input/gcamdata/R/zchunk_L2236.elecS_ghg_emissions_USA.R

+3-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ module_gcamusa_L2236.elecS_ghg_emissions_USA <- function(command, ...) {
5252
calOutputValue <- emiss.coeff <- fuel <- fuel_input <- fuel_input_USA <-
5353
fuel_input_share <- input.emissions <- palette <- region <- segment_share <-
5454
state <- stub.technology <- subsector <- subsector_1 <- supplysector <-
55-
tech_calOuput <- tech_fuel_input <- technology <- value <- year <- NULL
55+
tech_calOuput <- tech_fuel_input <- technology <- value <- year <-
56+
to.technology <- plant_type <- cooling_system <- water_type <-
57+
to.technology <- supplysector.y <- supplysector.x <- subsector0 <- NULL
5658

5759

5860

0 commit comments

Comments
 (0)