skip to main content
Accounting : Accounting Overview : Object-level Accounting Methods (OLAMs)
Object-level Accounting Methods (OLAMs)
In simulation, local inflows and gains/losses are typically input by the user, set by rules, or calculated by methods on the objects. For example, local inflows to a reservoir may be input on the Hydrologic Inflow slot and daily Evaporation may be calculated from a monthly table. These components represent a change in the physical amount of water in the object and must also be represented by the accounting system.
Object-level accounting methods (OLAMs) are used to allocate physical gains and losses to the accounting system. They can also be used to reconcile the physical and accounting systems. They are called object-level because they allocate water from a given simulation object to one or more accounts on that object.
 
Object-level accounting methods (OLAMs)
Object-level accounting methods are used to allocate physical gains, losses, and local inflows on an object to accounting slots on that object. In addition, they can be used to reconcile the physical and accounting system.
There are two types of OLAMs: compiled and user-defined. See the following sections for details:
Compiled Accounting Methods
 
Compiled accounting methods
Compiled accounting methods are hard-coded object-level accounting methods. These methods were created by CADSWES and are available in a library. They represent either commonly used functionality or methods that are too complex to represent as user-defined methods.
Examples of compiled accounting methods include commonly used methods like the Zero Slot Inflow method in the Reservoir Account Slot Inflow category which assigns zero to each account’s Slot Inflow. In addition, there are complex methods that were too difficult to implement in RPL. For example, there is the Heron Inflow Calculation; a method specific to basins that have Rio Grande water types. Table 1.1 briefly describes each of the compiled methods. The default method for each category is shown in italic; the general methods are also described in more detail after the table.
 
