program acces_direct
implicit none
integer im,jm,i,j
parameter (im=3,jm=2)
real xxx(im,jm)

do j=1,jm
   do i=1,im
      xxx(i,j)=10.*j+i
   enddo
enddo
print*,'Le champ xxx original'
write(*,'(3f10.2)') xxx


open (11,file='tt',form='unformatted',access='direct',recl=4*im)
do j=1,jm
   write(11,rec=j) (xxx(i,j),i=1,im)
enddo

do j=1,jm
   read(11,rec=jm-j+1) (xxx(i,j),i=1,im)
enddo

print*,'Le champ xxx apres ecriture et relecture'
write(*,'(3f10.2)') xxx

end
