Google
 

Trailing-Edge - PDP-10 Archives - decuslib10-12 - 43,50547/scalog.for
There is 1 other file named scalog.for in the archive. Click here to see a list.
      SUBROUTINE SCALOG (VARRA,DIST,NV,K)
      DIMENSION VARRA(2)
C	XMIN   ... TRIAL MINIMUM VALUE.
C	XMAX   ... TRIAL MAXIMUM VALUE.
C	T      ... TEMPORARY VALUE BEING TESTED FOR MINIMUM
C	       ... OR MAXIMUM, ALSO ROUNDING FACTOR.
C	NP     ... SUBSCRIPT AND DO-LOOP LIMIT.
      ETO10=0.4342945
C	INITIALIZE TRIAL MINIMUM AND MAXIMUM VALUES.
      XMAX=VARRA(1)
      XMIN=XMAX
C	CALCULATE LOCATION OF LAST POINT OF ARRAY.
      NP=NV*K
C	FIND MINIMUM ABD MAXIMUM VALUES OF ARRAY.
      DO 10 I=1,NP,K
      T=VARRA(I)
    5 IF (T-XMIN) 6,7,7
    6 XMIN=T
    7 IF (T-XMAX) 10,10,8
    8 XMAX=T
   10 CONTINUE
C	CALCULATE THE GREATEST 10^N LESS THAN OR EQUAL TO
C	THE MINIMUM VALUE OF THE ARRAY AND STORE IT IN THE
C	ARRAY LOCATION (NV*K+1).
      XMIN=10.**(INT(ETO10*ALOG(XMIN)+100.0001)-100)
      NP=NP+1
      VARRA(NP)=XMIN
      NP=NP+K
C	SET CONSTANT TO ROUND OFF LOG OF MAXIMUM ARRAY VALUE UP.
C	DETERMINE DELTA VALUE (NUMBER OF LOG CYCLES COVERING ARRAY
C	VALUES DIVIDED BY THE DISTANCE OVER WHICH DATA IS TO BE
C	PLOTTED) AND STORE IT IN THE ARRAY LOCATION (NV*K+K+1).
      XMAX=INT(ETO10*ALOG(XMAX)-100.0001)+100
      VARRA(NP)=(XMAX-ETO10*ALOG(XMIN))/DIST
      RETURN
      END