C LAST UPDATE: 
C+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
C
C**************************
C**     LRL_GET_HARM     **
C**************************
C
CD-Routine: Get Harmonics Data for a Spot - LRL_GET_HARM
C This routine returns the harmonics data for a spot in the Laue Reflections
C List. All the component reflections of a multiple may easily be generated
C from this information if required.
CD-end
CD-Fortran:
      SUBROUTINE LRL_GET_HARM (ISPOT, IH, IK, IL, H_N, K_N, L_N,
     +                         MULT, MINHARM, MAXHARM, INCHARM,
     +                         ALNOD, DTHR2NOD, IERR)
CD-end
      INCLUDE 'implicit_none.finc'
C
C Purpose: Get harmonics data for a spot
C
C Author:  John W. Campbell, July 1993
C
C Arguments:
C
      INTEGER ISPOT
      INTEGER IH
      INTEGER IK
      INTEGER IL
      INTEGER H_N
      INTEGER K_N
      INTEGER L_N
      INTEGER MULT
      INTEGER MINHARM
      INTEGER MAXHARM
      INTEGER INCHARM
      REAL    ALNOD
      REAL    DTHR2NOD
      INTEGER IERR
CD-Parameters:
C ISPOT   i (R)   Spot index number (in current sort order)
C IH      i (W)   Reflection 'h' index (lowest harmonic present 
C                 for a multiple)
C IK      i (W)   Reflection 'k' index (lowest harmonic present 
C                 for a multiple)
C IL      i (W)   Reflection 'l' index (lowest harmonic present 
C                 for a multiple)
C H_N     i (W)   Nodal 'h' index
C K_N     i (W)   Nodal 'k' index
C L_N     i (W)   Nodal 'l' index
C MULT    i (W)   Multiplicity
C MINHARM i (W)   Minimum harmonic number
C MAXHARM i (W)   Maximum harmonic number
C INCHARM i (W)   Harmonics increment (returns 1 for a single)
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
C
C     INTEGER I       !Index to spot
C
C-------------------------------------------------------------------------------
C
      IERR = 0
      IF (ISPOT.LT.1.OR.ISPOT.GT.NUM_SPOTS) THEN
         IERR = 1
         RETURN
      END IF
      I = INDX(ISPOT)
      CALL LRL_GETHKL (HKL(I), IH, IK, IL)
      CALL LRL_GETHKL (NOD_HKL(I), H_N, K_N, L_N)
      IF (MULTS(I).EQ.1) THEN
         MULT = 1
         MINHARM = 0
         IF (H_N.NE.0) THEN
            MINHARM = IH/H_N
         ELSE IF (K_N.NE.0) THEN
            MINHARM = IK/K_N
         ELSE IF (L_N.NE.0) THEN
            MINHARM = IL/L_N
         END IF
         MAXHARM = MINHARM
         INCHARM = 1
      ELSE
         CALL LRL_GETMULT (MULTS(I), MULT, MINHARM, MAXHARM, INCHARM)
      END IF
      ALNOD = LAMBDAS(I)*MINHARM
      DTHR2NOD = DMIN_THR2(I)/MINHARM
      RETURN
      END
