       function ctoi ( string, istrt, ifin )
c
c    jms:zeus3d.ctoi <------------- converts CHAR*8 string to an integer
c    from jms:zeus2d.strtoi                              ?????????, 19??
c
c    written by: Jim Stone
c    modified 1: January, 1990 by David Clarke; incorporated into ZEUS3D
c
c  PURPOSE:  Converts a segment of a character*8 string into an integer.
c
c  EXTERNALS: [NONE]
c
c-----------------------------------------------------------------------
c
c
c-----------------------------------------------------------------------
c------------------------ IMPLICIT STATEMENTS --------------------------
c-----------------------------------------------------------------------
c
       implicit      none
c
       character*8   string
       integer       istrt   , ifin    , ishift  , ival    , i
       integer       ctoi
c
       integer       asciic  (48:57)
c
c      Data Statements
c
       data          asciic  / 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 /
       save          asciic
c
c-----------------------------------------------------------------------
c
       ishift = 1
       ival   = 0
       do 10 i=ifin,istrt,-1
         ival   = ival + ishift * asciic ( ichar(string(i:i)) )
         ishift = ishift * 10
10     continue
       ctoi = ival
c
       return
       end
