diff --git a/src/utilities/bmi/mass_balance.cpp b/src/utilities/bmi/mass_balance.cpp index 4d3f02ab9f..f542a682a0 100644 --- a/src/utilities/bmi/mass_balance.cpp +++ b/src/utilities/bmi/mass_balance.cpp @@ -137,12 +137,9 @@ auto NgenMassBalance::check_support(const ModelPtr& model) -> expected expected { - //Ensure the model is capable of mass balance using the protocol - check_support(model).or_else( error_or_warning ); - //now check if the user has requested to use mass balance auto protocol_it = properties.find(CONFIGURATION_KEY); - if ( supported && protocol_it != properties.end() ) { + if ( protocol_it != properties.end() ) { geojson::PropertyMap mass_bal = protocol_it->second.get_values(); auto _it = mass_bal.find(TOLERANCE_KEY); @@ -184,6 +181,10 @@ auto NgenMassBalance::initialize(const ModelPtr& model, const Properties& proper //no mass balance requested, or not supported, so don't check it check = false; } + if ( check ) { + //Ensure the model is capable of mass balance using the protocol + check_support(model).or_else( error_or_warning ); + } return {}; // important to return for the expected to be properly created! } @@ -191,4 +192,4 @@ bool NgenMassBalance::is_supported() const { return this->supported; } -}}} // end namespace models::bmi::protocols \ No newline at end of file +}}} // end namespace models::bmi::protocols