C LAST UPDATE: 
C+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
C
C**************************
C**     LDM_SETF_PK      **
C**************************
C
C
      SUBROUTINE LDM_SETF_PK (IPACK, PAR, IS_PAR, CH_PAR, ND_PAR, 
     +                        VALUE, MAXPK)
C
      INCLUDE 'implicit_none.finc'
C
C Purpose: Set values for a pack based real parameter (for LDM_SET.. routines)
C
C ***** 'LDM' SERVICE ROUTINE ONLY *****
C
C Author:  John W. Campbell, June 1993
C
C Arguments:
C
      INTEGER IPACK
      INTEGER MAXPK
      REAL PAR(MAXPK)
      INTEGER IS_PAR(MAXPK)
      INTEGER CH_PAR(MAXPK)
      INTEGER ND_PAR(MAXPK)
      REAL VALUE

C  IPACK     (R)   Pack number, 0=all packs
C  PAR       (W)   Array containing parameter values to be set
C  IS_PAR    (W)   Array containing IS flags to be set
C  CH_PAR    (W)   Array containing CH flags to be set
C  ND_PAR    (W)   Array containing ND flags to be set
C  VALUE     (R)   Value to be set
C  MAXPK     (R)   Packs array dimension
C
C====== GLOBALS:
C
      INCLUDE 'ldm_data.finc'
C
C====== LOCALS:
C
      INTEGER I
C
C-------------------------------------------------------------------------------
C
      IF (IPACK.EQ.0) THEN
         DO 100 I = 1, MAXPK
            PAR(I) = VALUE
            IS_PAR(I) = 2
            CH_PAR(I) = CH_MASK
            ND_PAR(I) = -1000
100      CONTINUE
      ELSE        
         PAR(IPACK) = VALUE
         IS_PAR(IPACK) = 1
         CH_PAR(IPACK) = CH_MASK
         ND_PAR(IPACK) = -1000
      END IF
      RETURN
      END
