Read units type from file and set CDARCHY value based on units type

This commit is contained in:
Magne Sjaastad
2014-08-27 14:05:35 +02:00
parent d76dd6a588
commit ffbfb8bdf0
12 changed files with 143 additions and 19 deletions
@@ -329,3 +329,26 @@ void RifEclipseOutputFileTools::readGridDimensions(const QString& gridFileName,
stringlist_free( lgr_names );
}
//--------------------------------------------------------------------------------------------------
/// Returns the following integer values from the first INTEHEAD keyword found
/// 1 : METRIC
/// 2 : FIELD
/// 3 : LAB
/// -1 : No INTEHEAD keyword found
//--------------------------------------------------------------------------------------------------
int RifEclipseOutputFileTools::readUnitsType(ecl_file_type* ecl_file)
{
int unitsType = -1;
if (ecl_file)
{
ecl_kw_type* kwINTEHEAD = ecl_file_iget_named_kw(ecl_file, INTEHEAD_KW, 0);
if (kwINTEHEAD)
{
unitsType = ecl_kw_iget_int(kwINTEHEAD, INTEHEAD_UNIT_INDEX);
}
}
return unitsType;
}