subroutine stats_interpolate_and_sgs_scalar implicit none integer :: n do n = 1, nsv call stats_interpolate_i(svi(:,:,:,n), svm(ib-ih:ie,jb:je,kb:ke+kh,n)) call stats_interpolate_j(svj(:,:,:,n), svm(ib:ie,jb-jh:je,kb:ke+kh,n)) call stats_interpolate_k(svk(:,:,:,n), svm(ib:ie,jb:je,kb-kh:ke+kh,n)) call stats_compute_sgs(svsgs(:,:,:,n), svm(ib:ie,jb:je,kb-kh:ke+kh,n), ekh(ib:ie,jb:je,kb-kh:ke+kh)) end do end subroutine stats_interpolate_and_sgs_scalar