SUBROUTINE SCALG(ARRAY,AXLEN,NPTS,INC) C C LOGARITHMIC SCALING ROUTINE C C NOTE:The array size in the calling routine C should be dimensioned 2 greater than the number C of points in the array.ie.DIMENSION X(NPTS+2) C C ARRAY(real)=array containing the date points C AXLEN(real)=length of the axis in inches C NPTS(int)=number of points in the array C INC(int)=increment used to access array values C if +ve,axis has increasing values C if -ve,axis has decreasing values C the value of inc is the step factor in C accessing the array,which should be dimensioned C appropriately,ie.ARRAY(NPTS*INC+2) C C The subroutine returns the following values: C C XMIN(real)in ARRAY(NPTS*INC+1) C =the value of the logarithm at the origin C DX(real)in ARRAY(NPTS*INC+2) C =the change in logarithm per inch on the graph C DIMENSION ARRAY(1) INTEGER I K=IABS(INC) XMAX=ARRAY(1) XMIN=XMAX DO 10 I=1,NPTS,K !find the max,min of the array XMIN=AMIN1(ARRAY(I),XMIN) XMAX=AMAX1(ARRAY(I),XMAX) ARRAY(I)=ALOG10(ARRAY(I)) !convert array to log(array) 10 CONTINUE XMIN=ALOG10(XMIN) !convert min,max into logs XMAX=ALOG10(XMAX) IMAX=XMAX IF(XMAX)1,1,2 2 IMAX=IMAX+1 1 NDEC=XMIN IF(XMIN)20,30,30 20 NDEC=NDEC-1 !if mantissa<0,subtract 1 30 XMIN=NDEC !find the data range ND=IMAX-NDEC 40 ARRAY(NPTS*INC+1)=XMIN !store the values in the data array ARRAY(NPTS*INC+2)=FLOAT(ND) !number of decades RETURN END