I have the following part in my code.
x=1.d0
y=1.d0
do while (x<5.0)
do while (y<3.0)
print*,'x=',x,' y=',y
y=y+1.d0
end do
print*,'x================',x
x=x+1.d0
end do
Here my intention is to vary y-value through y-do-loop for each update in x of the x-do-loop. However, after the first x-loop, y-loop does not execute anymore, i.e. I get the following output.
x= 1.0000000000000000 y= 1.0000000000000000
x= 1.0000000000000000 y= 2.0000000000000000
x================ 1.0000000000000000
x================ 2.0000000000000000
x================ 3.0000000000000000
x================ 4.0000000000000000
Can't I use do while for my purpose? If yes, what modification can be done?
y=1.d0after you finish your x-do loop?