      subroutine str2r8(buf,value,error)
C
C Description:
C
C This routine converts a string (hopefully containing a number) to
C a real*8 number. This routine is more picky than the internal
C read style conversion. It will not allow scientific notation and
C it will not allow non-numeric characters within the string.
C
C Programming interface:
C
C Name   In/out  Type     Structure  Meaning
C
C buf    in      char(*)  scalar     The string containing the number
C value  out     real*8   scalar     The resulting double precision number
C error  out     logical  scalar     TRUE if a conversion error occurs
C
C Errors:
C
C If the string does not contain a number (integer or floating point)
C then error is set TRUE and the routine immediately returns.
C
C Routines accessed
C
C if_fp_num
C is_int_num
C err_msg
C
      implicit none
      real*8 value
      integer lnblnk
      logical error,is_fp_num,is_int_num
      character*(*) buf
      character*64 local
      local=buf
      if (is_fp_num(local) .or. is_int_num(local)) then
         if (is_int_num(local)) then
            local=local(1:lnblnk(local))//'.'
         end if
         read(local,1,err=403) value
 1       format(f64.0)
      else
         error=.true.
         call err_msg('str2r8',
     $        'The string cannot be converted to a number.')
      end if
      goto 400
 403  error=.true.
      call err_msg('str2r8','Error in type conversion.')
 400  continue
      if (error) then
         call err_msg('str2r8','Traceback')
      end if
      return
      end
