1、 SUBROUTINE NAMEAGE(NAME, NLEN, AGE, TEMP)CHARACTER*(*) NAMEINTEGER NLEN,AGEREAL TEMPCWRITE(6,1000) NAME(1:NLEN),AGE,TEMP1000 FORMAT(1X,Hello ,A, who is ,I2,. years old, has a temperature of , f4.1)RETURNENDCREAL A(5)COMMON /CC/XDATA A/1,2, 3,4,5/X=0Y=FUN(A,5)+FUN(A ,5)WRITE(*,*)YENDCFUNCTION FUN(A,
2、N)REAL A(N)COMMON /CC/XX=X+1F=1ENDCSUBROUTINE LAGINT(X,Y ,N ,T,Z)DIMENSION X(N) ,Y(N )DOUBLE PRECISION X,Y,T,X ,SZ=0.0IF (N.LE.0) RETURNIF(N.EQ.1) THENZ=Y(1)ENDIFIF(N.EQ.2) THENZ=(Y(1)*(T-X(2)-Y(2)*(T-X(1)/(X(1)-X(2)RETURNENDIFI=110 IF(X(1) .LT. T)I=I+1IF(I .LE. N) GOTO 10ENDIFK=I-4IF(K .LT. 1) K=1M=I+3IF( M .GT. N) M=NDO 30 I=K,MS=1.0DO 20 J=K,MIF(J .NE. I) THENS=S*(T-X(J)/(X(I)-X(J)ENDIF20 CONTINUEZ=Z+S*Y(I)30 CONTINUERETURNEND