[Thread Prev][Thread Next][Index]

Re: [ferret_users] reading FORTRAN sequential access data - simplequestion



Hi Bob,

Basically, I think Ferret like DIRECT access binary file more than sequential.(My personal opinion, never successfully read in combine variables in seq. access binary file before)
In your case, I will change fortran code into

real*8 hrmean(19,64,128)
open(unit=10,file='test.dat',access='direct',form='unformatted',recl=19*64*128*8)     write(10,rec=1) hrmean

Due to you are using real*8, so you have to specify recl to array dimension * 8

Then read in ferret script like

def axis/x=1:19:1 mx
def axis/y=1:64:1 my
def axis/z=1:128:1 mz
def grid/x=mx/y=my/z=mz mg
file/var=hrmean/grid=mg/form=stream/type=r8/order=xyz test.dat

Dan

2006/7/6, Bob Tomas <tomas@ucar.edu>:
Hello,

I tried to sort this out using the documentation but I wasn't able so...

I created a binary file using FORTRAN using something like:

         real*8 hrmean(19,64,128)
        open(unit=10,access='sequential',form='unformatted',...)
         write(10)hrmean

If someone can provide an example, I'd be very thankful.

Bob
--
-------------------------------------------------------------
Robert A. Tomas
National Center for Atmospheric Research
Climate and Global Dynamics Division - Paleoclimatology
1850 Table Mesa Drive
Boulder, CO 80305-3000
e-mail: tomas@ucar.edu  tel: 303-497-1342  fax:  303-497-1348



--
Welcome to visit my blog!
http://danish.twbbs.org/blog
[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement