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

MINLOC/MAXLOC bug with zero-sized arrays

Harald
Beginner
410 Views
Hi all,

the implementation of MINLOC and MAXLOC does not conform to the F2k8 draft standard:

[bash]  real :: a(0)
  print *, minloc (a), maxloc (a)
end program
[/bash]
Output:

1 1

Expected:

0 0

Regards,
Harald
0 Kudos
3 Replies
Steven_L_Intel1
Employee
410 Views
Correct - it doesn't - by default. Use -standard-semantics to get F03 behavior including this one.
0 Kudos
TimP
Honored Contributor III
410 Views
A reason for not making this the default has been relatively poor performance for minloc/maxloc.
0 Kudos
Harald
Beginner
410 Views
I see. I should take a note to always use -standard-semantics along with -stand f03.

Thanks,
Harald

0 Kudos
Reply