C....*...1.........2.........3.........4.........5.........6.........7.*
C     DGMABC  6/20/87 (ANNIVERSARY)
C
C     PURPOSE
C     COMPUTE R = A'BC.
C
C     USAGE
C     CALL DGMABC(A,B,C,R,N,M,L,K)
C
C     ARGUMENTS
C     A - INPUT N BY M MATRIX STORED COLUMNWISE (STORAGE MODE 0)
C         REAL*8
C     B - INPUT N BY L MATRIX STORED COLUMNWISE (STORAGE MODE 0)
C         REAL*8
C     C - INPUT L BY K MATRIX STORED COLUMNWISE (STORAGE MODE 0)
C         REAL*8
C     R - OUTPUT M BY K MATRIX STORED COLUMNWISE (STORAGE MODE 0)
C         REAL*8
C     N - NUMBER OF ROWS IN A
C         INTEGER*4
C     M - NUMBER OF COLUMNS IN A
C         INTEGER*4
C     L - NUMBER OF ROWS IN C
C         INTEGER*4
C     K - NUMBER OF COLUMNS IN C
C         INTEGER*4
C
      SUBROUTINE DGMABC(A,B,C,R,N,M,L,K)
      implicit real*8 (a-h,o-z)
      save
      REAL*8 A(1),B(1),C(1),R(1),ACC
C     A(N,M),B(N,L),C(L,K),R(M,K)
      DO 20 JJ=1,K
      DO 20 II=1,M
      ACC=0.D0
      DO 10 J=1,L
      DO 10 I=1,N
10    ACC=ACC+A(N*(II-1)+I)*B(N*(J-1)+I)*C(L*(JJ-1)+J)
20    R(M*(JJ-1)+II)=ACC
      RETURN
      END
