From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,ecadd6846af2d99e X-Google-Attributes: gid1164f8,public X-Google-Thread: 114b0c,ecadd6846af2d99e X-Google-Attributes: gid114b0c,public X-Google-Thread: 1094ba,ecadd6846af2d99e X-Google-Attributes: gid1094ba,public X-Google-ArrivalTime: 1991-03-22 21:51:56 PST Path: gmdzi!unido!fauern!ira.uka.de!sol.ctr.columbia.edu!zaphod.mps.ohio-state.edu!wuarchive!udel!haven!decuac!shlump.nac.dec.com!fman.enet.dec.com!peterson From: peterson@fman.enet.dec.com (Bob Peterson) Newsgroups: comp.sys.hp,comp.sys.dec,comp.lang.fortran Subject: Re: f77 comp option to swap bytes? Keywords: f77 compiler byte swap hp dec ultrix fortran Message-ID: <1991Mar22.132140@fman.enet.dec.com> Date: 22 Mar 91 18:21:40 GMT References: Sender: news@shlump.nac.dec.com Reply-To: peterson@fman.enet.dec.com (Bob Peterson) Followup-To: comp.sys.hp Organization: Digital Equipment Corporation Xref: gmdzi comp.sys.hp:27290 comp.sys.dec:23954 comp.lang.fortran:4326 In article , traymund@uiuc.edu (Tim Raymund) writes: >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: ... >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. Yes. The DEC Fortran V3.0 compiler might help. It is capable of byte swapping and VAX<->IEEE conversion on binary I/O. The drawbacks of this are that FORTRAN programmers sometimes equivalance a lot of data in COMMON to a single integer vector, and then do I/O with the vector. The conversions then may fail. The experimental support allows you three options to control this: a per-unit environment variable, a compiler option affecting all units, and a new OPEN statement keyword, CONVERT. Details on request. We haven't had enough experience with this to catch all the gotchas. One gotcha: the binary data may be converted, but the binary record formats have to be the same as well. We think we match formats pretty well, but like I said, we're in learn mode. \bob