Re: Dimension attribute based on host-associated variable - bug in Intel Fortran
- From: Rich Townsend <rhdt@xxxxxxxxxxxxxxxxxxx>
- Date: Thu, 28 Dec 2006 10:02:52 -0500
Arjen Markus wrote:
Rich Townsend schreef:
Hi all --I tried the following program with Intel Fortran 8.1 on Linux:
A question about what appears to be a bug in the Intel compiler: in a module
subroutine, I have declarations of the form
real, dimension(2*COUNT(spheres%inter)) :: lambda
real, dimension(COUNT(spheres%inter)) :: rho
integer, dimension(2*COUNT(spheres%inter)) :: indices
logical, dimension(COUNT(spheres%inter)) :: active_mask
The array spheres is accessed via host association, and is declared thusly:
type sphere_t
real, dimension(3) :: r = 0. ! Position vector
real :: l = 0. ! Radius
real :: rho = 0. ! Density
real :: lambda_in = 0. ! Ray entrance coordinate
real :: lambda_ex = 0. ! Ray exit coordinate
logical :: inter = .FALSE. ! Ray intersection flag
end type sphere_t
...
type(sphere_t), dimension(:), allocatable :: spheres
When I try to compile the code using Intel Fortran for Linux (9.1.40), I get the
following error messages:
fortcom: Error: sphimp_dda.f90, line 544: An array-valued argument is required
in this context. [COUNT]
real, dimension(2*COUNT(spheres%inter)) :: lambda
----------------------------^
fortcom: Error: sphimp_dda.f90, line 545: An array-valued argument is required
in this context. [COUNT]
real, dimension(COUNT(spheres%inter)) :: rho
--------------------------^
fortcom: Error: sphimp_dda.f90, line 546: An array-valued argument is required
in this context. [COUNT]
integer, dimension(2*COUNT(spheres%inter)) :: indices
-------------------------------^
fortcom: Error: sphimp_dda.f90, line 547: An array-valued argument is required
in this context. [COUNT]
logical, dimension(COUNT(spheres%inter)) :: active_mask
Now, as I understand it, there is nothing wrong with my code; spheres%inter is
an array-valued argument. Can I confirm that this is a bug in the Intel compiler?
program sphereprogram
type sphere
logical :: has
end type sphere
type(sphere), dimension(3) :: spheres
spheres(1)%has = .false.
spheres(2)%has = .true.
spheres(3)%has = .false.
write(*,*) count(spheres%has)
end program
It seems perfectly happy, so I do think your version 9.1.40 is
misinterpreting
the code.
Regards,
Arjen
Hmmm, I can compile this program too, without problem. It seems that the error
message is triggered by the use of COUNT() in an automatic array declaration, as
David Frank has already surmised. I've tried my original code on Lahey lf95, and
it compiles without problem.
cheers,
RIch
.
- Follow-Ups:
- References:
- Dimension attribute based on host-associated variable - bug in Intel Fortran
- From: Rich Townsend
- Re: Dimension attribute based on host-associated variable - bug in Intel Fortran
- From: Arjen Markus
- Dimension attribute based on host-associated variable - bug in Intel Fortran
- Prev by Date: Re: Dimension attribute based on host-associated variable - bug in Intel Fortran
- Next by Date: Re: Dimension attribute based on host-associated variable - bug in Intel Fortran
- Previous by thread: Re: Dimension attribute based on host-associated variable - bug in Intel Fortran
- Next by thread: Re: Dimension attribute based on host-associated variable - bug in Intel Fortran
- Index(es):
Relevant Pages
|