Skip to content

Commit

Permalink
Add tstops for more timeseries
Browse files Browse the repository at this point in the history
  • Loading branch information
SouthEndMusic committed Apr 23, 2024
1 parent bf12961 commit ba2f8dd
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions core/src/model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,19 @@ function Model(config::Config)::Model
end

# tell the solver to stop when new data comes in
# TODO add all time tables here
time_flow_boundary = load_structvector(db, config, FlowBoundaryTimeV1)
tstops = Vector{Float64}[]
push!(tstops, get_tstops(time_flow_boundary.time, config.starttime))
time_user_demand = load_structvector(db, config, UserDemandTimeV1)
push!(tstops, get_tstops(time_user_demand.time, config.starttime))
for schema_version in [
FlowBoundaryTimeV1,
LevelBoundaryTimeV1,
UserDemandTimeV1,
LevelDemandTimeV1,
FlowDemandTimeV1,
TabulatedRatingCurveTimeV1,
PidControlTimeV1,
]
time_schema = load_structvector(db, config, schema_version)
push!(tstops, get_tstops(time_schema.time, config.starttime))
end

# use state
state = load_structvector(db, config, BasinStateV1)
Expand Down

0 comments on commit ba2f8dd

Please sign in to comment.