Hi,
I am trying to test the following example about the use of data-type:
program foo_prog
implicit none
contains
function Vfoo(A) result(Vfoo_out)
type couple
integer :: one(:)
integer :: two(:)
end type couple
type(couple) :: A
integer :: Vfoo_out
Vfoo_out=sum(A%one*A%two)
end function Vfoo
end program foo_prog
But the complier is not agree with me:
"prueba.f90", line 10.23: 1514-199 (S) Array one is a deferred-shape
array but does not have the POINTER or ALLOCA.
** foo_prog === End of Compilation 1 ===
If I use pointer variables in the definition of type data couple, it
works fine:
type couple
integer,pointer :: one(:)
integer,pointer :: two(:)
end type couple
Is this restriction true in this context? so it is not possible to use a
deferred-shape array or I am doing something wrong?
Thanks for any idea,
David,
--
--------------------------------
DAVID LEAL
Universidad Carlos III de Madrid
Office: 10.1.02
Tel: (34-1)-624.93.14
Fax: (34-1)-624.98.49
E-mail : [log in to unmask]
http://jupiter.uc3m.es/~david/
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|