Delft-FEWS stores model states in the native model format.
Config/ColdStateFiles/
This page discusses the handling of warmStates.
The <importStateActivity>
is used to save a state.
This is configured at the end of the General Adapter module, see 05GeneralAdapterModule-importStateActivity.
By convention, only 'UpdateStates' (or Historical) Workflows save states at the end of the run.
Forecasts Workflows do not save their state typically.
<importStateActivity> <stateFile> <importFile>%WORK_DIR%/ToFews/outstates.nc</importFile> <!-- Rename imported state file so that it can be used as input state for a future model run. --> <relativeExportFile>../FromFews/instates.nc</relativeExportFile> </stateFile> </importStateActivity> |
Warm states written by the same ModuleInstanceId are part of a branch.
When a warmState on a branch expires, this breaks the branch and warmStates with a T0 before the expired state are no longer accessible as a warmState.
Example based on the SLEIP application in Australia, which has separate workflows for:
The AnnualUpdateState and HourlyUpdateState are identical,
Even though both UpdateStates run the same GA, they need to get a different moduleInstanceId. |
The <exportStateActivity> is used to start the model based on the initial conditions of a previous run (i.e. a warmState).
This is configured in the General Adapter module, see 05GeneralAdapterModule-exportStateActivity
The exportStateActivity can be used for any model Workflow (both UpdateStates and Forecasting)
<exportStateActivity> <moduleInstanceId>$Catchment$WflowHc</moduleInstanceId> <stateExportDir>%WORK_DIR%/FromFews</stateExportDir> <stateSelection> <warmState> <stateSearchPeriod unit="hour" start="-240" end="-5"/> </warmState> </stateSelection> </exportStateActivity> |
The <stateSelection>
defines which state is exported to the model and so determines the start of the simulation, see 05GeneralAdapterModule-stateSelection
Typically, a <warmState>
is configured in the search period. If no warmState is found, the default coldStateFile will be used at the beginning of <stateSearchPeriod>
.
The stateSelection search period can be set in several places.
The hierarchy follows the order shown below, i.e. Topology overrules ModuleConfigFile etc.
In case of nested Workflows, the top-level Workflow overrules the underlying nested Workflows.
<stateSelection>
in 13 WorkflowDescriptors), or There are two options in <exportStateActivity>
to also save warmStates at other times.
<loopTimestep>
, see 05GeneralAdapterModule-loopTimeStep<writeIntermediateState>
, see 05GeneralAdapterModule-writeIntermediateState<minimumRunLength>
, see 05GeneralAdapterModule-minimumRunLength. In some cases, transient States can be usefull, see 02Statehandling-TransientandLongLivingStates (below).
There are two options in <exportStateActivity>
to reduce the number of warm states in the database:
<transientStateExpiryTime>
to set a shorter expiryTime, see below. <transientStateExpiryTime>
<searchForTransientStates>
, see above.Example based on the the CHPS application in the USA, which has separate workflows for:
The state handling of these is described in more detail in the table below.
The UpdateStates run produces 10-15 warmStates every time it's run (i.e. daily).
Typically, only those at the end of a stateSearchPeriod are used:
All warmStates outside its own stateSearchPeriod will be superseded by next day's run.
But all remain in the database until they expire, which is when the workflow expires.
States created after the stateSearchPeriod of the GA that creates them are considered transient states.
States created within the stateSearchPeriod of the GA that creates them are considered long living states.
UpdateStates workflow in CHPS UpdateState workflows cannot be run from the Topology.
| |
Forecasts workflow in CHPS The run starts at the end of the warm state search period, Forecast workflows can be run from the Topology, with:
Modifiers for the Forecasts (<T0) are applied to UpdateStates. | |
Ensembles worflow in CHPS Similar to Forecasts workflows. Ensemble workflows can be run from the Topology, with:
Modifiers for the Forecasts can be excluded from the Ensembles. | |
UpdateStates workflow with Transient states With Consequently, the UpdateState run will start one day earlier (T0-11days). |
<workflowDescriptor id="UpdateStates" forecast="true" visible="true" allowApprove="true" autoApprove="true"> <description>UpdateStates</description> <cardinalTimeStep id="12Z"/> <stateSelection> <warmState> <stateSearchPeriod start="-15" end="-10" unit="day"/> <searchForTransientStates>false</searchForTransientStates> <transientStateExpiryTime multiplier="1" unit="day"/> </warmState> </stateSelection> <runExpiryTime multiplier="30" unit="day"/> </workflowDescriptor> |