!= Module TimeFilter_3D
!
! Authors::   SUGIYAMA Ko-ichiro
! Version::   $Id: timefilter_3d.f90,v 1.4 2007-08-20 07:33:02 odakker Exp $
! Tag Name::  $Name:  $
! Copyright:: Copyright (C) GFD Dennou Club, 2006. All rights reserved.
! License::   See COPYRIGHT[link:../../COPYRIGHT]
!
!== Overview
!
!ã‚¢ãƒƒã‚»ãƒªãƒ³ã®æ™‚é–“ãƒ•ã‚£ãƒ«ã‚¿. leap-frog ã®å¾Œã«é©ç”¨.
!
!== Error Handling
!
!== Bugs
!
!== Note
!
!== Future Plans
!
!

module TimeFilter_3d

  !ãƒ¢ã‚¸ãƒ¥ãƒ¼ãƒ«èªã¿è¾¼ã¿
  use dc_types, only : DP

  use GridSet_3d, only: DimXMin,     & !x æ–¹å‘ã®é…åˆ—ã®ä¸‹é™
    &                 DimXMax,     & !x æ–¹å‘ã®é…åˆ—ã®ä¸Šé™
    &                 DimYMin,     & !y æ–¹å‘ã®é…åˆ—ã®ä¸‹é™
    &                 DimYMax,     & !y æ–¹å‘ã®é…åˆ—ã®ä¸Šé™
    &                 DimZMin,     & !z æ–¹å‘ã®é…åˆ—ã®ä¸‹é™
    &                 DimZMax,     & !z æ–¹å‘ã®é…åˆ—ã®ä¸Šé™
    &                 SpcNum         !åŒ–å¦ç¨®ã®æ•°

  !æš—é»™ã®åž‹å®£è¨€ç¦æ¢
  implicit none

  !å±žæ€§ã®è¨å®š
  private

  !é–¢æ•°ã‚’ public å±žæ€§ã«è¨å®š
  public AsselinFilter

  !å¤‰æ•°å®šç¾©
  real(DP) :: tfil = 1.0d-1  !ã‚¢ãƒƒã‚»ãƒªãƒ³ã®æ™‚é–“ãƒ•ã‚£ãƒ«ã‚¿ã®ä¿‚æ•°

  !å€¤ã‚’ save ã™ã‚‹
  save tfil

contains

  subroutine AsselinFilter(VarA, VarN, VarB)
    !
    ! æ™‚é–“ãƒ•ã‚£ãƒ«ã‚¿ãƒ¼; Asselin ã®ã‚¿ã‚¤ãƒ ãƒ•ã‚£ãƒ«ã‚¿ãƒ¼ã‚’åˆ©ç”¨
    !

    !æš—é»™ã®åž‹å®£è¨€ç¦æ¢
    implicit none

    !å¤‰æ•°å®šç¾©
    real(DP), intent(in)     :: VarA(DimXMin:DimXMax,DimYMin:DimYMax,DimZMin:DimZMax)
    real(DP), intent(inout)  :: VarN(DimXMin:DimXMax,DimYMin:DimYMax,DimZMin:DimZMax)
    real(DP), intent(in)     :: VarB(DimXMin:DimXMax,DimYMin:DimYMax,DimZMin:DimZMax)
    real(DP)                 :: Var(DimXMin:DimXMax,DimYMin:DimYMax,DimZMin:DimZMax)

    !æ™‚é–“ãƒ•ã‚£ãƒ«ã‚¿
    Var  = VarN + tfil * ( VarB  - 2.0d0 * VarN + VarA )
    VarN = Var

  end subroutine AsselinFilter

end module TimeFilter_3d