Build

The buildstream process and all of the notation included in the SLiDE documentation here is meant to replicate the WiNDC buildstream. For more information, please reference:

  • Thomas F. Rutherford and Andrew Schreiber, "Tools for Open Source, Subnational CGE Modeling with an Illustrative Analysis of Carbon Leakage," J Global Econ Anal 4(2): 1-66.

Input

Build stream preferences can be specified using the SLiDE.Dataset input type.

  • name::String: dataset identifier. Data produced by the build stream will be saved in the directory data/<name>. If no name is specified, state_model will be used.

The following options can be specified using keyword arguments.

  • overwrite::Bool. Would you like to overwrite the existing dataset with this name? If set to true, the existing directory will be renamed.
  • eem::Bool. Would you like to build the Energy-Environment Module? By default, this is set to false.

Examples

Build model data, using the default name and all default options:

d, set = build()

Build model data, using the default name but enabling the Energy-Environment Module.

d, set = build( ; eem=true)

Build model data, naming the dataset slug_trails and using all default options:

d, set = build("slug_trails")

Build model data, naming the dataset slug_trails and overwriting the previous slug_trails dataset:

d, set = build("slug_trails"; overwrite=true)

Process

The buildstream is executed using the build function.

SLiDE.buildFunction
build(dataset::Dataset)

This function executes the SLiDE buildstream and generates the parameters necessary to run the model. If the dataset has already been generated and saved, the function will read and return those values. Otherwise, it will generate these parameters by executing:

  1. SLiDE.build_io
  2. SLiDE.build_eem – if dataset.eem=true
source
SLiDE.build_ioFunction
build_io(dataset::Dataset)

If the dataset has already been generated and saved, the function will read and return those values.

Otherwise, it will read input data from the /SLIDE_DIR/data/input/ directory and execute the four steps of the SLiDE buildstream via the following functions:

  1. SLiDE.partition_bea
  2. SLiDE.calibrate_national
  3. SLiDE.share_region
  4. SLiDE.disaggregate_region

Arguments

  • dataset::Dataset identifier

Returns

  • d::Dict of model parameters
  • set::Dict of Arrays describing parameter indices (years, regions, goods, sectors, etc.)
source
SLiDE.build_eemFunction
build_eem(dataset::Dataset)

If dataset.eem=true, continue the SLiDE buildstream for the Energy-Environment Module. If the dataset has already been generated and saved, the function will read and return those values.

Otherwise, it will execute the build routine via the following functions:

  1. SLiDE.scale_sector
  2. SLiDE.partition_seds
  3. SLiDE.disaggregate_energy!
  4. SLiDE.partition_co2!
  5. SLiDE.calibrate_regional

Arguments

  • dataset::Dataset identifier

Returns

  • d::Dict of model parameters
  • set::Dict of Arrays describing parameter indices (years, regions, goods, sectors, etc.)
source