Topic: DO LOOP not executing?
Getting back into Fortran after many years..................
The following DO LOOP does not show up as either an error or warning when editing the code:
implicit none
integer:: i = 0
do i = 0, -1
write (*,*)'hello!'
end do
the program compiles just fine, and when you launch it, it runs but you never see "hello!".
My somewhat spotty memory is that one can do negative increments on DO loops, but the proper syntax would be something like
do i = 0, -10, -1
My first thought is perhaps the do loop is not executing because
do i = 0, -1, 1 is the same as do i = 0,0
however, using do i = 0,0 does execute the loop, and you see "hello!".
Now with that said, I am saving the program with .for extension, which I assume triggers the F66 & F77 compiler standards, but still seems weird.
Thoughts?