## Simulation time-step phases

The steps below outline the phases of execution in a standard Source run.

**The phases of execution followed in a standard run are:**

__Start__the simulation time-step.__Read and Assign input values__from a time series for the current time-step. For example, if the data source for an inflow node is a time series, then a value is read from the time series corresponding to the current time-step and assigned to the inflow node.__Start River Operations:__This overrides the values assigned from the input time series from the tabular view.__Start the forecasting phase__: Run the forecast models whichuse functions.**do not**__Evaluate functions and modelled variables - where Time of Evaluation equals__*Start Of TimeStep*__River Operations override functions and forecast values__: If River Operations is used, then:- Override the values generated by functions.
- Override the values generated by forecast models.

__Plugins__: All valid Source plugins will be notified before each simulation time-step is run.__Resource Assessment Phase____For each Resource Assessment System__- Evaluate functions and modelled variables - where Time of Evaluation equals
*Resource Assessment*. - Process Resource Assessment System.

- Evaluate functions and modelled variables - where Time of Evaluation equals

- Environmental Flow Manager Phase
__Ordering phase:__- Evaluate functions and modelled variables - where Time of Evaluation equals
*Order Phase*and where the function isused at a network element.**not** __Process Water Users:__- Water User order calculations can be run in Parallel at this point in the ordering phase with the option enabled: "Process Water User Orders in Parallel": Scenario Options \ Performance
__For each Water User:__- Evaluate functions and modelled variables - where Time of Evaluation equals
*Order Phase*, and where the function is used at this Water User*.* - Calculate and distribute the demands of each Water user.

- Evaluate functions and modelled variables - where Time of Evaluation equals

__Constraint Phase__:- For each Network Element:
- Calculate minimum and maximum constraints at each element and pass the constraints downstream.

- For each Network Element:
__Ordering Phase__:- For each Network Element:
- Evaluate functions and modelled variables - where Time of Evaluation equals
*Order Phase*, and where the function is used at this network element*.* - Calculate regulated orders and pass upstream.
- Calculate off allocation orders and pass upstream.

- Evaluate functions and modelled variables - where Time of Evaluation equals

- For each Network Element:

- Evaluate functions and modelled variables - where Time of Evaluation equals
__Continue forecasting phase__: Run the forecast models whichuse functions.**do**__Flow Phase__- Evaluate functions and modelled variables - where Time of Evaluation equals
*Flow Phase*and where the function isused at a network element.**not** - Catchments can be all run in Parallel at this point in the flow phase with the option enabled: "Run Catchments in Parallel": Scenario Options \ Performance
__For each Network Element__:- Evaluate functions and modelled variables - where Time of Evaluation equals
*Flow Phase*, and where the function is used at this network element - Water Ownership - pre-timestep calculations
- Off Allocation: Generate storage release requests to distribute allocated volume to according to shares
- The wetland cluster that the element belongs to is solved for this time-step.
- Execute element flow phase calculations
- Water Ownership - post-timestep calculations, and colouring of water
- Calculate Constraint Factors for element
- Constituent modeling is executed.

- Evaluate functions and modelled variables - where Time of Evaluation equals

- Evaluate functions and modelled variables - where Time of Evaluation equals
__Evaluate functions and modelled variables - where Time of Evaluation equals__*Post Flow Phase.*__Resource Assessment__*Post TimeStep*Phase.__Finalise constituent modeling__(marker routing).- End of the forecasting phase.
__Evaluate functions and modelled variables - where Time of Evaluation equals__*End of TimeStep.*__Evaluate modelled variables - where Time of Evaluation equals__*Post Function Evaluation.*__Recording phase:__Writes the current time-step results to the requested recorders.__Plugins__All valid Source plugins will be notified after every simulation time-step is run.*:*__End__of the simulation time-step.