I am trying to define a subroutine which allocates different types of arrays. Here is a simplified version of the code:
subroutine Allocation1(Vec)
class(*), allocatable, intent(out) :: Vec(:)
select type(Vec)
type is(real(8))
allocate(Vec(10)); Vec = 0.D0
type is(complex(8))
allocate(Vec(10)); Vec = (0.D0,0.D0)
type is(integer)
allocate(Vec(10)); Vec = 0
endselect
endsubroutine Allocation1
But I got three error messages that I don't understand:
error #8306: Associate name defined in ASSOCIATE or SELECT TYPE statements doesn't have ALLOCATABLE or POINTER attribute [VEC]
As you can see VEC
is an allocatable array, so I don't think this error make sense. What does it mean, and how do I make this work?
I am using IVF XE 14.0.1.139.