C LAST UPDATE: 
C+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
C
C**************************
C**     LFN_AUTO_UPD     **
C**************************
C
C
      SUBROUTINE LFN_AUTO_UPD (IPACK, IPLATE, ITYP, UPD_FLAG, 
     +                         KPACK, KPLATE)
C
      INCLUDE 'implicit_none.finc'
C
C Purpose: Set global pack/plate update flags for parameter updates
C          as appropriate for LFN_AUTO_UPDT
C
C **** Service routine only ****
C
C Author:  John W. Campbell, October 1994
C
C Arguments:
C
      INTEGER IPACK
      INTEGER IPLATE
      INTEGER ITYP
      LOGICAL UPD_FLAG
      INTEGER KPACK
      INTEGER KPLATE
C
C  ITYP    (R)   Parameter class =1 pack based parameter (soft limits, phis)
C                                =2 plate based parameter
C
C====== Parameter statements
C 

C
C====== GLOBALS:
C

C
C====== FUNCTION TYPES:
C

C
C====== LOCALS:
C
      INTEGER KEYPLATE
      INTEGER IFLAG
      INTEGER IERR
      CHARACTER*2 ERRSTR

C     INTEGER KEYPLATE         !Key plate
C     INTEGER IFLAG            !Parameter status flag
C     INTEGER IERR             !Error flag
C     CHARACTER*2 ERRSTR       !Error string flag (dummy)
C
C-------------------------------------------------------------------------------
C
      KPACK = IPACK
      KPLATE = IPLATE
      IF (.NOT.UPD_FLAG) RETURN
      CALL LDM_GET_KEYP (IPACK, KEYPLATE, IFLAG, IERR, ERRSTR)
      IF (ITYP.EQ.1) THEN
         IF (IPACK.EQ.1) KPACK = 0
      ELSE
         IF (IPLATE.EQ.KEYPLATE) THEN
            KPLATE = 0
            IF (IPACK.EQ.1) KPACK = 0
         END IF
      END IF
      RETURN
      END
