      SUBROUTINE CEGV(H,M,EGV,MX,ERMAX)
C
C     THIS SUBROUTINE COMPUTES THE COMPLEX EIGENVALUES USING NEWTONS
C     METHOD STARTING WITH THE INITIAL ESTIMATES IN EGV.THIS IS THE
C     DOUBLE PRECISION VERSION
C
      IMPLICIT REAL*8 (A-H,O-Z)
      COMPLEX*16 EGV(MX)
      COMPLEX*16 ALPHA,BETA,A,B,Z,U,V,W,DELTA
      COMPLEX*16 X,Y,DEGV
      COMPLEX*16 CDTAN
      COMPLEX*16 CDSRT
      COMPLEX*16 ONE,CI
C
      REAL*8 ERMAX,ERR,ESP2
C
      COMMON /BLKEVN/ HB,CW,CB,FKW,FKB,ROHW,ROHB,ATEN
C
      DATA ESP1,ESP2,ITMAX /.1D-09,.1D-13,20/
C
C
      CI=DCMPLX(0.0D0,1.0D0)
      ONE=DCMPLX(1.0D0,0.0D0)
      ERMAX=0.
C
      IF(ATEN .LT. ESP1) GO TO 600
C
      DO 500 I=1,M
C
      K=0
      DEGV=EGV(I)
C
  100 CONTINUE
C
      K=K+1
      ALPHA=CDSRT(FKW**2+FKB**2*(DEGV-ONE))
      BETA=CDSRT(FKB**2*(DEGV+CI*ATEN))
      A=ALPHA*H
      B=BETA*(H-HB)
      X=A*CDCOS(A)-CDSIN(A)
      Y=B-CDTAN(B)
C
      Z=2.0*(ALPHA*BETA)**2/FKB**2
      U=ROHW*BETA*CDSIN(A)-ROHB*ALPHA*CDCOS(A)*CDTAN(B)
      V=ROHW*BETA**3*X-ROHB*ALPHA**3*Y*CDCOS(A)
      W=(ALPHA*BETA)**2*CDSIN(A)*CDTAN(B)*(ROHW*HB+(ROHB-ROHW)*H)
C
      DELTA=Z*U/(V+W)
      DEGV=DEGV-DELTA
C
      ERR=CDABS(DELTA/DEGV)
      IF(ERR .LT. ESP2) GO TO 300
      IF(K .GT. ITMAX) GO TO 200
C
      GO TO 100
C
  200 CONTINUE
      ERMAX=DMAX1(ERR,ERMAX)
      EGV(I)=DEGV
C
      GO TO 500
C
  300 CONTINUE
      ERMAX=DMAX1(ERR,ERMAX)
      EGV(I)=DEGV 
C
C
  500 CONTINUE
C
C
      IFLAG=0
      IF(ERMAX .GT. ESP1) CALL ABORT(IFLAG)
C
  600 CONTINUE
C
      RETURN
      END
