C LAST UPDATE: 
C+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
C
C**************************
C**     LDM_SET_KEYP     **
C**************************
C
C
CD-Doc:
C KEYPlate         SUBROUTINE LDM_SET_KEYP (IPACK, IVAL, IERR, ERRSTR)
CD-end
      SUBROUTINE LDM_SET_KEYP (IPACK, IVAL, IERR, ERRSTR)
C
      INCLUDE 'implicit_none.finc'
C
C Purpose: Set value of pack dependent integer parameter KEYPLATE
C
C Author:  John W. Campbell, June 1993
C
C Arguments:
C
      INTEGER IPACK
      INTEGER IVAL
      INTEGER IERR
      CHARACTER*(*) ERRSTR

C  IPACK     (R)   Pack number, 0=all packs
C  IVAL      (R)   Key plate number 1 to NUMPLATES
C  IERR      (W)   Error flag =0 OK
C                             =-1 Invalid pack number
C                             =3 Value must be >0
C  ERRSTR    (W)   Error description string if error found
C
C====== GLOBALS:
C
      INCLUDE 'ldm_data.finc'
      INCLUDE 'ldm_lrl.finc'
      EXTERNAL LDM_BDAT
C
C====== LOCALS:
C

C
C-------------------------------------------------------------------------------
C
      IERR = 0
      ERRSTR = ' '
      CALL LDM_ERR_I (IVAL, 1, 0, IERR, ERRSTR)
      IF (IERR.NE.0) RETURN
      CALL LDM_CHK_SPK (IPACK, IERR, ERRSTR)
      IF (IERR.NE.0) RETURN
      CALL LDM_SETI_PK (IPACK, KEYP, IS_KEYP, CH_KEYP, 
     +                  IVAL, LDM_MAXPK)
      RETURN
      END
