C LAST UPDATE: 
C+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
C
C**************************
C**     LDM_DCSET_PL     **
C**************************
C
C
      SUBROUTINE LDM_DCSET_PL (IPACK, IPLATE, PAR, DF_PAR, 
     +                        IS_PAR, CH_PAR, DF_IS_PAR,
     +                        IERR, ERRSTR, MAXPK, MAXPL)
C
      INCLUDE 'implicit_none.finc'
C
C Purpose: Set default values for a plate based string parameter 
C
C ***** 'LDM' SERVICE ROUTINE ONLY *****
C
C Author:  John W. Campbell, June 1993
C
C Arguments:
C
      INTEGER IPACK
      INTEGER IPLATE
      INTEGER MAXPK
      INTEGER MAXPL
      CHARACTER*(*) PAR(MAXPK,MAXPL)
      CHARACTER*(*) DF_PAR
      INTEGER IS_PAR(MAXPK,MAXPL)
      INTEGER CH_PAR(MAXPK,MAXPL)
      INTEGER DF_IS_PAR
      INTEGER IERR
      CHARACTER*(*) ERRSTR

C  IPACK     (R)   Pack number, 0=all packs
C  IPLATE    (R)   Plate number, 0=all plates
C  PAR       (W)   Array containing parameter values to be set
C  DF_PAR    (R)   Default value for the parameter
C  IS_PAR    (W)   Array containing IS flags to be set
C  CH_PAR    (W)   Array containing CH flags to be set
C  DF_IS_PAR (R)   Default value for the IS flags
C  IERR      (W)   Error flag = 0 OK
C                             =-1 Invalid pack specification
C  ERRSTR    (W)   Error string
C  MAXPK     (R)   Packs array dimension
C  MAXPL     (R)   Plates array dimension
C
C====== GLOBALS:
C
      INCLUDE 'ldm_data.finc'
C
C====== LOCALS:
C
      INTEGER I
      INTEGER J
C
C-------------------------------------------------------------------------------
C
      CALL LDM_CHK_SPL (IPACK, IPLATE, IERR, ERRSTR)
      IF (IERR.NE.0) RETURN
      IF (IPACK.EQ.0) THEN
         IF (IPLATE.EQ.0) THEN
            DO 100 I = 1, MAXPK
               DO 50 J = 1, MAXPL
                 PAR(I,J) = DF_PAR
                  IS_PAR(I,J) = DF_IS_PAR
                  CH_PAR(I,J) = CH_MASK
50             CONTINUE
100         CONTINUE
         ELSE
            DO 150 I = 1, MAXPK
                PAR(I,IPLATE) = DF_PAR
                IS_PAR(I,IPLATE) = DF_IS_PAR
                CH_PAR(I,IPLATE) = CH_MASK
150         CONTINUE
         END IF
      ELSE
         IF (IPLATE.EQ.0) THEN
            DO 200 J = 1, MAXPL
               PAR(IPACK,J) = DF_PAR
               IS_PAR(IPACK,J) = DF_IS_PAR
               CH_PAR(IPACK,J) = CH_MASK
200         CONTINUE
         ELSE
            PAR(IPACK,IPLATE) = DF_PAR
            IS_PAR(IPACK,IPLATE) = DF_IS_PAR
            CH_PAR(IPACK,IPLATE) = CH_MASK
         END IF
      END IF
      RETURN
      END
