C LAST UPDATE: 
C+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
C
C**************************
C**     LDM_IVAL         **
C**************************
C
C
      INTEGER FUNCTION LDM_IVAL (VALSTR, IVAL, IERR, ERRSTR)
C
      INCLUDE 'implicit_none.finc'
C
C Purpose: Get integer value for LDM parameter from string
C
C ***** 'LDM' SERVICE ROUTINE ONLY *****
C
C Author:  John W. Campbell, June 1993
C
C Return:      0 = OK
C              1 = syntax error in integer
C
C Arguments:
C
      CHARACTER*(*) VALSTR
      INTEGER IVAL
      INTEGER IERR
      CHARACTER*(*) ERRSTR
C
C VALSTR    (R)  Character string to be interpreted
C IVAL      (W)  Returned integer number (0 if syntax error)
C IERR      (W)  Error flag = 0 OK
C                           = 1 Syntax error in number
C           (W)  Error string (max. 80 chars)
C
C====== Parameter statements
C 

C
C====== GLOBALS:
C

C
C====== FUNCTION TYPES:
C
      INTEGER LDM_INTFP
C
C====== LOCALS:
C
      INTEGER K
      INTEGER ND
      REAL FP
C
C-------------------------------------------------------------------------------
C
      IERR = 0
      LDM_IVAL = 0
      ERRSTR = ' '
      K = LDM_INTFP (VALSTR, FP, IVAL, ND)
      IF (K.EQ.0.OR.K.EQ.2) THEN
         IERR = 1
         ERRSTR = 'Invalid syntax for integer number'
         LDM_IVAL = 1
      END IF
      RETURN
      END
