      logical function is_fp_num(str)
C
C Description: 
C
C This function returns true if the character string 'str' contains only a 
C floating-point number (This is a limited definition of 'floating-point'.)
C There must be no blanks between characters, 
C the first character must be a decimal digit, a '.' or a '+' or '-' sign. 
C All following characters must be decimal digits or a decimal point. Only 
C one decimal point is allowed. There must be at least 1 decimal digit in the
C string.
C     
C Name         in/out type          Structure  Meaning
C is_fp_num    out    logical       scalar     Returned TRUE if the input 
C                                              string contains a valid 
C                                              floating-point number as 
C                                              described above
C str          in     character(*)  scalar     The string containing the   
C                                              characters to be tested. 
C
C Errors:
C
C This routine should generate no errors. No errors are trapped.
C     
C Subroutines accessed:
C
C fnblnk
C lnblnk
C index (intrinsic)
C is_digit
C
      implicit none
      logical is_digit
      integer start,ptr,numcount,deccount,i,lnblnk,fnblnk
      character*(*) str
      character*13 firstchar
      data firstchar/'0123456789+-.'/
      is_fp_num=.true.
      start=fnblnk(str)
      ptr=lnblnk(str)
      if (ptr .gt. 0) then
         if (index(firstchar,str(start:start)) .ne. 0) then
            if (str(start:start) .eq. '.') then
               deccount=1
            else
               deccount=0
            end if
            if (is_digit(str(start:start))) then
               numcount=1
            else
               numcount=0
            end if
            do i=start+1,ptr
               if (is_digit(str(i:i))) then
                  numcount=numcount+1
               else
                  if (str(i:i) .eq. '.') then
                     deccount=deccount+1
                  else
                     is_fp_num=.false.
                  end if
               end if
            end do
            if ((numcount .lt. 1) .or. (deccount .ne. 1)) then
               is_fp_num=.false.
            end if
         else
            is_fp_num=.false.
         end if
      else
         is_fp_num=.false.
      end if
      return
      end
