Re: read fortran unformatted binary

From: Ekin Akoglu <ekin_at_nyahnyahspammersnyahnyah>
Date: Fri Apr 13 2012 - 03:01:22 MDT

Did you try fbinrecread? It seems it is more appropriate for you file
because it is for sequential access files.

On 04/13/2012 11:57 AM, Prince K XAVIER wrote:
> Hi,
>
> I have a fortran f77 binary file written using a f77 code as:
>
> open(15,file=outfile, form='unformatted')
>
> do i = 1, ntime
> ....
> write(15) yyr,ymo,yda ! Integers
> write(15) ((y(lon,lat),lon=1,145),lat=1,33) ! float
> ....
> end do
>
> How can I read it using NCL?
>
> I tried to read the first two records using:
>
> date = fbindirread (datadir+datafile, 0, (/3/), "integer")
> data = fbindirread (datadir+datafile, 1, (/145,33/), "float")
>
> but it gives some strange values and I know there is something wrong
> with the read statement. Could you suggest the correct way of reading
> the data?
>
> Another option was to write a fortran subroutine to read it and
> linking it using a shared object. This worked for some time but now
> fails with "Memory fault" error. Not a very stable solution in my
> opinion. Any better suggestions?
>
> Cheers
> Prince
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>

-- 
*Ekin Akoglu*
Research Assistant
Institute of Marine Sciences
Middle East Technical University
P.O. Box 28, 33731
Erdemli, Mersin
Turkey
Web: www.ims.metu.edu.tr
Email: ekin@ims.metu.edu.tr <mailto:ekin@ims.metu.edu.tr>
Phone: +90 324 521 34 34
GSM: +90 506 554 03 90
Fax: +90 324 521 23 27

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Apr 13 03:03:19 2012

This archive was generated by hypermail 2.1.8 : Fri Apr 13 2012 - 13:37:52 MDT