 
C LAST UPDATE: 
C+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
C
C**************************
C**     LRL_GET_OVPIX    **
C**************************
C
CD-Routine: Return No. of Overload Pixels for a Spot - LRL_GET_OVPIX
C This routine returns the number of overloaded pixels in a spot if
C set by the integration routine for a spot in the Laue Reflections List.
CD-end
CD-Fortran:
      SUBROUTINE LRL_GET_OVPIX (ISPOT, NOVLD, IERR)
CD-end
       INCLUDE 'implicit_none.finc'
C
C Purpose: Returns the  no. of overloaded pixels if set 
C
C Author:  John W. Campbell, June 1997
C
C
      INTEGER ISPOT
      INTEGER NOVLD
      INTEGER IERR
CD-Parameters:
C ISPOT   i (R)   Spot index number (in current sort order)
C NOVLD   i (W)   Returns the number of overloaded pixels in the
C                 spot if set by the integration routine (0-255). 
C                 -1 indicates not set; 255 means 255 or more
C                 are overloaded. 
C IERR    i (W)   Error flag =  0,  OK
C                            =  1,  Invalid spot number
CD-end
C====== GLOBALS:
C
      INCLUDE 'lrl_data.finc'
C
C====== FUNCTION TYPES:
C
      INTEGER NBITST
      EXTERNAL LRL_BDAT
C
C====== LOCALS:
C
      INTEGER I
C
C-------------------------------------------------------------------------------
C
      NOVLD = -1
      IERR = 0
      IF (ISPOT.LT.1.OR.ISPOT.GT.NUM_SPOTS) THEN
         IERR = 1
         RETURN
      END IF
      I = INDX(ISPOT)
      IF (NBITST(FLAGS(I),20,1).EQ.0) RETURN
      NOVLD = (NBITST(FLAGS(I),21,8))
      RETURN
      END 
