SUBROUTINE SCALE(ARRAY,AXLEN,NPTS,INC) C C Compute minimum and axis increment for line subroutine C C ARRAY(real) = array containing the data points C * the main program should dimension array(npts+2) C * in that this routine returns the axis minimum C * in ARRAY(NPTS+1) and the axis increment in C * ARRAY(NPTS+2) C AXLEN(real) = the length of the axis in inches C NPTS(integer)=the number of points in ARRAY C INC(integer)= the index increment used in accessing the array C it can be increasing or decreasing C dimension array(1),save(7) data save/1.0,2.0,4.0,5.0,8.0,10.0,20.0/ fad=0.01 k=iabs(inc) n=npts*k y0=array(1) yn=y0 do 20 i=1,n,k ys=array(i) if(y0.le.ys)goto 10 y0=ys goto 20 10 if(ys.gt.yn)yn=ys 20 continue firstv=y0 if(y0.lt.0.0)fad=fad-1.0 deltav=(yn-firstv)/axlen if(deltav.le.0.0)goto 70 i=alog10(deltav)+1000.0 p=10.0**(i-1000) deltav=deltav/p-0.01 do 30 i=1,6 is=i if(save(i).ge.deltav)goto 40 30 continue 40 deltav=save(is)*p firstv=deltav*aint(y0/deltav+fad) t=firstv+(axlen+0.01)*deltav if(t.ge.yn)goto 50 is=is+1 goto 40 50 firstv=firstv-aint((axlen+(firstv-yn)/deltav)/2.0)*deltav if((y0*firstv).le.0.0)firstv=0.0 if(inc.gt.0)goto 60 firstv=firstv+axlen*deltav deltav=-deltav 60 n=n+1 array(n)=firstv n=n+k array(n)=deltav return 70 deltav=1.0 firstv=firstv-0.5 goto 60 end