test_dot Subroutine

subroutine test_dot()

Arguments

None

Variables

Type Visibility Attributes Name Initial
real, public, dimension(3) :: a
real, public, dimension(3) :: b
real, public :: dotpro
integer, public :: i
integer, public :: imax
integer, public :: imin
real, public :: parpro

Source Code

subroutine test_dot()
real, dimension(3) :: a, b
real :: dotpro , parpro
integer i , imax , imin
   call unit_check_start('dot',msg='')
   a = [ 1.0, 2.0, 3.0 ]
   b = [ 4.0, 5.0, 6.0 ]
   imin=1
   imax=size(a)
   parpro=0.0
   call dot(a,b,imin,imax,parpro,dotpro)
   ! multiply by 1 to avoid gfortran-11 bug
   call unit_check('dot', dotpro == 32.0 ,'comparing',dotpro,1*dot_product(a,b))
   call unit_check_done('dot',msg='')
end subroutine test_dot