function ascii_width(i) implicit none integer*4 ascii_width,i,j logical negative if(i.lt.0)then negative=.true. j=-i else negative=.false. j=i endif if(j.lt.10)then ascii_width=1 elseif(j.lt.100)then ascii_width=2 elseif(j.lt.1000)then ascii_width=3 elseif(j.lt.10000)then ascii_width=4 elseif(j.lt.100000)then ascii_width=5 elseif(j.lt.1000000)then ascii_width=6 elseif(j.lt.10000000)then ascii_width=7 elseif(j.lt.100000000)then ascii_width=8 elseif(j.lt.1000000000)then ascii_width=9 else ascii_width=10 endif if(negative)ascii_width=ascii_width+1 return end