!---------------------------------------------------------------------
!     Copyright (C) GFD Dennou Club, 2005. All rights reserved.
!---------------------------------------------------------------------
                                                                 !=begin
!= Module SpongeLayer
!
!   * Developer: SUGIYAMA Ko-ichiro
!   * Version: $Id: spongelayer.f90,v 1.1.2.1 2005/12/30 12:13:18 kitamo Exp $
!   * Tag Name: $Name:  $
!   * Change History: 
!
!== Overview
!
!$B%9%]%s%8AX(B
!  * $B6-3&IU6a$GGH$NH?<M$rM^$(5[<}$9$k$?$a$NAX(B
! 
!== Error Handling
!
!== Bugs
!
!== Note
!
!  * $B$3$N4X?t$O(B, $B4pK\>l$,Nm$JJQ?t(B($BB.EY(B, $B%(%/%9%J!<4X?t$N>qMp(B)$B$K(B
!    $BE,MQ$9$k$3$H$rA[Dj$7$F$$$k(B. 
!  * $B3F3J;RE@$KBP$9$k4X?t$rDj5A$9$kI,MW$,$"$k(B
!
!== Future Plans
!
!
                                                                 !=end

module SpongeLayer 

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

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

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

end module SpongeLayer

!!!
!!! ss $B3J;RE@$KBP$9$k%9%]%s%8AX(B
!!!
function ss_SLayer_ss(ss_Var)
                                                                 !=begin
  !== Dependency
  use gridset,  only: DimXMin, DimXMax, DimZMin, DimZMax
  use arareset, only: ss_SDumpV
                                                                 !=end
  !--- $B0EL[$N7?@k8@6X;_(B
  implicit none
                                                                 !=begin  
  !== Input
  real(8), intent(in)   :: ss_Var(DimXMin:DimXMax, DimZMin:DimZMax)
                                                                 !=end
                                                                 !=begin
  !== Out
  real(8)  :: ss_SLayer_ss(DimXMin:DimXMax, DimZMin:DimZMax)
                                                                 !=end

  !--- $B%9%]%s%8AX$K$h$k%@%s%T%s%0$r7W;;(B
  ss_SLayer_ss =  0.0d0    !$B=i4|2=(B
  ss_SLayer_ss =  ss_SDumpV * ss_Var
  
end function ss_SLayer_ss


!!!
!!! sf $B3J;RE@$KBP$9$k%9%]%s%8AX(B
!!!
function sf_SLayer_sf(sf_Var)
                                                                 !=begin
  !== Dependency
  use gridset,  only: DimXMin, DimXMax, DimZMin, DimZMax
  use arareset, only: sf_SDumpV
                                                                 !=end
  !--- $B0EL[$N7?@k8@6X;_(B
  implicit none
                                                                 !=begin  
  !== Input
  real(8), intent(in)   :: sf_Var(DimXMin:DimXMax, DimZMin:DimZMax)
                                                                 !=end
                                                                 !=begin
  !== Out
  real(8)  :: sf_SLayer_sf(DimXMin:DimXMax, DimZMin:DimZMax)
                                                                 !=end

  !--- $B%9%]%s%8AX$K$h$k%@%s%T%s%0$r7W;;(B  
  sf_SLayer_sf =  0.0d0  !$B=i4|2=(B
  sf_SLayer_sf =  sf_SDumpV * sf_Var
  
end function sf_SLayer_sf


!!!
!!! fs $B3J;RE@$KBP$9$k%9%]%s%8AX(B
!!!
function fs_SLayer_fs(fs_Var)
                                                                 !=begin
  !== Dependency
  use gridset,  only: DimXMin, DimXMax, DimZMin, DimZMax
  use arareset, only: fs_SDumpV
                                                                 !=end
  !--- $B0EL[$N7?@k8@6X;_(B
  implicit none
                                                                 !=begin  
  !== Input
  real(8), intent(in)   :: fs_Var(DimXMin:DimXMax, DimZMin:DimZMax)
                                                                 !=end
                                                                 !=begin
  !== Out
  real(8)  :: fs_SLayer_fs(DimXMin:DimXMax, DimZMin:DimZMax)
                                                                 !=end

  !--- $B%9%]%s%8AX$K$h$k%@%s%T%s%0$r7W;;(B  
  fs_SLayer_fs =  0.0d0 !$B=i4|2=(B
  fs_SLayer_fs = fs_SDumpV * fs_Var
  
end function fs_SLayer_fs
