From: "Nuno R. Pinhco" <[log in to unmask]>
Date: Fri, 14 Nov 1997 17:23:18 +0100
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
X-List: [log in to unmask]
X-Unsub: To leave, send text 'leave comp-fortran-90' to [log in to unmask]
Reply-To: "Nuno R. Pinhco" <[log in to unmask]>
Sender: [log in to unmask]
Precedence: list
Pierre Hugonnet wrote:=20
PhotEm(:)%species a no signification: the component "species"
of the 1D array PhotEm(:) does not exist. You can access it only
element by element (PhotEm(i)%species)
[Nuno R. Pinh=E3o] =20
If I have well understood you, I don't agree. At least with my compiler =
(DVF) I can manipulate arrays of elements of a data type. See a sample =
code below - the all three cases variable test has the same value:
type PHOT_E_EMISSION
integer :: species
real*4 :: yield
end type PHOT_E_EMISSION
type (PHOT_E_EMISSION), allocatable, save :: PhotEm(:)
integer, pointer :: spc(:)
double precision, pointer :: val(:)
... some code ...
spc =3D> PhotEm%species
val =3D> PhotEm%yield
test =3D sum(spc * val)
test =3D sum(spc(:) * val(:))
test =3D sum(PhotEm(:)%species*PhotEm(:)%yield)
The difference now is that PhotEm%species and PhotEm%yield are no longer =
pointers...
The error I got was related to the definition of species and yield as =
pointers
Nuno
Pierre is correct in his assesment of the problem. You are not allowed to
have a pointer reference to the right of an array-valued reference. So
type test
integer :: foo
integer,pointer :: bar
end type test
type (test) zap(100)
zap(:)%foo is legal, but zap(:)%bar is not.
--
Richard Shapiro
Principal Engineer, Silicon Graphics SSO
[log in to unmask]
(781) 648-2269 MRF, (978) 567-2211 TW, (978) 567-2411 (Fax)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|