C LAST UPDATE: 
C+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
C
C**************************
C**     LDM_CHK_GEN      **
C**************************
C
CD-Routine: See if LRL Needs to be Regenerated - LDM_CHK_GEN
C This routine determines which of the three calculation stages need to
C be carried out to obtain a valid Laue Reflection List (LRL) for the
C required pack and plate.
CD-end
CD-Fortran:
      SUBROUTINE LDM_CHK_GEN (IPACK, IPLATE, MTX, GEN, OVL)
CD-end
      INCLUDE 'implicit_none.finc'
C
C Purpose: See if LRL needs to be regenerated (each of 3 parts of the
C          procedure)
C
C Author:  John W. Campbell, July 1993
C
C Arguments:
C
      INTEGER IPACK
      INTEGER IPLATE
      LOGICAL MTX
      LOGICAL GEN
      LOGICAL OVL

CD-Parameters:
C IPACK    i (R)   Pack number for which LRL is to be generated
C IPLATE   i (R)   Plate number for whic LRL is to be generated
C MTX      l (W)   =.TRUE. need to recalculate matrices, =.FALSE. do not
C GEN      l (W)   =.TRUE. need to regenerate LRL, =.FALSE. do not
C OVL      l (W)   =.TRUE. need to recalculate overlaps, =.FALSE. do not
CD-end
C
C====== GLOBALS:
C
      INCLUDE 'ldm_lrl.finc'
C
C====== LOCALS:
C

C
C-------------------------------------------------------------------------------
C
      MTX = .FALSE.
      IF (IPACK.NE.PKMTX.OR.IPLATE.NE.PLMTX) MTX = .TRUE.
      GEN = .FALSE.
      IF (IPACK.NE.PKGEN.OR.IPLATE.NE.PLGEN) GEN = .TRUE.
      OVL = .FALSE.
      IF (IPACK.NE.PKOVL.OR.IPLATE.NE.PLOVL) OVL = .TRUE.
      RETURN
      END
