diff --git a/Source/TimeIntegration/ERF_slow_rhs_pre.cpp b/Source/TimeIntegration/ERF_slow_rhs_pre.cpp index 2adcc4db9..7360f8939 100644 --- a/Source/TimeIntegration/ERF_slow_rhs_pre.cpp +++ b/Source/TimeIntegration/ERF_slow_rhs_pre.cpp @@ -147,8 +147,6 @@ void erf_slow_rhs_pre (int level, int finest_level, const GpuArray dxInv = geom.InvCellSizeArray(); const Real* dx = geom.CellSize(); - std::array flux; - // ************************************************************************* // Combine external forcing terms // ************************************************************************* @@ -472,6 +470,9 @@ void erf_slow_rhs_pre (int level, int finest_level, #ifdef _OPENMP #pragma omp parallel if (amrex::Gpu::notInLaunchRegion()) #endif + { + std::array flux; + for ( MFIter mfi(S_data[IntVar::cons],TileNoZ()); mfi.isValid(); ++mfi) { Box bx = mfi.tilebox(); @@ -536,7 +537,7 @@ void erf_slow_rhs_pre (int level, int finest_level, // Define flux arrays for use in advection // ************************************************************************* for (int dir = 0; dir < AMREX_SPACEDIM; ++dir) { - flux[dir].resize(amrex::surroundingNodes(tbx,dir),2); + flux[dir].resize(amrex::surroundingNodes(bx,dir),2); flux[dir].setVal(0.); } const GpuArray, AMREX_SPACEDIM> @@ -1106,4 +1107,5 @@ void erf_slow_rhs_pre (int level, int finest_level, } // two-way coupling } // end profile } // mfi + } // OMP }