Getting Started

The ReEDS model source code is available at no cost from the National Laboratory of the Rockies (NLR). The ReEDS model can be downloaded or cloned from https://github.com/NREL/ReEDS-2.0.

New users may also wish to start with some ReEDS training videos which are available on the NLR YouTube channel.

Installation Guide

Windows Command Line

The setup and execution of the ReEDS model can be accomplished using a command-line interpreter application and launching a command line interface (referred to as a “terminal window” in this documentation). For example, initiating the Windows Command Prompt application, i.e., cmd.exe, will launch a terminal window Fig. 1. (Note: If you encounter issues using command prompt, try using anaconda prompt or a git bash window)

_images/cmd-prompt.png

Fig. 1 Screenshot of a Windows Command Prompt terminal window

SUGGESTON: use a command line emulator such as ConEmu (https://conemu.github.io/) for a more user-friendly terminal. The screenshots of terminal windows shown in this document are taken using ConEmu.

IMPORTANT: Users should exercise Administrative Privileges when installing software. For example, right click on the installer executable for one of the required software (e.g., Anaconda3-2019.07-Windows-x86_64.exe) and click on “Run as administrator” (Fig. 2). Alternatively, right click on the executable for the command line interface (e.g., Command Prompt) and click on “Run as administrator” (Fig. 3). Then run the required software installer executables from the command line.

_images/run-as-admin.png

Fig. 2 Screenshot of running an installer executable using “Run as administrator”

_images/run-as-admin-2.png

Fig. 3 Screenshot of running “Command Prompt” with “Run as administrator”

Python Configuration

Windows

Install Anaconda: https://www.anaconda.com/download.

IMPORTANT : Be sure to download the Windows version of the installer.

Add Python to the “path” environment variable:

  1. In the Windows start menu, search for “environment variables” and click “Edit the system environment variables” (Fig. 4). This will open the “System Properties” window (Fig. 5).

_images/search-env-var.png

Fig. 4 Screenshot of a search for “environment variables” in the Windows start menu

_images/sys-prop-win.png

Fig. 5 Screenshot of the “System Properties” window.

  1. Click the “Environment Variables” button on the bottom right of the window (Fig. 5). This will open the “Environment Variables” window (Fig. 6).

_images/env-var-win.png

Fig. 6 Edit the Path environment variable

  1. Highlight the Path variable and click “Edit” (Fig. 6). This will open the “Edit environment variable” window (Fig. 7).

_images/edit-env-var-win.png

Fig. 7 Append the Path environment

  1. Click “New” (Fig. 7) and add the directory locations for \Anaconda\ and \Anaconda\Scripts to the environment path.

IMPORTANT : Test the Python installation from the command line by typing “python” (no quotes) in the terminal window. The Python program should initiate (Fig. 8).

_images/py-test.png

Fig. 8 Screenshot of a test of Python in the terminal window

MacOS

Download the latest version of Anaconda: https://www.anaconda.com/download

IMPORTANT: Make sure to download the Intel version even if your machine has an Apple Silicon / ARM processor.

_images/anaconda-intel.png

During Installation, select to install Anaconda for your machine only.

_images/anaconda-install-mac.png

Fig. 9 Image of Anaconda Install Mac

To have the installer automatically add anaconda to PATH, ensure that you’ve selected the box to “Add conda initialization to the shell”

_images/anaconda-custom-install-mac.png

Fig. 10 Image of Anaconda Install Mac - Customize Installation Type

To validate Python was installed properly execute the following command from a new terminal (without quotes): “python”

Python should initiate, looking similar to Fig. 8.

Conda Environment Setup

It is highly recommended to run ReEDS using the conda environment provided in the repository. This environment (named reeds2) is specified by the environment.yml and can be built with the following command - make sure you navigate to the ReEDS repository from terminal first:

conda env create -f environment.yml

You can verify that the environment was successfully created using the following (you should see reeds2 in the list):

conda env list

When creating the reeds2 environment locally, you might run into an SSL error that looks like: CondaSSLError: Encountered an SSL error. Most likely a certificate verification issue. To resolve this issue, run the following command before creating the environment again: conda config --set ssl_verify false.

GAMS Configuration

NLR uses GAMS versions 51.3.0 and 49.6.0; however, older versions might also work. A valid GAMS license must be installed.

  1. Install GAMS: https://www.gams.com/download/ If installing on Mac: on the “Installation” page, click “customize” and ensure the box to “Add GAMS to PATH” is checked.

    _images/gams-install-mac.png

    Fig. 11 Image of GAMS Install Mac

  2. Add GAMS to the PATH environment variable. This step can be skipped if you’re on Mac and added GAMS to the path in step 1.

    1. Follow the same instructions for adding Python to the path in the Python Configuration section above. Append the environment path with the directory location for the gams.exec application (e.g., C:\GAMS\win64\34).

  3. Test the GAMS installation from the command line by typing gams. The GAMS program should initiate (Fig. 12).

_images/gams-test.png

Fig. 12 Screenshot of a test of GAMS from the terminal window

Repository Setup

The ReEDS source code is hosted on GitHub: https://github.com/NREL/ReEDS-2.0

  1. Install Git Large File Storage, instructions can be found here: Installing Git Large File Storage

  2. From the Git command line run the following command to enable large file storage.

git lfs install
  1. Clone the ReEDS-2.0 repository on your desktop. Alternatively, download a ZIP from GitHub (Fig. 13).

_images/github-download.png

Fig. 13 Screenshot of GitHub links to clone the ReEDS repository or download ZIP of the ReEDS files

ReEDS2PRAS, Julia, and Stress Periods Setup

Julia will need to be installed and set up to successfully run the model since ReEDS uses stress periods by default. To get Julia and stress periods set up:

  1. Install Julia

    1. [max/linux]: Julia is included in the conda environment so no additional installation is needed

    2. [windows]: install Julia from https://julialang.org/downloads/

  2. Navigate to the ReEDS-2.0 directory from the command line, then run julia --project=. instantiate.jl

Troubleshooting Issues with Julia Setup

When setting up julia on Windows, you may run into some issues when running julia --project=. instantiate.jl. The following steps can be followed to help resolve issues and get julia set up sucessfully:

  1. Manually install Random123

  2. Re-run julia --project=. instantiate.jl

If that doesn’t resolve the issue, the following may help:

  1. If you previously installed julia, uninstall it: winget uninstall julia

  2. Manually install Julia 1.8.5

  3. Add the julia bin path to your environment PATH variable

  4. Install MinGW

  5. Open the julia interactive command line: julia

  6. Enter the julia package manager by pressing ], then run the following commands:

    • add Random123

    • registry add https://github.com/JuliaRegistries/General.git

    • registry add https://github.com/NREL/JuliaRegistires.git

    • instantiate

  7. Leave the package manager by pressing backspace or Ctrl+C

  8. Run the following commands to finish setup:

    • import PRAS

    • import TimeZones

    • TimeZones.build()

  9. You can then leave the julia command line by typing exit()

