11867 Do not assume that the first reported time step is initial time step

This commit is contained in:
Magne Sjaastad
2024-11-07 11:38:58 +01:00
parent 94d6f81b0f
commit d2cd425ad0

View File

@@ -260,7 +260,10 @@ void RifEclipseOutputFileTools::timeSteps( const ecl_file_type* ecl_file,
int dayValue = cvf::Math::floor( dayDoubleValue );
if ( useStartOfSimulationDate )
{
reportDateTime = reportDateTime.addDays( dayValue );
// Do not assume the first day value is zero. Adjust the day value to be relative to the first day value
// https://github.com/OPM/ResInsight/issues/11867
const int adjustedDayValue = dayValue - dayValues.front();
reportDateTime = reportDateTime.addDays( adjustedDayValue );
}
double dayFraction = dayDoubleValue - dayValue;