dzfftb Subroutine

subroutine dzfftb(n, r, Azero, a, b, Wsave)

Arguments

Type IntentOptional Attributes Name
integer :: n
real(kind=rk) :: r
real(kind=rk) :: Azero
real(kind=rk) :: a
real(kind=rk) :: b
real(kind=rk) :: Wsave

Contents

Source Code


Variables

Type Visibility Attributes Name Initial
integer, public :: i
integer, public :: ns2

Source Code

      subroutine dzfftb(n,r,Azero,a,b,Wsave)
      use fftpack_kind
      implicit none
      real(rk) :: a , Azero , b , r , Wsave
      integer :: i , n , ns2
      dimension r(*) , a(*) , b(*) , Wsave(*)
      if ( n<2 ) then
         r(1) = Azero
         return
      elseif ( n==2 ) then
         r(1) = Azero + a(1)
         r(2) = Azero - a(1)
         return
      else
         ns2 = (n-1)/2
         do i = 1 , ns2
            r(2*i) = 0.5_rk*a(i)
            r(2*i+1) = -0.5_rk*b(i)
         enddo
         r(1) = Azero
         if ( mod(n,2)==0 ) r(n) = a(ns2+1)
         call dfftb(n,r,Wsave(n+1))
      endif
      end subroutine dzfftb