revap types, step 1
Tobias Schlüter
tobias.schlueter@physik.uni-muenchen.de
Fri Aug 27 12:36:00 GMT 2004
Ron Young wrote:
> If a given machine is not byte addressable ,then
> logical*1,logical*4,integer*1,integer*2 and maybe integer*4 don't make
> since.
For integers this is not true at all: integer*1 is an integer with a range
[-128,127], no matter how many bytes you need to store them (IOW no matter how
memory accesses have to be aligned). This is functionality different from the
one integer*4 offers you.
Also, these datatypes might come in handy when using packed structure, i.e.
TYPE a
INTEGER*1 :: a
LOGICAL*1 :: b
INTEGER*2 :: c
END TYPE a
could be made to occupy 4 bytes of storage instead of 16, if wished. Access to
structure components would then of course have to happen in chunks of the
right alignment, but this wouldn't have to be great loss.
- Tobi
More information about the Fortran
mailing list