c cmatprod.f c c

      program dimtest
c
c     test the Matrix multiply and other matrix
c     aritmetic
c
c     John Mahaffy 3/31/96
c
       real a(3,3), b(3,3), c(3,3),x(3),y(3)
      data a/1,2,3,1,2,3,1,2,3/
      data b/1,1,1,2,2,2,3,3,3/
      data x/1,2,3/,y/2,2,2/
c     
      c = matmul(a,b)
      y = matmul(a,x)
c     
      write(*,*) ' a = '
      write( *, 2000) ((a(i,j),j=1,3),i=1,3)
      write(*,*) ' b = '
      write( *, 2000)  ((b(i,j),j=1,3),i=1,3)
      write(*,*) ' c = a b ='
      write( *, 2000)  ((c(i,j),j=1,3),i=1,3)
      write( *, 2001) "x", x
      write(*,*) ' y = a x '
      write(*,2001) 'y', y
c     
      dotpro = dot_product(x,y)
c     
      write(*,*)  'Evaluate the dot product of x and y'
      write(*,'(a,f8.1)') 'Result of DOT_PRODUCT function =', dotpro
      dotpro = sum(x*y)
      write(*,'(a,f8.1)') 'Dot Product using SUM function =', dotpro
 2000 format(4x,3f8.1)
 2001 format (/, 1x,a1,' = ', f8.1,/, (5x,f8.1))
      stop
      end
c
c c