diff --git a/ebos/eclbasevanguard.hh b/ebos/eclbasevanguard.hh index d78d158b5..7035f9d6a 100644 --- a/ebos/eclbasevanguard.hh +++ b/ebos/eclbasevanguard.hh @@ -444,21 +444,20 @@ public: parseContext_ = createParseContext(); } + std::optional outputInterval; + int output_param = EWOMS_GET_PARAM(TypeTag, int, EclOutputInterval); + if (output_param >= 0) + outputInterval = output_param; + readDeck(myRank, fileName, deck_, eclState_, eclSchedule_, eclSummaryConfig_, std::move(errorGuard), python, std::move(parseContext_), /* initFromRestart = */ false, - /* checkDeck = */ enableExperiments); + /* checkDeck = */ enableExperiments, outputInterval); this->summaryState_ = std::make_unique( Opm::TimeService::from_time_t(this->eclSchedule_->getStartTime() )); this->udqState_ = std::make_unique( this->eclSchedule_->getUDQConfig(0).params().undefinedValue() ); this->actionState_ = std::make_unique() ; - // Possibly override IOConfig setting for how often RESTART files should get - // written to disk (every N report step) - int outputInterval = EWOMS_GET_PARAM(TypeTag, int, EclOutputInterval); - if (outputInterval >= 0) - schedule().rst_override_interval(outputInterval); - // Initialize parallelWells with all local wells const auto& schedule_wells = schedule().getWellsatEnd(); parallelWells_.reserve(schedule_wells.size()); diff --git a/opm/simulators/flow/Main.hpp b/opm/simulators/flow/Main.hpp index ba51a21e1..910659528 100644 --- a/opm/simulators/flow/Main.hpp +++ b/opm/simulators/flow/Main.hpp @@ -455,9 +455,14 @@ namespace Opm OpmLog::info("Reading deck file '" + deckFilename + "'"); } + std::optional outputInterval; + int output_param = EWOMS_GET_PARAM(PreTypeTag, int, EclOutputInterval); + if (output_param >= 0) + outputInterval = output_param; + readDeck(mpiRank, deckFilename, deck_, eclipseState_, schedule_, summaryConfig_, nullptr, python, std::move(parseContext), - init_from_restart_file, outputCout_); + init_from_restart_file, outputCout_, outputInterval); setupTime_ = externalSetupTimer.elapsed(); outputFiles_ = (outputMode != FileOutputMode::OUTPUT_NONE); diff --git a/opm/simulators/utils/readDeck.cpp b/opm/simulators/utils/readDeck.cpp index c774fae2c..3990bb0d5 100644 --- a/opm/simulators/utils/readDeck.cpp +++ b/opm/simulators/utils/readDeck.cpp @@ -170,7 +170,7 @@ void setupMessageLimiter(const Opm::MessageLimits msgLimits, const std::string& void readDeck(int rank, std::string& deckFilename, std::unique_ptr& deck, std::unique_ptr& eclipseState, std::unique_ptr& schedule, std::unique_ptr& summaryConfig, std::unique_ptr errorGuard, std::shared_ptr& python, std::unique_ptr parseContext, - bool initFromRestart, bool checkDeck) + bool initFromRestart, bool checkDeck, const std::optional& outputInterval) { if (!errorGuard) { @@ -216,7 +216,7 @@ void readDeck(int rank, std::string& deckFilename, std::unique_ptr& d Opm::EclIO::ERst rst_file(rst_filename); const auto& rst_state = Opm::RestartIO::RstState::load(rst_file, report_step); if (!schedule) - schedule = std::make_unique(*deck, *eclipseState, *parseContext, *errorGuard, python, &rst_state); + schedule = std::make_unique(*deck, *eclipseState, *parseContext, *errorGuard, python, outputInterval, &rst_state); } else { if (!schedule) diff --git a/opm/simulators/utils/readDeck.hpp b/opm/simulators/utils/readDeck.hpp index 8e721d4de..d773eb084 100644 --- a/opm/simulators/utils/readDeck.hpp +++ b/opm/simulators/utils/readDeck.hpp @@ -34,6 +34,7 @@ #include #include +#include #include namespace Opm @@ -56,7 +57,7 @@ FileOutputMode setupLogging(int mpi_rank_, const std::string& deck_filename, con void readDeck(int rank, std::string& deckFilename, std::unique_ptr& deck, std::unique_ptr& eclipseState, std::unique_ptr& schedule, std::unique_ptr& summaryConfig, std::unique_ptr errorGuard, std::shared_ptr& python, std::unique_ptr parseContext, - bool initFromRestart, bool checkDeck); + bool initFromRestart, bool checkDeck, const std::optional& outputInterval); } // end namespace Opm #endif // OPM_READDECK_HEADER_INCLUDED