Is there any way to run a loop for discrete values of a variable? What about in some latest version?
Something like
for i in 1 5 9 11 31 77
used in Unix shell script?
I am not sure if this helps, but you can use arrays for indeces
program Console1
implicit none
! Variables
INTEGER :: X(4) = (/ 1, 3, 5, 7 /)
REAL :: Y(10) = 0.0
! Body of Console1
print *, X
! 1 3 5 7
Y(X) = 10.0/X
print *, Y
! 10.0 0.0 3.33 0.0 2.00 0.0 1.428 0.0 ...
end program Console1
DO I=(/ 1,3,5,7 /)but you can't. Maybe it can be done with in implicit do. I will investigate.emumwith non sequential values. They have to be constants though.