program shotheader
use sep
implicit none
integer::n2,n1,i,j
real::gx,gy,sx,sy
real,dimension(:,:),pointer::h1,h2
call sep_init()
call from_history('n2',n2)
call from_history('n1',n1)
call to_history('n1',n1)
call to_history('n2',n2*n2)
call to_history('n3',1)
call sep_close()

allocate(h1(n1,n2),h2(n1,n2))
write(0,*) 'size(h1,1),size(h2,1)',size(h1,1),size(h2,1)
write(0,*) 'size(h1,2),size(h2,2)',size(h1,2),size(h2,2)
h1=0.;h2=0.
call sep_read(h1)
do i=1,n2
   h2(1,i)=h1(1,i)
   h2(2,i)=h1(2,i)
end do
do i=1,n2 
   sx=h1(1,i)
   sy=h1(2,i)
   do j=1,n2
      h2(3,j)=sx
      h2(4,j)=sy
   end do
   call sep_write(h2)
end do
deallocate(h1,h2)
end program shotheader
