program main
  use base_ioutil_mod
  use base_struct_mod
  implicit none

  type(axis)                      :: ax_modl,ay_modl,az_modl
  type(axis)                      :: ax_data,ay_data,az_data,ahx_data,ahy_data,ahz_data
  real, dimension(:), allocatable :: modl
  real, dimension(:), allocatable :: data

  character(len=256)              :: mod1_, mod2_, dat1_, dat2_

  mod1_ = "mod1"; mod2_ = "mod2"
  dat1_ = "dat1"; dat2_ = "dat2"

  call sep_init(SOURCE)
  call getch_add_string("head=/dev/null")
  call getch_add_string("noheader=y")
  call set_no_putch()
  call sep_begin_prog()


  call hinaxis(mod1_, ax_modl , 1); call hinaxis(mod1_, ay_modl , 2); call hinaxis(mod1_, az_modl , 3)

  call hinaxis(dat1_, ax_data , 1); call hinaxis(dat1_, ay_data , 2); call hinaxis(dat1_, az_data , 3)
  call hinaxis(dat1_, ahx_data, 4); call hinaxis(dat1_, ahy_data, 5); call hinaxis(dat1_, ahz_data, 6)

  call houaxis(mod2_, ax_modl , 1); call houaxis(mod2_, ay_modl , 2); call houaxis(mod2_ , az_modl, 3)

  call houaxis(dat2_, ax_data , 1); call houaxis(dat2_, ay_data , 2); call houaxis(dat2_, az_data , 3)
  call houaxis(dat2_, ahx_data, 4); call houaxis(dat2_, ahy_data, 5); call houaxis(dat2_, ahz_data, 6)

  allocate(modl(ax_modl%n*ay_modl%n*az_modl%n))
  allocate(data(ax_data%n*ay_data%n*az_data%n*ahx_data%n*ahy_data%n*ahz_data%n))

  call random_number(modl)
  call random_number(data)

  call sseek(mod2_, 0, 0)
  call sseek(dat2_, 0, 0)

  call sep_write(modl, mod2_)
  call sep_write(data, dat2_)

end program
