From fa2fceccf48bc26ba41dd7d045f64fa05a43fe2a Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Thu, 25 Oct 2012 07:25:43 +0200 Subject: [PATCH] Do not compute SOIL if none of SGAS or SWAT is present p4#: 19303 --- .../ReservoirDataModel/RigReservoirCellResults.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ApplicationCode/ReservoirDataModel/RigReservoirCellResults.cpp b/ApplicationCode/ReservoirDataModel/RigReservoirCellResults.cpp index 9ca8ddf6e8..f8104b2f95 100644 --- a/ApplicationCode/ReservoirDataModel/RigReservoirCellResults.cpp +++ b/ApplicationCode/ReservoirDataModel/RigReservoirCellResults.cpp @@ -395,6 +395,12 @@ void RigReservoirCellResults::loadOrComputeSOIL() sgas = &(cellScalarResults(scalarIndexSGAS)); } + // Early exit if none of SWAT or SGAS is present + if (scalarIndexSWAT == cvf::UNDEFINED_SIZE_T && scalarIndexSGAS == cvf::UNDEFINED_SIZE_T) + { + return; + } + size_t soilResultValueCount = 0; size_t soilTimeStepCount = 0; if (swat)