function eval_corners(var, i, j, k)
use modglobal, only : ib, ie, ih, jb, je, jh, kb, ke, kh
integer, intent(in) :: i, j, k ! LOCAL indices
real, intent(in) :: var(ib-ih:ie+ih,jb-jh:je+jh,kb-kh:kb+kh)
real, dimension(8) :: eval_corners(8)
eval_corners(1) = var(i ,j ,k ) !c000
eval_corners(2) = var(i+1,j ,k ) !c100
eval_corners(3) = var(i ,j+1,k ) !c010
eval_corners(4) = var(i+1,j+1,k ) !c110
eval_corners(5) = var(i ,j ,k+1) !c001
eval_corners(6) = var(i+1,j ,k+1) !c101
eval_corners(7) = var(i ,j+1,k+1) !c011
eval_corners(8) = var(i+1,j+1,k+1) !c111
end function eval_corners