Skip to content

Commit

Permalink
Don't run allocation if not active during BMI runs
Browse files Browse the repository at this point in the history
  • Loading branch information
SouthEndMusic committed Apr 29, 2024
1 parent 3ea6ac6 commit 98ce2b2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions core/src/callback.jl
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,13 @@ function update_allocation!(integrator)::Nothing
(; p, t, u) = integrator
(; allocation) = p
(; allocation_models, mean_flows) = allocation

# Don't run the allocation algorithm if allocation is not active
# (Specifically for running Ribasim via the BMI)
if !is_active(allocation)
return nothing

Check warning on line 473 in core/src/callback.jl

View check run for this annotation

Codecov / codecov/patch

core/src/callback.jl#L473

Added line #L473 was not covered by tests
end

(; Δt_allocation) = allocation_models[1]

# Divide by the allocation Δt to obtain the mean flows
Expand Down

0 comments on commit 98ce2b2

Please sign in to comment.