      SUBROUTINE MKTIM(FFT,WORK,NUNI1,NMUL,NDFAST,NDFILE,
     *                 DO,NO,DT,NN,XSJ0,Y,JJ,IFILE)

      COMPLEX*8 FFT(NDFAST),WORK(NDFAST)
      DIMENSION NUNI1(NDFILE),NMUL(NDFILE),Y(NDFAST)
      COMMON   /TIME/ XSJ,XEJ,YSJ,YEJ,JXSPN,JXUT1,JXUT2,JYSPN,JYUT1,
     *                JYUT2,JFPX,JFPY,NXOFF,NYOFF,NXSAB,NYSAB,N0AXIS

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

      TMAX = 0.0

      DO 100 I = 1, NDFAST
        WORK(I) = (0.0,0.0)
        Y(I)    = 0.0
  100 CONTINUE

C     **********  NO -> 2**NP  **********

      NONEW = 2
  150 IF(NONEW.GE.NO) GO TO 200
      NONEW = NONEW*2
      GO TO 150
  200 NT = NONEW*2*2**(NMUL(IFILE)-1)

C     **********  PREPARATION FOR FFT  **********

      NP = JJ-NUNI1(IFILE)

      IF(NP.EQ.0) THEN
        WORK(1) = FFT(1)
      ELSE 
        WORK(1) = (0.0,0.0)
      END IF 

      DO 250 I = 2, NO+1
        WORK(I) = FFT(I)*CMPLX(0.0,DO*FLOAT(I-1))**NP
  250 CONTINUE

      DO 300 I = 2, NO+1
        WORK(NT+2-I) = CONJG(WORK(I))
  300 CONTINUE

C     **********  FFT  **********

      CALL FAST(NT,WORK,NDFAST,1)

C     **********  TIME DOMAIN  **********

      PAI   = ATAN(1.0)*4.0
      DURTN = 2.0*PAI/DO
      DT    = DURTN/NT 
      NTS   = INT(XSJ/DT)+1
      NTE   = INT(XEJ/DT)+1
      IF(NTE.GE.NT ) NTE = NT
      IF(NTS.GE.NTE) NTS = NT

      DO 350 I = NTS, NTE
        K       = I-NTS+1 
        Y(K)    = REAL(WORK(I))/DURTN
        ATIME   = ABS(Y(K))
        IF(ATIME.GT.TMAX) TMAX = ATIME
  350 CONTINUE

      NN   = NTE+1-NTS
      XSJ0 = DT*DFLOAT(NTS-1)

      WRITE(*,'(A,F10.4)')'     tmax = ',TMAX 

      RETURN
      END
