C LAST UPDATE: 
C+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
C
C**************************
C**     LDM_SAME_PK      **
C**************************
C
C
      LOGICAL FUNCTION LDM_SAME_PK (KEYWORD, NPK)
C
      INCLUDE 'implicit_none.finc'
C
C Purpose: See if all values are the same for a pack dependent parameter
C
C ***** 'LDM' SERVICE ROUTINE ONLY ****
C
C Author:  John W. Campbell, June 1993
C
C Arguments:
C
      CHARACTER*(*) KEYWORD
      INTEGER NPK

C KEYWORD  (R)   Parameter name keyword (full)
C NPK      (R)   Number of packs (minimum 1)
C
C====== Parameter statements
C 

C
C====== GLOBALS:
C

C
C====== FUNCTION TYPES:
C
      
C
C====== LOCALS:
C
      INTEGER I
      INTEGER IVAL
      INTEGER ND
      INTEGER ITYP
      INTEGER IFLAG
      INTEGER IERR
      CHARACTER*1 VALSTR
      CHARACTER*1 ERRSTR
      REAL VALUE
      REAL VREF
      REAL EPS

C     INTEGER I            !Packs loop variable
C     INTEGER IVAL         !Integer value of parameter
C     INTEGER ND           !No. of decimal placed for parameter value print
C     INTEGER ITYP         !Parameter type flag from LDM_GET
C     INTEGER IFLAG        !Parameter value status flag from LDM_GET
C     INTEGER IERR         !Error flag from LDM_GET
C     CHARACTER*1 VALSTR   !Parameter value string (treated as dummy here)
C     CHARACTER*1 ERRSTR   !Error return string (treated as dummy here)
C     REAL VALUE           !Real value of parameter
C     REAL VREF            !Reference value
C     REAL EPS             !Small difference for 'equal' values test
C
C-------------------------------------------------------------------------------
C
C
C====== See if same for all packs
C
      LDM_SAME_PK = .TRUE.
      CALL LDM_GET (KEYWORD, 1, 0, VALSTR, VREF, ND, IVAL,
     +              IFLAG, ITYP, IERR, ERRSTR)
      EPS = 1.0E-09
      DO 200 I = 1, NPK
         CALL LDM_GET (KEYWORD, I, 0, VALSTR, VALUE, ND, IVAL,
     +              IFLAG, ITYP, IERR, ERRSTR)
         IF (ABS(VALUE-VREF).GT.EPS) GO TO 300
200   CONTINUE
      RETURN
300   LDM_SAME_PK = .FALSE.
      RETURN
      END
