! free form output of string and vector of Octal values on terminal. ! call tv4oct('strng',numg,in) !string, followed by in(1),in(2)...in(numg) subroutine tv4oct(string,numg,ivec) ! tv4oct original 85.04.15 !! implicit none character*(*) string character*80 out,tmp*20 integer*4:: dest,numg,nch,i,j,ival,ia,ivec(*) nch=len(string) !how many chars output out=' '//string(1:nch)//' [octal] ' nch=nch+10 do i=1,numg ia=ivec(i) !get ith of vector dest=0 !char loc (backward) do while(ia.ne.0) dest=dest+1 tmp(dest:dest)=char(48+iand(ia,7)) ia=ishft(ia,-3) enddo do j=1,dest out(nch+dest-j:nch+dest-j)=tmp(j:j) enddo nch=nch+dest+1 if(nch > 75) then print 1000, out(1:nch) 1000 format(a) out=' [Oct] ' ; nch=8 endif enddo if(nch.gt.8) print 1000, out(1:nch) return end subroutine tv4oct