      SUBROUTINE ANALYT( DEPTH, CP, CS, RHO,
     &                     MED, N1, FREQ, ATUNIT, TASK )

C     MUNK PROFILE

C     RETURNS
C        CS, CP, RHO
C           FOR FLUID MEDIA AT I*H I = 1, N
C           FOR ELASTIC MEDIA AT I*H I = 0, N
C        AND DEPTHS OF INTERFACES

      IMPLICIT REAL*8 (A-H, O-Z)

      PARAMETER ( EPS = 0.00737 )
      COMPLEX*16 CP( N1 ), CS( N1 )
      REAL*8     RHO( N1 )
      CHARACTER  ATUNIT*1, TASK*8

C     Initialization is only important for providing a print-out of
C     the SSP for the user.  Unfortunately it overruns the array
C     RHO( 1 ) so we suppress it:

      IF ( TASK(1:4) .EQ. 'INIT' ) RETURN

      N = N1 - 1

      GOTO ( 1, 2, 9 ) MED

C     -------- MED 1, THE OCEAN
    1    H = 5000.0 / N
         DO I = 1, N1
            Z = ( I - 1 ) * H
            X = 2.0 * ( Z - 1300.0 ) / 1300.0
            CP(  I ) = 1500.0 * ( 1.0 + EPS * ( X - 1.0 + EXP( -X ) ) )
            CS(  I ) = 0.0
            RHO( I ) = 1.0
         END DO
         RETURN

C        -------- MED 2, THE FLUID HALF-SPACE
    2    CP(  1 ) = 1551.91
         CS(  1 ) = 0.0
         RHO( 1 ) = 1.0E20
         RETURN

C        -------- MED 9, AN ELASTIC LAYER
    9    H = 1000.0 / N
         Z = 5000.0
         DO I = 1,N+1
            CP( I ) = 4700.0 + ( Z - 5000.0 ) / 10.0
            CS( I ) = 2000.0 + ( Z - 5000.0 ) / 10.0
            CP( I ) = 4700.0
            CS( I ) = 2000.0
            RHO( I ) = 2.0
            Z = Z + H
         END DO

      RETURN
      END
