From: traymund@uiuc.edu (Tim Raymund)
Subject: f77 comp option to swap bytes?
Date: 21 Mar 91 22:36:19 GMT [thread overview]
Message-ID: <traymund.669594979@uiwpl.ece.uiuc.edu> (raw)
Is there a f77 compiler option to swap byte order on i/o? I ran
the same program on a DECstation 5000 and an HP 9000/835 (see program
at the end) and the resulting files look like:
DECstation 5000> od -h float.data
0000000 0028 0000 0000 3f80 0000 4000 0000 4040
0000020 0000 4080 0000 40a0 0000 40c0 0000 40e0
0000040 0000 4100 0000 4110 0000 4120 0028 0000
0000060
HP 9000/835> od -h float.data
0000000 0000 2800 803f 0000 0040 0000 4040 0000
0000020 8040 0000 a040 0000 c040 0000 e040 0000
0000040 0041 0000 1041 0000 2041 0000 0000 2800
0000060
We like to use binary file i/o as in the program, and it would
be handy if a f77 compiler option could be set to make the
files identical across systems.
Thanks for any help!
tim raymund
traymund@uiwpl.ece.uiuc.edu
program gen
integer n
parameter (n = 10)
real numb(n)
integer i
do i = 1,n
numb(i) = float(i)
end do
open (21, file='float.data',access='SEQUENTIAL',
$ form='UNFORMATTED',status='UNKNOWN')
rewind (21)
write (21) numb
close (21)
stop
end
--
Tim Raymund
Wave Propagation Lab, Department of Electrical and Computer Engineering,
University of Illinois, 1406 W. Green St., Urbana, IL 61801-2991 USA
Internet: t-raymund@uiuc.edu Phone: 217/333-2931 FAX: 217/244-5624
next reply other threads:[~1991-03-21 22:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
1991-03-21 22:36 Tim Raymund [this message]
1991-03-22 4:46 ` f77 comp option to swap bytes? Stephen Tihor
1991-03-22 12:46 ` Jim Gettys
1991-03-22 18:21 ` Bob Peterson
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