!---------------------------------------------------------------------
!     Copyright (C) GFD Dennou Club, 2004. All rights reserved.
!---------------------------------------------------------------------
                                                                 !=begin
!= Subroutine AsselinTimeFilter
!
!   * Developer: SUGIYAMA Ko-ichiro
!   * Version: $Id: asselintimefilter.f90,v 1.2.2.1 2005/11/14 01:55:12 kitamo Exp $
!   * Tag Name: $Name:  $
!   * Change History: 
!
!== Overview
!
!アッセリンの時間フィルタ. leap-frog の後に適用. 
! 
!== Error Handling
!
!== Bugs
!
!== Note
!
!== Future Plans
!
!
                                                                 !=end

subroutine AsselinTimeFilter(var_a, var_n, var_b)
                                                                 !=begin
  !== Dependency
  use gridset,   only: DimXMin, DimXMax, DimZMin, DimZMax
  use arareset,  only: tfil
                                                                 !=end
  !--- 暗黙の型宣言禁止
  implicit none
                                                                 !=begin  
  !== Input
  real(8), intent(in)     :: var_a(DimXMin:DimXMax, DimZMin:DimZMax)
  real(8), intent(in)     :: var_b(DimXMin:DimXMax, DimZMin:DimZMax)
                                                                 !=end
                                                                 !=begin
  !== In/Out
  real(8), intent(inout)  :: var_n(DimXMin:DimXMax, DimZMin:DimZMax)
                                                                 !=end

  real(8) :: vartfil_n(DimXMin:DimXMax, DimZMin:DimZMax)
  

  !--- 時間フィルタ
  vartfil_n = var_n + tfil * ( var_b  - 2.0d0 * var_n + var_a ) 

  !--- フィルタをかけた変数を出力
  var_n = vartfil_n
  
end subroutine AsselinTimeFilter
