5 ! Writes a 672000 byte file with buffering. The writing failed because
9 integer, parameter :: size
= 2800 ! << needs to be large enough
10 real(8) :: vec1(size
,30), dummy(size
)
13 CALL RANDOM_NUMBER(vec1
)
15 open(99, file
='test.dat', form
='unformatted', access
='direct', recl
=size
*8)
17 write(99,rec
=i
) vec1(:,i
)
18 write(99,rec
=i
+10) vec1(:,i
+10)
19 write(99,rec
=i
+20) vec1(:,i
+20) ! << rec = 30 was written to rec = 21
24 if (any (dummy
/= vec1(:,i
))) call abort()
25 read(99,rec
=i
+10) dummy
26 if (any (dummy
/= vec1(:,i
+10))) call abort()
27 read(99,rec
=i
+20) dummy
28 if (any (dummy
/= vec1(:,i
+20))) call abort() ! << aborted here for rec = 21
31 close(99, status
='delete')