program bin
       implicit none
       character*200                :: arqin,arqout
       character*200                :: arquivo,tmp
       integer, parameter           :: nx=10 
       integer                      :: ny
       real*4, allocatable          :: mat(:,:)   
    
       call getarg(1,arqin)
       read(arqin,*)arquivo
       call getarg(2,arqout)
       read(arqout,*)arquivo
       call getarg(3,tmp)
       read(tmp,*)ny
       
       allocate(mat(nx,ny)) 
             
       open(50,file=arqin,STATUS='UNKNOWN')
       open (40,file=arqout,status='unknown',access='direct',recl=nx*ny*4)

       read(50,*)mat(:,:)
       write(40,rec=1)mat

end
