diff --git a/opm/core/io/eclipse/EclipseWriter.cpp b/opm/core/io/eclipse/EclipseWriter.cpp index 874c2548..d7e3b034 100644 --- a/opm/core/io/eclipse/EclipseWriter.cpp +++ b/opm/core/io/eclipse/EclipseWriter.cpp @@ -787,8 +787,12 @@ void Summary::writeTimeStep(int reportStepIdx, const Opm::ScheduleConstPtr schedule = eclipseState_->getSchedule(); const auto& timeStepWells = schedule->getWells(reportStepIdx); std::map wellNameToIdxMap; + int openWellIdx = 0; for (size_t tsWellIdx = 0; tsWellIdx < timeStepWells.size(); ++tsWellIdx) { - wellNameToIdxMap[timeStepWells[tsWellIdx]->name()] = tsWellIdx; + if (timeStepWells[tsWellIdx]->getStatus(timer.currentStepNum()) != WellCommon::SHUT ) { + wellNameToIdxMap[timeStepWells[tsWellIdx]->name()] = openWellIdx; + openWellIdx++; + } } // internal view; do not move this code out of Summary!