NCL : fbinread

From: H C Pumphrey (hcp AT unknown)
Date: Mon Nov 13 1995 - 07:37:28 MST


Dear NCAR Graphics:

I have a few comments on NCL and particularly the facilities for
importing binary data.

Firstly, the documentation for the fbinread function states:

\begin{quote}
fbinread
++++++++
This function is used read in binary files that have been written using
an UNFORMATED FORTRAN write.
\end{quote}

UNFORMATTED actually has two Ts according to our Fortran compiler. More
importantly, the routine reads a file written by an unformatted
SEQUENTIAL write. If it was written by an unformatted DIRECT write, then
fbinread will not read it (but cbinread will). I think the documentation
should explain this.

More importantly still, the documentation does not explain how to read in
a file which has more than one Fortran record in it, and in fact gives
the impression that this is impossible. For example, if the file was
written by the lines

      REAL X(XSIZE),Y(YSIZE),Z(XSIZE,YSIZE)
      INTEGER I,J
      OPEN(10,FILE='test.dat',FORM='UNFORMATTED',ACCESS='SEQUENTIAL')
      
C *** GENERATE SOME DATA **
. [imagine FORTRAN code to generate data]
.
C ** WRITE DATA TO FILE ***
      WRITE(10)XSIZE
      WRITE(10)YSIZE
      WRITE(10)X
      WRITE(10)Y
      WRITE(10)Z

Then it appears that you CAN NOT import the the two integers XSIZE and
YSIZE, the two 1-d arrays X and Y and the 2-d array Z into NCL. Am I
correct in assuming this? If not, how do I do it? (I mean with the file
test.dat as it stands, NOT by re-writing the FORTRAN program to output
five separate files!) If it IS impossible, is
there any chance of changing this in future versions of NCL? I'm sure
netCDF is all very wonderful and that we will switch to it eventually,
but we have a very large volume of data in unformatted files, some
direct-access, some sequential and all with more than one record (i.e.
written by more than one FORTRAN write statement). Frequently each record
contains a mix of real, integer and character types, too. Of course we
want to move away from writing FORTRAN programs to display data to using
a modern scripting language. We have used IDL up to now, but this is
supplied as expensive, single-user licenses over which we all quarrel.
Also, its mapping abilities are poor compared to those of NCAR graphics.
I had high hopes that NCL would be the answer to our prayers but it isn't
if we can't import our data!

I hope this comment is useful to you.

Hugh C. Pumphrey

==========================================================================
Hugh C. Pumphrey | Telephone 0131-650-6026
Department of Meteorology | FAX 0131-662-4269
The University of Edinburgh | Replace 0131 with +44-131 if outside U.K.
Mayfield Road | -----------------------------------------
EDINBURGH EH9 3JZ | Email hcp AT unknown
Scotland | Or H.C.Pumphrey AT unknown
==========================================================================



This archive was generated by hypermail 2b29 : Wed Jun 28 2000 - 09:40:26 MDT