Checks the specified expression for the available variables and alters the flags for the time steps where the expression succeeds. For instance, a check can compare the water flow before and after a river junction. It is required that all referenced variables in the expression have the same size. Either all variables are regular with the same timestep, or all variables are non-equidistant with the same times. The comparison can be for different parameters at one location or per location of a locationSet, or for one parameter at two locations or at one location and the locations of a location set, or between multiple equal location sets.
Contents of check for seriesComparisonCheck
- id: identifier of the check.
- variableDefinition: embedded variable definition (see above).
- expression: A comparison between one or more variableIds (see examples below).
- validatingVariableId: One or more identifiers for variables for which the flags have to be modified.
- outputFlag: New flag value for time steps for which there is valid data and the expression holds. Either doubtful or unreliable.
- outputMode: When this option is set to logs_only, the flags will not be updated but the log events will be generated.
- logLevel: Log level for the log message that is logged if a time series does pass the check. Can be DEBUG, INFO, WARN, ERROR or FATAL. If level is error or fatal, then the module will stop running after logging the first log message. Fatal should never be used actually.
- logEventCode: Event code for the log message that is logged if a time series does pass the check. This event code has to contain a dot, e.g. "TimeSeries.Check", because the log message is only visible to the master controller if the event code contains a dot.
- logMessage: Log message that is logged if a time series does pass the check. Some more options are available than in the other checks:
- onErrorResumeNext When true, makes the secondary validation continue when an error logging is applied.
The number of flags that has been altered.
The id of the check that caused the flags to be altered.
The expression that caused the flags to be altered.
The header names of the timeseries for which the flags were altered.
The locationId where the alterations took place.
The name of the locations where the alterations took place.
The flag that has been set.
The parameterId where the alterations took place.
The name of the parameter where the alterations took place.
The period in which flags were changed.
Hide the autogenerated location and period in the log message.
The value of the last time that the flag for a timeseries has been updated.
It is not possible to compare two different location sets both containing more than one location id, but the following comparisons can be configured:
- one location with a scalar
- all the locations in a location set with a scalar
- two different locations
- one location with all the locations in a location set
- two similar locationSets, containing exactly the same location ids
Configuration examples for seriesComparisonCheck
The expression is always a comparison. The comparison operator is within XML one of (.ne., .eq., .gt., .ge., .lt., .le.). Each variable has to be a single word without spaces. Mathematical symbols or functions like e, pi or cos cannot be used as variableId, but they will be interpreted mathematically. Note that in case one of the variables of the expression contains missing values for a timestep, the expression fails, and no flags will be altered for this timestep. Also manually edited flags will be left untouched. In 2012_01 and onwards, it is possible to use logical conditions in the expression. These can be in Fortran77 style .and. and .or. or with && and ||.
Some mathematical functions worth mentioning are the following (these must be in lowercase):
avg(x1, x2, x3, ...)
min(x1, x2, x3, ...)
max(x1, x2, x3, ...)
abs( x )
round( x )
floor( x )
ceil( x )
sin, cos, tan
mod( x , y)
x % y Modulus
sqrt( x )
sum( x, y,...)
Sum of multiple variables
The following sample configuration sets the flags to unreliable when the values are smaller than 10 or bigger than 1000.
A more complex sample does a comparison for different parameters in similar location sets, it will mark values that were reliable or doubtful as unreliable,
in this case first for location1 and then for location2, when the difference between them is bigger than three:
The sample screenshot below demonstrates the use of the seriesComparisonCheck. In this case it has been used to set flags to unreliable for timesteps where the waterlevel measurements upstream are below the measurements downstream. The different output flags have been displayed using different colors at the bottom of the screenshot. In this case the flags of the values above the yellow part have been set to unreliable, whereas the flags of the values above the purple line have remained the same.