program Lin2_
  use sep
  use utils_

  implicit none

  real,    pointer :: data(:,:)
  integer          :: axis
  type(myaxis)     :: a1,a2
  integer          :: i1,i2


  call sep_init()

  a1%l="a1"
  call printaxis(a1)
  call pinaxis(a1)
  call printaxis(a1)

  a2%l="a2"
  call printaxis(a2)
  call pinaxis(a2)
  call printaxis(a2)

  call houaxis(a1,1)
  call houaxis(a2,2)

  call from_param("axis",axis,1)
  call sep_close()

  allocate(data(a1%n,a2%n))

  if(axis==2) then
     do i2=1,a2%n
        data(:,i2) = a2%o+(i2-1)*a2%d
     end do
  else
     do i1=1,a1%n
        data(i1,:) = a1%o+(i1-1)*a1%d
     end do
  end if

  call sep_write(data)

  call exit(0)
end program Lin2_
