inSTREAM & inSALMO: Recent (2012-2020) Versions


Until February 2021, this was the main inSTREAM and inSALMO page. It provides the last versions of these models that ran on the Swarm software platform. These versions are now superceded by inSTREAM 7 and related versions that use the NetLogo platform.

inSTREAM 6.1

InSTREAM 6.1 is a specialized version developed for studies of how within-day flow fluctuations affect trout populations. Its development was sponsored by Argonne National Laboratory and the Western Area Power Administration. This version is particularly complex and challenging to apply; if you are interested in it, please contact us. The model is fully described in this 2014 report.

The current version: inSTREAM 5

This page provides release notes and downloads for the individual-based stream trout research and environmental assessment model. As of February, 2012, the current release of inSTREAM is version 5.0.

All copies of inSTREAM available here are configured for a single trout species, cutthroat. Instructions for adding and changing species are in the software and graphical user interface documentation (below).

Potential users interested in assistance or training are encouraged to contact Steve Railsback (see the "Who we are" page on this site).

***NOTE: Versions of inSTREAM 5.0 before the current 28 August 2014 release had a software error that could strongly affect results of simulations using rectangular cells in straight transects (as discussed below at "Converting site input from version 4"). This error could cause cells not to recognize some adjacent cells as neighboring, thereby restricting movement of small trout. Versions of inSTREAM 5.0 before the the 31 July 2014 release also had an error in the aquatic predation survival code: previous releases of inSTREAM 5.0 assumed zero piscivorous fish density. Neither of these errors affect versions of inSTREAM before 5.0.***

Differences from previous versions of inSTREAM

Version 5.0 of inSTREAM uses the same methods for modeling fish (behavior, physiology, etc.) as version 4.2, but has these differences from previous versions.

  • Habitat cells are n-dimensional polygons, allowing a fully two-dimensional representation of space.
  • Habitat input--cell coordinates, hydraulics (depths and velocities as a function of flow), and habitat variables (hiding and feeding cover; spawning gravel)--uses general file formats that can be generated via Geographic Information Systems. Hence, hydraulics can be simulated with any two-dimensional (or pseudo-two- dimensional, including PHABSIM/RHABSIM) hydraulic model. (Notes on converting RHABSIM input are below; however, RHABSIM users may find it easier to use inSTREAM 4.2 than to transform hydraulic simulation files for use in 5.0.)
  • Multiple stream reaches that are fully two-dimensional can be simulated. Reaches can be linked in any way: in series from upstream to downstream, as a tributary network, in parallel as delta channels or channels around islands, etc.
  • Its Windows version is packaged in a new graphical user interface (GUI) that eliminates the need to install Swarm. The GUI is described below.
  • Input files can be in comma-separated value (CSV) format so they are easier to build and maintain in spreadsheet and statistical software.
  • Output files are in CSV format, and the main outputs are in a new format that makes them easier to analyyze using Excel's "PivotTables", the "DataPilot" tool in Open Office (or Libre Office) Calc, or statistical software.
  • Documentation of the model and software is available as indexed, searchable help files.
  • Optional, detailed output files can be turned on and off very easily, whereas they previously required editing and re-compiling the model code.
  • Memory management has been improved so much longer model runs are possible.
  • Execution speed has been improved, for example by using a "KD Tree" data structure to reduce the computations for model fish to identify nearby habitat cells.


The primary citation for inSTREAM remains: “InSTREAM: the individual-based stream trout research and environmental assessment model”, Railsback, S. F., B. C. Harvey, S. K. Jackson, and R. H. Lamberson. General Technical Report PSW-GTR-218, U. S. Department of Agriculture Forest Service, Pacific Southwest Research Station, Albany, California. 2009. 254 pages. This document can be downloaded here.

Fully updated documentation of inSTREAM version 5.0 and its software is included as help files in the GUI, and provided here in PDF format.

Several large Excel files documenting our tests of the model software are available upon request.

The inSTREAM 5.0 Graphical User Interface (GUI) for Windows

