Closed Thread
Results 1 to 2 of 2

Thread: "Nan" Fortran

  1. #1
    mater is offline Newbie
    Join Date
    Mar 2010
    Posts
    1
    Rep Power
    0

    "Nan" Fortran

    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:
    Code:
               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
    Thank you very much If someone interested in. Have a nice day
    Last edited by WingedPanther; 03-08-2010 at 06:04 PM. Reason: add code tags (the # button)

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Join Date
    Oct 2007
    Location
    /dev/null
    Posts
    4,513
    Blog Entries
    8
    Rep Power
    59

    Re: "Nan" Fortran

    Where are you getting the NaN error? Do you have a debugger to single-step the code?
    sudo rm -rf /

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 8
    Last Post: 09-20-2011, 05:11 AM
  2. MASM How To Use "Open" And "Save As" (Win32 API) ?
    By RhetoricalRuvim in forum Assembly
    Replies: 12
    Last Post: 08-13-2011, 04:10 PM
  3. "\r\n" are for some reason turned into "\r\n\r\n"; what's wrong?
    By RhetoricalRuvim in forum Ruby Programming
    Replies: 1
    Last Post: 08-06-2011, 05:55 PM
  4. Alex G. CSS "Sexy Buttons" - what about "submit on 'ENTER'" ?
    By shackrock in forum JavaScript and CSS
    Replies: 7
    Last Post: 12-05-2010, 04:57 PM
  5. Replies: 2
    Last Post: 11-01-2010, 11:52 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts