Computing.Net > Forums > Programming > Fortran Do loop problem

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Fortran Do loop problem

Reply to Message Icon

Name: Urkle10
Date: February 10, 2004 at 07:26:39 Pacific
OS: Win 2000
CPU/Ram: PIII 600 / 256 MB
Comment:

Do loop does not seem to be exiting properly

Example:

Do 700 Niter=1,Noiter
***
Code
***
700 Continue

In debugger, Noiter is equal to 2, a watch shows that Niter will increment greater than Noiter until loop is exited be some other means. Niter and Noiter are not changed in the loop, this has been shown by stepping through each line with a watch on Niter and Noiter, they do not change. Both variables are integers.

Other do loops in the program run fine, tried hard coding a number for Noiter, problem remained.



Sponsored Link
Ads by Google

Response Number 1
Name: egkenny
Date: February 10, 2004 at 19:34:36 Pacific
Reply:

I tested this program and it iterated two times.
Program testme
integer Niter, Noiter
Noiter = 2
Do 700 Niter=1,Noiter
Print *,Niter
700 Continue
stop
end

BTW, I am using the following:
Windows XP Pro
Cygwin
g77


0
Reply to Message Icon

Related Posts

See More


File that copies itself getting info abt clients ...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Fortran Do loop problem

excel macro do-loop www.computing.net/answers/programming/excel-macro-doloop/8032.html

ASP - using a variable in a Do Loop www.computing.net/answers/programming/asp-using-a-variable-in-a-do-loop/6352.html

DOS - For Loop Problem www.computing.net/answers/programming/dos-for-loop-problem/17488.html