Appendix A. 2 



SUBROUTINE P0WW6T(A,B,FIRSTX,DELX,Y,N,ILIST,CT0FF1,CT0FF2) 

 C 



C THIS ROUTINE PERFORMS A BEST FIT TO DATA WITH A POWER LAW 

 C FUNCTION OF THE FORM Y=A*X**B USING A WEIGHTING METHOD 

 C AS DESCRIBED IN SCARB0R0U6H(1930) , ART. 114. 

 C INPUTS ARE 

 C A=COEFFICIENT OF X 

 C B= EXPONENT OF X 



C X= ARRAY OF INDEPENDENT VARIABLE VALUES 

 C Y= ARRAY OF DEPENDENT VARIABLE VALUES 

 C N= NUMBER OF DATA PAIRS OF X AND Y 



C AMIN= MINIMUM VALUE FOR A CORRECTION TO STOP ITERATION 

 C BMIN= MINIMUM VALUE FOR B CORRECTION TO STOP ITERATION 

 C ILIST= 1 FOR SUMMARY OF ITERATION PROCESS, = , NO LISTING 

 C PROGRAMMED BY C.G. FOX -ADVANCED TECHNOLOGY STAFF, NAVOCEANO, 4/15/83 

 C 



DIMENSION X( 1024 ),Y( 1024) 

 C 



C COMPUTE INITIAL ESTIMATE OF A AND B BY PERFORMING A SIMPLE 

 C LINEAR FIT ON LOG TRANSFORMED DATA 

 C 



YSQR=1. 



YSQSUM=0.0 



XPROD=0.0 



XSUM=0.0 



YSUM=0.0 



XSQR=0.0 



X(1)=FIRSTX 



DO 10 1=2, N 

 10 X(I)=X(I-1)+DELX 

 C WRITE(6,'(80X,2F10.4)') (X(I),Y(I),I=1,20) 



DO 50 J=1,N 



IF(Y(J).LE.0.0) GO TO 50 



YTEMP=AL0G10(Y(J)) 



XTEMP=AL0G10(X(J)) 



IF(XTEMP.GT.CT0FF2.0R.XTEMP.LT.CT0FF1) GO TO 50 

 C YSQR=YTEMP*YTEMP 



XPROD=XPROD+(YTEMP*XTEMP*YSQR) 



XSUM=XSUM+XTEMP*YSQR 



YSUM=YSUM+YTEMP*YSQR 



YSQSUM=YSQSUM+YSQR 



XS OR =XS QR+ ( XTEMP*XTEMP* YSQR ) 

 50 CONTINUE 



B=((YSQSUM*XPROD)-(XSUM*YSUM))/((YSQSUM*XSQR)-(XSUM*XSUM)) 



A=(YSUM/YSQSUM)-(B*(XSUM/YSQSUM)) 



A=10.**A 



RETURN 



END 



131 



