module dot_mod implicit none contains real(8) function dot(x, y) result(r) implicit none !-------------------------------------------------------------------- ! Arguments !-------------------------------------------------------------------- real(8), intent(in) :: x(3), y(3) !-------------------------------------------------------------------- ! Locals !-------------------------------------------------------------------- integer :: i !-------------------------------------------------------------------- ! Compute dot product !-------------------------------------------------------------------- r = 0.0d0 do i = 1, 3 r = r + x(i) * y(i) enddo end function dot end module dot_mod