program main
  use sep
  implicit none

  real, dimension(:,:)  , pointer :: header_sou
  real, dimension(:,:,:), pointer :: header_rec
  integer                         :: nco, nsh, ntr, itr, ish
  real                            :: gx, gy, ooffx, doffx

  nco = 2
  nsh = 5
  ntr = 41

  ooffx = -200
  doffx = 10
  call initpar()

  allocate(header_sou(nco, nsh), header_rec(nco, ntr, nsh))

  header_sou(1, 1) = -1000.; header_sou(2, 1) = 0.
  header_sou(1, 2) = -500. ; header_sou(2, 2) = 0.
  header_sou(1, 3) = 0.    ; header_sou(2, 3) = 0.
  header_sou(1, 4) = 500.  ; header_sou(2, 4) = 0.
  header_sou(1, 5) = 1000. ; header_sou(2, 5) = 0.

  do ish=1, nsh
     do itr=1, ntr
        gx = ooffx + (itr-1)*doffx + header_sou(1, ish)
        gy = 0
        header_rec(1, itr, ish) = gx
        header_rec(2, itr, ish) = gy
     end do
  end do


  call sep_write(header_sou, "hdr_sou")
  call sep_write(header_rec, "hdr_rec")

  call to_history("n1", nco, "hdr_sou"); call to_history("n2", nsh, "hdr_sou")
  call to_history("n1", nco, "hdr_rec"); call to_history("n2", ntr, "hdr_rec"); call to_history("n3", nsh, "hdr_rec")
end program
