Assigning values to a derived type (structure constructor?)
- From: andrew.mallner@xxxxxxxxxxx
- Date: 26 Oct 2006 20:10:33 -0700
I have a derived type that has a number of properties:
TYPE Particle
REAL** :: X,Y,Z,U,V,W,E, ...
END TYPE
TYPE(Particle) :: Partcles(0:100)
After an interaction I want to adjust the U, V, W, and E values:
Particles(i)%U = NewU
Particles(i)%V = NewV
Particles(i)%W = NewW
Particles(i)%E = NewE
I know I can assign all the values at once like:
Particles(i) = Particle(InitX, InitY, InitZ, InitU, InitV, InitW,
InitE, ...)
Other languages have something like this (VB Example)
With Particles(I)
.E = NewE
.U = NewU
....
End With
Does Fortran have something similar?
.
- Follow-Ups:
- Re: Assigning values to a derived type (structure constructor?)
- From: Richard Maine
- Re: Assigning values to a derived type (structure constructor?)
- Prev by Date: Re: F77 HP extension PARAMETER
- Next by Date: Re: Assigning values to a derived type (structure constructor?)
- Previous by thread: Help, Can't find my bug
- Next by thread: Re: Assigning values to a derived type (structure constructor?)
- Index(es):
Relevant Pages
|