C $Id: mulmat.f,v 1.2 1998/07/24 21:54:43 asc Exp $
      SUBROUTINE MULMAT(A,B,NROWA,NCOLA,NCOLB,C)
      IMPLICIT none
C
C     THIS ROUTINE MULTIPLIES 2 GENERAL MATRICES TO FORM A RESULTANT
C     MATRIX. THE ONLY RESTRICTION IS THAT THE NUMBER OF COLUMNS OF
C     MATRIX A MUST BE THE SAME AS THE NUMBER OF ROWS OF MATRIX B --
C     WHICH IS NOT A REAL LIMITATION, AS IF THAT IS NOT TRUE, THE
C     MATRIX MULTIPLICATION OPERATION IS NOT DEFINED IN THE FIRST
C     PLACE.
C

      INTEGER*4  NROWA, NCOLA, NCOLB, ICOL, IROW, INNER
      REAL*8     SUM,A(NROWA,NCOLA),B(NCOLA,NCOLB),C(NROWA,NCOLB)

      DO 200 IROW = 1 , NROWA
      DO 200 ICOL = 1 , NCOLB
      SUM = 0.0D0
      DO 100 INNER = 1 , NCOLA
      SUM = SUM + A(IROW,INNER)*B(INNER,ICOL)
  100 CONTINUE
      C(IROW,ICOL)=SUM
  200 CONTINUE

      RETURN
      END
