Subject: Extra words...
From: Erik Kluzek (erik@cgd.ucar.edu)
Date: Mon May 18 1998 - 09:42:32 MDT
On Sun, 17 May 1998, Gerhard Gross wrote:
> A few years ago I wrote some software to read CCM history files
> and extract any data from them. In the process I discovered that
> there was a discrepency between the history files and the CCM
> documetation (User's Guide To NCAR CCM3, p 123, etc.) as you have
> mentioned. The actual history files include a number of extra
> words and the pattern is this: "each record" in a history file
> includes a 4 byte integer at the beginning of the record and one
> at the end of the record. The value of this integer is the
> length, in bytes, of the record being bounded. All records,
> including each of the 3 header records for each time sample, as
> well as each data record, have this property.
I just wanted to point out the source of these "extra words". When FORTRAN
writes out UNFORMATTED SEQUENTIAL data it adds these extra words to the
begining and end of each record written. So if you use FORTRAN to read the
files you don't have to worry about it. But, if you use another language
, such as "C", you do have to worry about it. And of course if you look
at something like a octal dump you'll see it as well.
The place where the extra words are written are determined by the FORTRAN
writes. So each FORTRAN write statment "WRITE(IUNIT) ...." will add the
number of bytes written on that statement to the begining and end of the record.
Erik
Erik Kluzek, (CGD at NCAR)
National Center for Atmospheric Research
Boulder CO, (off) (303)497-1326 (fax) (303)497-1324
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
This archive was generated by hypermail 2b27 : Thu Jun 01 2000 - 09:06:16 MDT