For example, I want to loop from 1 to 500 at an increment of 2. However, for every 8 loops I want to skip the next 18 loops (make the do-variable increase by 18). How do I do that?
My code is:
event = 0
do i = 1,500,2
event = event + 1
if (event .eq. 8) then
i = i + 18
event = 0
endif
enddo
However, I got the error: "A do-variable within a DO body shall not appear in a variable definition context". Basically I can't alter the variable "i" in the loop. So how should I write the code to realize it?
Thanks.