- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
According to the standard, all elements of the result of the intrinsic functions minloc and maxloc should be 0 if their array argument is 0-sized. But with Intel Fortran the elements are 1 instead:
integer, allocatable :: a(:), b(:,:)
allocate(a(0), b(2,0))
print *, maxloc(a)
print *, maxloc(b)
end
This should print
0
0 0
But instead I get
1
1 1
This is with the latest 2021.5.0 version and goes back to at least 18.0
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
/standard-semantics is your friend - sets /assume:noold_maxminloc.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Argh... I don't know why that didn't occur to me (it's resolved "problems" in the past). Thanks! I need a config file so that that flag is always automatically included. Is such a thing possible?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'll comment that maxloc/minloc initially did not define the result in this case. It was clarified in F2008, I think.

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