Skip to content

Introduction to Input/Output Files

This part of the CE-QUAL-W2 User Manual describes all model input and output files. Each file's format, required variables, and usage context are documented in the chapters that follow. Input and output files use either fixed-format text or comma-separated value (CSV) text. Output files are typically comma-delimited, with the exception of a few fixed-format output text files.

Input Files Overview

CE-QUAL-W2 requires several categories of input files to define the model domain, boundary conditions, and simulation options. Figure 1 provides a schematic overview of the input file structure.

Overview of input files required for CE-QUAL-W2
Figure 1. Overview of the input files required for CE-QUAL-W2.

Required Files

The following files are required for every CE-QUAL-W2 simulation:

  • Main control file: w2_con.npt (fixed-format text) or w2_con.csv (comma-delimited, introduced in Version 4.21)
  • Grid bathymetry file: defines the computational grid geometry
  • Shade file: provides topographic and vegetative shading information

For detailed format specifications, see Input and Output Data Description.

Required Boundary Condition Files (Time Series)

  • Inflow files: flow, temperature, and constituent concentrations
  • Head boundary files (if applicable): head, temperature, and constituent concentrations
  • Outflow files: flow or hydraulic structure specifications (structure or gate file)
  • Meteorological files: wind speed, wind direction, air temperature, dew point temperature, and cloud cover

Tributary and distributed tributary files can represent either positive (inflow) or negative (outflow) flows.

Additional Input Files

Many optional input files activate special routines within CE-QUAL-W2. These include files for:

  • Particle transport (see Using Particle Transport)
  • Total dissolved gas (TDG) and the System TDG (SYSTDG) model
  • Fish habitat
  • Aeration
  • Environmental performance criteria
  • Initial river water level
  • Dynamic zooplankton settling and rising
  • Dynamic algae settling, rising, and toxins
  • Auto-outlet port selection for temperature
  • Sediment diagenesis
  • Dynamic pipe
  • Dynamic gates
  • Dynamic pump
  • Initial conditions (if not uniform)
  • Dynamic light extinction
  • Dynamic structure elevation
  • pH buffering
  • Constriction

Each of these files is described in detail in the chapters that follow.

Output Files Overview

CE-QUAL-W2 generates many output files during a simulation. The user controls which files are produced and at what frequency they are written. Figure 2 provides a schematic overview of the output file categories.

CE-QUAL-W2 generated output files
Figure 2. CE-QUAL-W2 generated output files.

Preprocessor and Model Run Diagnostics

  • Preprocessor output: pre.opt, pre.wrn, pre.err
  • Model run output: w2.wrn, w2.err, w2errordump.csv

Snapshot Output (Text File)

  • Snapshot file (SNP): provides a text-based summary of model state at user-specified intervals

Binary File for Post-Processing

  • Visual PLoT (VPL) linkage file: binary file used by w2_post.exe for post-processing model results

Time Series, Contour, Profile, and Other Output Files

  • Spreadsheet profile (SPR) and longitudinal profile (PRF)
  • Contour output (CPL): Tecplot-compatible contour data
  • Time series output (TSR): time series at specified points or segments
  • Withdrawal output (WDO): time series at withdrawal locations
  • Environmental performance criteria output
  • Initial river water level summary and water level output
  • Dynamic zooplankton and algae settling/rising output
  • Auto-outlet port selection for temperature output
  • Sediment diagenesis output
  • Fish habitat output
  • Flow balance and nutrient mass balance output
  • Kinetic flux output
  • Particle dynamics output
  • W2Anim output

Post-Processing with w2_post.exe

Post-processing of model output is performed by the user. The program w2_post.exe reads the VPL linkage file and provides tools for visualizing and analyzing model results.

Command-Line Working Directory Specification

In the Windows version of CE-QUAL-W2, the user can supply a command-line argument that sets the working directory for both the preprocessor and the model executable. This eliminates the need to copy the executable into every directory that contains input files.

Tip

Use a batch file to run the preprocessor and model sequentially, specifying the working directory as a command-line argument. This allows a single copy of the executables to serve multiple project directories.

In a batch file, execute the following commands:

preW2_v4_64.exe "C:\scott\waterqual\LakeLouise"
W2_v4_64.exe "C:\scott\waterqual\LakeLouise"

The syntax requires the executable name, followed by a space, followed by the working directory path enclosed in double quotes. The executable uses that directory as the working directory for all file operations. The working directory is displayed in the text box of the preprocessor and W2 dialog window during execution.