- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I found that Intel Fortran 15 gives incorrect results with the COUNT intrinsic in initialization expressions. Consider the following program:
program count_bug implicit none integer, parameter :: npts(2) = (/ 42, 1 /) integer, parameter :: ndims = count(npts .gt. 1) write (*,'(2(I0, 1X))') count(npts .gt. 1), ndims end program
When compiled with ifort, the output is "1 -1". The correct output is "1 1".
This result was obtained with Intel Fortran 15.0.1 20141022 on Mac OS X 10.10.1.
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Right you are! Escalated as issue DPD200366183 - thanks for letting us know.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This was a rather interesting bug. Interesting in that it affected only rank-1 arrays - if you called COUNT with an array of two or more dimensions, I am told it worked correctly. I expect the fix to appear in Update 3.

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