C LAST UPDATE: 
C+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
C
C**************************
C**     LDM_SET_SYMAX    **
C**************************
C
C
CD-Doc:
C SPDY_MAx         SUBROUTINE LDM_SET_SYMAX (IPACK, IPLATE, VALUE, 
C                 +                          IERR, ERRSTR)
CD-end
      SUBROUTINE LDM_SET_SYMAX (IPACK, IPLATE, VALUE, IERR, ERRSTR)
C
      INCLUDE 'implicit_none.finc'
C
C Purpose: Set value of plate dependent real parameter SPDY_MAX
C
C Author:  John W. Campbell, July 1994
C
C Arguments:
C
      INTEGER IPACK
      INTEGER IPLATE
      REAL    VALUE
      INTEGER IERR
      CHARACTER*(*) ERRSTR

C  IPACK     (R)   Pack number, 0=all packs
C  IPLATE    (R)   Plate number, 0=all plates
C  VALUE     (R)   Value for upper y bound for chebyshev polynomial fit as 
C                  an offset in mm. from the pattern centre
C  IERR      (W)   Error flag =0 OK
C                             =-1 Invalid pack number
C                             =-2 Invalid plate number
C                             = 6 Invalid value (<10.0)
C  ERRSTR    (W)   Error description string if error found
C
C====== GLOBALS:
C
      INCLUDE 'ldm_data.finc'
      EXTERNAL LDM_BDAT
      INCLUDE 'ldm_lrl.finc'
C
C====== LOCALS:
C

C
C-------------------------------------------------------------------------------
C
      IERR = 0
      ERRSTR = ' '
      IF (VALUE.LT.10.0) THEN
         ERRSTR = 'Value must be >= 10.0'
         IERR = 6
         RETURN
      END IF
      CALL LDM_CHK_SPL (IPACK, IPLATE, IERR, ERRSTR)
      IF (IERR.NE.0) RETURN
      CALL LDM_SETF_PL (IPACK, IPLATE, SPDYMAX, IS_SPDYMAX, CH_SPDYMAX, 
     +                  ND_SPDYMAX, VALUE, LDM_MAXPK, LDM_MAXPL)
      CALL LDM_CLR_GEN (IPACK, IPLATE, 2)
      RETURN
      END
