summaryrefslogtreecommitdiff
path: root/map65/libm65/dot.f90
blob: f0688098361853f2bf60529fb55242e279e633da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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