Directory Summary
This directory provides the scripts which construct intermediate data and the SAGE model input file. Actual filenames may have an additional suffix related to the rulemaking, usually specified in the main script.
Contents
Directory Structure
├───scripts
│ 00_main.R
│ 01_capacity_shares.R
│ 02_compiling_ipm_output_data.R
│ 03_making_capital_charge_rate_table.R
│ 04_aggregating_ipm_output.R
│ 05_map_ipm_years_to_sage.R
│ 06_create_real_resource_table_inputs.R
The core build process is governed by the main control script, 00_main.R, which calls the other scripts to perform specific tasks in the build process.
Back to Contents
Construct Capacity Shares by Prime Mover and Fuel Type
- 01_capacity_shares.R
| File Name |
Sheet Name |
Directory |
NEEDS <IPM case name>.xlsx |
"NEEDS_active" |
build/data/<RIA Name>/other_input_data |
NEEDS <IPM case name>.xlsx |
"NEEDS_hardwiredCapMW" |
build/data/<RIA Name>/other_input_data |
Outputs
| File Name |
Format |
Directory |
constituent_units |
csv/rds |
intermediates/<RIA name> |
region_capshare_by_pm |
csv/rds |
intermediates/<RIA name> |
region_capshare_by_ft |
csv/rds |
intermediates/<RIA name> |
Back to Contents
Clean and Compile IPM Output Costs
- 02_compiling_ipm_output_data.R
Get fuel expense
| File Name |
Sheet Name |
Directory |
<baseline> FuelSupply |
"Coal Consumed_1" |
build/data/<RIA Name>/baseline |
<policy> FuelSupply |
Coal Consumed_1 |
build/data/<RIA Name>/policy |
<baseline> FuelSupply |
"Pet. Coke Consumed_1" |
build/data/<RIA Name>/baseline |
<policy> FuelSupply |
"Pet. Coke Consumed_1" |
build/data/<RIA Name>/policy |
<baseline> FuelSupply |
"Waste Coal Consumed_1" |
build/data/<RIA Name>/baseline |
<policy> FuelSupply |
"Waste Coal Consumed_1" |
build/data/<RIA Name>/policy |
<baseline> FuelSupply |
"NaturalGas Consumed_1" |
build/data/<RIA Name>/baseline |
<policy> FuelSupply |
"NaturalGas Consumed_1" |
build/data/<RIA Name>/policy |
<baseline> FuelSupply |
"Oil Consumed_1" |
build/data/<RIA Name>/baseline |
<policy> FuelSupply |
"Oil Consumed_1" |
build/data/<RIA Name>/policy |
Outputs
| File Name |
Format |
Directory |
coal_demand_regions |
csv/rds |
intermediates/<RIA name> |
aggplant_coal |
csv/rds |
intermediates/<RIA name> |
aggplant_oil |
csv/rds |
intermediates/<RIA name> |
Back to Contents
Get total annual costs
| File Name |
Sheet Name |
Directory |
<baseline> Cost_TotalAnnual |
"CN_AB", ..., "WECC_WY" |
build/data/<RIA Name>/baseline |
<policy> Cost_TotalAnnual |
"CN_AB", ..., "WECC_WY" |
build/data/<RIA Name>/policy |
Outputs
| File Name |
Format |
Directory |
b_costs |
csv/rds |
intermediates/<RIA name> |
p_costs |
csv/rds |
intermediates/<RIA name> |
aggplant_costs |
csv/rds |
intermediates/<RIA name> |
Back to Contents
Get transmission costs
| File Name |
Sheet Name |
Directory |
<baseline> DAT File |
"TransmissionProperties" |
build/data/<RIA Name>/baseline |
<baseline> TransmissionSummary |
"CapacityBuilt" |
build/data/<RIA Name>/baseline |
<policy> TransmissionSummary |
"CapacityBuilt" |
build/data/<RIA Name>/policy |
Outputs
| File Name |
Format |
Directory |
trans_cost_parameters |
csv/rds |
intermediates/<RIA name> |
b_trans_newcapacity |
csv/rds |
intermediates/<RIA name> |
p_trans_newcapacity |
csv/rds |
intermediates/<RIA name> |
trans_newcapacity |
csv/rds |
intermediates/<RIA name> |
Back to Contents
Get regional summary costs
| File Name |
Sheet Name |
Directory |
<baseline> RegionalSummary |
"CN_AB", ..., "WECC_WY" |
build/data/<RIA Name>/baseline |
<policy> RegionalSummary |
"CN_AB", ..., "WECC_WY" |
build/data/<RIA Name>/policy |
Outputs
| File Name |
Format |
Directory |
bregional_costs |
csv/rds |
intermediates/<RIA name> |
pregional_costs |
csv/rds |
intermediates/<RIA name> |
regional_costs |
csv/rds |
intermediates/<RIA name> |
Back to Contents
Construct Capital Charge Rates
- 03_making_capital_charge_rate_table.R
Get generation unit data
| File Name |
Sheet Name |
Directory |
<baseline> DAT File |
"UnitInfo" |
build/data/<RIA Name>/baseline |
<baseline> DAT File |
"RunUniverse" |
build/data/<RIA Name>/baseline |
<baseline> DAT File |
"CapitalChargeRate" |
build/data/<RIA Name>/baseline |
<policy> DAT File |
"UnitInfo" |
build/data/<RIA Name>/policy |
<policy> DAT File |
"RunUniverse" |
build/data/<RIA Name>/policy |
<policy> DAT File |
"CapitalChargeRate" |
build/data/<RIA Name>/policy |
Outputs
| File Name |
Format |
Directory |
dat_unitinfo_enhanced_b |
csv/rds |
intermediates/<RIA name> |
tempb |
csv/rds |
intermediates/<RIA name> |
dat_unitinfo_enhanced_p |
csv/rds |
intermediates/<RIA name> |
tempp |
csv/rds |
intermediates/<RIA name> |
Create aggregate plant cost with model unit data
| File Name |
Sheet Name |
Directory |
aggplant_costs.xlsx |
N/A |
intermediates/<RIA name>/csv |
Outputs
| File Name |
Format |
Directory |
ccr |
csv/rds |
intermediates/<RIA name> |
Back to Contents
Aggregate IPM Output Costs to SAGE Regions
- 04_aggregating_ipm_output.R
Calculate plant total costs by type
| File Name |
Sheet Name |
Directory |
aggplant_costs.xlsx |
N/A |
intermediates/<RIA name>/csv |
Outputs
| File Name |
Format |
Directory |
aggplant_costs_prep |
csv/rds |
intermediates/<RIA name> |
plant_type_temp |
csv/rds |
intermediates/<RIA name> |
Back to Contents
Distribute costs to SAGE regions
| File Name |
Sheet Name |
Directory |
region_capshare_by_pm.xlsx |
N/A |
intermediates/<RIA name>/csv |
Outputs
| File Name |
Format |
Directory |
aggplant_cost |
csv/rds |
intermediates/<RIA name> |
Back to Contents
Calculate total overnight capital costs
| File Name |
Sheet Name |
Directory |
ccr.xlsx |
N/A |
intermediates/<RIA name>/csv |
Outputs
| File Name |
Format |
Directory |
aggplant_costs_pm |
csv/rds |
intermediates/<RIA name> |
Back to Contents
Calculate gas use at coal units
| File Name |
Sheet Name |
Directory |
plant_type_temp.xlsx |
N/A |
intermediates/<RIA name>/csv |
aggplant_coal.xlsx |
N/A |
intermediates/<RIA name>/csv |
Outputs
| File Name |
Format |
Directory |
fuel_type_temp |
csv/rds |
intermediates/<RIA name> |
Back to Contents
Allocate non-fossil and natural gas fuel costs to sage regions
| File Name |
Sheet Name |
Directory |
region_capshare_by_ft.xlsx |
N/A |
intermediates/<RIA name>/csv |
Outputs
| File Name |
Format |
Directory |
aggplant_costs_ft |
csv/rds |
intermediates/<RIA name> |
Back to Contents
Combine different costs
| File Name |
Sheet Name |
Directory |
aggplant_costs_pm.xlsx |
N/A |
intermediates/<RIA name>/csv |
aggplant_coal.xlsx |
N/A |
intermediates/<RIA name>/csv |
aggplant_oil.xlsx |
N/A |
intermediates/<RIA name>/csv |
trans_newcapacity |
N/A |
intermediates/<RIA name>/csv |
region_capshare_by_pm.xlsx |
N/A |
intermediates/<RIA name>/csv |
Outputs
| File Name |
Format |
Directory |
aggplant_costs_manip |
csv/rds |
intermediates/<RIA name> |
coal_costs |
csv/rds |
intermediates/<RIA name> |
oil_costs |
csv/rds |
intermediates/<RIA name> |
transmission_cost |
csv/rds |
intermediates/<RIA name> |
Back to Contents
Aggregate costs by SAGE region
| File Name |
Sheet Name |
Directory |
Table 1_Real.xlsx |
N/A |
build/ipm/<RIA Name>/other_input_data |
aggplant_costs_manip.xlsx |
N/A |
intermediates/<RIA name>/csv |
transmission_cost.xlsx |
N/A |
intermediates/<RIA name>/csv |
Tax Credits and EOR.xlsx |
N/A |
build/ipm/<RIA Name>/other_input_data |
Outputs
| File Name |
Format |
Directory |
transport_shares |
csv/rds |
intermediates/<RIA name> |
temp_subs_next |
csv/rds |
intermediates/<RIA name> |
costs_by_sage_region |
csv/rds |
intermediates/<RIA name> |
ipm_input_for_sage |
csv/rds |
intermediates/<RIA name> |
Back to Contents
Map IPM Model Years to SAGE Model Years
- 05_map_ipm_years_to_sage.R
| File Name |
Sheet Name |
Directory |
ipm_input_for_sage.csv |
csv/rds |
intermediates/<RIA name> |
Outputs
| File Name |
Format |
Directory |
ipm_input_for_sage_mapped.csv |
csv |
output/<RIA name> |
Back to Contents
- 06_create_real_resource_table_inputs.R
| File Name |
Sheet Name |
Directory |
costs_by_sage_region.csv |
csv/rds |
intermediates/<RIA name> |
Outputs
| File Name |
Format |
Directory |
real_resource_table_inputs.csv |
csv |
output/<RIA name> |
Back to Contents