- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
the following program throws a compiler error with ifort 12.6.233 and I don't know why:
program main
implicit none
INTEGER, PARAMETER :: ndims = 3
REAL :: p_array(5,4,3)
INTEGER :: idim, icount(ndims)
icount(:) = (/ (SIZE(p_array,idim), idim=1,ndims) /)
END program main
The error is as follows:
example.f90(8): error #6211: A symbol must be a defined parameter in this context. [IDIM]
icount(:) = (/ (SIZE(p_array,idim), idim=1,ndims) /)
I have tested the code with gfortran, NEC compiler, PGI, NAG. None of these encounters any problems...
Best,
Florian
the following program throws a compiler error with ifort 12.6.233 and I don't know why:
program main
implicit none
INTEGER, PARAMETER :: ndims = 3
REAL :: p_array(5,4,3)
INTEGER :: idim, icount(ndims)
icount(:) = (/ (SIZE(p_array,idim), idim=1,ndims) /)
END program main
The error is as follows:
example.f90(8): error #6211: A symbol must be a defined parameter in this context. [IDIM]
icount(:) = (/ (SIZE(p_array,idim), idim=1,ndims) /)
I have tested the code with gfortran, NEC compiler, PGI, NAG. None of these encounters any problems...
Best,
Florian
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, looks like a bug. I don't see anything wrong with this array constructor.
I'll get a bug report started.
ron
I'll get a bug report started.
ron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This issue still isn't fixed. However, it can be worked around by writing the array elements explicitly, instead of in an implied loop:
icount = (/SIZE(p_array,1),SIZE(p_array,2),SIZE(p_array,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