C $Id: utmxtrp8.f,v 1.2 1998/07/24 21:54:45 asc Exp $
      SUBROUTINE MXTRP8(A,R,N,M)
CC
CC PURPOSE: FORMS THE TRANSPOSE OF AN N X M MATRIX
CC
CC ARGUMENT LIST
CC   ARGUMENT  TYPE  I/O  DESCRIPTION <DIM>
CC    A         R8    I    NAME OF MATRIX TO BE TRANSPOSED <N,M>
CC    R         R8    O    NAME OF RESULTANT MATRIX <M,N>
CC    N         I4    I    NUMBER OF ROWS OF A AND COLUMNS OF R
CC    M         I4    I    NUMBER OF COLUMNS OF A AND ROWS OF R
CC
CC CALLING SUBROUTINES: AXSPAR,ACERR,ADERR,PRERR,OBSTR1,OBSTR2,PISTR1,
CC                      PISTR2
CC
CC SUBROUTINES CALLED: NONE
CC
CC COMMON VARIABLES USED : NONE
CC
CC   -DECLARE EXTERNAL VARIABLES
       REAL*8 A(1),R(1)
       INTEGER*4 N,M
CC   -ALGORITHM
       IR=0
       DO 10 I=1,N
          IJ=I-N
          DO 20 J=1,M
             IJ=IJ+N
             IR=IR+1
             R(IR)=A(IJ)
 20       CONTINUE
 10    CONTINUE
       RETURN
       END
