主题:依然高分悬赏,求高手解答!
我编了一个子例行程序,当主程序段调用的时候显示数组越界。
主程序段部分
ISTEP是时间步循环,MTF是我编写的子例行程序
调试的时候发现在运行的过程中ISTEP=1120403456
但是在时间步是由外界输入的,最多NSTEP=20000
不知道为什么会变成这样 求解答!!!
DO 500 ISTEP=1,NSTEP
CALL EXPLIT (ACCEH,ACCEV,AFACT,AZERO,AALFA,BZERO,DTIME,
& DTEND,FORCE,IFIXD,IFPRE,IFUNC,ISTEP,NDOFN,NPOIN,OMEGA,
& RESID,TDISP,VELOC,YMASS,SDISP)
CALL MTF(SDISP,TDISP,ISTEP,DTIME,BOUND)
————————————————————————————————————————————————
SUBROUTINE MTF(SDISP,TDISP,ISTEP,DTIME,BOUND)
REAL S,CA,U(400,20000,2),DX,T11,T12,T13,TDISP(400)
REAL T21,T22,T23,T24,T25,BOUND(33,5),SDISP(400,2)
INTEGER IBOUN,J,IDOFN,NBOUN,I,BNODE
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CC cc
CC THIS SUBROUTINE IS ARTIFICIAL BOUNDRY CONDITIONS cc
CC cc
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
IF (ISTEP.LE.2) GO TO 60
NBOUN=33
DX=10.0
CA=0.001
S=(CA*DTIME)/DX
T11=(2-S)*(1-S)/2
T12=S*(2-S)
T13=S*(S-1)/2
T21=T11*T11
T22=2*T11*T12
T23=2*T11*T13+T12*T12
T24=2*T12*T13
T25=T13*T13
DO 10 IBOUN=1,NBOUN
READ(10,*) (BOUND(IBOUN,J),J=1,5)
10 CONTINUE
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CC 提取边界点P时刻与P-1时刻的位移值 CC
CC 从第三时步开始 CC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
DO 30 IBOUN=1,NBOUN
DO 30 J=1,5
BNODE=(BOUND(IBOUN,J)-1)*2+1
U(BOUND(IBOUN,J),ISTEP-2,1)=SDISP(BNODE,1)
U(BOUND(IBOUN,J),ISTEP-1,1)=SDISP(BNODE,2)
BNODE=BNODE+1
U(BOUND(IBOUN,J),ISTEP-2,2)=SDISP(BNODE,1)
U(BOUND(IBOUN,J),ISTEP-1,2)=SDISP(BNODE,2)
30 CONTINUE
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CC 从第三时步起计算边界位移值 CC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
DO 40 IBOUN=1,NBOUN
DO 40 I=1,2
U(BOUND(IBOUN,1),ISTEP,I)=T11*U(BOUND(IBOUN,1),ISTEP-1,I)+
&T12*U(BOUND(IBOUN,2),ISTEP-1,I)+T13*U(BOUND(IBOUN,3),ISTEP-1,I)+
&T21*U(BOUND(IBOUN,1),ISTEP-2,I)+T22*U(BOUND(IBOUN,2),ISTEP-2,I)+
&T23*U(BOUND(IBOUN,3),ISTEP-2,I)+T24*U(BOUND(IBOUN,4),ISTEP-2,I)+
&T25*U(BOUND(IBOUN,5),ISTEP-2,I)
40 CONTINUE
CCCCCCCCCCCCCCCCCCCCCCCCCC
CC 导出边界点位移值 CC
CCCCCCCCCCCCCCCCCCCCCCCCCC
DO 50 IBOUN=1,NBOUN
BNODE=(BOUND(IBOUN,1)-1)*2+1
TDISP(BNODE)= U(BOUND(IBOUN,1),ISTEP,1)
BNODE=BNODE+1
TDISP(BNODE)= U(BOUND(IBOUN,1),ISTEP,2)
50 CONTINUE
60 CONTINUE
END
——————————————————————————————————————————————————
主程序段部分
ISTEP是时间步循环,MTF是我编写的子例行程序
调试的时候发现在运行的过程中ISTEP=1120403456
但是在时间步是由外界输入的,最多NSTEP=20000
不知道为什么会变成这样 求解答!!!
DO 500 ISTEP=1,NSTEP
CALL EXPLIT (ACCEH,ACCEV,AFACT,AZERO,AALFA,BZERO,DTIME,
& DTEND,FORCE,IFIXD,IFPRE,IFUNC,ISTEP,NDOFN,NPOIN,OMEGA,
& RESID,TDISP,VELOC,YMASS,SDISP)
CALL MTF(SDISP,TDISP,ISTEP,DTIME,BOUND)
————————————————————————————————————————————————
SUBROUTINE MTF(SDISP,TDISP,ISTEP,DTIME,BOUND)
REAL S,CA,U(400,20000,2),DX,T11,T12,T13,TDISP(400)
REAL T21,T22,T23,T24,T25,BOUND(33,5),SDISP(400,2)
INTEGER IBOUN,J,IDOFN,NBOUN,I,BNODE
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CC cc
CC THIS SUBROUTINE IS ARTIFICIAL BOUNDRY CONDITIONS cc
CC cc
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
IF (ISTEP.LE.2) GO TO 60
NBOUN=33
DX=10.0
CA=0.001
S=(CA*DTIME)/DX
T11=(2-S)*(1-S)/2
T12=S*(2-S)
T13=S*(S-1)/2
T21=T11*T11
T22=2*T11*T12
T23=2*T11*T13+T12*T12
T24=2*T12*T13
T25=T13*T13
DO 10 IBOUN=1,NBOUN
READ(10,*) (BOUND(IBOUN,J),J=1,5)
10 CONTINUE
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CC 提取边界点P时刻与P-1时刻的位移值 CC
CC 从第三时步开始 CC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
DO 30 IBOUN=1,NBOUN
DO 30 J=1,5
BNODE=(BOUND(IBOUN,J)-1)*2+1
U(BOUND(IBOUN,J),ISTEP-2,1)=SDISP(BNODE,1)
U(BOUND(IBOUN,J),ISTEP-1,1)=SDISP(BNODE,2)
BNODE=BNODE+1
U(BOUND(IBOUN,J),ISTEP-2,2)=SDISP(BNODE,1)
U(BOUND(IBOUN,J),ISTEP-1,2)=SDISP(BNODE,2)
30 CONTINUE
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CC 从第三时步起计算边界位移值 CC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
DO 40 IBOUN=1,NBOUN
DO 40 I=1,2
U(BOUND(IBOUN,1),ISTEP,I)=T11*U(BOUND(IBOUN,1),ISTEP-1,I)+
&T12*U(BOUND(IBOUN,2),ISTEP-1,I)+T13*U(BOUND(IBOUN,3),ISTEP-1,I)+
&T21*U(BOUND(IBOUN,1),ISTEP-2,I)+T22*U(BOUND(IBOUN,2),ISTEP-2,I)+
&T23*U(BOUND(IBOUN,3),ISTEP-2,I)+T24*U(BOUND(IBOUN,4),ISTEP-2,I)+
&T25*U(BOUND(IBOUN,5),ISTEP-2,I)
40 CONTINUE
CCCCCCCCCCCCCCCCCCCCCCCCCC
CC 导出边界点位移值 CC
CCCCCCCCCCCCCCCCCCCCCCCCCC
DO 50 IBOUN=1,NBOUN
BNODE=(BOUND(IBOUN,1)-1)*2+1
TDISP(BNODE)= U(BOUND(IBOUN,1),ISTEP,1)
BNODE=BNODE+1
TDISP(BNODE)= U(BOUND(IBOUN,1),ISTEP,2)
50 CONTINUE
60 CONTINUE
END
——————————————————————————————————————————————————