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4)=2.*E3
A3(4,3)=2.*E3
A3(1,3)=E3
A3(3,1)=E3
A3(2,4)=E3
A3(4,2)=E3
A3(1,4)=E1
A3(4,1)=E1
A3(2,3)=E1
A3(3,2)=E2
DO 10 I=1,4
DO 10 J=1,4
10 FK(I,J)=3.14159*(A1(I,J)+A2(I,J)+A3(I,J)*XM*XM)/DENF
PRINT *, ((FK(I,J),J=1 ,4),I=1,4)
END
[Fortran] 纯文本查看 复制代码
SUBROUTINE FSTIF(A,B,XO,FK,XM,DENF)
!DEC$ attributes dllexport ::FSTIF
REAL A,B,X0,FK(4,4),XM,DENF
DIMENSION A1(4,4),A2(4,4),A3(4,4)
DO 12 I=1,4
DO 12 J=1,4
A1(I,J)=0.
A2(I,J)=0.
[Fortran] 纯文本查看 复制代码
PROGRAM SFTIFss
REAL A,B,X0,XM,DENF,FK(4,4)
DO 10 I=1,4
DO 10 J=1,4
10 FK(I,J)=0.0
A=18.0
B=12.0
X0=54.0
DENF=0.035885
XM=1.0
CALL FSTIF(A,B,X0,FK,XM,DENF)
PRINT *, ((FK(I,J),J=1,4),I=1,4)
END