AvgObjectsAtEachTimestep

This function evaluates to a list. Each item of the list is a list comprised of the datetime at which the average was performed, and the value of the average.

Description

Average several object’s slot values, for each timestep in a range.

Type

LIST{LIST{DATETIME, NUMERIC}}

Arguments

Type

Meaning

1

STRING

Subbasin name

2

STRING

slot name

3

STRING

aggregation filter ("INPUT", "OUTPUT", or "ALL")

4

BOOLEAN

time conversion option ("TRUE" or "FALSE")

5

DATETIME

start date

6

DATETIME

end date

Evaluation

A list of slots is generated by searching all of the objects in the Subbasin argument for slots which match the slot name argument. If the time conversion option argument is TRUE, and the values to be averaged are of the FLOW unit type, the values are multiplied by their corresponding timestep length to convert them to values of the unit type VOLUME.

Next, all of the object’s slot values are averaged, yielding one value for each timestep in the time range of the datetime arguments. The function returns a list of two items, where the first and second items of the inner lists are the datetime and the average value, respectively.

Mathematical
Expression

 

Comments

If the time conversion option argument is TRUE, but the unit of the slot values is not FLOW, RiverWare aborts the run with an error.

If none of the values for a slot satisfy the aggregation filter argument, the "SUM" aggregation function yields an aggregated value of 0.0 for that slot, while the "AVG", "MIN", and "MAX" aggregation functions abort RiverWare with an error.

 
AvgObjectsAtEachTimestep("upper basin", "Storage", "ALL", FALSE
@"October, Previous Year",
@"September, Current Year")
 

For a monthly model, the above function would return something like:

{ { 24:00 October 31, 1996, 1233232.2 "m3" },
{ 24:00 November 30, 1996, 1067478.3 "m3" },
....
{ 24:00 September 30, 1997, 1563456.7 "m3" } }