-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Single Component Dependency end-point function #133
Comments
35 tasks
Created
|
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is provisionally completed pending review of PR #150
def model_order_recursive(model_object, model_object_cache, model_exec_list, model_touch_list = []):
model_exec_list
andmodel_touch_list
in placemodel_domain_dependencies()
domain_exec_list = model_domain_dependencies([the state dict], [domain, i.e. common path root], [end point names (to appens to root)] )
The STATE operational model system provides for "dependency execution" which assembles a list of integer IDs ordered according to their components data dependency (from independent to dependent variables), in order to insure proper order execution.
Currently, this is done in the same function that tokenizes all operational model and special action objects. But it would be best if there were a function to do this to allow us to extract different "execution chains" for a given endpoint to avoid redundant executions and the potential for erroneous data due to executing code outside of it's model domain.
Conceptual Example
What are the special actions/OM ops that must be executed each timestep for
OD
(withdrawal) duringHYDR
simulation in a givenRCHRES 1
?RCHRES 1
:/STATE/RCHRES_R001
OVOL
: value of outflow from the previous timestep inRCHRES 1
OD = demand
: theOD
input (OD1
,OD2
,OD3
) is the demand for water from theRCHRES
at the current timestepmonth
: the numerical index for current timestep month (1-12)RCHRES 1
contains a water withdrawal intake with the following components:flowby = 10.0
: a constant, in cfs, indicating the minimum value of instream flow that must pass the intakeavailable_flow
:OVOL - flowby
;demand_monthly
: a table that contains a monthly varying base demand[ 1: 2.0, 2: 2.0, 3: 2.2, 4: 2.2, 5: 2.2, 6: 2.3, 7:2.4, 8:2.4, 9: 2.1, 10: 2.1, 11: 2.0, 12: 2.0 ]
demand
: a lookup with the demand sent to theRCHRES
demand = min(demand_monthly, available_flow)
OD1 = demand
month
: self-explanatoryflowby
: in this case it is a single numerical value, and thus depends on no variableOVOL
since it is from the last time stepHYDR
:OD = demand
: theOD
input (OD1
,OD2
,OD3
) is the demand for water from theRCHRES
at the current timestepSince the allowable withdrawal amount varies as a function of a monthly minimum flow requirement (i.e. a "flow-by")
OD
must be calculated afterdemand_monthly
,flowby
andavailable_flow
. Similarly,available_flow
must be calculated afterflowby
.Code
Example: Find
SEDTRN
related executables in a singleRCHRES
viamodel_order_recursive()
Extra testing output to show details of dependencies.
The text was updated successfully, but these errors were encountered: