ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc subroutine char_to_int(n,g) c Routine for searching a string of characters "g" containing an c integer and converting that to an integer value returned as "n" c If the string contains more than one integer, only the first c in the sequence is returned. character*1 ch integer n,i,j,k,lev,jpos,ilength,jstart,jend,nlength c Alter the maximum length of the character string as necessary c in the following two lines... character*60 g ilength=60 do j=1,ilength ch(1:1)=g(j:j) call get_number(ch,i) if(i.lt.10) then jstart=j goto 13 endif enddo 13 do j=jstart+1,ilength ch(1:1)=g(j:j) call get_number(ch,i) if(i.eq.10) then jend=j goto 14 endif enddo 14 nlength=jend-jstart n=0 do j=1,nlength jpos=jstart+j-1 k=nlength-j lev=10**k ch(1:1)=g(jpos:jpos) call get_number(ch,i) n=n+i*lev enddo return end ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc subroutine get_number(ch,i) character*1 ch integer i i=10 if(ch(1:1).eq.'0') i=0 if(ch(1:1).eq.'1') i=1 if(ch(1:1).eq.'2') i=2 if(ch(1:1).eq.'3') i=3 if(ch(1:1).eq.'4') i=4 if(ch(1:1).eq.'5') i=5 if(ch(1:1).eq.'6') i=6 if(ch(1:1).eq.'7') i=7 if(ch(1:1).eq.'8') i=8 if(ch(1:1).eq.'9') i=9 return end