Quantcast
Channel: Intel® Fortran Compiler
Viewing all articles
Browse latest Browse all 3270

Coarray type with an allocatable component of length zero

$
0
0

I get a SIGSEGV when running the following code

 type t

	  real, allocatable :: a(:)

	 end type t

	 type(t) :: data[*]

	 allocate(data%a(0))

	 print*, size(data[1]%a)

	end program

If, instead of the last line I put

print*, size(data%a)

it runs successfully by printing 0 for each image. In principle I could work out the problem by using 'allocated' statements, but

allocated(data[1]%a)

produces

The argument to the ALLOCATED intrinsic cannot be a coindexed object.

On the other hand, using 'allocated(data%a)' correctly prints T for each image, but I specifically need to use the square brackets with either 'size' or 'allocated' in my code.

Thanks


Viewing all articles
Browse latest Browse all 3270

Trending Articles