comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Fortran and byte swapping
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Fortran and byte swapping [message #7677] Fri, 13 December 1996 00:00
Simon Williams is currently offline  Simon Williams
Messages: 5
Registered: October 1996
Junior Member
I have a large dataset which is in Unformatted variable-length
records written in FORTRAN on a SUN (big endian). I want to
read it on a DEC alpha running OSF (little endian) using IDL.
It is not really practical to convert the whole dataset.

1. I Can't use "openr, ..... ,/f77_unformatted" because the
record length information stored in the file is byte-swapped
so it falls over on the first read.

2. I could drop the /f77_unformatted keyword and handle the
record structure myself, but even then I can't see a simple
way of doing it - I would need an IDL function which behaves
like readu, so that I can pass an arbitrary number of arguments
to it or I will have to clog up my routine with a load of
calls to byteorder for each parameter I read.

Any ideas? The nicest solution would be a "byteswap keyword" to
the open routines - like the one provided by dec fortran, but I
guess that's a bit much to ask!

Simon Williams


--
------------------------------------------------------------ -------
Simon Williams British Atmospheric Data Centre
s.r.williams@rl.ac.uk Tel : 01235 446314 FAX : 01235 445848
------------------------------------------------------------ -------
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: NT and Unix systime precision
Next Topic: Re: wave code

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 14:09:05 PDT 2025

Total time taken to generate the page: 0.80141 seconds