module dottest_
  implicit none
  logical, parameter, private ::  T = .true.,  F = .false.
contains
  !----------------------------------------------------------------
  subroutine dottest(oper,m,d)
    real, pointer :: m(:),d(:)
    interface
       function oper(adj,add,m,d) result(stat)
         integer             :: stat
         logical, intent(in) :: adj, add
         real, pointer       :: m(:),d(:)
       end function oper
    end interface
    integer        :: stat
    real, pointer  :: m1(:),m2(:),d1(:),d2(:)
    integer        :: nm,nd
    
    nm = size(m)
    nd = size(d)

    allocate(m1(nm),m2(nm))
    allocate(d1(nd),d2(nd))

    call random_number(m1)
    call random_number(d2)
    stat = oper( F, F, m1, d1)
    stat = oper( T, F, m2, d2)
    write(0,*) dot_product(m1,m2),dot_product(d1,d2)

    stat = oper( F, T, m1, d1)
    stat = oper( T, T, m2, d2)
    write(0,*) dot_product(m1,m2),dot_product(d1,d2)    

  end subroutine dottest
  !----------------------------------------------------------------
end module dottest_




