From 98ce2b24597ddc0f2fbc56461f05093d699da44b Mon Sep 17 00:00:00 2001 From: Bart de Koning Date: Mon, 29 Apr 2024 11:28:06 +0200 Subject: [PATCH] Don't run allocation if not active during BMI runs --- core/src/callback.jl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/src/callback.jl b/core/src/callback.jl index 048ba7530..26ef97bfc 100644 --- a/core/src/callback.jl +++ b/core/src/callback.jl @@ -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 + end + (; Δt_allocation) = allocation_models[1] # Divide by the allocation Δt to obtain the mean flows