C     ***********************
C     *  SUBROUTINE OUTPUT  *
C     ***********************
C
      SUBROUTINE OUTPUT(SP,NES1,NES2,NES3,ND1,ND2,ND3,NF)
C
      IMPLICIT REAL*8(A-H,O-Z)
      COMPLEX*16 SP(ND2,ND3,10)
      DIMENSION NES1(ND1),NES2(ND1),NES3(ND1)
      COMMON /FREQ/ FT,NO / XZ / FX0(10),FZ0(10),DA(10),NFLT
     *       / NS / NS1,NS2,NS3
     *       / NE / NE1,NE2,NE3
C
      ND1=ND1
      IF(NF.EQ.1) THEN
        WRITE(7,7000) FT,NO,1,1,1
        WRITE(7,7010) NE1,NE2,NE3
        WRITE(7,7020) (NES1(I),I=1,NE1)
        WRITE(7,7020) (NES2(I),I=1,NE2)
        WRITE(7,7020) (NES3(I),I=1,NE3)
      END IF
C
      DO 120 N=1,NFLT
C
      WRITE(6,5000)N
C
      WRITE(6,6000)
      DO 110 M=1,NE1
        MM=NES1(M)
        WRITE(6,6010)MM
        DO 100 L=1,NO,5
          WRITE(6,6020) (FT*(L+J),SP(MM,L+J,N),CDABS(SP(MM,L+J,N)),
     *                   CDABS(SP(MM,L+J,N))*FT*(L+J),J=0,4)
          IF(NF.EQ.1) WRITE(7,7030) (DREAL(SP(MM,L+J,N)),
     *                               DIMAG(SP(MM,L+J,N)),J=0,4)
  100   CONTINUE
  110 CONTINUE
C
      WRITE(6,6030)
      DO 210 M=1,NE2
        MM=NES2(M)+NS1
        WRITE(6,6010)NES2(M)
        DO 200 L=1,NO,5
          WRITE(6,6020) (FT*(L+J),SP(MM,L+J,N),CDABS(SP(MM,L+J,N)),
     *                   CDABS(SP(MM,L+J,N))*FT*(L+J),J=0,4)
          IF(NF.EQ.1) WRITE(7,7030) (DREAL(SP(MM,L+J,N)),
     *                               DIMAG(SP(MM,L+J,N)),J=0,4)
  200   CONTINUE
  210 CONTINUE
C
      WRITE(6,6040)
      DO 310 M=1,NE3
        MM=NES3(M)+NS1+2*NS2
        WRITE(6,6010)NES3(M)
        DO 300 L=1,NO,5
          WRITE(6,6020) (FT*(L+J),SP(MM,L+J,N),CDABS(SP(MM,L+J,N)),
     *                   CDABS(SP(MM,L+J,N))*FT*(L+J),J=0,4)
          IF(NF.EQ.1) WRITE(7,7030) (DREAL(SP(MM,L+J,N)),
     *                               DIMAG(SP(MM,L+J,N)),J=0,4)
  300   CONTINUE
  310 CONTINUE
C
      WRITE(6,6050)
      DO 410 M=1,NE2
        MM=NES2(M)
        WRITE(6,6010)MM
        DO 400 L=1,NO
          WRITE(6,6020)FT*L,SP(NS1+NS2+MM,L,N),
     *                 CDABS(SP(NS1+NS2+MM,L,N))
  400   CONTINUE
  410 CONTINUE
C
  120 CONTINUE
C
      RETURN
C
 5000 FORMAT(///  ' FAULT NUMBER = ',I3)
 6000 FORMAT(//4X,'DISPLACEMENT OF SURF.1')
 6010 FORMAT(  /7X,'ELEMENT NO.',I3/)
 6020 FORMAT(   6X,F8.5,2X,2F13.5,2X,F13.5,2X,F13.5 )
 6030 FORMAT(//4X,'DISPLACEMENT OF SURF.2')
 6040 FORMAT(//4X,'DISPLACEMENT OF BOND.3')
 6050 FORMAT(//4X,'FORCE        OF SURF.2')
 7000 FORMAT(F15.7,I15,F15.7,2I15)
 7010 FORMAT(3I15)
 7020 FORMAT(20I3)
 7030 FORMAT(10F8.5)
C
      END
