C LAST UPDATE: 
C+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
C
C**************************
C**     LRL_STILLOK      **
C**************************
C
C
      LOGICAL FUNCTION LRL_STILLOK (II)
C
      INCLUDE 'implicit_none.finc'
C
C Purpose: See if spot still predicted for revised soft limits
C
C Author:  John W. Campbell, October 1993
C
C  **** LRL Service Routine Only ***
C
C Arguments:
C
      INTEGER II
C
C II    (R)   Index to reflection list arrays.
C
C====== Parameter statements
C 

C
C====== GLOBALS:
C
      INCLUDE 'lrl_data.finc'
C
C====== FUNCTION TYPES:
C

C
C====== LOCALS:
C
      LOGICAL OK
      INTEGER IHARM
      INTEGER MULT
      INTEGER MINHARM
      INTEGER MAXHARM
      INTEGER INCHARM
      REAL LAMBDA
      REAL DTHR2

C     LOGICAL OK           !Current harmonic OK flag
C     INTEGER IHARM        !Harmonics loop counter
C     INTEGER MULT         !Multiplicity
C     INTEGER MINHARM      !Minimum harmonic
C     INTEGER MAXHARM      !Maximum harmonic
C     INTEGER INCHARM      !Harmonic increment
C     REAL LAMBDA          !Lambda
C     REAL DTHR2           !1/dmin**2
C
C-------------------------------------------------------------------------------
C
      LRL_STILLOK = .TRUE.
      IF (MULTS(II).EQ.1) THEN
         IF (LAMBDAS(II).LT.LMIN_NEW.OR.LAMBDAS(II).GT.LMAX_NEW) THEN
            LRL_STILLOK = .FALSE.
            RETURN
         END IF
         IF (DMIN_THR2(II).GT.DTHR2_NEW) THEN
            LRL_STILLOK = .FALSE.
            RETURN
         END IF
      ELSE
         CALL LRL_GETMULT (MULTS(II), MULT, MINHARM, MAXHARM, INCHARM)
         DO 10 IHARM = MINHARM, MAXHARM, INCHARM
            OK = .TRUE.
            LAMBDA = LAMBDAS(II) * FLOAT(MINHARM) / FLOAT(IHARM)
            DTHR2 = DMIN_THR2(II) * FLOAT(IHARM) / FLOAT(MINHARM)
            IF (LAMBDA.LT.LMIN_NEW.OR.LAMBDA.GT.LMAX_NEW) OK = .FALSE.
            IF (DTHR2.GT.DTHR2_NEW) OK = .FALSE.
            IF (OK) RETURN
10       CONTINUE
         LRL_STILLOK = .FALSE.
      END IF
      RETURN
      END
