C LAST UPDATE: 
C+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
C
C**************************
C**    EXTEND_LDM        **
C**************************
C
C
      SUBROUTINE EXTEND_LDM
C
C      INCLUDE 'implicit_none.finc'
C
C Purpose: Extend LDM parameter set as for LAUEGEN
C
C Author:  John W. Campbell, December 1995
C
C Arguments:
C
C      None
C
C====== Parameter statements
C 
 
C
C====== GLOBALS:
C

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

C
C====== LOCALS:
C
      LOGICAL PROF_ROT
      INTEGER IERR
      INTEGER NPROF
      REAL PROMIN
      CHARACTER*1 DUMSTR(2)
      CHARACTER*3 FTYPES(2)
      CHARACTER*3 PRTYPES(2)
      CHARACTER*3 ROTTYPES(2)

C     LOGICAL PROF_ROT          !Rotate profiles flag
C     INTEGER IERR              !Error flag
C     INTEGER NPROF             !Default no. of profiles
C     REAL PROMIN               !Default promin value from LFN_SAINT_DF
C     CHARACTER*1 DUMSTR(2)     !Dummy string
C     CHARACTER*3 FTYPES(2)     !Integration o/p file types
C     CHARACTER*3 PRTYPES(2)    !Profiles for all plates flags
C     CHARACTER*3 ROTTYPES(2)   !Profiles rotate flags

      DATA FTYPES/'mtz','ge'/
      DATA PRTYPES/'no','yes'/
      DATA ROTTYPES/'no','yes'/
C
C-------------------------------------------------------------------------------
C
      CALL LDM_NEWSTR ('INT_FTYPE', 6, 1, 0, 3, 'mtz',
     +                 FTYPES, 2, 3, 1, 0, IERR)
      IF (IERR.NE.0) GO TO 800

      CALL LDM_NEWSTR ('INT_TEMPLATE', 6, 1, 0, 120, 'int####.mtz',
     +                 DUMSTR, 1, 1, 0, 0, IERR)
      IF (IERR.NE.0) GO TO 800

      CALL LFN_SAINT_DF (NPROF, PROMIN, PROF_ROT)
      CALL LDM_NEWINT ('NPROF', 5, 1, 0, NPROF, 1, 17, 5, IERR)
      IF (IERR.NE.0) GO TO 800

      CALL LDM_NEWSTR ('PROF_ROTATE', 6, 1, 0, 3, 'yes',
     +                 ROTTYPES, 2, 3, 1, 0, IERR)
      IF (IERR.NE.0) GO TO 800

      CALL LDM_NEWFLP ('PROMIN', 6, 1, 0, 0.0, 0.0, 0.0, 1, 1, 1, IERR) 
      IF (IERR.NE.0) GO TO 800

      CALL LDM_NEWSTR ('PROF_ALL', 6, 1, 0, 3, 'no',
     +                 PRTYPES, 2, 3, 1, 0, IERR)
      IF (IERR.NE.0) GO TO 800

      CALL LDM_NEWFLP ('SCALE_INT', 7, 1, 0, 0.0, 0.0, 0.0, 
     +                 1, 1, 1, IERR) 
      IF (IERR.NE.0) GO TO 800

      CALL LDM_NEWINT ('OVLIM', 5, 1, 0, 0, 0, 0, 1, IERR)
      IF (IERR.NE.0) GO TO 800
     
      RETURN
C
C====== Error (Fatal)
C
800   STOP '**Error** Cannot extend LDM parameters list'
      END
