As stated in a previous thread Some explanation on do loop
The number of trips through the loop is computed before the loop begins.
so the code is legal, although I would avoid writing such code. The code
implicit none
integer :: i
i = 2
do i=i,4
print*,i
end do
end
for example gives output
2
3
4