      SUBROUTINE INBEM(FFT,NDFAST,DO,NO,IFILE,IDATA,NUNI2,
     *                  MDATA,NTYPE,FNAME,NDFILE,NDDATA)

      COMPLEX*8 FFT(NDFAST)
      DIMENSION MDATA(NDFILE,NDDATA),NTYPE(NDFILE),NUNI2(NDFILE)
      CHARACTER FNAME(NDFILE)*30

      COMMON  /STYLE/ NSTYLE,IXR,IYR,JXR,JYR,NSX,NSTY

C     **********  INITIALIZATION  **********

      DO 50 I = 1, NDFAST
        FFT(I) = (0.0,0.0)
   50 CONTINUE

      MP = NSTY-NUNI2(IFILE)
      PW = 100.D0**MP

C     **********  READ WAVE DATA  **********


      WRITE(*,'(A,A,I4)')' >> ',FNAME(IFILE),MDATA(IFILE,IDATA)

      OPEN(4,FILE=FNAME(IFILE),ERR=20,STATUS='OLD')

      READ(4,4000)DO,NO

      IF(NTYPE(IFILE).EQ.1) THEN
        READ(4,4010)
      ELSE
        READ(4,4020)
      END IF

      DO 200 I = 1, MDATA(IFILE,IDATA)-1
        DO 100 J = 1, NO, 5
          READ(4,4030)
  100   CONTINUE
  200 CONTINUE

      DO 300 I = 1, NO, 5
        READ(4,4040)(FFT(I+J), J=1, 5)
  300 CONTINUE

      IF(MP.NE.0) THEN
        DO 400 I = 1, NO
          FFT(I) = FFT(I)*PW
  400   CONTINUE
      END IF

      CLOSE(4)

 4000 FORMAT(F15.3,I15)
 4010 FORMAT(///)
 4020 FORMAT(////)
 4030 FORMAT()
 4040 FORMAT(10F8.3)

      RETURN

C     ***  ERROR  ***

   20 WRITE(*,*) 'File access error.'
      STOP

      END
