C LAST UPDATE: 
C+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
C
C**************************
C**     LFN_ADDOBS       **
C**************************
C
CD-Routine: Add Spot to Refinement Observations List - LFN_ADDOBS
C This routine is used to add the observed  spot position for a given
C reflection to the refinement observations list.
CD-end
CD-Fortran:
      SUBROUTINE LFN_ADDOBS (IH, IK, IL, XM, YM, IERR)
CD-end
      INCLUDE 'implicit_none.finc'
C
C Purpose: Add spot to observed refinement spots list
C
C Author:  John W. Campbell, September 1993
C
C Arguments:
C
      INTEGER IH
      INTEGER IK
      INTEGER IL
      REAL XM
      REAL YM
      INTEGER IERR
CD-Parameters:
C  IH      i (R)   'h' index
C  IK      i (R)   'k' index
C  IL      i (R)   'l' index
C  XM      r (R)   Observed 'x' position (rasters)
C  YM      r (R)   Observed 'y' position (rasters)
C  IERR    i (W)   Error flag =0 OK, =1 list full
CD-end
C====== GLOBALS:
C
      INCLUDE 'refine_limits.finc'
      INCLUDE 'refobs_list.finc'
C
C-------------------------------------------------------------------------------
C
      IERR = 0
      IF (NUM_REF_OBS.GE.MAX_REF_OBS) THEN
         IERR = 1
         RETURN
      END IF
      NUM_REF_OBS = NUM_REF_OBS + 1
      HOBS (NUM_REF_OBS) = IH
      KOBS (NUM_REF_OBS) = IK
      LOBS (NUM_REF_OBS) = IL
      XM_OBS (NUM_REF_OBS) = XM 
      YM_OBS (NUM_REF_OBS) = YM  
      RETURN
      END
