END SUBROUTINEPK(N.X,Y.A.B.R) DOUBLE PRECISION X,Y,A,B,R DIMENSION XON)YON) 8X=00 SY=0.0 SXX-00 SYY-0.0 SXY-0.0 D010=1,N X1=X0 YI-YO) SX-SX+XI SY-SY+YI SXX-SXX+X1*XI SVV=SYY+YIYI SXY-SXY+X1*Yl 10 CONTINUE DXX=SXX -SX*SX/N DYY=SYY-SY*SY/N DXY-SXY-SX+SY/N B=DXY/DXX RETURN END SUBROUTINE LGRG2(X,Y.N,T.Z) DIMENSION X(N),Y(N) DOUBLE PRECISION X,Y,T.Z,S Z=0.0 IF(N.LE.0)RETURN IFON EO DTHEN Z=Y(1) RETURN END IF IF(N.EQ.2)THEN Z=Y(1)*(T-X(2)-Y(2)*(TX1))/X1-X(2) RETURN END IF IF(T.LE.X(2))THEN K=1 M=3END SUBROUTINE PK(N,X,Y,A,B,R) DOUBLE PRECISION X,Y,A,B,R DIMENSION X(N),Y(N) SX=0.0 SY=0.0 SXX=0.0 SYY=0.0 SXY=0.0 DO 10 I=1,N X1=X(I) Y1=Y(I) SX=SX+X1 SY=SY+Y1 SXX=SXX+X1*X1 SYY=SYY+Y1*Y1 SXY=SXY+X1*Y1 10 CONTINUE DXX=SXX-SX*SX/N DYY=SYY-SY*SY/N DXY=SXY-SX*SY/N B=DXY/DXX A=(SY-B*SX)/N R=DXY/SQRT(DXX*DYY) RETURN END SUBROUTINE LGRG2(X,Y,N,T,Z) DIMENSION X(N),Y(N) DOUBLE PRECISION X,Y,T,Z,S Z=0.0 IF(N.LE.0)RETURN IF(N.EQ.1)THEN Z=Y(1) RETURN END IF IF(N.EQ.2)THEN Z=(Y(1)*(T-X(2))-Y(2)*(T-X(1)))/(X(1)-X(2)) RETURN END IF IF(T.LE.X(2))THEN K=1 M=3