Skip to content

Commit

Permalink
fix: seek to beginning of config file after looking for verbose key (#33
Browse files Browse the repository at this point in the history
)

* fix: seek to beginning of config file after looking for verbose key; fixes #32

* fix: clear ifstream flags before seeking

Co-authored-by: Nels <[email protected]>

---------

Co-authored-by: Nels <[email protected]>
  • Loading branch information
aaraney and hellkite500 authored Sep 12, 2024
1 parent 567adc7 commit 5120df4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lgar.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@ extern void InitFromConfigFile(string config_file, struct model_state *state)
}
}

// seek to beginning of input after searching for 'verbosity'
fp.clear();
fp.seekg(0, fp.beg);

if (verbosity.compare("none") != 0) {
std::cerr<<"------------- Initialization from config file ---------------------- \n";
Expand Down Expand Up @@ -2646,4 +2649,4 @@ extern double lgar_theta_mass_balance(int layer_num, int soil_num, double psi_cm

}

#endif
#endif

0 comments on commit 5120df4

Please sign in to comment.