Table 1.1  Compiled accounting methods summary
Object / Category
Method
Description
Agg Diversion Account Reconciliation
No Method
No action - never executed
Bifurcation Account Slot Inflow
No Method
No action - never executed
Zero Slot Inflows
Sets all Slot Inflows to 0.0. See Zero Slot Inflows for details.
Confluence Account Slot Inflow
No Method
No action - never executed
Zero Slot Inflows
Sets all Slot Inflows to 0.0
Rio Grande Inflow 2
Confluence^RioGrande.Slot Inflow is set equal to the Inflow 2. All other accounts’ Slot Inflow set to 0.0
Sidewater Inflow 2
Distribute Confluence.Inflow 2 to the Floriston Rate and Undes account Slot Inflow.
Control Point Account Slot Inflow
No Method
No action - never executed
Zero Slot Inflows
Sets all Slot Inflows to 0.0
Copy Slot to Slot Inflows
On the specified account, set the Slot Inflow equal to the Local Inflow. Set all other Slot Inflows to 0.0. See Copy Slot to Slot Inflows for details.
Distribution Canal Account Slot Inflow
No Method
No action - never executed
Zero Slot Inflows
Sets all Slot Inflows to 0.0
Diversion Object Account Slot Inflow
No Method
No action - never executed
Zero Slot Inflows
Sets all Slot Inflows to 0.0
Inline Pump Account Slot Inflow
No Method
No action - never executed
Zero Slot Inflows
Sets all Slot Inflows to 0.0
Pipe Junction Account Slot Inflow
No Method
No action - never executed
Zero Slot Inflows
Sets all Slot Inflows to 0.0
Pipeline Account Slot Inflow
No Method
No action - never executed
Zero Slot Inflows
Sets all Slot Inflows to 0.0
Reach Account Slot Inflow
No Method
No action - never executed
Zero Slot Inflows
Sets all Slot Inflows to 0.0.
Reconcile Rio Grande Outflow
Rio Grande Local Inflow
Reach^RioGrande.Slot Inflow is set equal to the Reach.Local Inflow. All other accounts’ Slot Inflows are set to 0.0. See Rio Grande Local Inflow for details.
Provo River Local Inflow
Reach^ProvoRiver.Slot Inflow is set equal to the Local Inflow.
NIC Local Inflow
Reach^NIC.Slot Inflow is set equal to the Local Inflow.
Copy Slot to Slot Inflows
On the specified account, set the Slot Inflow equal to the Local Inflow. Set all other Slot Inflows to 0.0. See Copy Slot to Slot Inflows for details.
Reach Account Gain Loss
No Method
No action - never executed
San Juan Gain Loss
Sets Gain Loss on accounts with water types Rio Grande and San Juan. Many accounting slots are registered as dependencies.
Reservoir Account Slot Inflow
Reservoirs:
Storage
Level Power
Sloped Power
Pumped Storage
No Method
No action - never executed
Zero Slot Inflows
Sets all Slot Inflows to 0.0
Heron Inflow
Sets Slot Inflow on accounts with water types Rio Grande and San Juan. Many accounting slots are registered as dependencies. See Heron Inflow for details.
Pooled Account Slot Inflow
Pooled.SlotInflow is set equal to the object’s Hydrologic Inflow Net
Donner Inflow
Basin-specific
Prosser Uncomm
Basin-specific
Copy Slot to Slot Inflows
On the specified account, set the Slot Inflow equal to the Hydrologic Inflow. Set all other Slot Inflows to 0.0. See Copy Slot to Slot Inflows for details.
Reservoir Account Gain Loss
Reservoirs:
Storage
Level Power
Sloped Power
Pumped Storage
No Method
No action - never executed
Heron Gain Loss Calculation
Sets Gain Loss on accounts with water types Rio Grande and San Juan. Many accounting slots are registered as dependencies. See Reservoir Account Gain Loss for details.
El Vado Loss Calculation
Nambe Falls Loss Calculation
Elephant Butte Loss Calculation
Elephant Butte Loss with RG Compact
Sets Gain Loss on accounts with water types Rio Grande and San Juan Includes logic for the RG Compact. Many accounting slots are registered as dependencies. See Elephant Butte and El Vado Gain Loss for details.
Abiquiu Loss Calculation
Sets Gain Loss on accounts with water types Rio Grande and San Juan. Many accounting slots are registered as dependencies. See Abiquiu, Cochiti, and Jemez Gain Loss for details.
Jemez Loss Calculation
Cochiti Loss Calculation
Reservoir Account Reconciliation
No Method
No action - never executed
Water User Account Reconciliation
No Method
No action
Stream Gage Account Slot Inflow
No Method
No action - never executed
Zero Slot Inflows
Sets all Slot Inflows to 0.0
Reconcile Rio Grande Outflow
See Reconcile Rio Grande for details.
All Rio Grande
Sets Slot Inflow on accounts with water types Rio Grande
All San Juan Chama
Sets Slot Inflow on accounts with water types San Juan
General and Commonly Used Compiled Methods
Following are descriptions of general and commonly used compiled methods. Each method is executed according to its selected execution time; the default execution time is listed in the method description.
* No Method
The default No Method is a no-action method and does nothing. In fact, the method has a static execution time of “Never”, meaning it will never execute.
* Zero Slot Inflows
The Zero Slot Inflows method on many of the object’s account slot inflow category sets the Slot Inflow to 0.0 for each account. By default, it is executed once at the beginning of the run, but you can change this, if desired.
* Copy Slot to Slot Inflows
The Copy Slot to Slot Inflows method copies the object’s local inflow to the target account’s Slot Inflow and sets the other accounts’ Slot Inflow to zero. This method is available only in the <Object> Account Slot Inflow category, on the objects listed in Table 1.2 and with one of the possible local inflow methods selected.
 
Table 1.2  Object’s and physical methods for use with Copy Slot to Slot Inflows method
Object
Local Inflow Category
Possible Methods
local Inflow Slot
Control Point
Local Inflow
Input Local Inflow
Local Inflow
Reach
Local Inflow and Solution Direction
Specify Local Inflow, Solve Inflow or Outflow
Specify Local Inflow, Solve Outflow
Solve Inflow, Outflow or Local Inflow
Contingent Local Inflow or Solve Outflow
Local Inflow
Reservoirs: Storage, Level Power
hydrologicInflow
CalculationCategory
solveHydrologicInflow
inputHydrologicInflow
Hydrologic Inflow and Loss
Hydrologic Inflow
Reservoirs: Sloped Power, Pumped Storage
hydrologicInflow
CalculationCategory
inputHydrologicInflow
Hydrologic Inflow
Slots Specific to This Method
 Target Account
Type: List Slot
Units: No Units
Description: This slot contains one account on the object. This account’s Slot Inflow will be set equal to the local inflow.
Only one account is allowed in this list and the account must be on the same object as this slot. Also, the account must be a storage or passthrough account. This slot can be set (by account name, water type, or water owner) for many objects at once using the Multiple Object Method Selector. See Multiple Object Method Selector in User Interface for details.
I/O: Required Input
Method Details 
The method first assigns zero to the current timestep value of the Slot Inflow slot of all accounts on the object. It then copies the current timestep value in the object’s Local Inflow slot, as shown in Table 1.2, to the specified target account’s Slot Inflow slot.
By default, this method is given an execution time of Beg of Timestep Once, meaning it is executed once at each timestep before simulation starts. This execution time can be changed by the user. See Copy Slot to Slot Inflows for details.
User-defined Accounting Methods
User-defined accounting methods are created by the user in the RiverWare Policy Language (RPL).
 
