# 1 "<stdin>"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "<stdin>"
! dot product test
program zyxabc
implicit none
real, allocatable, dimension (:) :: xtilda
real, allocatable, dimension (:) :: ytilda
real, allocatable, dimension (:) :: x
real, allocatable, dimension (:) :: y
real, allocatable, dimension (:) :: array
real, allocatable, dimension (:) :: ya
integer n1

n1=101

allocate (xtilda(2*n1),ytilda(2*n1),x(n1),y(n1),array(n1),ya(2*n1))
!
!
!
call Dottest01 (n1,xtilda,ytilda,x,y)
!
end program zyxabc
subroutine Dottest01(n1,xtilda,ytilda,x,y)
  use avomodel
  use sep

!
integer n1,i1, iseed,n2,stat
real xscalar, yscalar 
real xtilda(n1),ytilda(n1),x(n1),y(n1)

!
x=0.;y=0.;out1=0.;out2=0.
!
! fill x and y with random numbers:
iseed=1993
do i1=1,n1
  x(i1) = ran1( iseed)
  y(i1) = ran1( iseed)
end do
!################################################################
stat = avomodel_lop( .false.,.false.,x, ytilda) 
stat = avomodel_lop( .true.,.false., xtilda, y) 
! calculate the inner product:
xscalar=0.
yscalar=0.
do i1=1,n1
  xscalar=xscalar+xtilda(i1)*x(i1)
  yscalar=yscalar+ytilda(i1)*y(i1)
end do
write(0,*) '############################################################'
write(0,*) 'x_igrad2_lop=',xscalar,'        y_igrad2_lop=',yscalar
write(0,*) '############################################################'

return
end
