mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#4927 Blind attempt at improving reliability of smspec import
This commit is contained in:
parent
dc2af5e0c8
commit
285433cbb8
@ -173,6 +173,8 @@ std::vector<RifRestartFileInfo> RifReaderEclipseSummary::getRestartFiles( const
|
||||
m_warnings.clear();
|
||||
*hasWarnings = false;
|
||||
|
||||
std::set<QString> restartFilesOpened;
|
||||
|
||||
RifRestartFileInfo currFile;
|
||||
currFile.fileName = headerFileName;
|
||||
while ( !currFile.fileName.isEmpty() )
|
||||
@ -216,6 +218,12 @@ std::vector<RifRestartFileInfo> RifReaderEclipseSummary::getRestartFiles( const
|
||||
*hasWarnings = true;
|
||||
break;
|
||||
}
|
||||
else if ( restartFilesOpened.count( currFile.fileName ) != 0u )
|
||||
{
|
||||
m_warnings.push_back( "RifReaderEclipseSummary: Same restart file being opened multiple times" );
|
||||
*hasWarnings = true;
|
||||
}
|
||||
restartFilesOpened.insert( currFile.fileName );
|
||||
}
|
||||
|
||||
if ( !currFile.fileName.isEmpty() ) restartFiles.push_back( currFile );
|
||||
|
12
ThirdParty/Ert/lib/ecl/ecl_smspec.cpp
vendored
12
ThirdParty/Ert/lib/ecl/ecl_smspec.cpp
vendored
@ -1230,8 +1230,16 @@ ecl_smspec_type * ecl_smspec_fread_alloc(const char *header_file, const char * k
|
||||
const ecl::smspec_node * day_node = ecl_smspec_get_var_node(ecl_smspec->misc_var_index, "DAY");
|
||||
if (day_node != NULL) {
|
||||
ecl_smspec->day_index = smspec_node_get_params_index( day_node );
|
||||
ecl_smspec->month_index = smspec_node_get_params_index( &ecl_smspec->misc_var_index["MONTH"] );
|
||||
ecl_smspec->year_index = smspec_node_get_params_index( &ecl_smspec->misc_var_index["YEAR"] );
|
||||
|
||||
const ecl::smspec_node * month_node = ecl_smspec_get_var_node(ecl_smspec->misc_var_index, "MONTH");
|
||||
if (month_node != NULL) {
|
||||
ecl_smspec->month_index = smspec_node_get_params_index( month_node );
|
||||
}
|
||||
|
||||
const ecl::smspec_node * year_node = ecl_smspec_get_var_node(ecl_smspec->misc_var_index, "YEAR");
|
||||
if (year_node != NULL) {
|
||||
ecl_smspec->year_index = smspec_node_get_params_index( year_node );
|
||||
}
|
||||
}
|
||||
|
||||
if ((ecl_smspec->time_index == -1) && ( ecl_smspec->day_index == -1)) {
|
||||
|
Loading…
Reference in New Issue
Block a user