To include a script in the computing sequence of a forecast in HEC-RTS, you must complete the following steps:

  1. Create a Scripting Program
  2. Assign a Model Key to the Script
  3. Add the Script to the Program Order
  4. Create a Forecast Run Using the Script

This guide walks you through creating a scripting program in your watershed.

Prerequisites

Before you begin, make sure you’ve already created your script and saved it in the <watershed name>\scripts directory. 

Be sure to follow the instructions in this guide to define the required function in your script, ensuring it triggers the next program in the sequence after a it runs successfully. 

Step 1: Create a Scripting Program

To create a scripting program: 

  1. Launch HEC-RTS and open your watershed.
  2. Navigate to the Setup tab.
  3. From the Watershed Tree right-click on Scripting.
  4. Select New from the context menu. The Create New Scripting Program dialog will appear.
  5. Enter a name for your script in the Name field.
  6. Optionally, provide a description in the Description field.
  7. Click OKThe Scripting Program dialog will open. 
  8. In the Jython Script field, click the ellipsis (…) button.
  9. In the file browser that opens, navigate to your .py script file, select it, and click Open. The file's pathname will appear in the Jython Script field.
  10. Click Apply, then OK to save and close the dialog.

Step 2: Assign a Model Key to the New Script Program

Learn how to assign a model key to your scripting program here.

Once the key is assigned, the Scripting Program and its associated key will appear in the Watershed Tree, similar to the example shown below.

Step 3: Add Scripting to the Program Order

Learn how to add the scripting program to a custom program order here.

After completing this step, your custom Program Order will include the scripting program, as demonstrated in the example below.

Step 4: Create a New Forecast Run

Learn how to set up a forecast run using your custom program order here.

Once complete, your Forecast Run will reflect the inclusion of the scripting program, as shown in the example below.

Final Review

After completing all steps, create a new forecast using the newly configured forecast run. Verify that the forecast computes successfully without any errors.

If issues arise during computation, revisit the previous steps to check for configuration errors and make any necessary adjustments. Repeat the process as needed until the forecast runs correctly.