
C LAST UPDATE: 
C+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
C
C**************************
C**     LDM_NEWFLP       **
C**************************
C
CD-Routine: Define a New Floating Point Parameter - LDM_NEWFLP
C This routine is used create a new floating point (real) LDM parameter 
C to form part of an extended LDM parameter set.
CD-end
CD-Fortran:
      SUBROUTINE LDM_NEWFLP (KEYWORD, MINL, ITYP, ISTD, F_DEFLT, 
     +                       F_MIN, F_MAX, ICHK, ND, ND_DFLT, IERR)
CD-end
      INCLUDE 'implicit_none.finc'
C
C Purpose: Define a new integer LDM parameter
C
C Author:  John W. Campbell, December 1995
C
C Arguments:
C
      CHARACTER*(*) KEYWORD
      INTEGER MINL
      INTEGER ITYP
      INTEGER ISTD
      REAL F_DEFLT
      REAL F_MIN
      REAL F_MAX
      INTEGER ICHK
      INTEGER ND
      INTEGER ND_DFLT
      INTEGER IERR

CD-Parameters:
C KEYWORD   (R) Parameter name (full) character string  
C MINL      (R) Minimum length for keyword match
C ITYP      (R) Parameter type 1=dataset, 2=pack, 3=plate specific 
C ISTD      (R) Standard parameter for output  = 1 yes, =0 no
C F_DEFLT   (R) Default parameter value  
C F_MIN     (R) Minimum allowed value (if ICHK==5) 
C F_MAX     (R) Maximum allowed value (if ICHK==5) 
C ICHK      (R) Check value option =0 any integer OK,
C                                  =1 any >=0.0
C                                  =2 any >0.0
C                                  =3 any <=0.0
C                                  =4 any <0.0
C                                  =5 must be in range F_MIN to F_MAX
C ND        (R) No. of decimal places for printing value when it was
C               recalculated by a program
C ND_DFLT   (R) No. of decimal places for printing the default value 
C IERR      (W) Error return = 0 OK
C                            = 1 Parameter error
C                            =-1 Cannot allocate memory
CD-end
C
C====== Parameter statements
C 

C
C====== GLOBALS:
C
      INCLUDE 'ldm_data.finc'
      INCLUDE 'ldm_extended.finc'
      EXTERNAL LDM_BDAT
C
C====== FUNCTION TYPES:
C
      INTEGER KDMSTR
      INTEGER LENSTR
      EXTERNAL LDM_DUMMY_CHF
C
C====== LOCALS:
C
      INTEGER KERR
      REAL FDFLT(2)
C
C-------------------------------------------------------------------------------
C
      IERR = 0
      IF (.NOT.EXTENDED) THEN
         CALL LDM_EXTEND_INIT (KERR)
         IF (KERR.NE.0) THEN
            IERR = 1
            IF (KERR.EQ.-1) IERR = -1
            RETURN
         END IF
      END IF
      IF (ITYP.LT.1.OR.ITYP.GT.3) THEN
         IERR = 1
         RETURN
      END IF
      IF (MINL.LT.1) THEN
         IERR = 1
         RETURN
      END IF
      IF (ISTD.NE.0.AND.ISTD.NE.1) THEN
         IERR = 1
         RETURN
      END IF
      IF (ICHK.LT.0.OR.ICHK.GT.5) THEN
         IERR = 1
         RETURN
      END IF

      FDFLT(1) = F_DEFLT
      CALL KDMF_DEFINE_FLOAT (KDX_EXT, KDMSTR(KEYWORD), LENSTR(KEYWORD), 
     +                      MINL, ITYP, ISTD, 1, FDFLT, F_MIN, F_MAX, 
     +                      ICHK, LDM_DUMMY_CHF, ND, ND_DFLT, KERR)
      IF (KERR.GT.0) IERR = 1
      IF (KERR.LT.0) IERR = -1
      RETURN
      END
