SUBROUTINE NAMEAGE(NAME, NLEN, AGE, TEMP)
CHARACTER*(*) NAME
INTEGER NLEN,AGE
REAL TEMP
C
WRITE(6,1000) NAME(1:NLEN),AGE,TEMP
1000 FORMAT(1X,'Hello ',A,', who is ',I2,
. ' years old, has a temperature of ', f4.1)
RETURN
END
C
REAL A(5)
COMMON /CC/X
DATA A/1,2,3,4,5/
X=0
Y=FUN(A,5)+FUN(A,5)
WRITE(*,*)Y
END
C
FUNCTION FUN(A,N)
REAL A(N)
COMMON /CC/X
X=X+1
F=1
END
C
SUBROUTINE LAGINT(X,Y,N ,T,Z)
DIMENSION X(N),Y(N)
DOUBLE PRECISION X,Y,T,X,S
Z=0.0
IF (N.LE.0) RETURN
IF(N.EQ.1) THEN
Z=Y(1)
ENDIF
IF(N.EQ.2) THEN
Z=(Y(1)*(T-X(2))-Y(2)*(T-X(1)))/(X(1)-X(2))
RETURN
ENDIF
I=1
10 IF(X(1) .LT. T)
I=I+1
IF(I .LE. N) GOTO 10
ENDIF
K=I-4
IF(K .LT. 1) K=1
M=I+3
IF( M .GT. N) M=N
DO 30 I=K,M
S=1.0
DO 20 J=K,M
IF(J .NE. I) THEN
S=S*(T-X(J))/(X(I)-X(J))
ENDIF
20 CONTINUE
Z=Z+S*Y(I)
30 CONTINUE
RETURN
END