SolveWaterRights and SolveWaterRightsWithLags

This water accounting function invokes the Water Rights Allocation method on a computational subbasin. Click for more information. The subbasin identifies a set of accounts for which to solve; the Water Type identifies the supply chain that models the allocatable flow of water in the subbasin. The date controls the behavior of instream flow rights during the solution.

Description

Invokes computational subbasin’s Water Rights Allocation method.

Type

SolveWaterRights: LIST { LIST { SLOT, NUMERIC } }

SolveWaterRightsWithLags: LIST{ LIST{SLOT, DATETIME, NUMERIC} }

Arguments

Type

Meaning

1

STRING

the name of the computational subbasin

2

STRING

the name of the Water Type that identifies the allocatable flow supply chain

3

DATETIME

"controlling date" for instream flow rights. Rights at or senior to (i.e., with priority date earlier or equal to) this date can make calls; instream flow rights junior to this date compute their Available Allocatable Flow.

Evaluation

Runs the selected Water RIghts Allocation method on the subbasin. For each water right account (has priority) in the subbasin, the function returns {slot, value} pairs for the following slots:

  • Appropriation Request on all rights,
  • Available Allocatable Flow on Instream Flow Accounts whose priority date is later than the controlling date (3rd argument),
  • Supply slot values representing appropriations to the water right accounts. For storage rights on in-line reservoirs, this is a Transfer In supply; for off-stream storage rights, this is a Diversion supply to the passthrough account on a Diversion object that supplies the off-stream storage right account. For diversion rights, this is a Diversion supply.

A changing set of temporary slots (whose names begin with Temp) on the rights is also returned, for use by RiverWare developers.

If no appropriation is to be made, a value of zero is returned so that old appropriations that are no longer valid will be invalidated by this rule.

Evaluation cont.

The SolveWaterRightsWithLags() predefined rule function works much like SolveWaterRights(), but is used when the subbasin passthrough accounts contain lags. It returns a list of {slot name, date-time, value} triplets, which the rule uses to place the value in the appropriate slot at the appropriate timestep. The timestep given will reflect the Local Timestep Offset of the account on which the slot resides. It is some number of timesteps after the current rules-controller timestep, and reflects the relationships of the account to other accounts in the subbasin based on their respective cumulative lag times to the end of the subbasin.

For detailed descriptions of the solution methods, see the Accounting Water Rights documentation .

Comments

The calling rule is expected to make the assignments of the values to the slots.

 

To cause all instream flow rights to compute their Available Allocatable Flow values:

FOREACH (LIST pair IN SolveWaterRights( "Network", "Allocatable Flow",
@"20:00:00 January 1, 1800" )) DO
( pair<0> )[] = pair<1>
ENDFOREACH

 

To cause all instream flow rights to make calls, using their already-computed Available Allocatable Flow slot values:

 

FOREACH (LIST pair IN SolveWaterRights( "Network", "Allocatable Flow",
@"20:00:00 December 31, 2030")) DO
( pair<0> )[] = pair<1>
ENDFOREACH
 

Or if lags are to be considered:

FOREACH (LIST triplet IN SolveWaterRightsWithLags( "Network",
"Allocatable Flow",
@"20:00:00 December 31, 2030")) DO
( triplet<0> )[triplet<1>] = triplet<2>
ENDFOREACH