[Thread Prev][Thread Next][Index]

Re: [ferret_users] Data reading



Hi Joerg,

The code at the line given in the error message is encountered when Ferret is trying the determine the best format for listing out your data as character (string) values to the console.  I am not sure why you are encountering this error (assuming that error message is accurate); maybe the magnitude of the data values, maybe the data was not interpreted correctly when read in.  (Some Fortran binary data file formats have a count value at the beginning that was either 4 bytes or 8 bytes, depending on version of gfortran used.)

But you might be able to work around this problem by not listing any values to the console and instead just saving all the data in a netcdf file after you read it into Ferret.  So after reading in the data, issue the Ferret command:
LIST /FORMAT=CDF /FILE=GB_1km_197101.nc SD, LD, TA, Q, W, P
Since this writes the data using a completely different method, you should not encounter the error you mentioned.  You can then cancel the data read in from the binary stream file, and use the netcdf file you just created for the data.  You probably want to use the Ferret "statistics" command on the dataset variables to make sure values appear to be interpreted correctly.  Then maybe listing some of the values.  If the error shows up again, you might try the ncdump command (from the shell prompt - not a ferret command).  Probably first just list the headers "ncdump -h", then maybe a full dump, to see if the data values appear to be correct.

Karl


On Sun, Sep 1, 2013 at 4:50 PM, Kaduk, Joerg (Dr.) <jk61@xxxxxxxxxxxxxxx> wrote:

Hello,

I have a reading problem:

I have a stream big endian r*4 file with 6 variables on 227964 land points for 31 days.

The data are ordered such that there are first all variables of day 1, then of day 2, …

I tried the below, but ferret crashed (see below) – with or without /swap.

This is:

                FERRET v6.84 

                Linux 2.6.32-220.23.1.el6.x86_64 64-bit - 08/13/13

 

I checked the file size and it fits with 4*6*227964*31

 

I could write fortran code to convert to netcdf, but it would be nice if I could do this via ferret….

Any help greatly appreciated.

 

Cheers,

Joerg

 

 

 

yes? define axis/x=1:227964:1 xa

yes? define axis/t=1:31:1 xt

yes? define grid/x=xa/t=xt xgr

yes? file/var=sd,ld,ta,q,w,p/grid=xgr/format=stream/type=r4/swap GB_1km_197101.bin

yes? show data

     currently SET data sets:

    1> ./GB_1km_197101.bin  (default)

name     title                             I         J         K         L         M         N

SD       SD                               1:227964  ...       ...       1:31      ...       ...

LD       LD                               1:227964  ...       ...       1:31      ...       ...

TA       TA                               1:227964  ...       ...       1:31      ...       ...

Q        Q                                1:227964  ...       ...       1:31      ...       ...

W        W                                1:227964  ...       ...       1:31      ...       ...

P        P                                1:227964  ...       ...       1:31      ...       ...

yes? SET MEMORY/SIZE=1000

Cached data cleared from memory

yes? list sd[i=1:100,l=1]

             VARIABLE : SD

             FILENAME : GB_1km_197101.bin

             SUBSET   : 100 points (X)

             T        : NaN

At line 72 of file var_data_fmt.F

Fortran runtime error: End of record

 

 

Jörg Kaduk

Senior lecturer

http://www.geog.le.ac.uk/staff/jk61/

t: +44 (0)116 252 3848

Department of Geography, University of Leicester, University Road, Leicester LE1 7RH, UK

 

Elite Without Being Elitist

 

Times Higher Awards Winner 2007, 2008, 2009, 2010, 2011, 2012, 2013

 




--
Karl M. Smith, Ph.D.
JISAO Univ. Wash. and TMAP/PMEL NOAA
"The contents of this message are mine personally and do
not necessarily reflect any position of the Government
or the National Oceanic and Atmospheric Administration."

[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement