Re: readu sees unexpected records [message #43992 is a reply to message #43848] |
Fri, 06 May 2005 08:30   |
Paul Van Delst[1]
Messages: 1157 Registered: April 2002
|
Senior Member |
|
|
Hjalti Sig wrote:
> Thank you guys. The f77_unformatted fixed the problem. The IDL
> documentation however says this keyword is UNIX specific (see below),
> and I am running on a windows XP. So the documentation does not seem
> quite accurate about this...?
I'd be more forgiving about the IDL documentation in this case because the common Fortran
behaviour for sequential, unformatted I/O (4-byte markers at begin and end of record) is
not stipulated by the Fortran standard (at least, anywhere I can find it). I think most
vendors decided that the current system was the most efficient to satisfy those things
that *are* standardised. It is not guaranteed that every Fortran compiler on every
platform will produce sequential, unformatted files the same way (e.g. some older systems
only use 2-byte record markers. Some only put markers at the beginning of the record).
Over time, fortuitously, a "defacto" standard for sequential, unformatted file formats has
come to pass - most likely due to customer complaints to maverick Fortran compiler vendors
to pull their finger out and get their act together.
The Unix reference is maybe due to people sharing files between SGIs, Suns, IBMs, etc back
when those workstation type of machines were all the rage and customers wanted the file
sharing to be independent of the vendor platform/compiler? Then again, I've never really
used a Windows machine (for anything important) so who knows?
paulv
>
> F77_UNFORMATTED
> Unformatted variable-length record files produced by UNIX FORTRAN
> programs contain extra information along with the data in order to
> allow the data to be properly recovered. This method is necessary
> because FORTRAN input/output is based on record-oriented files, while
> UNIX files are simple byte streams that do not impose any record
> structure. Set the F77_UNFORMATTED keyword to read and write this
> extra information in the same manner as f77(1), so that data to be
> processed by both IDL and FORTRAN. See UNIX-Specific Information for
> further details.
> ---------------
>
> Regards, Hjalti
--
Paul van Delst
CIMSS @ NOAA/NCEP/EMC
|
|
|