From 29bfcdd25f4370fbd99f34c9b8fdf4eb7eb62d79 Mon Sep 17 00:00:00 2001 From: Shengting Cui Date: Thu, 17 Aug 2023 14:29:29 +0000 Subject: [PATCH] Move check_output_var_names() function to create_multi_formulation --- src/realizations/catchment/Bmi_Multi_Formulation.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/realizations/catchment/Bmi_Multi_Formulation.cpp b/src/realizations/catchment/Bmi_Multi_Formulation.cpp index f096b5e88a..4cf3e5bf58 100644 --- a/src/realizations/catchment/Bmi_Multi_Formulation.cpp +++ b/src/realizations/catchment/Bmi_Multi_Formulation.cpp @@ -137,6 +137,9 @@ void Bmi_Multi_Formulation::create_multi_formulation(geojson::PropertyMap proper if (out_precision_it != properties.end()) { set_output_precision(properties.at(BMI_REALIZATION_CFG_PARAM_OPT__OUTPUT_PRECISION).as_natural_number()); } + + // check if a requested output variable name is valid, if not, stop the execution + check_output_var_names(); } /** @@ -292,11 +295,6 @@ string Bmi_Multi_Formulation::get_output_line_for_timestep(int timestep, std::st throw std::invalid_argument("Only current time step valid when getting multi-module BMI formulation output"); } - // check if a requested output variable name is valid, if not, stop the execution - if (timestep == 0) { - check_output_var_names(); - } - // Start by first checking whether we are NOT just using the last module's values if (!is_out_vars_from_last_mod) {