!---------------------------------------------------------------------
!     Copyright (C) GFD Dennou Club, 2004. All rights reserved.
!---------------------------------------------------------------------
                                                                 !=begin
!= Subroutine DivergenceVel
!
!   * Developer: SUGIYAMA Ko-ichiro (sugiyama@gfd-dennou.org)
!   * Version: $Id: divergencevel.f90,v 1.3 2005/02/02 09:53:48 odakker Exp $
!   * Tag Name: $Name:  $
!   * Change History:
!
!== Overview
!
!速度の発散 ▽・u の計算
!
!== Error Handling
!
!== Known Bugs
!
!== Note
!
!== Future Plans
!
                                                                 !=end

subroutine DivergenceVel(fs_VelX, sf_VelZ, ss_DivVel)
                                                                 !=begin
  !== Dependency
  use dc_trace, only: BeginSub, EndSub
  use gridset, only: DimXMin, DimXMax, DimZMin, DimZMax
  use differentiate, only: ss_dx_fs, ss_dz_sf
                                                                 !=end
  !--- 暗黙の型宣言禁止
  implicit none
                                                                 !=begin
  !== Input
  real(8), intent(in)  :: fs_Velx(DimXMin:DimXMax, DimZMin:DimZMax) !速度 u
  real(8), intent(in)  :: sf_Velz(DimXMin:DimXMax, DimZMin:DimZMax) !速度 w

  !== Output
  real(8), intent(out) :: ss_DivVel(DimXMin:DimXMax, DimZMin:DimZMax) !速度の収束
                                                                 !=end

  call BeginSub("DivergenceVel", &
&                 fmt="%c",       &
&                 c1="Calculate divergece (ss_DivVel).")

  !--- 速度 u
  ss_DivVel =  ss_dx_fs( fs_VelX ) + ss_dz_sf( sf_VelZ )

  call EndSub("DivergenceVel")

end subroutine DivergenceVel