comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Error in reading large Fortran unformatted files
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Error in reading large Fortran unformatted files [message #75125 is a reply to message #75068] Thu, 17 February 2011 07:02 Go to previous messageGo to previous message
Kenneth P. Bowman is currently offline  Kenneth P. Bowman
Messages: 585
Registered: May 2000
Senior Member
In article
<45a7d29c-1223-4e0e-8390-5a549f91cd02@s11g2000yqh.googlegroups.com>,
OM <metukio@gmail.com> wrote:

> The output is now:
> nb1=2147483657
> nb2=995288272
>
> I still have no idea what this means.

nb1 is the largest possible positive 32-bit signed integer

IDL> print, 2L^31 - 1
2147483647

The fact that nb2 does not match nb1 indicates a problem.

The problem is probably that the version of Fortran that wrote your
file only allows 2 GB records. That is, the length word at the
beginning and end of each record is only 4 bytes.

A 64-bit fortran may or may not use 8-byte length words. You may be
able to set this as a Fortran option.

You should be able to find out in your Fortran documentation,
or you can find it experimentally by running a Fortran program
that writes a 2 GB record. I suggest that you write 4-byte
integer zeroes. Then try reading the file in IDL.

You can try this, which will read the first 4 bytes as the length word

nb1=0ul
nb2=0ul
OPENR, 1, f
READU, 1, nb1, d, nb2

or this, which will read the first 8 bytes as the length word

nb1 = 0ULL
nb2 = 0ULL
OPENR, 1, f
READU, 1, nb1, d, nb2

Then repeat the experiment with a 4GB record.

Ken Bowman
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Video Mosaicking
Next Topic: Re: BUG: How to crash IDL using !null

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Oct 09 23:57:09 PDT 2025

Total time taken to generate the page: 0.00204 seconds