If you’re experiencing issues on Mac, a possible solution is:

  1. Update the version of julia

  2. Create the ‘reeds2’ conda environment with the environment.yml file

  3. Run julia from the terminal to open the interactive command line

  4. Run import Pkg; Pkg.add("PRAS")

  5. Run Pkg.add("TimeZones")

  6. Exit julia with the command exit(), then run julia instantiate.jl

  7. Manually move the Manifest.toml file from the julia environment (~/miniconda3/envs/reeds2/share/julia/environments/reeds2/Manifest.toml) to the ReEDS repo

Running ReEDS

Quick Start:

  1. Navigate to the ReEDS directory from the command line

  2. Activate environment: conda activate reeds2

  3. Run the model: python runbatch.py

  4. Follow the prompts for batch configuration

  5. Check for a successful run:

    1. Look for CSV files in runs/[batchname_scenario]/outputs (a successful run should have 100+ csv files in the outputs folder)

    2. Verify the reporting folders (“reeds-report”, “reeds-report-reduced”) exist in the outputs folder

Understanding cases.csv

Switches are set in the cases.csv file and need to be specified by the user. The default case configuration is called “cases.csv”.

General structure:

  • Column A: Model switches

  • Column B: Switch descriptions

  • Column C: Available choices (note: this is not available for all switches)

  • Column D: Default values

  • Column E: Your case configuration

Note: all monetary switches should be entered in 2004 dollars.

_images/cases-csv.png

Fig. 14 Screenshot of cases.csv

Additional cases_*.csv files:

  • cases_standardscenarios.csv: contains all scenarios used for Standard Scenarios

  • cases_test.csv: contains a group of “test” scenarios that are used to test various capabilities

The user may also create custom case configuration files by using the suffix in the file name (e.g., “cases_smalltests.csv”). It should follow the same column formatting as cases.csv, but does not need to include all available switches.

County Resolution Data

For non-NLR users, some additional data is required to run the ReEDS model at the ‘county’ spatial resolution. This is currently considered a special case and some data was required to be kept outside the ReEDS repository because the data is simply too large. The hourly renewable capacity factor data is now available to all at: https://data.openei.org/submissions/5986.

If you would like to run the model at county resolution, download the files available from the link provided, unzip each folder, and place the files obtained into inputs/variability/multi-year in your locally cloned ReEDS repository. The input_processing scripts have also been updated to check for these files for any county-level runs. The ‘cases_spatialflex.csv’ file provides examples of specific switch settings to run ReEDS at county-level.

Additional Resources

NLR has a YouTube channel that contains tutorial videos for ReEDS. The following are recommended videos for getting started with ReEDS:

If you’d like practice with running a specific ReEDS scenario, you can walk through the ReEDS Training Homework.

Additional resources and learning:

NLR Specific Setup

See the Internal ReEDS Documentation. Information on Yampa and HPC setup can be found there.