Try something like:
TYPE TYPE_PTR
INTEGER, POINTER :: X
END TYPE TYPE_PTR
TYPE(TYPE_PTR), DIMENSION(5) :: AP
ap(1)%x => dummy_int
Catherine
Jose Munoz wrote:
> Dear all,
>
> Is there a way to distinguish between an array of pointers and a pointer
> to an array? If I understand it right, Fortran90 normally uses the
> latter. Consider the following program:
>
> PROGRAM arrayp
> IMPLICIT NONE
> INTEGER,TARGET :: i
> INTEGER,DIMENSION(5),TARGET ::ai
> INTEGER,DIMENSION(:),POINTER ::ap
> ap=>ai ! Valid, pointer to an aray
> ap(1)=>i ! Error: Object is not a pointer object [AP]
> END PROGRAM arrayp
>
> I get the given error message at the last line of the program.
> Alternatively, is there a way to create an array of pointers?
>
> Many thanks,
>
> Jose
--
-------------------------------------------------------------------------
Catherine Moroney phone : (818) 393-3392
Jet Propulsion Laboratory fax : (818) 393-3134
MailStop 168-414 email : [log in to unmask]
4800 Oak Grove Drive
Pasadena, CA 91109-8099
|