C
C     MAIN
C
      PARAMETER(NDLYR=30,NDFFT=1024)
      IMPLICIT REAL*8 (A-H,O-Z)
      CHARACTER TITL*50
      DIMENSION DNS(NDLYR),DEP(NDLYR),VS(NDLYR),QF(NDLYR),DDY(NDFFT)
      COMPLEX*16 FFT(NDFFT)
C
      CALL SOILIN(NDLYR,NL,DNS,VS,DEP,QF,NQF,THETA)
C
      DO 100 I=1,NT
        FFT(I)=DCMPLX(WV(I),0.0D0)
  100 CONTINUE
C
      CALL WVFFT(NT,FFT,NDFFT,-1)
C
      DFFT=DFLOAT(NT)
      DO 200 I=1,NT
        FFT(I)=FFT(I)/DFFT
  200 CONTINUE
C
      DUR=DFLOAT(NT)*DT
      FOM=0.0D0
      DOM=8.D0*DATAN(1.D0)/DUR
      NOM=NT/2+1
      CALL WVML(FOM,DOM,NOM,NDLYR,NL,DNS,VS,DEP,QF,NQF
     *         ,THETA,NDFFT,FFT)
C
      DO 300 I=2,NT/2
        FFT(NT+2-I)=DCMPLX(REAL(FFT(I)),-IMAG(FFT(I)))
  300 CONTINUE
C
      CALL WVFFT(NT,FFT,NDFFT,1)
C
      DO 400 I=1,NT
        DDY(I)=DREAL(FFT(I))
  400 CONTINUE
C
      STOP
      END
         