Previous versions of inSTREAM required Windows users to install Cygwin (a Unix-like terminal window) and the Swarm simulation system, compile inSTREAM from source code, and run inSTREAM from inside Cygwin. Now, version 5.0 can be installed within a GUI: a stand-alone Windows program that is easy to install and use, and contains many tools for using inSTREAM. The GUI has these characteristics:

  • Installation requires only un-zipping a file and creating a desktop icon (below).
  • It should work under any version of Windows (but not non-Windows operating systems).
  • It provides menus and editing windows for setting up new "projects" (sets of input files for specific sites and simulation experiments).
  • Simulation experiments (replicate runs, parameter sweeps, factorial experiments for calibration, scenario comparisons, etc.) are easily set up via a menu-driven tool.
  • Results of model runs and simulation experiments can automatically be imported to an Excel file that contains preliminary analyses.
  • It includes a built-in "Limiting Factors Tool" that automates sensitivity analyses to determine which potential management actions (e.g., changing flow, temperature, spawning gravel, hiding cover) are likely to benefit fish populations.
  • Documentation is included as separate help files for the model description, GUI, the inSTREAM software, and the Limiting Factors Tool.
  • Parameter values and setup variables are easily reviewed and edited.
  • It catches many errors in model setup and parameter values and shows the user where to fix them; and provides warnings when parameter values are outside normal ranges.
  • Model runs can be started, with or without graphical displays, and halted, by simply clicking on buttons.
  • Experienced users can revise and re-compile the inSTREAM code used by the GUI.

The GUI itself is a Java program and requires Java to be installed (as it typically is on Windows computers). The GUI version will work only on Windows machines because it contains a Windows executable of the model. The GUI software has a separate version number from inSTREAM; the current release of the GUI is v. 1.1.

Instructions and download for installing inSTREAM 5.0 in Windows

The inSTREAM software and graphical user interface are packaged for Windows users as a ZIP archive file. To install the model and interface:

  1. Download the inSTREAM zip file. Store it anyplace.
  2. Unzip the inSTREAM zip file into a convenient directory where you have permission to write files. This will create a new subdirectory tree called inSTREAM. For example, the zip file can be extracted to your My Documents directory.
  3. Using the Windows Explorer, navigate to the \inSTREAM_1-1\GUI subdirectory. If you extracted the zip file to My Documents, this directory will be My Documents\inSTREAM_1-1\GUI.
  4. In the \inSTREAM_1-1\GUI directory, right-click on the file inSTREAM_GUI.exe. Select "Create a shortcut", which will create a new shortcut file with the inSTREAM icon: inSTREAM icon.
  5. Drag the new shortcut file to your desktop. Click on it to start the graphical interface.

Download inSTREAM 5.0 for Windows here. (Zip archive file; 25 megabytes; last updated 28 August 2014.)

Modifying the inSTREAM code used by the GUI

It is quite likely that users will need to make small modifications to the inSTREAM code used within the GUI, for example to simulate more or different species, change the age classes used to report output, or customize output files. To do so, simply follow the instructions below for using inSTREAM in Windows without the GUI, with one change. Instead of downloading a separate copy of the inSTREAM code, just edit the code used by the GUI; it is at: \inSTREAM_x\Code\inSTREAM. Then, after installing MinGW and Swarm, open the MinGW terminal window, navigate to that directory, and recompile the code.

inSTREAM 5.0 Software Without GUI for Windows, Linux, and MacIntosh

We also distribute inSTREAM 5.0 in the way all previous versions were distributed: as a TAR archive of code and example input files that can be compiled in a variety of operating systems. inSTREAM should compile with the gcc 3.x and 4.x compilers, and the MinGW compiler (explained more below). Note that running inSTREAM in this way requires installation of Version 2.2 or later of the Swarm simulation platform. Swarm is available for Windows, MacIntosh, and Linux/Unix operating systems; see for information, directions, and downloads for installing Swarm.

Using inSTREAM in Windows without the GUI

Windows users who are experienced with older versions of inSTREAM, or experienced software developers, may simply prefer running the model code without the GUI. (However, we strongly recommend trying the GUI.)

The inSTREAM code should compile in the Cygwin version of Swarm--which was the only Windows version of Swarm until 2011--and its gcc 3.3.3 compiler. Instructions for installing and using inSTREAM with Cygwin are in our 2009 Forest Service report.

However, we strongly recommend instead using the MinGW release of Swarm for Windows. MinGW is a newer compiler that has important advantages: it is easier and more reliable to install (the Swarm-specific version of Cygwin often fails to install in newer versions of Windows), it creates Windows executables that can be run without having to start up Cygwin, and its executables execute a little faster than Cygwin's.

If you want to revise and recompile the code used by the Windows GUI, you must install and use the MinGW version of Swarm.

