! tv4dec subroutine i/o c.typscn sbp 85.04.15 ! free form output of string and vector of integer values on terminal. ! call tv4dec('strng',numg,in) !string, followed by in(1),in(2)...in(numg) !tpl call tv4dec(string,numg,ivec) !type numg int*4 in base 10 subroutine tv4dec(string,numg,ivec) implicit none character*(*) string character*80 out character(20) fmt integer*2 numg !allow it, *4 also ok integer*4 nch,i,ival,ia,iw,mch integer*4 ivec(*) nch=len(string) !how many chars output out=' '//string(1:nch)//' [dec] ' nch=nch+8 do i=1,numg ival=ivec(i) !get ith of vector ia=ival iw=0 do while (ia /= 0) ia=ia/10 iw=iw+1 enddo if(ival <= 0) iw=iw+1 ! if((nch+iw+1) > 75) then print 1000, out(1:nch) 1000 format(a) out=' [dec] ' nch=8 endif mch=nch+iw write (fmt, '(a, i0, a)') '(i', iw, ', a)' write(out(nch:mch),fmt) ival, ' ' nch=mch+1 enddo print 1000, out(1:nch) return end