User-defined accounting methods
User-defined accounting methods are object-level accounting methods (OLAMs) created by the user in the RiverWare Policy Language.
For example, user-defined accounting methods can be used to specify how Hydrologic Inflow on a reservoir is allocated to the accounts on that reservoir or how the seepage in a reach is charged to the passthrough accounts on the reach. Often the methods depend on policy decision and are not physically based. For example, seepage in a reach may be charged only to the allocatable flow for that reach, not to any of the other water released from upstream reservoirs for downstream diversions. As a result, the methods are basin-specific and must be created for each basin.
Because the methods are basin-specific, the user must define and configure these methods for each basin. On storage and passthrough accounts, there are slots called Slot Inflow and Gain Loss. These are the slots in the accounting system that are set by the User-defined Accounting Methods to allocate local inflows and apportion gains and losses, respectively. This is done in the RiverWare Policy Language (RPL) using the Accounting Method Set Editor. In this editor, there are preconfigured policy groups for the allowed Objects/Accounts and the intended actions. For example, there is a policy group for the Reservoir Account Slot Inflow and Reservoir Account Gain Loss. These policy groups correspond to categories on the appropriate object.
 
In DeepLake, the Hydrologic Inflow is shared equally amongst three accounts in a Deep Lake: A, B, and C. The Storage Account Slot Inflow method would be the following:
• DeepLake ^ “A.Slot Inflow”[] = DeepLake.“Hydrologic Inflow”[] / 3
• DeepLake ^ “B.Slot Inflow”[] = DeepLake.“Hydrologic Inflow”[] / 3
• DeepLake ^ “C.Slot Inflow”[] = DeepLake.“Hydrologic Inflow”[] / 3
When the user creates a new Method in one of these policy groups, the new method appears as a method in the appropriate category on the object’s Accounting Methods tab and can be selected by the user. By selecting this method on the object, the user is telling the object that the selected User-defined Accounting Method should apply to the accounts on that object. As a result, the method created for each object applies to all of the accounts on the object. Multiple assignment statements may be necessary to set all necessary slots.
Table 1.3 lists the policy groups / categories in the Accounting Method Set Editor and the associated objects and the accounts to which they apply
 
Table 1.3  Accounting Method Set Editor policy groups, associated objects, and applicable accounts
Policy Group / Category
Object
Accounts
Agg Diversion Account Reconciliation
Aggregate Diversion
Diversion
Bifurcation Account Slot Inflow
Bifurcation
Passthrough
Confluence Account Slot Inflow
Confluence
Passthrough
Control Point Account Slot Inflow
Control Point
Passthrough
Distribution Canal Account Slot Inflow
Distribution Canal
Passthrough
Diversion Object Account Slot Inflow
Diversion Object
Passthrough
Inline Pump Account Slot Inflow
Inline Pump
Passthrough
Pipe Junction Account Slot Inflow
Pipe Junction
Passthrough
Pipeline Account Slot Inflow
Pipeline
Passthrough
Reach Account Gain Loss
Reach
Passthrough
Reach Account Slot Inflow
Reach
Passthrough
Reservoir Account Gain Loss
Storage Reservoir
Level Power Reservoir
Pumped Storage Reservoir
Sloped Power Reservoir
Storage and/or Passthrough
Reservoir Account Reconciliation
Storage Reservoir
Level Power Reservoir
Pumped Storage Reservoir
Sloped Power Reservoir
Storage and/or Passthrough
Reservoir Account Slot Inflow
Storage Reservoir
Level Power Reservoir
Pumped Storage Reservoir
Sloped Power Reservoir
Storage and/or Passthrough
Stream Gage Account Slot Inflow
Gage
Passthrough
Water User Account Reconciliation
Water User
Diversion
User-defined accounting methods, although written in RPL, do not behave the same as rules. Although the methods are prioritized in the method set editor, the priority is not used. Instead, there can only be one method selected for each object. The methods execute according to their specified execution time. See Reconciling the Accounting and Physical Systems for additional information.
Figure 1.4  Object-level Accounting Method Set Editor
Although the methods are specific to a basin, there are a few features that can be used to generalize the methods. The keyword ThisObject (there is no space) can be used in place of a specific object name. When called, it will replace this with the name of the object from which the method is called.
 
