Hello,
I found the following program 1 and 2 give different binary files.
Could anyone explain why? I compared the two binary files
and find that test.out2 has 8 bytes more in the middle and the first
4 bytes and last 4 bytes of the two files are also different.
Related with this, I have a binary file produced by
write(11) A
Can I read it in column by column in a different code by doing
read(11)A(:,1)
read(11)A(:,2)
The need for doing this comes when A is a huge array, and I only need it
one column at a time.
Thanks for your help
Xiaogang
program 1
===========A
real*8 :: A(1000,2)
open(11,file='test.out1',access='sequential',form='unformatted')
write(11) A
close(11)
program 2
===========
real*8 :: A(1000,2)
open(11,file='test.out2',access='sequential',form='unformatted')
write(11) A(:,1)
write(11) A(:,2)
close(11)
------------------------------------------------
Dr Xiaogang Wang
Departement de chimie
Universite de Montreal
C.P. 6128, succursale Centre-ville
Montreal, Quebec H3C 3J7
Tel. (514) 3436111 ext. 3947 (office)
FAX (514) 3437586 (office)
e-mail: [log in to unmask]
homepage: http://www.esi.umontreal.ca/~wangx
------------------------------------------------
|