Print

Print


> Date:          Thu, 24 Aug 2000 20:08:39 +0010
> From:          [log in to unmask]

> Harvey Richardson wrote:
> >>> The Fortran 90 standard says
> >>> 
> >>>  "In a storage association context
> >>>    ...
> >>>   A nonpointer scalar object of type double precision real or 
> >>>   default complex occupies two contiguous numeric storage units."
> >>> 
> >>> so you could use COMMON or EQUIVALENCE to have a real arrays
> >>> mapped to the complex array.

Only if the COMPLEX variable is of default precision.

> >>In which order are the real and imaginary parts of each complex number stored?
> >
> >I don't know but I'll answer the question "which of the numeric
> >storage units contain the real and imaginary parts?"...
> >
> >For Fortran 77 the first is real and the second imaginary.
> >
> >When I wrote the above I did not realise that the Fortran 90 standard
> >does not contain the text that states this in the Fortran 77 standard
> >(4.6).  At least I (and others) couldn't find it.
> 
> I think one of the others who expressed a similar view to yours was Richard 
> Maine.
> 
> If this is true about the "oversight" in the F90/F95(?) standard, then 
> potentially a lot of code could be broken by a new "compiler vendor kid on the 
> block" and maintaining compliance to the standard.
> 
> Be they good practices or not, many engineering programs have been written with 
> equivalence to the real and imaginary parts of complex numbers.  I can remember 
> instances from my youth, when good programming practices were those that used 
> every devious trick I could invent.
> 
> If this is an oversight (and before BG decides to go into the new "standard" BG 
> Fortran compiler), is there a mechanism to correct this before potential harm?
> 
> Regards, Paddy
> 
> Paddy O'Brien,


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%