C LAST UPDATE: 
C+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
C
C**************************
C**     LRL_GET_NIDX     **
C**************************
C
CD-Routine: Get Nodal Index for a Spot - LRL_GET_NIDX
C This routine returns the 'nodal index' for a spot from the Laue Reflections
C List (i.e. the maximum absolute nodal index for the three indices).
CD-end
CD-Fortran:
      SUBROUTINE LRL_GET_NIDX (ISPOT, NOD_IDX, IERR)
CD-end
       INCLUDE 'implicit_none.finc'
C
C Purpose: Get 'nodal index' for a spot (i.e. max absolute nodal index)
C
C Author:  John W. Campbell, July 1993
C
C
      INTEGER ISPOT
      INTEGER NOD_IDX
      INTEGER IERR
CD-Parameters:
C ISPOT   i (R)   Spot index number (in current sort order)
C NOD_IDX i (W)   The nodal index
C IERR    i (W)   Error flag =  0,  OK
C                            =  1,  Invalid spot number
CD-end
C
C====== GLOBALS:
C
      INCLUDE 'lrl_data.finc'
C
C====== FUNCTION TYPES:
C
      EXTERNAL LRL_BDAT
C
C====== LOCALS:
C
      INTEGER I
      INTEGER NH, NK, NL
C
C-------------------------------------------------------------------------------
C
      NOD_IDX = 0
      IERR = 0
      IF (ISPOT.LT.1.OR.ISPOT.GT.NUM_SPOTS) THEN
         IERR = 1
         RETURN
      END IF
      I = INDX(ISPOT)
      CALL LRL_GETHKL (NOD_HKL(I), NH, NK, NL)
      IF (IABS(NH).GT.NOD_IDX) NOD_IDX = ABS(NH)
      IF (IABS(NK).GT.NOD_IDX) NOD_IDX = ABS(NK)
      IF (IABS(NL).GT.NOD_IDX) NOD_IDX = ABS(NL)
      RETURN
      END 
