Skip to content

Commit

Permalink
add USEEIOv2.3 model specs
Browse files Browse the repository at this point in the history
  • Loading branch information
bl-young committed Aug 1, 2024
1 parent 2181b12 commit 556ec51
Show file tree
Hide file tree
Showing 4 changed files with 141 additions and 54 deletions.
66 changes: 66 additions & 0 deletions inst/extdata/modelspecs/USEEIOv2.3-GHG.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
Model: "USEEIOv2.3-GHG" # 2017 Detail, Commodity
BaseIOSchema: 2017
BaseIOLevel: "Detail"
IOYear: 2017 # Year for IO data
ModelRegionAcronyms: ["US"]
ModelType: "EEIO"
IODataSource: "BEA"
BasePriceType: "PRO" #producer
BasewithRedefinitions: FALSE
CommodityorIndustryType: "Commodity"
ScrapIncluded: FALSE
DisaggregationSpecs: null
ExternalImportFactors: TRUE

SatelliteTable:
GHG:
FullName: "Greenhouse Gases"
Abbreviation: "GHG"
StaticSource: TRUE
StaticFile: "flowsa/FlowBySector/GHG_national_2019_m2_v2.0.3_1cb504c.parquet"
FileLocation: "DataCommons"
DataYears: [2019]
Locations: ["US"]
SectorListSource: "NAICS"
SectorListYear: 2017
SectorListLevel: "6"
OriginalFlowSource: "FEDEFLv1.2"
ScriptFunctionCall: "getFlowbySectorCollapsed" #function to call for script
ScriptFunctionParameters: null
DataSources:
USEPA_GHG_2024:
Title: "GHG Inventory"
Author: "USEPA"
DataYear: 2022
URL: "https://www.epa.gov/ghgemissions/inventory-us-greenhouse-gas-emissions-and-sinks-1990-2022"
Primary: TRUE

Indicators:
GreenhouseGases:
Name: "Greenhouse Gases"
Code: "GHG"
Group: "Impact Potential"
Unit: "kg CO2 eq"
SimpleUnit: "Kilograms Carbon Dioxide (CO2)"
SimpleName: "Greenhouse Gases"
StaticSource: TRUE
StaticFile: "lciafmt/ipcc/IPCC_v1.1.1_27ba917.parquet"
FileLocation: "DataCommons"
ScriptFunctionCall: "getImpactMethod" #function to call for script
ScriptFunctionParameters:
indicators: ["AR6-100"]
DataSources:
IPCC_AR6:
Title: "IPCC Sixth Assessment Report: Direct Global Warming Potentials for 100 year time horizon"
Author: "IPCC"
DataYear: 2021
URL: ""
Primary: TRUE

DemandVectors:
DefaultDemand: "DefaultDemandVectors" # Name of default demand vectors yml file
# Additional demand vectors beyond useeior defaults

ImportFactors:
StaticFile: "useeior/US_detail_import_factors_exio_2019_17sch.csv"
FileLocation: "DataCommons"
66 changes: 66 additions & 0 deletions inst/extdata/modelspecs/USEEIOv2.3-s-GHG-19.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
Model: "USEEIOv2.3-s-GHG-19"
BaseIOSchema: 2017
BaseIOLevel: "Summary"
IOYear: 2019 # Year for IO data
ModelRegionAcronyms: ["US"]
ModelType: "EEIO"
IODataSource: "BEA"
BasePriceType: "PRO" #producer
BasewithRedefinitions: FALSE
CommodityorIndustryType: "Commodity"
ScrapIncluded: FALSE
DisaggregationSpecs: null
ExternalImportFactors: TRUE

SatelliteTable:
GHG:
FullName: "Greenhouse Gases"
Abbreviation: "GHG"
StaticSource: TRUE
StaticFile: "flowsa/FlowBySector/GHG_national_2019_m1_v2.0.3_1cb504c.parquet"
FileLocation: "DataCommons"
DataYears: [2019]
Locations: ["US"]
SectorListSource: "NAICS"
SectorListYear: 2017
SectorListLevel: "6"
OriginalFlowSource: "FEDEFLv1.2"
ScriptFunctionCall: "getFlowbySectorCollapsed" #function to call for script
ScriptFunctionParameters: null
DataSources:
USEPA_GHG_2024:
Title: "GHG Inventory"
Author: "USEPA"
DataYear: 2022
URL: "https://www.epa.gov/ghgemissions/inventory-us-greenhouse-gas-emissions-and-sinks-1990-2022"
Primary: TRUE

Indicators:
GreenhouseGases:
Name: "Greenhouse Gases"
Code: "GHG"
Group: "Impact Potential"
Unit: "kg CO2 eq"
SimpleUnit: "Kilograms Carbon Dioxide (CO2)"
SimpleName: "Greenhouse Gases"
StaticSource: TRUE
StaticFile: "lciafmt/ipcc/IPCC_v1.1.1_27ba917.parquet"
FileLocation: "DataCommons"
ScriptFunctionCall: "getImpactMethod" #function to call for script
ScriptFunctionParameters:
indicators: ["AR6-100"]
DataSources:
IPCC_AR6:
Title: "IPCC Sixth Assessment Report: Direct Global Warming Potentials for 100 year time horizon"
Author: "IPCC"
DataYear: 2021
URL: ""
Primary: TRUE

DemandVectors:
DefaultDemand: "DefaultDemandVectors" # Name of default demand vectors yml file
# Additional demand vectors beyond useeior defaults

ImportFactors:
StaticFile: "useeior/US_summary_import_factors_exio_2019_17sch.csv"
FileLocation: "DataCommons"
40 changes: 0 additions & 40 deletions tests/import_factors_summary_2019.csv

This file was deleted.

23 changes: 9 additions & 14 deletions tests/test_model_build.R
Original file line number Diff line number Diff line change
Expand Up @@ -90,20 +90,15 @@ cfg <- c(paste0("modelspecs/", m, ".yml"))
model <- buildModel(m, configpaths = file.path(cfg))
printValidationResults(model)

## USEEIOv2.0 Summary, commodity model with GHGs and Import Factors
cfg <- c(paste0("modelspecs/", m, ".yml"),
"import_factors_summary_2019.csv"
)
model <- useeior:::initializeModel(m, configpaths = file.path(cfg))
model$specs$Model <- "USEEIOv2.0-s-GHG-19-IF"
model$specs$ExternalImportFactors <- TRUE
model$specs$ImportFactors <- list()
model$specs$ImportFactors$StaticFile <- "import_factors_summary_2019.csv"
model <- useeior:::loadIOData(model, file.path(cfg))
model <- useeior:::loadandbuildSatelliteTables(model)
model <- useeior:::loadandbuildIndicators(model)
model <- useeior:::loadDemandVectors(model)
model <- useeior:::constructEEIOMatrices(model, file.path(cfg))
## USEEIOv2.3 Detail, commodity model with GHGs and Import Factors
m <- "USEEIOv2.3-GHG"
model <- buildModel(m)
printValidationResults(model)
writeModeltoXLSX(model, ".")

## USEEIOv2.3 Summary, commodity model with GHGs and Import Factors
m <- "USEEIOv2.3-s-GHG-19"
model <- buildModel(m)
printValidationResults(model)

## USEEIOv2.0 Summary, industry model
Expand Down

0 comments on commit 556ec51

Please sign in to comment.