C LAST UPDATE: 
C+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
C
C**************************
C**     LRL_GET_XFYFD    **
C**************************
C
CD-Routine: Return Coordinates for a Spot - LRL_GET_XFYFD
C This routine returns the predicted coordinates for a spot in the Laue
C Reflections List. The spot position may or may not be distortion
C corrected depending on the option selected when the Laue Reflection List
C was generated.
CD-end
CD-Fortran:
      SUBROUTINE LRL_GET_XFYFD (ISPOT, XFD, YFD, IERR)
CD-end
      INCLUDE 'implicit_none.finc'
C
C Purpose: Get predicted coordinates for a spot 
C
C Author:  John W. Campbell, July 1993
C
C Arguments:
C
      INTEGER ISPOT
      REAL  XFD
      REAL  YFD
      INTEGER IERR
CD-Parameters:
C ISPOT   i (R)   Spot index number (in current sort order)
C XFD     r (W)   Predicted 'x' coordinate of stored spot along 'xd' ('xf')
C                 wrt. predicted pattern centre
C YFD     r (W)   Predicted 'y' coordinate of stored spot along 'yd' ('yf')
C                 wrt. predicted pattern centre
C                 Note: These will be distortion corrected if this option
C                       was selected when the reflection list was generated
C                       (normal) case (LRL_GEN, LRL_GNR). The distortion
C                       correction status can be found by calling the 
C                       routine LRL_STATUS
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-------------------------------------------------------------------------------
C
      IERR = 0
      IF (ISPOT.LT.1.OR.ISPOT.GT.NUM_SPOTS) THEN
         IERR = 1
         RETURN
      END IF
      I = INDX(ISPOT)
      XFD = XF_D(I)
      YFD = YF_D(I)
      RETURN
      END
