Skip to content

RifReaderOpmCommon: Compute restart data size locally - #14713

Open
kriben wants to merge 1 commit into
devfrom
restart-file-size-util
Open

RifReaderOpmCommon: Compute restart data size locally#14713
kriben wants to merge 1 commit into
devfrom
restart-file-size-util

Conversation

@kriben

@kriben kriben commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@kriben
kriben requested a review from magnesj September 9, 2026 13:20
@kriben
kriben marked this pull request as ready for review September 11, 2026 07:02
@kriben kriben self-assigned this Sep 11, 2026
std::int64_t currentReportIndex = isUnified ? -1 : 0;
for ( const auto& entry : entries )
{
if ( std::get<0>( entry ) == "SEQNUM" ) ++currentReportIndex;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explain why SEQNUM has special treatment.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SEQNUM is special because it defines report-step boundaries in an Eclipse unified restart file (.UNRST).

A unified file is structured roughly as:

  SEQNUM = report step 0                                                                                                                 
    INTEHEAD                                                                                                                             
    PRESSURE                                                                                                                             
    ...                                                                                                                                  
    LGR                                                                                                                                  
    PRESSURE                                                                                                                             
    ...                                                                                                                                  
  SEQNUM = report step 10                                                                                                                
    INTEHEAD                                                                                                                             
    PRESSURE                                                                                                                             
    ...                                                                                                                                  

Therefore, in RifReaderOpmCommon::restartDataSize():

  • The presence of SEQNUM means the restart file is unified.
  • Each SEQNUM starts a new report-step block.
  • currentReportIndex starts at -1, because the first SEQNUM advances it to report index 0.
  • The increment happens before testing the keyword, allowing SEQNUM itself to be counted as part of the report step.
  • reportIndex is an ordinal index, not the report-step number. This matters because report-step numbers may be non-contiguous, such as
    0, 10, 20.

A separate restart file such as .X0010 contains only one report step and normally has no SEQNUM. For that case, the entire file is
report index 0, so currentReportIndex starts at 0.

@kriben
kriben force-pushed the restart-file-size-util branch from 8dff6ab to 47dca79 Compare September 14, 2026 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants