function dotp(x,y) implicit none real :: dotp real, dimension(3) :: x, y dotp = sum(x*y) end function dotp