Message text written by Mike Bauer
>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.
***************************************************************************
***
Your solution is probably to order the derived type
components
by decreasing size, thus making padding unneccessary,
i.e.
reverse the order of your 2 components. This is
similar to a
similar rule for ordering items in a COMMON block with
old
F77 code.
***************************************************************************
***
Also, is it possible to evaluate a function inside of a WHERE statement?
For example,
WHERE(X.GE.10)
COMPUTE
END WHERE<
***************************************************************************
********
Yes, as long as it forms part of a valid array
assignment in the
context of the WHERE. Note, however, that for a
non-elemental
function (the only ones you can write unless using
Fortran 95), it
will be fully evaluated before masking is applied. It
is not possible
to mask it such that it is evaluated only for true
values of the mask,
as you seem to want.
Regards,
Mike Metcalf
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|