      subroutine matmul (a,b,c,n1,n2,n3)                
      dimension       a(n1,n3)   ,b(n1,n2)   ,c(n2,n3)
          do 103 i=1,n1
              do 102 j=1,n3
        sum=0.0
                  do 101 l=1,n2
                  sum = sum+b(i,l)*c(l,j)
  101             continue
        a(i,j)=sum
  102         continue
  103     continue
      return
      end
C-----------------------------------------------------------------------------
      subroutine matmuld (a,b,c,n1,n2,n3)                
        implicit real*8 (a-h,o-z)
      dimension       a(n1,n3)   ,b(n1,n2)   ,c(n2,n3)
          do 103 i=1,n1
              do 102 j=1,n3
        sum=0.0
                  do 101 l=1,n2
                  sum = sum+b(i,l)*c(l,j)
  101             continue
        a(i,j)=sum
  102         continue
  103     continue
      return
      end
