diff --git a/scripts/build_pestpp_linux.sh b/scripts/build_pestpp_linux.sh index 4a5499e16..5cd097b5f 100755 --- a/scripts/build_pestpp_linux.sh +++ b/scripts/build_pestpp_linux.sh @@ -1,6 +1,6 @@ # this should be run from one dir level up - the repo root... rm -rf build mkdir build && cd build -cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=g++-9 .. +cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=g++ .. make -j install cpack -G TGZ diff --git a/src/libs/common/config_os.h b/src/libs/common/config_os.h index d71e20c53..92f4a8316 100644 --- a/src/libs/common/config_os.h +++ b/src/libs/common/config_os.h @@ -2,7 +2,7 @@ #define CONFIG_OS_H_ -#define PESTPP_VERSION "5.2.5"; +#define PESTPP_VERSION "5.2.6"; #if defined(_WIN32) || defined(_WIN64) #define OS_WIN diff --git a/src/libs/common/utilities.cpp b/src/libs/common/utilities.cpp index 1525400ba..405a1ebfe 100644 --- a/src/libs/common/utilities.cpp +++ b/src/libs/common/utilities.cpp @@ -918,6 +918,7 @@ void read_dense_binary(const string& filename, vector& row_names, vector pest_utils::upper_ip(name); col_names.push_back(name); i++; + delete[] col_name; } i = 0; double data = -1.; @@ -956,6 +957,7 @@ void read_dense_binary(const string& filename, vector& row_names, vector break; } name = string(row_name, name_size); + delete[] row_name; pest_utils::strip_ip(name); pest_utils::upper_ip(name); if (!in.good()) @@ -965,10 +967,12 @@ void read_dense_binary(const string& filename, vector& row_names, vector cout << ss.str(); break; } + //skip the values //in.seekg(col_names.size() * sizeof(double), ios_base::cur); - row_name = new char[sizeof(double) * col_names.size()]; - in.read(row_name, sizeof(double)* col_names.size()); + char* rest_of_line = new char[sizeof(double) * col_names.size()]; + in.read(rest_of_line, sizeof(double)* col_names.size()); + delete[] rest_of_line; if (in.eof()) break; if (!in.good()) @@ -1520,7 +1524,7 @@ void ExternalCtlFile::read_file(ofstream& f_rec) throw_externalctrlfile_error("filename '" + filename + "' not found"); } ifstream f_in(filename); - if (!f_in.good()) + if (f_in.bad()) { throw_externalctrlfile_error("error opening filename '" + filename + "' for reading"); } @@ -1542,10 +1546,10 @@ void ExternalCtlFile::read_file(ofstream& f_rec) cleaned = true; } } - if (cleaned) - { +// if (cleaned) +// { strip_ip(t); - } +// } } int hsize = col_names.size(); set tset; diff --git a/src/libs/pestpp_common/Ensemble.cpp b/src/libs/pestpp_common/Ensemble.cpp index d7df5fc97..bf8f940c7 100644 --- a/src/libs/pestpp_common/Ensemble.cpp +++ b/src/libs/pestpp_common/Ensemble.cpp @@ -3169,6 +3169,7 @@ void ParameterEnsemble::to_dense_ordered(string file_name) fout.write((char*)&tmp, sizeof(tmp)); mx = max(tmp, mx); } + for (vector::const_iterator b = vnames.begin(), e = vnames.end(); b != e; ++b) { @@ -3176,7 +3177,9 @@ void ParameterEnsemble::to_dense_ordered(string file_name) char* par_name = new char[name.size()]; pest_utils::string_to_fortran_char(name, par_name, name.size()); fout.write(par_name, name.size()); + delete[] par_name; } + //write matrix n = 0; @@ -3191,6 +3194,7 @@ void ParameterEnsemble::to_dense_ordered(string file_name) par_transform.ctl2model_ip(org_pars); else if (tstat == transStatus::NUM) par_transform.ctl2numeric_ip(org_pars); + for (int irow = 0; irow < n_real; ++irow) { //Parameters pars(var_names, reals.row(irow)); @@ -3212,6 +3216,7 @@ void ParameterEnsemble::to_dense_ordered(string file_name) fout.write((char*)&tmp, sizeof(tmp)); pest_utils::string_to_fortran_char(name, real_name, tmp); fout.write(real_name, tmp); + delete[] real_name; for (int jcol = 0; jcol < n_var; ++jcol) { data = pars[vnames[jcol]]; @@ -3296,6 +3301,7 @@ void ParameterEnsemble::to_dense_unordered(string file_name) char* par_name = new char[name.size()]; pest_utils::string_to_fortran_char(name, par_name, name.size()); fout.write(par_name, name.size()); + delete[] par_name; } //write matrix @@ -3313,6 +3319,7 @@ void ParameterEnsemble::to_dense_unordered(string file_name) fout.write((char*)&tmp, sizeof(tmp)); pest_utils::string_to_fortran_char(name, real_name, tmp); fout.write(real_name, tmp); + delete[] real_name; for (int jcol = 0; jcol < var_names.size(); ++jcol) { data = t[jcol]; diff --git a/src/libs/pestpp_common/EnsembleMethodUtils.cpp b/src/libs/pestpp_common/EnsembleMethodUtils.cpp index 5deb36240..7acd5258e 100644 --- a/src/libs/pestpp_common/EnsembleMethodUtils.cpp +++ b/src/libs/pestpp_common/EnsembleMethodUtils.cpp @@ -1152,6 +1152,7 @@ void EnsembleSolver::solve(int num_threads, double cur_lam, bool use_glm_form, P } if (num_exp > 0) { + performance_log->log_event(ss.str()); throw runtime_error(ss.str()); } delete ut_ptr; @@ -1350,7 +1351,8 @@ void UpgradeThread::ensemble_solution(const int iter, const int verbose_level,co Eigen::MatrixXd ivec, s, s2, V, Ut, d_dash; string key; - local_utils::save_mat(verbose_level, thread_id, iter, t_count, "weights", weights.toDenseMatrix()); + Eigen::MatrixXd wtemp = weights.diagonal().matrix(); + local_utils::save_mat(verbose_level, thread_id, iter, t_count, "weights", wtemp); local_utils::save_mat(verbose_level, thread_id, iter, t_count, "obs_resid", obs_resid); obs_resid = weights * obs_resid; local_utils::save_mat(verbose_level, thread_id, iter, t_count, "scaled_obs_resid", obs_resid); @@ -1367,6 +1369,11 @@ void UpgradeThread::ensemble_solution(const int iter, const int verbose_level,co Eigen::MatrixXd temp = parcov_inv.toDenseMatrix(); local_utils::save_mat(verbose_level, thread_id, iter, t_count, "parcov_inv", temp); } + else + { + Eigen::MatrixXd temp = parcov_inv.diagonal().matrix(); + local_utils::save_mat(verbose_level, thread_id, iter, t_count, "parcov_inv", temp); + } if (act_obs_names.size() > 0) { //this works bc the mm solve doesnt pass these names... ss.str(""); ss << "solution scaling factor: " << scale << endl; @@ -3508,6 +3515,8 @@ void L2PhiHandler::report_group(bool echo) { { for (auto& oo : o.second) { + if (oo.second == 0.0) + continue; len = max(len,(int)oo.first.size()); } break; @@ -3543,13 +3552,13 @@ void L2PhiHandler::report_group(bool echo) { g = pair.first; ss.str(""); ss << left << setw(len) << pest_utils::lower_cp(g) << " "; - ss << right << setw(9) << mn_map[g] << " "; - ss << setw(9) << std_map[g] << " "; - ss << setw(9) << mmn_map[g] << " "; - ss << setw(9) << mx_map[g] << " "; + ss << right << setw(9) << setprecision(3) << mn_map[g] << " "; + ss << setw(9) << setprecision(3) << std_map[g] << " "; + ss << setw(9) << setprecision(3) << mmn_map[g] << " "; + ss << setw(9) << setprecision(3) << mx_map[g] << " "; - ss << setw(9) << 100. * pmn_map[g] << " "; - ss << setw(9) << 100. * pstd_map[g]; + ss << setw(9) << setprecision(3) << 100. * pmn_map[g] << " "; + ss << setw(9) << setprecision(3) << 100. * pstd_map[g]; //ss << setw(15) << 100. * pmmn_map[g]; //ss << setw(15) << 100. * pmx_map[g]; ss << endl; @@ -4433,7 +4442,7 @@ void ParChangeSummarizer::write_to_csv(string& filename) { f << pest_utils::lower_cp(grp_name) << "," << mean_change[grp_name]*100.0 << "," << std_change[grp_name]*100.0 << ","; f << num_at_lbound[grp_name] << "," << percent_at_lbound[grp_name]; - f << num_at_ubound[grp_name] << "," << percent_at_ubound[grp_name]; + f << "," << num_at_ubound[grp_name] << "," << percent_at_ubound[grp_name]; f <<","<< init_cv[grp_name] << "," << curr_cv[grp_name] << endl; } f.close(); @@ -4674,10 +4683,12 @@ vector run_ensemble_util(PerformanceLog* performance_log, ofstream& frec,Pa { ss.str(""); ss << "error running ensemble: " << e.what(); + performance_log->log_event(ss.str()); throw runtime_error(ss.str()); } catch (...) { + performance_log->log_event("error running ensemble"); throw runtime_error(string("error running ensemble")); } @@ -4696,10 +4707,12 @@ vector run_ensemble_util(PerformanceLog* performance_log, ofstream& frec,Pa { ss.str(""); ss << "error processing runs: " << e.what(); + performance_log->log_event(ss.str()); throw runtime_error(ss.str()); } catch (...) { + performance_log->log_event("error processing runs"); throw runtime_error(string("error processing runs")); } diff --git a/src/libs/pestpp_common/FileManager.cpp b/src/libs/pestpp_common/FileManager.cpp index fc8227e1c..d46a5662a 100644 --- a/src/libs/pestpp_common/FileManager.cpp +++ b/src/libs/pestpp_common/FileManager.cpp @@ -61,7 +61,7 @@ void FileManager::open_default_files(bool restart) FileManager::~FileManager(void) { - /*for (auto &i : ofile_map) + for (auto &i : ofile_map) { if(i.second->is_open()) i.second->close(); delete i.second; @@ -75,7 +75,7 @@ FileManager::~FileManager(void) { if(i.second->is_open()) i.second->close(); delete i.second; - }*/ + } } string FileManager::build_filename(const string &ext, bool include_dir) diff --git a/src/libs/pestpp_common/MOEA.cpp b/src/libs/pestpp_common/MOEA.cpp index 9b160eb14..657915b84 100644 --- a/src/libs/pestpp_common/MOEA.cpp +++ b/src/libs/pestpp_common/MOEA.cpp @@ -3435,6 +3435,7 @@ ParameterEnsemble MOEA::generate_pso_population(int num_members, ParameterEnsemb { //generate this first before pso resets the objectives member map... ParameterEnsemble temp(&pest_scenario, _dp.get_rand_gen_ptr()); + if (num_members > _dp.shape().first) { int num_reals = num_members - _dp.shape().first; @@ -3449,11 +3450,12 @@ ParameterEnsemble MOEA::generate_pso_population(int num_members, ParameterEnsemb if (temp.shape().first > 0) { new_dp.append_other_rows(temp); + pso_pbest_dp.append_other_rows(temp); vector real_names = temp.get_real_names(); - temp = get_initial_pso_velocities(temp.shape().first); - temp.set_real_names(real_names); - cur_velocity.append_other_rows(temp); + ParameterEnsemble ptemp = get_initial_pso_velocities(temp.shape().first); + ptemp.set_real_names(real_names); + cur_velocity.append_other_rows(ptemp); } @@ -3491,8 +3493,19 @@ ParameterEnsemble MOEA::generate_pso_population(int num_members, ParameterEnsemb vector fi_fixed_names = _dp.get_fixed_info().get_fixed_names(); new_dp.get_fixed_info().set_fixed_names(fi_fixed_names); map fi; + vector rnames = _dp.get_fixed_info().get_real_names(); + set sdp_rnames(rnames.begin(),rnames.end()); + set::iterator dpend = sdp_rnames.end(); + rnames = temp.get_fixed_info().get_real_names(); + set stemp_rnames(rnames.begin(),rnames.end()); + set::iterator tend = stemp_rnames.end(); for (auto &p : primary_parent_map) { - fi = _dp.get_fixed_info().get_real_fixed_values(p.second); + if (sdp_rnames.find(p.second) != dpend) + fi = _dp.get_fixed_info().get_real_fixed_values(p.second); + else if (stemp_rnames.find(p.second) != tend) + fi = temp.get_fixed_info().get_real_fixed_values(p.second); + else + throw_moea_error("fixed info for existing realization '"+p.second+"' not found"); new_dp.get_fixed_info().add_realization(p.first, fi); } } diff --git a/src/libs/pestpp_common/OutputFileWriter.cpp b/src/libs/pestpp_common/OutputFileWriter.cpp index 5dd130a33..f89f6786b 100644 --- a/src/libs/pestpp_common/OutputFileWriter.cpp +++ b/src/libs/pestpp_common/OutputFileWriter.cpp @@ -281,7 +281,8 @@ void OutputFileWriter::scenario_report(std::ostream &os, bool report_mode) os << setw(0) << " Number of parameters = " << pest_scenario.get_ctl_ordered_par_names().size() << endl; os << setw(0) << " Number of adjustable parameters = " << pest_scenario.get_n_adj_par() << endl; os << setw(0) << " Number of observations = " << pest_scenario.get_ctl_ordered_obs_names().size() << endl; - os << setw(0) << " Number of prior estimates = " << pest_scenario.get_ctl_ordered_pi_names().size() << endl << endl; + os << setw(0) << " Number of non-zero weighted observations = " << pest_scenario.get_ctl_ordered_nz_obs_names().size() << endl; + os << setw(0) << " Number of prior estimates = " << pest_scenario.get_ctl_ordered_pi_names().size() << endl << endl; os << pest_scenario.get_control_info() << endl; pest_scenario.get_pestpp_options().summary(os); diff --git a/src/libs/pestpp_common/Pest.cpp b/src/libs/pestpp_common/Pest.cpp index 53d29efde..e63ab9f7a 100644 --- a/src/libs/pestpp_common/Pest.cpp +++ b/src/libs/pestpp_common/Pest.cpp @@ -55,12 +55,18 @@ void Pest::set_defaults() { pestpp_options.set_defaults(); svd_info.set_defaults(); - regul_scheme_ptr = new DynamicRegularization; - regul_scheme_ptr->set_defaults(); + regul_scheme_ptr = 0;//new DynamicRegularization; + //regul_scheme_ptr->set_defaults(); control_info.set_defaults(); } +void Pest::set_default_dynreg() +{ + regul_scheme_ptr = new DynamicRegularization; + regul_scheme_ptr->set_defaults(); +} + void Pest::check_inputs(ostream &f_rec, bool forgive, bool forgive_parchglim, int cycle) { if (control_info.noptmax == 0) @@ -1015,9 +1021,9 @@ int Pest::process_ctl_file(ifstream& fin, string _pst_filename, ofstream& f_rec) vector tokens_case_sen; vector model_input_formal_names{ "PEST_FILE","MODEL_FILE" }; vector model_output_formal_names{ "PEST_FILE","MODEL_FILE" }; -#ifndef _DEBUG - try { -#endif +//#ifndef _DEBUG +// try { +//#endif prior_info_string = ""; for (lnum = 1, sec_begin_lnum = 1; getline(fin, line); ++lnum) @@ -1685,16 +1691,16 @@ int Pest::process_ctl_file(ifstream& fin, string _pst_filename, ofstream& f_rec) { tokens_to_pi_rec(f_rec, line_upper); } -#ifndef _DEBUG - } - catch (PestConversionError& e) { - std::stringstream out; - out << "Error processing \"" << pst_filename << "\" on line number " << lnum << endl; - out << e.what() << endl; - e.add_front(out.str()); - e.raise(); - } -#endif +//#ifndef _DEBUG +// } +// catch (PestConversionError& e) { +// std::stringstream out; +// out << "Error processing \"" << pst_filename << "\" on line number " << lnum << endl; +// out << e.what() << endl; +// e.add_front(out.str()); +// e.raise(); +// } +//#endif fin.close(); @@ -3066,7 +3072,7 @@ map Pest::get_pars_at_near_bounds(const Parameters & pars, doubl Pest::~Pest() { - /*if (regul_scheme_ptr != 0) + if (regul_scheme_ptr != 0) { try { @@ -3075,7 +3081,7 @@ Pest::~Pest() { catch (...) { } - }*/ + } } pair Pest::parse_keyword_line(ofstream &f_rec, const string &line) diff --git a/src/libs/pestpp_common/Pest.h b/src/libs/pestpp_common/Pest.h index dfe23ad75..b82ab652c 100644 --- a/src/libs/pestpp_common/Pest.h +++ b/src/libs/pestpp_common/Pest.h @@ -41,6 +41,7 @@ class Pest { friend ostream& operator<< (ostream &os, const Pest& val); Pest(); void set_defaults(); + void set_default_dynreg(); void check_inputs(ostream &f_rec, bool forgive=false, bool forgive_parchglim=true,int cycle=NetPackage::NULL_DA_CYCLE); void check_io(ofstream& f_rec, bool echo_errors=true); //int process_ctl_file_old(ifstream &fin, string pst_filename, ofstream &f_rec); diff --git a/src/libs/pestpp_common/covariance.cpp b/src/libs/pestpp_common/covariance.cpp index 310ea9351..491f31981 100644 --- a/src/libs/pestpp_common/covariance.cpp +++ b/src/libs/pestpp_common/covariance.cpp @@ -1319,7 +1319,7 @@ void Covariance::from_uncertainty_file(const string &filename, vector &o throw runtime_error("Cov::from_uncertainty_file() error:EOF encountered while reading standard_deviation block\ from uncertainty file:" + filename); pest_utils::upper_ip(line); - if (line.find("END") != string::npos) + if (line.find("END STANDARD_DEVIATION") != string::npos) { break; } diff --git a/src/libs/pestpp_common/pest_data_structs.cpp b/src/libs/pestpp_common/pest_data_structs.cpp index 45fbb59b2..b70cc4f2f 100644 --- a/src/libs/pestpp_common/pest_data_structs.cpp +++ b/src/libs/pestpp_common/pest_data_structs.cpp @@ -159,6 +159,7 @@ const ParameterGroupInfo& ParameterGroupInfo::operator=(const ParameterGroupInfo ParameterGroupRec* new_ptr = new ParameterGroupRec(*(*it).second); groups[(*it).first] = new_ptr; old2new[(*it).second] = new_ptr; + } unordered_map::iterator it_find; it = rhs.parameter2group.begin(); @@ -168,7 +169,15 @@ const ParameterGroupInfo& ParameterGroupInfo::operator=(const ParameterGroupInfo if (it_find != old2new.end()) parameter2group[(*it).first] = (*it_find).second; } - return *this; +// unordered_map::iterator iit(old2new.begin()); +// unordered_map::iterator eend(old2new.end()); +// +// for (; iit != eend; ++iit) { +// delete (*iit).second; +// delete (*iit).first; +// } + + return *this; } vector ParameterGroupInfo::get_group_names() const @@ -195,11 +204,36 @@ bool ParameterGroupInfo::have_switch_derivative() const ParameterGroupInfo::~ParameterGroupInfo() { - unordered_map::iterator it(groups.begin()); +// unordered_map::iterator it(groups.begin()); +// unordered_map::iterator end(groups.end()); +// for (; it != end; ++it) { +// delete (*it).second; +// } +// +// it = parameter2group.begin(); +// end = parameter2group.end(); +// +// for (; it != end; ++it) { +// delete (*it).second; +// } +} + +void ParameterGroupInfo::free_mem() +{ + unordered_map::iterator it(groups.begin()); unordered_map::iterator end(groups.end()); for (; it != end; ++it) { delete (*it).second; } + + it = parameter2group.begin(); + end = parameter2group.end(); + + for (; it != end; ++it) { + delete (*it).second; + } + groups.clear(); + parameter2group.clear(); } ostream& operator<< (ostream &os, const ParameterGroupInfo &val) @@ -1874,7 +1908,7 @@ void PestppOptions::set_defaults() set_sqp_update_hessian(false); set_sqp_scale_facs(vector{0.00001, 0.0001,0.0005, 0.001, 0.0025, 0.005, 0.01, 0.05, 0.075, 0.1, 0.25,0.5, 1.0,2.,5.,10.,}); - set_mou_generator("DE"); + set_mou_generator("PSO"); set_mou_population_size(100); set_mou_dv_population_file(""); set_mou_obs_population_restart_file(""); diff --git a/src/libs/pestpp_common/pest_data_structs.h b/src/libs/pestpp_common/pest_data_structs.h index a6a8e9b14..02700a7b7 100644 --- a/src/libs/pestpp_common/pest_data_structs.h +++ b/src/libs/pestpp_common/pest_data_structs.h @@ -90,6 +90,7 @@ class ParameterGroupInfo { void par_erase(const string& par_name) { parameter2group.erase(par_name); } void grp_erase(const string& grp_name) { groups.erase(grp_name); } + void free_mem(); ~ParameterGroupInfo(); private: unordered_map groups; @@ -127,7 +128,7 @@ class ParameterInfo { Parameters get_init_value(const vector &keys) const; const ParameterRec* get_parameter_rec_ptr(const string &name) const; ParameterRec* get_parameter_rec_ptr_4_mod(const string &name); - void insert(const string &name, const ParameterRec &rec) {parameter_info[name] = rec;} + void insert(const string &name, ParameterRec rec) {parameter_info[name] = rec;} void erase(const string& name) { parameter_info.erase(name);} ParameterInfo() {} ~ParameterInfo() {} diff --git a/src/libs/run_managers/abstract_base/model_interface.cpp b/src/libs/run_managers/abstract_base/model_interface.cpp index 7e9916b9a..e20c6212a 100644 --- a/src/libs/run_managers/abstract_base/model_interface.cpp +++ b/src/libs/run_managers/abstract_base/model_interface.cpp @@ -1261,6 +1261,10 @@ void InstructionFile::prep_ins_file_for_reading(ifstream& f_ins) if (s_marker.size() != 1) throw_ins_error("marker on first line should be one character, not: " + s_marker); marker = s_marker.c_str()[0]; + if (marker == '!') + { + throw_ins_error("the bang ('!') cant be used as the marker bc it is used to indicate free-format instructions"); + } } diff --git a/src/programs/pest++/pest++.cpp b/src/programs/pest++/pest++.cpp index daf721632..4ead90de3 100644 --- a/src/programs/pest++/pest++.cpp +++ b/src/programs/pest++/pest++.cpp @@ -193,6 +193,7 @@ int main(int argc, char* argv[]) // create pest run and process control file to initialize it Pest pest_scenario; + pest_scenario.set_default_dynreg(); #ifndef _DEBUG try { #endif diff --git a/src/programs/pestpp-da/pestpp-da.cpp b/src/programs/pestpp-da/pestpp-da.cpp index dbbf8f740..99435de0c 100644 --- a/src/programs/pestpp-da/pestpp-da.cpp +++ b/src/programs/pestpp-da/pestpp-da.cpp @@ -1000,7 +1000,11 @@ int main(int argc, char* argv[]) } } - + if (cmdline.runmanagertype == CmdLine::RunManagerType::SERIAL) + { + delete run_manager_ptr; + } + //childPest.get_base_group_info_ptr_4_mod()->free_mem(); } // end cycle loop diff --git a/src/programs/pestpp-opt/pestpp-opt.cpp b/src/programs/pestpp-opt/pestpp-opt.cpp index 4a335ceaa..b548215e3 100644 --- a/src/programs/pestpp-opt/pestpp-opt.cpp +++ b/src/programs/pestpp-opt/pestpp-opt.cpp @@ -273,10 +273,10 @@ int main(int argc, char* argv[]) ObjectiveFunc obj_func(&(pest_scenario.get_ctl_observations()), &(pest_scenario.get_ctl_observation_info()), &(pest_scenario.get_prior_info())); - TerminationController termination_ctl(pest_scenario.get_control_info().noptmax, pest_scenario.get_control_info().phiredstp, - pest_scenario.get_control_info().nphistp, pest_scenario.get_control_info().nphinored, pest_scenario.get_control_info().relparstp, - pest_scenario.get_control_info().nrelpar, pest_scenario.get_regul_scheme_ptr()->get_use_dynamic_reg(), - pest_scenario.get_regul_scheme_ptr()->get_phimaccept()); +// TerminationController termination_ctl(pest_scenario.get_control_info().noptmax, pest_scenario.get_control_info().phiredstp, +// pest_scenario.get_control_info().nphistp, pest_scenario.get_control_info().nphinored, pest_scenario.get_control_info().relparstp, +// pest_scenario.get_control_info().nrelpar, pest_scenario.get_regul_scheme_ptr()->get_use_dynamic_reg(), +// pest_scenario.get_regul_scheme_ptr()->get_phimaccept()); @@ -321,7 +321,7 @@ int main(int argc, char* argv[]) if (success) { - termination_ctl.check_last_iteration(); + //termination_ctl.check_last_iteration(); optimum_run.update_ctl(tmp_pars, tmp_obs); // save parameters to .par file output_file_writer.write_par(file_manager.open_ofile_ext("par"), optimum_run.get_ctl_pars(), *(base_trans_seq.get_offset_ptr()), @@ -341,7 +341,7 @@ int main(int argc, char* argv[]) fout_rec << "Model run failed. No results were recorded." << endl << endl; exit(1); } - termination_ctl.set_terminate(true); + //termination_ctl.set_terminate(true); } diff --git a/src/programs/sweep/sweep.cpp b/src/programs/sweep/sweep.cpp index 756479c47..1b47f6734 100644 --- a/src/programs/sweep/sweep.cpp +++ b/src/programs/sweep/sweep.cpp @@ -414,6 +414,7 @@ int main(int argc, char* argv[]) // create pest run and process control file to initialize it Pest pest_scenario; + pest_scenario.set_default_dynreg(); try { performance_log.log_event("starting to process control file"); pest_scenario.process_ctl_file(file_manager.open_ifile_ext("pst"), file_manager.build_filename("pst"),fout_rec);