Example 1.1   
Following is a reach Pass Through Gain Loss method that makes use of the “ThisObject” syntax. It would be useful on this basin because each reach has two accounts, Fish and Farmers. The Fish account gets charged with all loss, Farmers get none. Each reach in the model could then use this method.
ThisObject ^ “Fish.Gain Loss”[] = ThisObject. “Total GainLoss”[]
ThisObject ^ “Farmers.Gain Loss”[] = 0 [“acre-feet”]
Note:  Gain Loss in the accounting system is a volume.
 
Example 1.2   
Following is an example setting all of the account’s Slot Inflow to zero using a ForEach loop (note, this is just a sample method, this functionality can be accomplished much more easily using the compiled Zero Slot Inflows method, as follows. See Zero Slot Inflows.
FOREACH (STRING account IN AccountNamesByAccountType(ThisObject, “ALL”))
ThisObject^(account CONCAT “.Slot Inflow”)[] = 0 [“cfs”]
ENDFOREACH
Note:  See Managing RPL Sets in RiverWare Policy Language (RPL) for additional information on RPL and its uses.
Execution of OLAMs
Object-level accounting methods provide flexibility in when they can be executed, what they set, and the data required. This section describes the execution times and some additional information on errors you may encounter during execution.
Execution Time
You are able to control when each object-level accounting method is executed. Because object-level accounting methods set the Slot Inflow and Gain Loss values on the accounts and these are required knowns for the account solution, this execution time allows you to control when the accounts solve. Depending on the application, you should execute the method as soon as possible once the information is known. For example, if you input Local Inflow, then you can configure your Slot Inflow method to execute at the Beginning of the run. Table 1.4 shows possible execution times.
 
Table 1.4  Possible execution times
Execution Time
Description
Dependencies
Never
The method is never executed. This is only available for the default no-action method for each category.
None
Beg. of Run
At the beginning of the run, the method is executed once per timestep.
None
Beg. of Timestep Once
The method is executed once before each timestep's simulation.
None
Beg. of Timestep
The method is executed before each timestep's simulation and if dependent slots change. For this execution time, the method registers both simulation and accounting slots as dependencies. That is, if a value in a dependent slot changes, the method is put on the accounting queue to resolve.
Note: This could have performance implications if slot dependencies cause methods to re-fire.
Accounting and Simulation Slots
After Simulation
The method is executed after each timestep's simulation is complete and as accounting dependencies change.
Note:  This is the default for compiled methods and the only execution time in releases prior to RiverWare 5.1.
Technically, the method is executed as part of the accounting beginning of timestep which occurs after all rules have executed and all dispatching is complete. Each method registers accounting slot dependencies when executed. Therefore, if a value in a dependent accounting slot changes, then the method will re-execute.
Accounting Slots only
Note:  See How the Accounting System Solves for details about the run sequence, including OLAM execution.
Data Requirements and Error Conditions
The object-level accounting methods can only access information that exists at the time they are called or the method will terminate early. For example, the object-level accounting methods set to execute After Simulation can only access accounting values at the previous timestep as accounts may not have solved yet. Usually, these methods can access physical values at the current timestep as the simulation has likely solved when After Simulation object-level accounting methods are called. Input values can be accessed by any OLAM.
Additionally, if an OLAM attempts to set a slot’s timestep that has an Input value (I flag), the run will abort with an error: “Attempting to set an input value”. If you want to input Slot Inflow / Gain Loss, then you will need to input Slot Inflow / Gain Loss on all accounts OR create a user-defined method that does not attempt to assign to an input.
Selecting OLAMs and Execution Time
OLAMs and their Execution Time are selected from the object’s Accounting Methods tab.
The Accounting Methods tab works similar to the Methods tab. You select a category, then choose a method from the Selected Method menu at the top of the tab. An adjacent combo box labeled Execution Time allows you to choose the Execution Time. The category / method list on this tab also contains the Execution Time column showing the currently chosen execution time for each selected method.
Additionally, you can select methods on multiple objects using the Multiple Object Method Selector; see Multiple Object Method Selector in User Interface for details. See Selecting Object Level Accounting Methods (OLAMs) in User Interface for details about OLAMs.
Revised: 08/02/2021