Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29253 Discussions

Unexpected behaviour of ALL and ANY (bug?)

mhermanns
Beginner
468 Views
I'm trying to use the ALL and ANY commands in a code similar to the following one:

...

integer :: Ordering(1:Number_Derivatives)

...

do i = 1, Number_Derivatives
do j = 1, Number_Derivatives
if(any(Ordering(1:i-1) == j)) cycle

...

enddo
enddo

Looking at the Fortran 95 standard and the Intel language reference guide, the previous code should not execute the cycle command when i = 1, since then the Mask for the command ANY has size zero, since the triplet turns out to be empty: 1:i-1 = 1:0.

Instead, the command any(Ordering(1:i-1) == j) for i = 1 returns nothing, not a true and not a false.

I would like to know if this is my interpretation error from the documents or it is a possible bug of the compiler.

Thanks in advance and greetings from Spain,

Miguel
0 Kudos
2 Replies
mhermanns
Beginner
468 Views
I forgot to mention that I'm using version 8.0 without additional patches.

Miguel
0 Kudos
Steven_L_Intel1
Employee
468 Views
Hard to say without a runnable example. I don't know how you can say that the expression returns "nothing".
I would suggest trying the latest compiler update, and if the problem persists, come up with a small, runnable example and submit it to support.
0 Kudos
Reply