!---------------------------------------------------------------------
!     Copyright (C) GFD Dennou Club, 2005. All rights reserved.
!---------------------------------------------------------------------
                                                                 !=begin
!=Module Summation
!
!  * Developer: KITAMORI Taichi
!  * Version: $Id: $
!  * Tag: $Name: $
!  * Change History:
!
!==Overview
!
!水兵平均などの平均値計算用モジュール. 
!
!==Error Handling
!
!==Known Bugs
!
!==Note
!
!==Future Plans
!
                                                                 !=end
module mean

  interface s_meanx_ss
    function s_meanx_ss(var)
      use gridset
      real(8), intent(in) :: var(DimXMin:DimXMax, DimZMin:DimZMax)
      real(8)             :: s_meanx_ss(DimZMin:DimZMax)
    end function s_meanx_ss
  end interface

end module mean

function s_meanx_ss(var)
  use gridset
  implicit none

  real(8), intent(in) :: var(DimXMin:DimXMax, DimZMin:DimZMax)
  real(8)             :: s_meanx_ss(DimZMin:DimZMax)
  integer             :: i

  s_meanx_ss = 0.0d0
  do i = RegXMin, RegXMaX
    s_meanx_ss =  s_meanx_ss + var(i,:)
  end  do
  s_meanx_ss = s_meanx_ss / (RegXMax - RegXMin + 1)

end function s_meanx_ss
