Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix using the forcing file header error. #624

Merged
merged 2 commits into from
Sep 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 3 additions & 15 deletions include/realizations/catchment/Bmi_Multi_Formulation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,22 +239,10 @@ namespace realization {

time_t get_variable_time_begin(const std::string &variable_name) {
std::string var_name = variable_name;
// when unspecified, assume all data is available for the same range.
// If no var_name, use forcing ...
if(var_name == "*" || var_name == ""){
// when unspecified, assume all data is available for the same range.
// Find one that successfully returns...
for(std::map<std::string,std::shared_ptr<data_access::GenericDataProvider>>::iterator iter = availableData.begin(); iter != availableData.end(); ++iter)
{
var_name = iter->first;
//TODO: Find a probably more performant way than trial and exception here.
try {
time_t rv = availableData[var_name]->get_data_start_time();
return rv;
}
catch (...){
continue;
}
break;
}
return forcing->get_data_start_time();
}
// If not found ...
if (availableData.empty() || availableData.find(var_name) == availableData.end()) {
Expand Down