Skip to content

Initial Conditions

Alexander Michalek edited this page Jul 18, 2025 · 4 revisions

Initial conditions define the starting discharge (q0) for each stream link at the beginning of the simulation. This model supports two methods for specifying initial conditions, controlled via the initial_conditions.flag parameter in the config.yaml file.

Configuration Options

The initial_conditions block in config.yaml looks like this:

initial_conditions:
  flag: 0  # 0 = constant value, 1 = from NetCDF file
  initial_value: 1.0
  filename: "/path/to/snapshot.nc"    # Required if flag = 1
  varname: "snapshot"                 # Required if flag = 1
  id_varname: "LinkID"                # Required if flag = 1

Options Definitions

Flag = 0: Constant Initial Value

If flag is set to 0, the model uses a constant discharge value for all links. This is the simplest and fastest option and requires only the initial_value field.

  • All stream links will be initialized with the same value of q0 = initial_value.
  • This mode is useful for testing or for initializing the start of the simulations.

Flag = 1: NetCDF File Input

If flag is set to 1, the model reads initial conditions from a NetCDF file. The file must contain:

  • A 1D float variable containing the discharge values
  • A 1D integer variable containing the corresponding LinkIDs This option is to be used when restarting from generated snapshot files.

Required fields:

  • filename: Path to the NetCDF file
  • varname: Name of the variable that stores discharge values
  • id_varname: Name of the variable that stores link IDs

Best Practices

  • Use flag = 0 when initializing simple synthetic tests or when no saved state is available.
  • Use flag = 1 to resume from a previously saved state or to initialize from external hydrologic data.
  • Always ensure that the NetCDF file contains valid LinkIDs and matching discharge data.
  • Ensure that filename, varname, and id_varname match the actual NetCDF file contents.

Clone this wiki locally