mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1396 Update file reader based on API changes in ERT
This commit is contained in:
@@ -121,22 +121,22 @@ bool RifEclipseInputFileTools::openGridFile(const QString& fileName, RigEclipseC
|
||||
bool allKwReadOk = true;
|
||||
|
||||
fseek(gridFilePointer, specgridPos, SEEK_SET);
|
||||
allKwReadOk = allKwReadOk && NULL != (specGridKw = ecl_kw_fscanf_alloc_current_grdecl__(gridFilePointer, false , ECL_INT_TYPE));
|
||||
allKwReadOk = allKwReadOk && NULL != (specGridKw = ecl_kw_fscanf_alloc_current_grdecl__(gridFilePointer, false , ecl_type_create_from_type(ECL_INT_TYPE)));
|
||||
progress.setProgress(1);
|
||||
|
||||
fseek(gridFilePointer, zcornPos, SEEK_SET);
|
||||
allKwReadOk = allKwReadOk && NULL != (zCornKw = ecl_kw_fscanf_alloc_current_grdecl__(gridFilePointer, false , ECL_FLOAT_TYPE));
|
||||
allKwReadOk = allKwReadOk && NULL != (zCornKw = ecl_kw_fscanf_alloc_current_grdecl__(gridFilePointer, false , ecl_type_create_from_type(ECL_FLOAT_TYPE)));
|
||||
progress.setProgress(2);
|
||||
|
||||
fseek(gridFilePointer, coordPos, SEEK_SET);
|
||||
allKwReadOk = allKwReadOk && NULL != (coordKw = ecl_kw_fscanf_alloc_current_grdecl__(gridFilePointer, false , ECL_FLOAT_TYPE));
|
||||
allKwReadOk = allKwReadOk && NULL != (coordKw = ecl_kw_fscanf_alloc_current_grdecl__(gridFilePointer, false , ecl_type_create_from_type(ECL_FLOAT_TYPE)));
|
||||
progress.setProgress(3);
|
||||
|
||||
// If ACTNUM is not defined, this pointer will be NULL, which is a valid condition
|
||||
if (actnumPos >= 0)
|
||||
{
|
||||
fseek(gridFilePointer, actnumPos, SEEK_SET);
|
||||
allKwReadOk = allKwReadOk && NULL != (actNumKw = ecl_kw_fscanf_alloc_current_grdecl__(gridFilePointer, false , ECL_INT_TYPE));
|
||||
allKwReadOk = allKwReadOk && NULL != (actNumKw = ecl_kw_fscanf_alloc_current_grdecl__(gridFilePointer, false , ecl_type_create_from_type(ECL_INT_TYPE)));
|
||||
progress.setProgress(4);
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ bool RifEclipseInputFileTools::openGridFile(const QString& fileName, RigEclipseC
|
||||
if (mapaxesPos >= 0)
|
||||
{
|
||||
fseek(gridFilePointer, mapaxesPos, SEEK_SET);
|
||||
mapAxesKw = ecl_kw_fscanf_alloc_current_grdecl__( gridFilePointer, false , ECL_FLOAT_TYPE);
|
||||
mapAxesKw = ecl_kw_fscanf_alloc_current_grdecl__( gridFilePointer, false , ecl_type_create_from_type(ECL_FLOAT_TYPE));
|
||||
}
|
||||
|
||||
if (!allKwReadOk)
|
||||
@@ -228,7 +228,7 @@ std::map<QString, QString> RifEclipseInputFileTools::readProperties(const QStrin
|
||||
|
||||
fseek(gridFilePointer, fileKeywords[i].filePos, SEEK_SET);
|
||||
|
||||
ecl_kw_type* eclipseKeywordData = ecl_kw_fscanf_alloc_current_grdecl__(gridFilePointer, false, ECL_FLOAT_TYPE);
|
||||
ecl_kw_type* eclipseKeywordData = ecl_kw_fscanf_alloc_current_grdecl__(gridFilePointer, false, ecl_type_create_from_type(ECL_FLOAT_TYPE));
|
||||
if (eclipseKeywordData)
|
||||
{
|
||||
QString newResultName = caseData->results(RifReaderInterface::MATRIX_RESULTS)->makeResultNameUnique(fileKeywords[i].keyword);
|
||||
@@ -261,7 +261,7 @@ bool RifEclipseInputFileTools::readProperty(const QString& fileName, RigEclipseC
|
||||
FILE* filePointer = util_fopen(fileName.toLatin1().data(), "r");
|
||||
if (!filePointer) return false;
|
||||
|
||||
ecl_kw_type* eclipseKeywordData = ecl_kw_fscanf_alloc_grdecl_dynamic__(filePointer, eclipseKeyWord.toLatin1().data(), false, ECL_FLOAT_TYPE);
|
||||
ecl_kw_type* eclipseKeywordData = ecl_kw_fscanf_alloc_grdecl_dynamic__(filePointer, eclipseKeyWord.toLatin1().data(), false, ecl_type_create_from_type(ECL_FLOAT_TYPE));
|
||||
bool isOk = false;
|
||||
if (eclipseKeywordData)
|
||||
{
|
||||
|
||||
@@ -382,8 +382,9 @@ void RifEclipseOutputFileTools::createReportStepsMetaData(std::vector<ecl_file_t
|
||||
int namedKeywordCount = ecl_file_get_num_named_kw(ecl_file, kw);
|
||||
for (int iOcc = 0; iOcc < namedKeywordCount; iOcc++)
|
||||
{
|
||||
ecl_type_enum dataType = ecl_file_iget_named_type(ecl_file, kw, iOcc);
|
||||
if (dataType != ECL_DOUBLE_TYPE && dataType != ECL_FLOAT_TYPE && dataType != ECL_INT_TYPE)
|
||||
ecl_data_type dataType = ecl_file_iget_named_data_type(ecl_file, kw, iOcc);
|
||||
ecl_type_enum dataTypeEmum = ecl_type_get_type(dataType);
|
||||
if (dataTypeEmum != ECL_DOUBLE_TYPE && dataTypeEmum != ECL_FLOAT_TYPE && dataTypeEmum != ECL_INT_TYPE)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user