read fortran unformatted binary

From: Prince K XAVIER <prince.xavier_at_nyahnyahspammersnyahnyah>
Date: Fri Apr 13 2012 - 02:57:33 MDT

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
Received on Fri Apr 13 02:57:48 2012

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