From: Toon Moene <toon@moene.indiv.nluug.nl>
Subject: Re: Forcing 32-bit integers and math
Date: 1998/10/15 [thread overview]
Message-ID: <705kpm$4rq$1@newnews.nl.uu.net> (raw)
In-Reply-To: 701flh$njg$1@news.kjist.ac.kr
"G. Hugh SONG" <ghsong@\"Spamspoiler\"kjist.ac.kr> wrote:
> open(Uout, file = 'i2.dt', form='unformatted')
> write(Uout) i2
> close(Uout)
...
> open(Uout, file = 'r8.dt', form='unformatted')
> write(Uout) r8
> close(Uout)
> stop
> end
> Then, I created two executables, test.ix for intel and test.ax for alpha.
> The file sizes of the output files after running test.ix are
> -rw------- 1 ghsong faculty 28 Oct 14 11:47 i4.dt
> -rw------- 1 ghsong faculty 28 Oct 14 11:47 id.dt
> -rw------- 1 ghsong faculty 48 Oct 14 11:47 r8.dt
> -rw------- 1 ghsong faculty 28 Oct 14 12:21 rd.dt
> -rw------- 1 ghsong faculty 18 Oct 14 11:47 i2.dt
> After running test.ax, they are
> -rw------- 1 ghsong faculty 36 Oct 14 11:35 i4.dt
> -rw------- 1 ghsong faculty 36 Oct 14 11:35 id.dt
> -rw------- 1 ghsong faculty 56 Oct 14 11:35 r8.dt
> -rw------- 1 ghsong faculty 36 Oct 14 12:18 rd.dt
> -rw------- 1 ghsong faculty 26 Oct 14 11:35 i2.dt
> This result implies that the two output "record" files are
> significantly different.
Indeed they are - the Alpha unformatted records have two 64-bit record length
specifiers, whereas the Intel ones use 32-bit specifiers.
Note that the Fortran Standard doesn't guarantee you anything about the
possibility of reading unformatted files on one system that were written on
another; therefore the records in them and their sizes do not necessarily
have to agree.
For this sort of exchange, use formatted I/O or a portable "binary" format
like HDF.
Hope this helps,
--
Toon Moene (mailto:toon@moene.indiv.nluug.nl)
Saturnushof 14, 3738 XG Maartensdijk, The Netherlands
Phone: +31 346 214290; Fax: +31 346 214286
g77 Support: mailto:fortran@gnu.org; egcs: mailto:egcs-bugs@cygnus.com
prev parent reply other threads:[~1998-10-15 4:00 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <YQsT1.507$525.1552696@ptah.visi.com>
[not found] ` <6vt65k$5hp$1@walter-fddi.cray.com>
1998-10-14 4:00 ` Forcing 32-bit integers and math G. Hugh SONG
1998-10-14 4:00 ` Greg Lindahl
1998-10-15 4:00 ` H.W. Stockman
1998-10-15 4:00 ` Greg Lindahl
1998-10-15 4:00 ` James Giles
1998-10-15 4:00 ` Richard Maine
1998-10-18 4:00 ` James Giles
1998-10-15 4:00 ` Greg Lindahl
1998-10-16 4:00 ` Jeff Drummond
1998-10-16 4:00 ` James Giles
1998-10-15 4:00 ` Jeff Drummond
1998-10-15 4:00 ` Jeff Drummond
1998-10-15 4:00 ` Toon Moene [this message]
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox