      subroutine XVALUE(DIGIT,LENGTH,OUTCOM,NOTNUM)
        real EXPON,SUM,TEN,TENTH,OUTCOM
        integer IP,KEY,START,LENGTH,I,JX,IP1,J,K
        character DIGIT(LENGTH)*1
        logical NOTNUM
        character ANUMB(10)*1,DIG*1,HOLD*1
        data ANUMB/'0','1','2','3','4','5','6','7','8','9'/
      data TEN/10./
      NOTNUM = .false.
      TENTH = 1.
      SUM = 0.
      EXPON = 0.
      START = 1
      IP = 2
      KEY = 0
      DIG = DIGIT(1)
      if (LENGTH.eq.1.and.(DIG.eq.'E'.or.DIG.eq.'e'.or.DIG.eq.'D'.or.DIG
     &   .eq.'d')) go to 230
      if (DIG.ne.'-') go to 100
      KEY = 1
      START = 2
100   continue
      if (DIG.eq.'+') START = 2
      if (DIG.eq.'.') go to 140
      do 130 I = START, LENGTH
         IP = I+1
         DIG = DIGIT(I)
         if (DIG.eq.'E'.or.DIG.eq.'D'.or.DIG.eq.'e'.or.DIG.eq.'d') go to
     &       180
         if (DIG.eq.'.') go to 140
         do 110 JX = 1, 10
            if (DIG.eq.ANUMB(JX)) go to 120
110      continue
         go to 230
120      continue
         SUM = SUM*TEN+float(JX-1)
130   continue
      go to 220
140   continue
      IP1 = IP
      do 170 J = IP1, LENGTH
         IP = J+1
         TENTH = TENTH/TEN
         DIG = DIGIT(J)
         if (J.gt.LENGTH) go to 220
         if (DIG.eq.' '.or.DIG.eq.',') go to 220
         if (DIG.eq.'E'.or.DIG.eq.'D'.or.DIG.eq.'e'.or.DIG.eq.'d') go to
     &       180
         do 150 JX = 1, 10
            if (DIG.eq.ANUMB(JX)) go to 160
150      continue
         go to 230
160      continue
         SUM = SUM+float(JX-1)*TENTH
170   continue
      go to 220
180   continue
      DIG = DIGIT(IP)
      HOLD = DIG
      if (DIG.eq.'-'.or.DIG.eq.'+') IP = IP+1
      do 210 K = IP, LENGTH
         DIG = DIGIT(K)
         do 190 JX = 1, 10
            if (DIG.eq.ANUMB(JX)) go to 200
190      continue
         go to 230
200      continue
         EXPON = EXPON*TEN+float(JX-1)
210   continue
      if (HOLD.eq.'-') EXPON = -EXPON
220   continue
      OUTCOM = SUM*TEN**EXPON
      if (KEY.eq.1) OUTCOM = -OUTCOM
      go to 240
230   continue
      NOTNUM = .true.
240   continue
      return
      end
