
C LAST UPDATE:
C+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
C
C*********************
C**     LSM_INDX    **
C*********************
C
C
CD-Routine: Get LIRL reflection index- LSM_INDX
C Gets the LIRL index of a reflection in the latest set of reflections
C returned by the routine LSM_NEXT_REFLN. The index may then be used to
C access the individual reflection data from the LIRL next singles
C reflection set from the LIRL using the normal LIRL set of routines.
CD-end
CD-Fortran:
      INTEGER FUNCTION LSM_INDX (IR)
CD-end
C
      INCLUDE 'implicit_none.finc'
C
C Purpose: Get LIRL reflection index from a retrieved set
C
C Author:  Steffi Arzt, John Campbell, July 1997
C
C Arguments:
C
      INTEGER IR
C
CD-Parameters:
C  IR       i (R)   The reflection number within the range of 1 to the
C                   value returned by the last call to LSM_NEXT_REFLN
C
C             Returns the index number for the reflection in the LIRL
CD-end
C
C====== PARAMETERS:
C
      INCLUDE 'limits.finc'
C
C====== GLOBALS:
C
      INCLUDE 'next_refl.finc'
C
C====== LOCALS:
C
C
C-------------------------------------------------------------------------------
C
      IF (IR.LT.1.OR.IR.GT.NREFS) THEN
         LSM_INDX = 0
         RETURN
      END IF
      LSM_INDX = INDX_ARR (IR)
      RETURN
      END
