C
C
      SUBROUTINE  SOLVE (Y0,Y1,W,W1)
C
C     -----------------------------------------------------------
C
C       SUBROUTINE PURPOSE:
C       SOLVING EIGENVALUES BY TRIAL AND ERROR METHOD.
C
C     -----------------------------------------------------------
C
      IMPLICIT DOUBLE PRECISION (A-H,O-Z)
C
      COMMON
     !   /PARAMT/
     !     RO,R1,H,STEP
     !   /BESSEL/
     !     BJ00,BJ01,BJ10,BY00,BY01,BY10
C
C
      IF (DABS(Y0).LT.1.D-10) THEN
         W1=W-STEP
         RETURN
      ELSE IF (DABS(Y1).LT.1.D-10) THEN
         W1=W
         RETURN
      ENDIF
      I=0
      Z0=Y0
      Z1=Y1
      W1=W-(STEP*DABS(Z1))/(DABS(Z0)+DABS(Z1))
      S0=W1-(W-STEP)
      S1=W-W1
10    X=W1*RO
         CALL  BESSJ0 (X,BJ0)
         CALL  BESSY0 (X,BJ0,BY0)
         CALL  BESSJ1 (X,BJ1)
         CALL  BESSY1 (X,BJ1,BY1)
         BJ00=BJ0
         BJ10=BJ1
         BY00=BY0
         BY10=BY1
         X=W1*R1
         CALL  BESSJ0 (X,BJ0)
         CALL  BESSY0 (X,BJ0,BY0)
         BJ01=BJ0
         BY01=BY0
         I=I+1
         Z=BJ01*(W1*BY10+H*BY00)-BY01*(W1*BJ10+H*BJ00)
      IF (I.GT.80) THEN
         WRITE (8,100)
         RETURN
      ENDIF
      IF (DABS(Z).LT.1.D-10) RETURN
      IF (Z*Z0.LT.0.0) THEN
         S1=(S0*DABS(Z))/(DABS(Z0)+DABS(Z))
         W1=W1-S1
         S0=S0-S1
         Z1=Z
         GO TO 10
      ELSE IF (Z*Z1.LT.0.0) THEN
         S0=(S1*DABS(Z))/(DABS(Z1)+DABS(Z))
         W1=W1+S0
         S1=S1-S0
         Z0=Z
         GO TO 10
      ELSE
         WRITE (8,110)
      ENDIF
C
100   FORMAT (/,' * ATTN * ACCURACY IN CALCULATING BESSEL SERIES WAS ',
     .       'LOWERED TO REDUCE',/,' CALCULATION LOAD.')
110   FORMAT (/,' * WRN * INTERNAL STEP IN "EIGEN" AND "SOLVE" MUST BE',
     .       ' SHORTENED.')
C
      RETURN
      END

