Skip to content

Initial Conditions

Manjaree Binjolkar edited this page Sep 5, 2025 · 3 revisions

Initial conditions specify the starting state (y0) for each simulation stream at the beginning of the model run. This program supports two methods for specifying initial conditions, controlled via the initial.mode parameter in the config.yaml file.

Configuration Options

The initial block in config.yaml looks like this:

initial:
  mode: "constant"                # Options: "constant" or "from_file"
  file: ""                        # Required if mode = "from_file"
  values: [0.01, 0.1, 0.0, 0.1, 0.01, 1.0, 1.0, 0.0, 0.0]  # Initial values for each state variable (if mode is "constant")
  # Order of values: [snow, static, surface, grav, aquifer, T_air, T_soil, surf_runoff, total_runoff]

Option Definitions

Mode = "constant": Constant Initial State

When mode is set to "constant", the model initializes all ODE states for each stream with the same user-specified values.

  • Provide the values as an array under initial.value.
  • Each element in the array corresponds to one state variable in the model (add exact tanks here).
  • This option is simple and recommended for new runs or testing.

Example:

initial:
  mode: "constant"
  values: [0.01, 0.1, 0.0, 0.1, 0.01, 1.0, 1.0, 0.0, 0.0] 

Mode = "from_file": Initial State from NetCDF File

When mode is set to "from_file", the model loads the initial conditions from a NetCDF file.

  • The file must contain a 2D variable where:

    • The first dimension indexes streams (link_ids).
    • The second dimension indexes model states.
  • A variable holding link_ids is also required to map states to the correct streams.

  • This mode is typically used for restarting simulations from a previous outputs, typically by loading the final.nc file generated by this module.

Required fields:

  • file: Path to the NetCDF file containing the initial state.

Example:

initial:
  mode: "from_file"
  file: "/data/final_20190101_20190110.nc"

Best Practices

  • Ensure the NetCDF file’s dimensions and variable names match the expected format.
  • When using restart files, verify that the link IDs in the file align with those in your spatial parameters CSV.

Clone this wiki locally