module gms_size_all
  use datatype
  use mem_manager
  implicit none
  interface size_all_x
    module procedure size_all_x_x
    module procedure size_all_x_xy
    module procedure size_all_x_xz
    module procedure size_all_x_xyz
  end interface

  interface size_all_y
    module procedure size_all_y_y
    module procedure size_all_y_xy
    module procedure size_all_y_yz
    module procedure size_all_y_xyz
  end interface

  interface size_all_z
    module procedure size_all_z_z
    module procedure size_all_z_xz
    module procedure size_all_z_yz
    module procedure size_all_z_xyz
  end interface

contains
  function size_all_x_x(input) result(output)
    type(var_x), intent(in) :: input
    integer :: output

      output = ub_axis1 - lb_axis1 + 1 
    
  end function size_all_x_x

  function size_all_x_xy(input) result(output)
    type(var_xy), intent(in) :: input
    integer :: output

    output = ub_axis1 - lb_axis1 + 1 

  end function size_all_x_xy

  function size_all_x_xz(input) result(output)
    type(var_xz), intent(in) :: input
    integer :: output

	output = ub_axis1 - lb_axis1 + 1     

  end function size_all_x_xz

  function size_all_x_xyz(input) result(output)
    type(var_xyz), intent(in) :: input
    integer :: output

    output = ub_axis1 - lb_axis1 + 1     

  end function size_all_x_xyz

  function size_all_y_y(input) result(output)
    type(var_y), intent(in) :: input
    integer :: output

    output = ub_axis2 - lb_axis2 + 1     

  end function size_all_y_y

  function size_all_y_xy(input) result(output)
    type(var_xy), intent(in) :: input
    integer :: output

    output = ub_axis2 - lb_axis2 + 1     

  end function size_all_y_xy

  function size_all_y_yz(input) result(output)
    type(var_yz), intent(in) :: input
    integer :: output

    output = ub_axis2 - lb_axis2 + 1     

  end function size_all_y_yz

  function size_all_y_xyz(input) result(output)
    type(var_xyz), intent(in) :: input
    integer :: output

    output = ub_axis2 - lb_axis2 + 1     

  end function size_all_y_xyz

  function size_all_z_z(input) result(output)
    type(var_z), intent(in) :: input
    integer :: output

    output = ub_axis3 - lb_axis3 + 1     

  end function size_all_z_z

  function size_all_z_xz(input) result(output)
    type(var_xz), intent(in) :: input
    integer :: output

     output = ub_axis3 - lb_axis3 + 1     

  end function size_all_z_xz

  function size_all_z_yz(input) result(output)
    type(var_yz), intent(in) :: input
    integer :: output

     output = ub_axis3 - lb_axis3 + 1     

  end function size_all_z_yz

  function size_all_z_xyz(input) result(output)
    type(var_xyz), intent(in) :: input
    integer :: output

     output = ub_axis3 - lb_axis3 + 1     

  end function size_all_z_xyz

end module gms_size_all
