problems with opening unformatted direct file.

Arlindo da Silva dasilva at ALUM.MIT.EDU
Sat Jun 28 12:06:14 EDT 2008


On Sat, Jun 28, 2008 at 1:44 AM, lantao sun <lantaosun at gmail.com> wrote:

> Dear all,
>
> I write a simple file in FORTRAN by:
>        open (51,file='uwind.dat',form='unformatted,
> access='direct',recl=2001*2001*4)


Which Fortran compiler are you using? The units for specifying the RECL was
system dependent before Fortran 90 (could be in bytes or words); with f90
the units are words (4 bytes). I suspect you are using f90, in which case
the RECL above is wrong (try recl=2001*2001), having a "gap" (read:junk
values) right after the rad variable. You can verify this by checking the
size of your resulting file; the correct size is 2001*2001*4 bytes.

    Arlindo


--
Arlindo da Silva
dasilva at alum.mit.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20080628/8ca2266d/attachment.html 


More information about the gradsusr mailing list