Hi everybody,
while I was working on a finite difference method, I came across with a mistake. I am new in programming. Could you please help me how to get over this problem? These are the codes:
Thank you very much If someone interested in. Have a nice dayCode:dimension U(100),UO(100) INTEGER::IMAX=10 REAL:: DX=0.0182,DT=0.1 IMAX1=IMAX-1 do 2 I=1,IMAX U(I)=0 2 UO(I)=0 T=0 N=0 100 T=T+DT N=N+1 if(T.LT.0.1) GO TO 22 U(IMAX)=10 go to 23 22 U(IMAX)=T*100 23 continue do 3 I=2,IMAX1 3 U(I)=UO(I)+DT*1./DX**2.*(UO(I+1)+UO(I-1)-2.*UO(I)) DO 4 I=1,IMAX 4 UO(I)=U(I) write(6,5)(UO(I),I=1,IMAX) 5 format(d17.10) if(N.LT.150) go to 100 stop end
Last edited by WingedPanther; 03-08-2010 at 06:04 PM. Reason: add code tags (the # button)
Where are you getting the NaN error? Do you have a debugger to single-step the code?
sudo rm -rf /
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks