From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,3618db9cb5caf6aa,start X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1993-09-09 07:38:01 PST Newsgroups: comp.unix.osf.osf1 Path: gmd.de!newsserver.jvnc.net!howland.reston.ans.net!agate!doc.ic.ac.uk!uknet!comlab.ox.ac.uk!keith From: keith@rahman.earth.ox.ac.uk (Keith Refson) Subject: f77 -convert big_endian broken? Message-ID: Organization: Dept of Earth Sciences, Oxford University, UK. Date: 09 Sep 1993 14:27:02 GMT I just discovered to my dismay that the "-convert big_endian" option to f77 doesn't work as expected. If I am reading the manual page correctly, it ought to produce binary unformatted files compatible with the Sun machines. However it doesn't seem to convert floating point data, only integer. Here's the test program. program fin real a(10) data a/1,2,3,4,5,6,7,8,9,0/ write(7) a stop end which when compiled without any -convert options writes the data: Dump: fort.7 Offset: 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef 00000000: 28 00 00 00 00 00 80 3f 00 00 00 40 00 00 40 40 | (......?...@..@@ | 00000010: 00 00 80 40 00 00 a0 40 00 00 c0 40 00 00 e0 40 | ...@...@...@...@ | 00000020: 00 00 00 41 00 00 10 41 00 00 00 00 28 00 00 00 | ...A...A....(... | With -convert big_endian I get: Dump: fort.7 Offset: 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef 00000000: 00 00 00 28 00 00 80 3f 00 00 00 40 00 00 40 40 | ...(...?...@..@@ | 00000010: 00 00 80 40 00 00 a0 40 00 00 c0 40 00 00 e0 40 | ...@...@...@...@ | 00000020: 00 00 00 41 00 00 10 41 00 00 00 00 00 00 00 28 | ...A...A.......( | Notice that it has done nothing with the fp data and only byte-swapped the record length words. However the following program program fin real a(10) integer x(10) equivalence (x,a) data a/1,2,3,4,5,6,7,8,9,0/ write(7) x stop end produces this output: Dump: fort.7 Offset: 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef 00000000: 00 00 00 28 3f 80 00 00 40 00 00 00 40 40 00 00 | ...(?...@...@@.. | 00000010: 40 80 00 00 40 a0 00 00 40 c0 00 00 40 e0 00 00 | @...@...@...@... | 00000020: 41 00 00 00 41 10 00 00 00 00 00 00 00 00 00 28 | A...A..........( | which *is* byte-swapped, and in fact reads in correctly on Sun machines. I am running OSF/1 v1.2. Is this fixed in 1.3? Keith Refson -- ------------------------------------------------------------------------------ | Email : keith@earth.ox.ac.uk | Dr Keith Refson | | UUCP : ...!mcsun!uknet!ed!K.Refson| Department of Earth Sciences | | PHONE(FAX): +44 865 272026 (272072) | Parks Road, Oxford OX1 3PR, UK | ------------------------------------------------------------------------------