      SUBROUTINE PRTMAT(MR,MC,NAME,S4,MX)
C
C     THIS SUBROUTINE GENERATES A ONE PAGE PRINT OUT OF THE ABSOLUTE
C     VALUE OF THE ELEMENTS IN A 20X20 COMPLEX MATRIX IN E6.1 FORMAT
C     WITH THE DIAGONAL ELEMENTS UNDERLINED. IN ADDITION THE MIN. AND
C     MAX. OF:  THE FIRST AND LAST ROW AND COL., THE ELEMENTS ABOVE THE
C     DIAGONAL, THE ELEMENTS ON THE DIAG., AND  THE ELEMENTS BELOW THE 
C     DIAG. ARE PRINTED.
C
      IMPLICIT REAL*8 (A-H,O-Z)
      DIMENSION XMAG(20)
      CHARACTER*4 NAME
      CHARACTER*6 IDIAG(20),BLANK,DASH
      COMPLEX*16  S4(MX,MX)
C
      DATA BLANK,DASH /'      ','______'/
C
      MP=MIN0(20,MR,MC)
      M=MIN0(MR,MC)
      WRITE(9,100) NAME
  100 FORMAT(1H1,6HARRAY-,A4/)
C
      WRITE(9,200) (I,I=1,MP)
  200 FORMAT(5X,20I6)
C
      DO 800 II=1,MP
C
      DO 300 I=1,MP
      XMAG(I)=CDABS(S4(II,I))
  300 CONTINUE
C
      WRITE(9,400) II,(SNGL(XMAG(I)),I=1,MP)
  400 FORMAT(1X,I2,2X,20E6.1)
C
      IIM1=II-1
      IIP1=II+1
C
      DO 500 I=1,IIM1
      IDIAG(I)=BLANK
  500 CONTINUE
C
      IDIAG(II)=DASH
C
      DO 600 I=IIP1,MP
      IDIAG(I)=BLANK
  600 CONTINUE
C
      WRITE(9,700) (IDIAG(I),I=1,MP)
  700 FORMAT(1X,4X,20A6)
C
  800 CONTINUE
C
      XMAG(1)=.1D+38
      XMAG(2)=0.0D0
      XMAG(3)=.1D+38
      XMAG(4)=0.0D0
C
      DO 900 II=1,MR
      XMAG(1)=DMIN1(XMAG(1),CDABS(S4(II,1)))
      XMAG(2)=DMAX1(XMAG(2),CDABS(S4(II,1)))
      XMAG(3)=DMIN1(XMAG(3),CDABS(S4(II,MC)))
      XMAG(4)=DMAX1(XMAG(4),CDABS(S4(II,MC)))
  900 CONTINUE
C
      XMAG(5)=.1D+38
      XMAG(6)=0.0D0
      XMAG(7)=.1D+38
      XMAG(8)=0.0D0
C
      DO 1000 I=1,MC
      XMAG(5)=DMIN1(XMAG(5),CDABS(S4(1,I)))
      XMAG(6)=DMAX1(XMAG(6),CDABS(S4(1,I)))
      XMAG(7)=DMIN1(XMAG(7),CDABS(S4(MR,I)))
      XMAG(8)=DMAX1(XMAG(8),CDABS(S4(MR,I)))
 1000 CONTINUE
C
C
      XMAG(9)=.1D+38
      XMAG(10)=0.0D0
      XMAG(11)=.1D+38
      XMAG(12)=0.0D0
      XMAG(13)=.1D+38
      XMAG(14)=0.0D0
      FMAXD=-.1D+38
      FMIND=+.1D+38
C
      DO 1300 I=1,MC
      DO 1200 II=1,MR
      IF(II .LT. I) THEN
      XMAG(9)=DMIN1(XMAG(9),CDABS(S4(II,I)))
      XMAG(10)=DMAX1(XMAG(10),CDABS(S4(II,I)))
      ELSE IF (II .EQ. I) THEN
      XMAG(11)=DMIN1(XMAG(11),CDABS(S4(II,I)))
      XMAG(12)=DMAX1(XMAG(12),CDABS(S4(II,I)))
C
C      WRITE(9,*) II,DREAL(S4(II,I))
C      WRITE(6,*) II,DREAL(S4(II,I))
C
      FMAXD=DMAX1(FMAXD,DREAL(S4(II,I)))
      FMIND=DMIN1(FMIND,DREAL(S4(II,I)))
      ELSE IF (II .GT. I) THEN
      XMAG(13)=DMIN1(XMAG(13),CDABS(S4(II,I)))
      XMAG(14)=DMAX1(XMAG(14),CDABS(S4(II,I)))
      END IF 
 1200 CONTINUE
 1300 CONTINUE
C
      WRITE(9,1500)
 1500 FORMAT(//)
C
      WRITE(9,1600) 1,SNGL(XMAG(1)),SNGL(XMAG(2))
      WRITE(9,1600) MC,SNGL(XMAG(3)),SNGL(XMAG(4))
 1600 FORMAT(1X,'THE MIN. AND MAX. MAG. IN COL.',I5,' ARE ',2E12.4/)
C
      WRITE(9,1700) 1,SNGL(XMAG(5)),SNGL(XMAG(6))
      WRITE(9,1700) MR,SNGL(XMAG(7)),SNGL(XMAG(8))
 1700 FORMAT(1X,'THE MIN. AND MAX. MAG. IN ROW ',I5,' ARE ',2E12.4/)
      WRITE(9,1500)
C
      WRITE(9,1800) SNGL(XMAG(9)),SNGL(XMAG(10))
 1800 FORMAT(1X,'THE MIN. AND MAX. MAG. ABOVE THE DIAG. ARE ',2E12.4/)
C
      WRITE(9,1900) SNGL(XMAG(11)),SNGL(XMAG(12))
 1900 FORMAT(1X,'THE MIN. AND MAX. MAG. ON THE DIAG. ARE ',2E12.4/)
C
      WRITE(9,1950) SNGL(FMIND),SNGL(FMAXD)
 1950 FORMAT(1X,'THE MIN. AND MAX. ON THE DIAG. ARE ',2E12.4/)
C
      WRITE(9,2000) SNGL(XMAG(13)),SNGL(XMAG(14))
 2000 FORMAT(1X,'THE MIN. AND MAX. MAG. BELOW THE DIAG. ARE ',2E12.4/)
C
      RETURN
      END
 
