        SUBROUTINE CTOR2(S,N,I,R)
C
C               T.J.PEARSON  1978 MAY 11
C               MODIFIED 1979 FEB 6  VAX/VMS FORTRAN 4
C               MODIFIED 1989 MAY 26  CONVERT FR. FUNCTION TO SUBROUTINE
C
C               EVALUATE NUMBER AT S(I); INCREMENT I
C               RETURN AS REAL*8
C
        REAL*8      R,RR,FRACTN
        INTEGER     IEXPON,SIGN
        INTEGER*4   N,I,IEXPON,ICOLON
        INTEGER*2   S(N),COLON,PLUS,MINUS,POINT,E,ELC
        CHARACTER*2 CCOLON,CPLUS,CMINUS,CPOINT,CE,CELC
        EQUIVALENCE (CCOLON,COLON), (CPLUS,PLUS), (CMINUS,MINUS), 
     +              (CPOINT,POINT), (CE,E), (CELC,ELC)
        DATA        CCOLON/':'/,CPLUS/'+'/,CMINUS/'-'/,CPOINT/'.'/,
     1              CE/'E'/,CELC/'e'/
        DATA        TEN/10.0/
C
        R=0D0
        IF(I.GT.N) GOTO 270
        SIGN=+1
        IF(S(I).NE.MINUS) GOTO 130
            I=I+1
            SIGN=-1
            CALL SKIPBL(S,N,I)
            GOTO 140
  130   IF(S(I).NE.PLUS) GOTO 140
            I=I+1
            CALL SKIPBL(S,N,I)
  140   ISTART=I
        ICOLON=0
  150   CALL CTOD2(S,N,I,RR)
        R = RR*SIGN/(60D0**ICOLON) + R
        IF(I.GT.N) GOTO 270
        IF(S(I).NE.COLON) GOTO 160
            I=I+1
            ICOLON=ICOLON+1
            GOTO 150
C
C               LOOK FOR FRACTIONAL PART, IF ANY
C
  160   IF(S(I).NE.POINT) GOTO 170
        J=I+1
        CALL CTOD2(S,N,J,RR)
        FRACTN=RR*SIGN
        R=R + FRACTN*10D0**(I-J+1)
        I=J
        IF(I.GT.N) GOTO 270
C
C               Look for exponent, if any; an exponent may not stand
C               alone
C
  170   IF(.NOT.(S(I).EQ.E.OR.S(I).EQ.ELC) .OR. I.EQ.ISTART) GOTO 270
        I=I+1
        IF(I.GT.N) GOTO 270
        SIGN=+1
        IF(S(I).NE.MINUS) GOTO 180
            I=I+1
            SIGN=-1
            GOTO 190
  180   IF(S(I).NE.PLUS) GOTO 190
            I=I+1
  190   CALL CTOI2(S,N,I,IEXPON)
        R=R * 10D0**(SIGN*IEXPON)
  270   CONTINUE
        RETURN
        END

