      SUBROUTINE MXM (A,NA,B,MA,C,MB)
      INTEGER NA, MA, MB
      DOUBLE PRECISION A(NA,MA), B(MA,MB), C(NA,MB)
      DOUBLE PRECISION ZERO
      PARAMETER (ZERO=0.0D0)
      INTEGER I, J, K
      DO 110 I=1,NA
         DO 100 J=1,MB
            C(I,J) = ZERO
 100     CONTINUE
 110  CONTINUE
      DO 140 J=1,MB
         DO 130 K=1,MA
            DO 120 I=1,NA
               C(I,J) = C(I,J) + A(I,K)*B(K,J)
 120        CONTINUE
 130     CONTINUE
 140  CONTINUE
      RETURN
      END
