diff --git a/src/libs/pestpp_common/EnsembleMethodUtils.cpp b/src/libs/pestpp_common/EnsembleMethodUtils.cpp index aac66d72..c1379895 100644 --- a/src/libs/pestpp_common/EnsembleMethodUtils.cpp +++ b/src/libs/pestpp_common/EnsembleMethodUtils.cpp @@ -4319,8 +4319,8 @@ bool EnsembleMethod::should_terminate(int current_n_iter_mean) message(1, "nphinored (also used for consecutive bad lambda cycles): ", nphinored); //int n_mean_iter = pest_scenario.get_pestpp_options().get_ies_n_iter_mean(); vector::iterator begin_idx = best_mean_phis.begin(); - if ((current_n_iter_mean > 0) && (best_mean_phis.size() > current_n_iter_mean)) - begin_idx = best_mean_phis.end() - (current_n_iter_mean+1); //bc of prior phi and then adding the mean shift to the list + //if ((current_n_iter_mean > 0) && (best_mean_phis.size() > current_n_iter_mean)) + // begin_idx = best_mean_phis.end() - (current_n_iter_mean+1); //bc of prior phi and then adding the mean shift to the list if (best_mean_phis.size() > 0) { @@ -4341,7 +4341,8 @@ bool EnsembleMethod::should_terminate(int current_n_iter_mean) for (auto& phi : best_mean_phis) { ratio = (phi - best_phi_yet) / phi; - if ((i>=(iter - current_n_iter_mean)) && (ratio <= phiredstp)) + //if ((i>=(iter - current_n_iter_mean)) && (ratio <= phiredstp)) + if (ratio <= phiredstp) count++; i++; } diff --git a/src/libs/pestpp_common/EnsembleSmoother.cpp b/src/libs/pestpp_common/EnsembleSmoother.cpp index 142af322..96038c14 100644 --- a/src/libs/pestpp_common/EnsembleSmoother.cpp +++ b/src/libs/pestpp_common/EnsembleSmoother.cpp @@ -78,7 +78,7 @@ void IterEnsembleSmoother::iterate_2_solution() //if ((n_iter_mean > 0) && (solution_iter % n_iter_mean == 0)) iters_since_reinflate++; - if ((current_n_iter_mean > 0) && (iters_since_reinflate >= current_n_iter_mean)) + if ((current_n_iter_mean != 0) && (iters_since_reinflate >= current_n_iter_mean)) { iter++; reset_par_ensemble_to_prior_mean(); @@ -86,7 +86,6 @@ void IterEnsembleSmoother::iterate_2_solution() n_iter_mean_idx++; if (n_iter_mean.size() > n_iter_mean_idx) { - current_n_iter_mean = n_iter_mean[n_iter_mean_idx]; } } @@ -94,11 +93,11 @@ void IterEnsembleSmoother::iterate_2_solution() if (should_terminate(current_n_iter_mean)) { //if (iter > pest_scenario.get_pestpp_options().get_ies_n_iter_mean()) { - if (iter > current_n_iter_mean) { + if (current_n_iter_mean == 0) { break; } else{ - message(1,"continuing iterations to satisfy ies_n_iter_mean"); + message(1,"continuing iterations because reinflation is in use"); } }