!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
module cubemain_header_tools
  use cube_types
  use cubetools_parameters
  use cubedag_flag
  use cubemain_messaging
  !
  public :: cubemain_header_tools_compress_c
  private
  !
contains
  !
  subroutine cubemain_header_tools_compress_c(ou,in,flags,unit,nw,error)
    use cubetools_axis_types
    use cubetools_header_methods
    use cubeadm_clone
    !----------------------------------------------------------------------
    !
    !----------------------------------------------------------------------
    type(cube_t), pointer, intent(inout) :: ou
    type(cube_t), pointer, intent(inout) :: in
    type(flag_t),          intent(in)    :: flags(:)
    character(len=*),      intent(in)    :: unit
    integer(kind=chan_k),  intent(in)    :: nw
    logical,               intent(inout) :: error
    !
    type(axis_t) :: axis
    character(len=*), parameter :: rname='HEADER>TOOLS>COMPRESS>C'
    !
    call cubemain_message(mainseve%trace,rname,'Welcome')
    !
    call cubeadm_clone_header(in,flags,ou,error)
    if (error) return
    call cubetools_header_put_array_unit(unit,ou%head,error)
    if (error) return
    call cubetools_header_get_axis_head_c(ou%head,axis,error)
    if (error) return
    axis%n = nw
    axis%ref = 1d0
    axis%val = 0d0
    call cubetools_header_update_axset_c(axis,ou%head,error)
    if (error) return
  end subroutine cubemain_header_tools_compress_c
end module cubemain_header_tools
!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