(Due to deep conflicts between Swarm and the 64-bit version of MinGW, it is very unlikely that a 64-bit Windows version of inSTREAM will ever exist.)

To use inSTREAM in Windows outside the GUI, via MinGW:

  1. Install MinGW and Swarm using the instructions here. Make sure you set the Swarmhome environment variable on your computer.
  2. Download this TAR-Gzip archive of inSTREAM 5.0 for MinGW: inSTREAM_5-0_2014-08-28.tgz. This archive uses Windows file formats.
  3. Un-archive, compile, and run inSTREAM, using the instructions here. Use the inSTREAM archive you downloaded instead of the swarmapps-2.3.0.tar.gz code file used in the example.
  4. Note that compiling the model produces an executable file instream.exe that is in a (possibly hidden) subdirectory named ".libs". The file instream.exe that the compiler produces in the code directory is not the real executable.
  5. The executable instream.exe can be copied or moved from the .libs directory to any directory of input files. It can be executed by clicking on it in Windows Explorer.
  6. To run inSTREAM in "batch" mode (without the graphical output displays), open either a Windows command window or the MinGW terminal window. Navigate to the directory containing instream.exe and the input files. Issue the command instream.exe -b

Using inSTREAM in Linux

There is one important reason for running inSTREAM in Linux: its code is readily compiled and run in 64-bit mode, on 64-bit computers using 64-bit Linux and the 64-bit version of the gcc compiler. Our experience has been that inSTREAM will execute approximately 30-50% faster in 64-bit mode.

The drawback is that using inSTREAM in Linux requires installing Swarm (and the several other software libraries that Swarm depends on). Experienced Linux users may have little problem, even if they have to compile Swarm and its dependencies from source. (For help, see the Swarm web site and these notes on building Swarm in MinGW, which are relevant.) There are also packaged distributions of Swarm for some versions of Linux; new Linux users should probably try one of them. See this site concerning binary distributions for Linux..

Use this archive of inSTREAM 5.0 for Linux: inSTREAM_5-0-Linux_2014-08-28.tgz. It uses Unix file formats.

(Please note that mixing Linux and Windows file formats is a very common source of frustrating problems with inSTREAM. Failing to convert input files to Unix format will cause inSTREAM to crash: perhaps with an error statement but perhaps with only a “Segmentation fault” error.)

Converting site input from version 4 of inSTREAM

Version 4.2 and some other previous versions of inSTREAM used a pseudo-two-dimensional representation of habitat: rectangular cells lay on "transects" perpendicular to the current, with velocity always in one direction. The RHABSIM one-dimensional hydraulic modeling software was used to generate the hydraulic input files.

Study sites developed for version 4.2 can be adapted to version 5.0 of inSTREAM relatively easily using these steps:

  1. Use this Excel workbook and the version 4.2 cell data file to create a v. 5.0 cell geometry file. Instructions are in the workbook.
  2. Create a v. 5.0 cell data file from the v. 4.2 cell data file. This is simply a matter of deleting some columns; see the software guides for the two versions.
  3. Edit the v. 4.2 inSTREAM code to (a) write the "DEPTH_VEL_RPT" optional output file (un-comment the line //#define DEPTH_VEL_RPT in the file HabitatManager.h), and (b) write this output for all cells, even when dry (find the method depthVelReport in the file Cell.m and change the statement if(depth != 0) to if(1)).
  4. Using this modified version of inSTREAM 4.2, simulate a sequence of days in which flow steps up over each of the flows in the hydraulic input files, which were generated by RHABSIM. This will create a DEPTH_VEL_RPT output file with the depth and velocity of each cell at each of those flows.
  5. Use this second Excel workbook to process the DEPTH_VEL_RPT into a v. 5.0 hydraulic input file. Instructions are in the workbook.


Version 5.0 of inSTREAM was designed by Steve Railsback and Bret Harvey. Its software was developed by Steve Jackson and Colin Sheppard.

The inSTREAM GUI was designed by Steve Railsback and Colin Sheppard, and programmed by Colin Sheppard.

Charles Sharpsteen (Environmental Resource Engineering, Cal Poly Humboldt) developed the MinGW version of Swarm that made Windows versions of inSTREAM possible.

Version 5.0 of inSTREAM and its GUI were developed under projects funded by the US Forest Service and the US Bureau of Reclamation's Central Valley Project Improvement Act.