diff --git a/Source/BoundaryConditions/MOSTAverage.cpp b/Source/BoundaryConditions/MOSTAverage.cpp index b2a5f72e8..e2dfc0d99 100644 --- a/Source/BoundaryConditions/MOSTAverage.cpp +++ b/Source/BoundaryConditions/MOSTAverage.cpp @@ -270,7 +270,7 @@ MOSTAverage::set_k_indices_N() AMREX_ASSERT_WITH_MESSAGE(m_zref <= m_zhi - 0.5 * m_dz, "Query point must be below the last z-cell!"); - int lk = static_cast(floor((m_zref - m_zlo) / m_dz - 0.5)); + int lk = static_cast(floor((m_zref - m_zlo) / m_dz)); m_zref = (lk + 0.5) * m_dz + m_zlo;