C....*...1.........2.........3.........4.........5.........6.........7.*.......8
C     DGMAPA  10/16/71
C
C     PURPOSE
C     TRANSPOSE THE MATRIX A AND POSTMULTPLY BY A: APA=A'A
C
C     USAGE
C     CALL DGMAPA(A,APA,N,M)
C
C     ARGUMENTS
C     A   - INPUT N BY M MATRIX
C           STORED COLUMNWISE (STORAGE MODE OF 0)
C           ELEMENTS OF A ARE REAL*8
C     APA - OUTPUT M BY M MATRIX
C           STORED COLUMNWISE (STORAGE MODE OF 0)
C           ELEMENTS OF APA ARE REAL*8
C     N   - NUMBER OF ROWS IN A
C     M   - NUMBER OF COLUMNS IN A
C
      SUBROUTINE DGMAPA(A,APA,N,M)
      implicit real*8 (a-h,o-z)
      save
      REAL*8 A(N,M),APA(M,M)
      DO 10 I=1,M
      DO 10 J=1,M
      APA(I,J)=0.D0
      DO 10 K=1,N
10    APA(I,J)=APA(I,J)+A(K,I)*A(K,J)
      RETURN
      END
