Skip to content

Also output RUNTIMEI to SMSPEC file.#4878

Draft
blattms wants to merge 3 commits intoOPM:masterfrom
blattms:feature/support-runtimei
Draft

Also output RUNTIMEI to SMSPEC file.#4878
blattms wants to merge 3 commits intoOPM:masterfrom
blattms:feature/support-runtimei

Conversation

@blattms
Copy link
Member

@blattms blattms commented Jan 2, 2026

This is needed by some external tools.

RUNTIMEI is an integer vector of size 50 and we store the following

  • item 1: 2 if simulation is finshed, 1 otherwise
  • item 3: The index of the first report step of the simulation (zero-based)
  • item 4: The index of the current report step of the simulation (zero-based)
  • item 5-9: When the simulation was started (YYYY, MM, DD, HH, MM, SS). Note that this a rough approximation as we use the time that initialize output.
  • item 10-14: The simulation time when the last report step was written (YYYY, MM, DD, HH, MM, SS)
  • item 35: The value used for BASIC of RPTRST or 0 if that was omitted.

All other items are zero.

@blattms
Copy link
Member Author

blattms commented Jan 2, 2026

Jenkins for all regression tests should fail as we added another output vector.

@blattms blattms added the manual:new-feature This is a new feature and should be described in the manual label Jan 2, 2026
@blattms
Copy link
Member Author

blattms commented Jan 2, 2026

jenkins build this please

@blattms
Copy link
Member Author

blattms commented Jan 5, 2026

OK. seems like SMSPEC file is not tested.

Copy link
Member

@bska bska left a comment

Choose a reason for hiding this comment

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

This is a good start. I'd appreciate some additional refactoring before merging though.

Copy link
Member Author

@blattms blattms left a comment

Choose a reason for hiding this comment

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

comments have been addressed.

@blattms
Copy link
Member Author

blattms commented Jan 12, 2026

jenkins build this please

@bska
Copy link
Member

bska commented Jan 12, 2026

We cannot reuse that logic as it is different for the two date types

The part that constructs the tm object–i.e., the call to std::gmtime()–is common to both uses and should be a separate helper function.

@blattms blattms force-pushed the feature/support-runtimei branch from d937781 to 221184f Compare January 12, 2026 14:34
@blattms
Copy link
Member Author

blattms commented Jan 12, 2026

jenkins build this please

@blattms
Copy link
Member Author

blattms commented Jan 15, 2026

jenkins build this please

@blattms blattms force-pushed the feature/support-runtimei branch 3 times, most recently from b6a0f9b to 368eec9 Compare February 23, 2026 13:00
@blattms blattms force-pushed the feature/support-runtimei branch from 368eec9 to 23b0b41 Compare March 5, 2026 11:39
@blattms
Copy link
Member Author

blattms commented Mar 6, 2026

jenkins build this opm-simulators=6894 please

@blattms
Copy link
Member Author

blattms commented Mar 6, 2026

This is based on #5038 now to get a correct value for Item 1 if the simulation is stopped in an ACTIONX

blattms added 3 commits March 11, 2026 16:38
The final write is special as it might create an RSM file.
Up to now we created this file only for the last write of the last
report step of a simulation.

This approach neglected that a simulation might finish before the last
step if it encounters an EXIT keyword inside of an executed ACTIONX
statement.

With this change we will also write an RSM file in this case. Such a
file was missing before.
This is needed by some external tools.

RUNTIMEI is an integer vector of size 50 and we store the following
- item 1: 2 if simulation is finshed, 1 otherwise
- item 3: The index of the first report step of the
           simulation (zero-based)
- item 4:  The index of the current report step of the
           simulation (zero-based)
- item 5-9: When the simulation was started (YYYY, MM, DD, HH, MM,
            SS). Note that this a rough approximation as we use the time that
            initialize output.
- item 10-14: The simulation time when the last report step was
            written (YYYY, MM, DD, HH, MM, SS)
- item 35: The value used for BASIC of RPTRST or 0 if that was omitted.

All other items are zero.
Before we would have written the file only after the first time step
of the last report step.
Hence simulations that did adaptive time stepping would stay marked as
not finished for upcoming RUNTIMEI support.

Previously, if output writing of arrays WGNAMES and KEYWORDS changed
due to e.g. ACTIONX in one of the adaptive time steps that was also
not reflected in the in the SMSPEC file.
@blattms blattms force-pushed the feature/support-runtimei branch from 23b0b41 to 1111d91 Compare March 13, 2026 11:10
@blattms
Copy link
Member Author

blattms commented Mar 13, 2026

In the last commit there is another fix for a bug that I discovered. We did not always write the SMSPEC file at the end of the simulation. If there was an adaptive timestep during the last report step, we would end up with the write out after the first time step of that report step. We might therefore miss some keywords or wgnames if there were changes due to ACTIONX

@blattms
Copy link
Member Author

blattms commented Mar 13, 2026

jenkins build this opm-simulators=6894 please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

manual:new-feature This is a new feature and should be described in the manual

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants