From 629e73e3a1fd2019fe8601c9441011cdde1837f1 Mon Sep 17 00:00:00 2001 From: hellkite500 Date: Fri, 16 Aug 2024 12:02:33 -0600 Subject: [PATCH] fix: don't reuse global model params, fixes #871 and #872 --- include/realizations/catchment/Formulation_Manager.hpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/include/realizations/catchment/Formulation_Manager.hpp b/include/realizations/catchment/Formulation_Manager.hpp index f587e1fe36..4140a97309 100644 --- a/include/realizations/catchment/Formulation_Manager.hpp +++ b/include/realizations/catchment/Formulation_Manager.hpp @@ -385,9 +385,11 @@ namespace realization { //because they will eventually be used by someone, someday, looking at configurations //being turned into concrecte formulations... // geojson::JSONProperty::print_property(global_config.formulation.parameters.at("modules")); - global_config.formulation.link_external(feature); - // geojson::JSONProperty::print_property(global_config.formulation.parameters.at("modules")); - missing_formulation->create_formulation(global_config.formulation.parameters); + + //Make a copy of the global configuration so parameters don't clash when linking to external data + auto formulation = realization::config::Formulation(global_config.formulation); + formulation.link_external(feature); + missing_formulation->create_formulation(formulation.parameters); return missing_formulation; }