diff --git a/components/mpas-ocean/src/shared/mpas_ocn_time_average_coupled.F b/components/mpas-ocean/src/shared/mpas_ocn_time_average_coupled.F index db3d100b4e2f..4b50ef499d8b 100644 --- a/components/mpas-ocean/src/shared/mpas_ocn_time_average_coupled.F +++ b/components/mpas-ocean/src/shared/mpas_ocn_time_average_coupled.F @@ -426,10 +426,10 @@ subroutine ocn_time_average_coupled_accumulate(statePool, forcingPool, timeLevel ! find vertical level that is just above the critical depth reference level ! this does not account for depression due to ice shelf cavities or sea ice - iLevelCritDepth = 1 + iLevelCritDepth = nVertLevels ! default to deepest layer if we don't find the desired depth do iLevel = 1, nVertLevels if(refBottomDepth(iLevel) > config_2d_thermal_forcing_depth) then - iLevelCritDepth = iLevel-1 + iLevelCritDepth = iLevel exit end if end do