[Thread Prev][Thread Next][Index]

Re: How to read the data wroten in ferret



Hi Yang,

Mark Verschell's explanation is right on. There are other approaches, as well.

One is to use LIST/FORMAT=STREAM instead of /FORMAT=UNFORMATTED. This would enable
you to read the file with the FORTRAN code that you present if you change
access="sequential" to access="direct". See
http://ferret.wrc.noaa.gov/Ferret/Documentation/Users_Guide/v50/partII.html#LIST$/FORMAT
for further explanation.

Still another approach is to use the XSEQUENCE function (or UNRAVEL in Ferret V4.91)
to make a single record from the entire block of data

     yes? list/file=my.dat/format=unformatted/order=Y XSEQUENCE(t2)

(see "Note 2" in the documentation) Then I think you should be able to read it with
the exact FORTRAN code that you show.

    - steve

=====================================

Yang Haijun wrote:

> Hi,
>
> I want to get a new data from NetCDF data, so I did like this,
>
> yes? sh da
>      currently SET data sets:
>     1> /usr5/navyang/yhj/MOM_3/EXP/PACIFIC1/CONTROL/ts_45_92_season.nc  (default)
>  name     title                             I         J         K         L
>  T2       T1[GT=TAX2@MOD]                  1:85      1:48      1:23      1:192
>
> yes? list/file=my.dat/format=unformatted t2
>
> I got a new data named "my.day".
> Then I used a Fortran code to read this new data,
>
>       parameter(imt=85,jmt=48,kmt=23,lmt=192)
>       dimension temp(imt,jmt,kmt,lmt)
>
>       open(11,file="b.bin",form="unformatted",access="sequential")
>
>       read(11) temp
>
>       end
>
> When I run this code, I failed and was told,
>
> forrtl: severe (67): input statement requires too much data, unit 11, file
> /usr5/navyang/yhj/MOM_3/EXP/FERRET/b.bin
>
> Does anyone know the reason?
>
> Thanks very much,
>
> Haijun Yang

--
Steve Hankin
NOAA/PMEL, 7600 Sand Point Way NE, Seattle, WA 98115-0070
ph. (206) 526-6080 -- FAX (206) 526-6744




[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement