Variables as Arrays

Variables in ENERGY 2020 are stored as multi-dimensional arrays whose dimensions are sets. The variables are defined and stored on an HDF5 database (named database.hdf5). As an example, the variable, TotDemand[Fuel,ECC,Area,Year], is a multi-dimensional array having 4 sets - fuels, economic categories, areas, and years. 

Variables Defined on HDF5 Database

The Julia code that defines and creates the model variables on the HDF5 database is stored in the \Database folder. The variables are organized on the HDF5 database based on the file names that create the variable.

An example of Julia code (extracted from CCalDB.jl) that creates a commercial variable, CERSM[Enduse,EC,Area,Year], on the HDF5 database is shown in Example 1 below. 

The HDF5 database (referenced in the code above as "db") will store a 4-dimensional array named CERSM defined by the 4 sets - Enduse, EC, Area, and Year - on a partition, named CCalDB.

Example 1:  Creating a Variable, CERSM, on HDF5 Database (from CCalDB.jl):

CERSM = CreateVariableInHDF5(db, "CCalDB/CERSM", (:Enduse, :EC, :Area, :Year),

        "Capital Energy Requirement Multiplier (Btu/Btu)","Btu/Btu")


Another example of Julia code (extracted from SOutput.jl) that creates a model summary variable, TotDemand[Fuel, ECC,Area,Year], on the the HDF5 database is shown in Example 2 below. This variable is stored on partition within the database, named, SOutput.

Example 2:  Creating a Variable, TotDemand, on HDF5 Database (from SOutput.jl):

TotDemand = CreateVariableInHDF5(db,"SOutput/TotDemand", (:Fuel, :ECC, :Area, :Year),

"Energy Demand (TBtu/Yr)","TBtu/Yr")

       

Julia script files that create all the model variables are stored in the \Database folder and are listed in the table below.

Julia FileName

Database Partition

Category of Model Variables Created by File

CCalDB.jl

CCalDB

Commercial demand calibration variables

CInput.jl

CInput

Commercial demand input variables and commercial set descriptors and keys

COutput.jl

COutput

Commercial demand output variables

ECalDB.jl

ECalDB

Electric price calibration variables

EGCalDB.jl

EGCalDB

Electric generating unit dispatch calibration variables

EGInput.jl

EGInput

Electric generating unit input variables

EGOutput.jl

EGOutput

Electric generating unit output variables

EInput.jl

EInput

Electricity module input variables

EOutput.jl

EOutput

Electricity module output variables

ICalDB.jl

ICalDB

Industrial demand calibration variables

IInput.jl

IInput

Industrial demand input variables, sets, descriptors and keys

IOutput.jl

IOutput

Industrial demand output variables

KInput.jl

KInput

Macroeconomic input variables from the Oxford Model (TOM)

KOutput.jl

KOutput

Macroeconomic output variables from the Oxford Model (TOM)

MainDB.jl

MainDB

Global sets, set descriptors and set keys

MCalDB.jl

MCalDB

Economic sector calibration variable/economic growth rate

MEInput.jl

MEInput

Emissions-related input variables

MEOutput.jl

MEOutput

Emissions-related output variables

MInput.jl

MInput

Macroeconomic input variables

MOutput.jl

MOutput

Macroeconomic output variables

RCalDB.jl

RCalDB

Residential demand calibration variables

RInput.jl

RInput

Residential demand input variables, set descriptors and keys

ROutput.jl

ROutput

Residential demand output variables

SCalDB.jl

SCalDB

Summary module calibration variables

SInput.jl

SInput

Summary module input variables

SOutput.jl

SOutput

Summary module output variables

SpInput.jl

SpInput

Supply module input variables

SpOutput.jl

SpOutput

Supply module output variables

TCalDB.jl

TCalDB

Transportation demand calibration variables

TInput.jl

TInput

Transportation demand input variables, set descriptors and keys

TOutput.jl

TOutput

Transportation demand output variables

VBInput.jl

VBInput

Input variables read in through the DAT input data files

vData_ElectricUnits.jl

vData_ElectricUnits

Electric unit input variables read in through the DAT input data files