You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update `status_timestep` to the current values at the `timestep` for all `variables_to_update` in the status provided by the user (`user_status`).
151
+
The variables to update are given in `variables_to_update`, which is a vector of symbols.
152
+
153
+
`status_timestep` is a status representing a single time-step. `user_status` is the status provided that gives values for variables that are not computed by any model.
154
+
It may give constant values or vectors of values, in which case the `timestep` is used to select the value to use for the current time step.
Copy file name to clipboardExpand all lines: src/dependencies/dependencies.jl
+20-4Lines changed: 20 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,9 @@
1
1
dep(::T, nsteps=1) where {T<:AbstractModel} =NamedTuple()
2
2
3
3
"""
4
-
dep(m::ModelList, nsteps=1; verbose::Bool=true)
4
+
dep(m::ModelList)
5
5
dep(mapping::Dict{String,T}; verbose=true)
6
+
dep!(m::ModelList, nsteps=1)
6
7
7
8
Get the model dependency graph given a ModelList or a multiscale model mapping. If one graph is returned,
8
9
then all models are coupled. If several graphs are returned, then only the models inside each graph are coupled, and
@@ -34,7 +35,12 @@ to other scales if needed. Then we transform all these nodes into soft dependenc
34
35
Then we traverse all these and we set nodes that need outputs from other nodes as inputs as children/parents.
35
36
If a node has no dependency, it is set as a root node and pushed into a new Dict (independant_process_root). This Dict is the returned dependency graph. And
36
37
it presents root nodes as independent starting points for the sub-graphs, which are the models that are coupled together. We can then traverse each of
37
-
these graphs independently to retrieve the models that are coupled together, in the right order of execution.
38
+
these graphs independently to r
39
+
40
+
# Notes
41
+
42
+
The difference between `dep(m::ModelList)` and `dep!(m::ModelList, nsteps)` is that the first one returns the dependency graph found in the model list, while the
43
+
second one returns the dependency graph with the specified number of steps, modifying the simulation IDs of each node in the graph (`simulation_id=fill(0, nsteps)`).
38
44
39
45
# Examples
40
46
@@ -75,8 +81,18 @@ function dep(nsteps=1; verbose::Bool=true, vars...)
0 commit comments