program dotprod implicit none integer :: i real :: c, dotp real, dimension(3) :: a, b !---------------------------- ! input vectors !---------------------------- print*,'Enter first vector' read*, a print*,'Enter second vector' read*, b !---------------------------- ! calculate dot product !---------------------------- c = dotp(a,b) !---------------------------- ! check magnitude !---------------------------- if(abs(c) < 1.0e-6) then print*,'---------------------------------------------------' print*,'Warning: magnitude of dot product is less than 1e-6' print*,'---------------------------------------------------' endif !---------------------------- ! print result !---------------------------- print*,'dot product = ', c end program dotprod