- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
here is my code
if (plot_default == 1) then ! Add default list 1
dflt1: do l = 1, size(plt_lst1)
i = 1
do while (i .le. siz_me_list)
if (plt_lst1(l) .eq. me_list(i)%me_flag) then
plot_list(j + k) = plt_lst1(l)
k = k + 1
num_plot = num_plot + 1
cycle dflt1
else
i = i + 1
end if
end do
end do dflt1
else if (plot_default == 2) then ! Add default list 2
dflt2: do l = 1, size(plt_lst2)
i = 1
do while (i .le. siz_me_list)
if (plt_lst2(l) .eq. me_list(i)%me_flag) then
plot_list(j + k) = plt_lst2(l)
k = k + 1
num_plot = num_plot + 1
cycle dflt2
else
i = i + 1
end if
end do
end do dflt2
end if
I can compile and run the code without any problem,
My question is regarding portability and any other potential problems
arises due to cycling outer do loop inside inner do loop.
Will there be any potential problem due to changing outerloop inside inner loop
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When you say "cycle diff2", you are telling the compiler to, effectively, go to the END DO of the loop labeled diff2. This is perfectly fine.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page