Author: GeoGarfieldGeoGarfield
Date: May 11, 2008 11:20
hi,
I have been asking myself this question for a long time, and there's
nobody around me at work who knows anything about programming, so
there it is.
I very much like derived types. I use them all the time. In the
derived type ptcl I have three unallocated arrays x,y and z. In the
main I create the variable ptcles of type ptcl. I would like to pass
ptcles as argument to a routine called gnagna that would allocate the
arrays ptcles%%x, ptcles%%y, and ptcles%%z.
Here is the code. When I compile it with the PGI compiler on a Cray,
it works. I first get F F F , then T T T.
Beyond the practical aspect, I would like to know whether I am lucky,
or whether all F90 compilers on all machines will accept it.
--------------------------------------------------------------------------------------------
module opla
type ptcl
double precision, dimension(:), pointer :: x,y,z
end type
end module
|