C
C *** CAL. OF RAYLEIGH PHASE WAVE VELOCITY IN ONE LAYER MEDIUM ***
C
      REAL FUNCTION FNCCR*8(VP,VS)
      IMPLICIT REAL*8(A-H,O-Z)
C
      DZ=0.0001D0
C
      SP=VS/VP
      IF(SP.GE.0.0D0) Z= 0.91263D0
      IF(SP.GE.0.2D0) Z= 0.90767D0
      IF(SP.GE.0.4D0) Z= 0.88899D0
      IF(SP.GE.0.6D0) Z= 0.83575D0
      IF(SP.GE.0.7D0) Z= 0.77062D0
      IF(SP.GE.0.8D0) Z= 0.63338D0
C
      F0=FNCFR1(SP,Z)
  100 Z=Z-DZ
      F1=FNCFR1(SP,Z)
      AF=F0/F1
      F00=F0
      F0 =F1
      IF(AF.GE.0.D0)GOTO 100
      FZ=Z+DZ*F0/(F0-F00)
C
      FNCCR=VS*DSQRT(FZ)
C
      RETURN
      END
C
C
      REAL FUNCTION FNCFR1*8(SP,Z)
      IMPLICIT REAL*8(A-H,O-Z)
C
      Z2=Z*Z
      Z3=Z2*Z
C
      F1=16.D0*(Z-1.D0)*SP*SP
      FNCFR1=F1-Z3+8.D0*Z2-24.D0*Z+16.D0
C
      RETURN
      END
