Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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 ||.

For instance, when using the following expression, for every timestep, the flag is set to the output flag if the specified output flag for the specified timeseries is less reliable than the current flag, and the absolute difference between the timeseries sets identified by variableId a and b is bigger than 10 or a is less than 1000.

Code Block

	(abs(a - b) .gt. 10) .or. a .lt. 1000

Some mathematical functions worth mentioning are the following (these must be in lowercase):

Function

Description

avg(x1, x2, x3, ...)

Average

min(x1, x2, x3, ...)

Minimum

max(x1, x2, x3, ...)

Maximum

abs( x )

Absolute value

round( x )

Rounded value

floor( x )

Floor

ceil( x )

ceiling

sin, cos, tan

Trigonometric

mod( x , y)

x % y Modulus

sqrt( x )

SquareRoot

sum( x, y,...)

Sum of multiple variables

A simple configuration example for the seriesComparisonCheck is given below, it will make the workflow check the values that are reliable or doubtful, and mark them as unreliable if they are smaller than thirteen:The following sample configuration sets the flags to unreliable when the values are smaller than 10 or bigger than 1000.

Code Block
xml
xml
<?xml version="1.0" encoding="UTF-8"?>
<secondaryValidation xmlns="http://www.wldelft.nl/fews" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.wldelft.nl/fews http://fews.wldelft.nl/schemas/version1.0/secondaryValidation.xsd">
    <seriesComparisonCheck id="checkWithScalar">
      <!-- comparison between location variable and scalar, set to unreliable -->
	<seriesComparisonCheck id="checkWithScalar">
		<variableDefinition>
			  <variableDefinition>
            <variableId>H_obs_location1</variableId>
			<timeSeriesSet>
				<moduleInstanceId>SeriesComparisonCheck</moduleInstanceId>
				<valueType>scalar</valueType>
				            <timeSeriesSet>
                <moduleInstanceId>SeriesComparisonCheck</moduleInstanceId>
                <valueType>scalar</valueType>
                <parameterId>H.obs</parameterId>
				                <locationId>location1</locationId>
				                <timeSeriesType>external historical</timeSeriesType>
				                <timeStep unit="minute" multiplier="15"/>
				                <relativeViewPeriod unit="day" start="-30" end="0"/>
				                <readWriteMode>read only</readWriteMode>
			            </timeSeriesSet>
		        </variableDefinition>
		        <expression>H_obs_location1location .lt. 10 .or. H_obs_location .gegt. 13<1000</expression>
		        <validatingVariableId>H_obs_location1</validatingVariableId>
		        <outputFlag>unreliable</outputFlag>
		        <logLevel>INFO</logLevel>
		        <logEventCode>TimeSeries.Check</logEventCode>
		        <logMessage>%AMOUNT_CHANGED_FLAGS% flags set to %OUTPUT_FLAG% by [%CHECK_ID%, %EXPRESSION%].</logMessage>
    </seriesComparisonCheck>
</secondaryValidation>

...