module ooc_ioutil_mod
  use sep
  use oc_utils_mod
  implicit none

  type, public :: fileinfo
     character(len=128)                :: name
     integer                           :: nd, esize
     integer, dimension(:), pointer    :: n
     real,    dimension(:), pointer    :: o,d
     integer                           :: blon ! number of blocks
     integer                           :: bloe ! elements in a block
     integer                           :: blob ! bytes in a block
  end type

contains
  !----------------------------------------------------------------
  subroutine ooc_allocateheader(file, t_)
    type(fileinfo),     intent(inout) :: file
    character(len=128), intent(in)    :: t_

    file%name=t_

    file%nd = sep_dimension(t_)
    allocate (file%n(file%nd)); file%n = 1
    allocate (file%o(file%nd)); file%o = 0.
    allocate (file%d(file%nd)); file%d = 1.
    call from_aux(t_, "n"    ,file%n    ,file%n)
    call from_aux(t_, "o"    ,file%o    ,file%o)
    call from_aux(t_, "d"    ,file%d    ,file%d)
    call from_aux(t_, "esize",file%esize,4)

  end subroutine


end module
