      PROGRAM ISO

C     Generates the time series for an isovelocity problem

      INTEGER STKFIL
      PARAMETER ( STKFIL = 6, PI = 3.141592 )

      REAL    RD( 51 ), STACK( 51, 1001 )
      COMPLEX ST
      CHARACTER PULSE*4, PULTIT*80

      C0    = 1500.0   ! REFERENCE SOUND SPEED
      PULSE = 'P   '   ! PULSE TYPE
      FREQ  = 50.0
      FMIN  =   0.0
      FMAX  =  10.0 * FREQ
      OMEGA =   2.0 * PI * FREQ
      R     =  200.0   ! RANGE IN METERS

      TMIN = 0.0
      TMAX = 1.0
      NT   = 512
      DELT = TMAX / ( NT - 1 )

C     Generate the vector of receiver depths

      NRD = 1
      DO IR = 1, NRD
         RD( IR ) = ( IR - 1 ) * 10.0
      END DO

C     Construct the time series

      DO IR = 1, NRD
         SLANTR = SQRT( RD( IR ) ** 2 + R ** 2 )
         DO IT = 1, NT
            TIME = TMIN + ( IT - 1 ) * DELT
            T = TIME - SLANTR / C0    ! THIS IS REDUCED TIME

C           --- calculate the source time series
            CALL SOURCE( T, OMEGA, FMIN, FMAX, PULSE, ST, PULTIT )

            STACK( IR, IT ) = -ST / SLANTR
         END DO   ! NEXT TIME
      END DO  ! NEXT DEPTH

C     Write out the stack

      WRITE( STKFIL, * ) ''''//'Analytic- '//PULTIT(1:69)//''''
      WRITE( STKFIL, * ) NRD, ( RD( IR ), IR = 1, NRD )

      DO IT = 1, NT
         TIME = TMIN + ( IT - 1 ) * DELT
         WRITE( STKFIL, * ) TIME, ( STACK( IR, IT ), IR = 1, NRD )
      END DO

      STOP
      END
