subroutine stats_interpolate_and_sgs_vel implicit none integer :: i, j, k !> Perform required interpolations to cell faces and centers call stats_interpolate_k(uik, um(ib:ie,jb:je,kb-kh:ke+kh)) call stats_interpolate_i(wik, wm(ib-ih:ie,jb:je,kb:ke+kh)) call stats_interpolate_k(vjk, vm(ib:ie,jb:je,kb-kh:ke+kh)) call stats_interpolate_j(wjk, wm(ib:ie,jb-jh:je,kb:ke+kh)) call stats_interpolate_j(uij, um(ib:ie,jb-jh:je,kb:ke+kh)) call stats_interpolate_i(vij, vm(ib-ih:ie,jb:je,kb:ke+kh)) do k=kb,ke+kh do j=jb,je do i=ib,ie uc (i,j,k) = 0.5* (um(i+1,j,k) + um(i,j,k)) vc (i,j,k) = 0.5* (vm(i,j+1,k) + vm(i,j,k)) if (k==ke+kh) then wc(i,j,k) = wc(i,j,k-1) else wc(i,j,k) = 0.5* (wm(i,j,k+1) + wm(i,j,k)) end if end do end do end do call stats_sgs_momentum(usgs, vsgs, wsgs) end subroutine stats_interpolate_and_sgs_vel