X-Sender: [log in to unmask]
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Date: Thu, 16 Jul 1998 17:00:29 -0500
From: Mike Bauer <[log in to unmask]>
X-List: [log in to unmask]
X-Unsub: To leave, send text 'leave comp-fortran-90' to [log in to unmask]
X-List-Unsubscribe: <mailto:[log in to unmask]>
Reply-To: Mike Bauer <[log in to unmask]>
Sender: [log in to unmask]
Errors-To: [log in to unmask]
Precedence: list
I've come across a compiler dependency concerning derived type I/O.
Consider,
TYPE BOX
INTEGER : I
REAL*8, DIMENSION(10) : Q
END BOX
then
OPEN(UNIT=10,FILE='afile.bin',STATUS='REPLACE',FORMAT=UNFORMATED)
WRITE(10) BOX
the size of afile.bin comes out as
4k + 10*8k + 4k + 4k = 92k with SGI-f90
= 96k with AIX-f90
Clearly this is a problem if one were to use a f77 program to read
afile.bin. I suppose the KIND declaration might resolve this problem?
Apparently xlf90 pads mixed type I/O because if I make Q an INTEGER both
compilers return a 52k file.
What happens here is that the SGI compiler pads the structure in memory, but
not in the file. So, if you read this in in Fortran 77 using a statement
like READ (10) I,(Q(K),K=1,10) you'll be alright. I suspect the way to read
it in F77 on the IBM might be to use a VAX record so you get the same
padding.
Also, is it possible to evaluate a function inside of a WHERE statement?
For example,
WHERE(X.GE.10)
COMPUTE
END WHERE
here the COMPUTE function acts on those elements of array X GE 10?
Not in F90. If COMPUTE were declared ELEMENTAL, should can do it in F95.
--
Richard Shapiro
Principal Engineer, Silicon Graphics SSO
[log in to unmask]
(781) 648-2269 MRF, (978) 567-2211 TW, (978) 567-2411 (Fax)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|