Re: How to define the rec_type in the function of fbinrecread to read a special binary file

From: <shea_at_nyahnyahspammersnyahnyah>
Date: Sat Jan 26 2013 - 19:38:13 MST

The outlined approch has worked on multiple machines and operating systems.

Perhaps the fortran sequential file was created on a 'big-endian' machine
and you are reading on a little-endian machine or vice versa.

There is no automatic way to test. It is the user's responsibility to use
thr sppropriate 'setfileoption' .

> Dear Dennis and Dave,
>
> Thanks for the suggestion.
>
> It does not work.
>
> Hopeful NCL can read read multiple types at a time one day!
>
> Guangshan
>
> On Jan 25, 2013, at 2:31 PM, Dennis Shea <shea@ucar.edu> wrote:
>
>> NCL's fbin*read functions can only read one type at a time/
>>
>> fili = "example01"
>> ii = fbinrecread(fili, 0, 3, "integer")
>> rr = fbinrecread(fili, 0, 3, "float" )
>>
>> a = ii(0)
>> b = rr(1)
>> c = rr(2)
>>
>> Good luck
>>
>> On 01/25/2013 09:17 AM, Guangshan Chen wrote:
>>> Dear all,
>>>
>>> I have a binary file. It is written as the following in the fortran
>>> code:
>>>
>>> integer a
>>> real b,c
>>>
>>> a=10
>>> b=20.0
>>> c=30.0
>>>
>>> open(11, file="example01", form="unformatted")
>>> write(11) a, b, c
>>>
>>>
>>> There is only record in this binary file. If I would like to use
>>> fbinrecread to read
>>> finrecread("example01", 0, 3, ????). How to define the rec_type?
>>>
>>> a is integer, b and c are real.
>>>
>>> Thanks for any help.
>>>
>>> Guangshan
>>>
>>> _______________________________________________
>>> ncl-talk mailing list
>>> List instructions, subscriber options, unsubscribe:
>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>
>>
>
>

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Sat Jan 26 19:38:23 2013

This archive was generated by hypermail 2.1.8 : Tue Jan 29 2013 - 22:44:26 MST