Re: Declaration to get 8-bit (or 16-bit) integer?
- From: Clive Page <junk@xxxxxxxxxxxx>
- Date: Tue, 30 Jan 2007 23:16:01 +0000
In message <epohfj$j3m$1@xxxxxxxxxxxxxxxxxx>, Paul van Delst <Paul.vanDelst@xxxxxxxx> writes
But seriously, I use this for the multi-byte case:
MODULE Endian_Utility
USE Type_Kinds
IMPLICIT NONE
CONTAINS
FUNCTION Big_Endian()
INTEGER(Short) :: Source = 1_Short
LOGICAL :: Big_Endian
Big_Endian = .FALSE.
IF ( IACHAR(TRANSFER(Source,'a')) == 0 ) Big_Endian = .TRUE.
END FUNCTION Big_Endian
....
END MODULE Endian_Utility
That looks very similar to a module that I posted some years ago. If only I could remember how it worked :-)
Now to a more difficult topic: how to get the effect of LOGICAL*1
What for? :o)
If you want a really large array of logicals, e.g. flags for bad pixels in a huge image, then the difference between 1-byte and 4-byte data can be significant.
--
Clive Page
.
- Follow-Ups:
- Re: Declaration to get 8-bit (or 16-bit) integer?
- From: Paul van Delst
- Re: Declaration to get 8-bit (or 16-bit) integer?
- References:
- Declaration to get 8-bit (or 16-bit) integer?
- From: Clive Page
- Re: Declaration to get 8-bit (or 16-bit) integer?
- From: Terence
- Re: Declaration to get 8-bit (or 16-bit) integer?
- From: Richard E Maine
- Re: Declaration to get 8-bit (or 16-bit) integer?
- From: glen herrmannsfeldt
- Re: Declaration to get 8-bit (or 16-bit) integer?
- From: Richard Maine
- Re: Declaration to get 8-bit (or 16-bit) integer?
- From: Gordon Sande
- Re: Declaration to get 8-bit (or 16-bit) integer?
- From: Clive Page
- Re: Declaration to get 8-bit (or 16-bit) integer?
- From: Paul van Delst
- Declaration to get 8-bit (or 16-bit) integer?
- Prev by Date: Re: Declaration to get 8-bit (or 16-bit) integer?
- Next by Date: Re: F77 -> F95 Intro Presentation Material
- Previous by thread: Re: Declaration to get 8-bit (or 16-bit) integer?
- Next by thread: Re: Declaration to get 8-bit (or 16-bit) integer?
- Index(es):