      PROGRAM ANGLES

C     Given two sound speed values, computes the maximum
C     angle at the first which turns at the second
C     angle measured wrt horizontal axis

C     Snell says, C2 * COS( ) = C1 * COS( 0.0 )

      PI = 3.14159265358979

      WRITE( *, * )
      WRITE( *, * )
      WRITE( *, * )
     &   'This routine calculates the take-off angle of the ray'
      WRITE( *, * )
     &   'which will turn (go horizontal) at a particular depth'
      WRITE( *, * )
      WRITE( *, * ) 'This angle depends only on the sound speed at the'
      WRITE( *, * ) 'source depth and at the turning depth.'
      WRITE( *, * )

 1000 WRITE( *, * ) 'Type the two sound speed values:'
      READ( *, * ) C1, C2

      IF ( C1 .GE. C2 ) THEN
         WRITE( *, * )
         WRITE( *, * ) 'FATAL ERROR: Must have C1 < C2 otherwise the'
         WRITE( *, * ) 'ray is not refracted back'
         WRITE( *, * )
         GO TO 1000
      ENDIF

      WRITE( *, * )
      WRITE( *, * )
      WRITE( *, * ) 'The take-off angle in degrees is = ',
     &                              180.0 / PI * ACOS( C1 / C2 )

      STOP
      END
