The Elk Code
 
Loading...
Searching...
No Matches
zfftifc_fftw.f90
Go to the documentation of this file.
1
2! Copyright (C) 2002-2005 J. K. Dewhurst, S. Sharma and C. Ambrosch-Draxl.
3! This file is distributed under the terms of the GNU General Public License.
4! See the file COPYING for license details.
5
6subroutine zfftifc(nd,n,sgn,z)
7implicit none
8! arguments
9integer, intent(in) :: nd,n(nd),sgn
10complex(8), intent(inout) :: z(*)
11! local variables
12integer, parameter :: FFTW_ESTIMATE=64
13integer p
14integer(8) plan
15real(8) t1
16! interface to FFTW version 3
17!$OMP CRITICAL(fftw_)
18call dfftw_plan_dft(plan,nd,n,z,z,sgn,fftw_estimate)
19!$OMP END CRITICAL(fftw_)
20call dfftw_execute(plan)
21!$OMP CRITICAL(fftw_)
22call dfftw_destroy_plan(plan)
23!$OMP END CRITICAL(fftw_)
24if (sgn == -1) then
25 p=product(n(1:nd))
26 t1=1.d0/dble(p)
27 call zdscal(p,t1,z,1)
28end if
29end subroutine
30
31subroutine rzfftifc(nd,n,sgn,r,z)
32implicit none
33! arguments
34integer, intent(in) :: nd,n(nd),sgn
35real(8), intent(inout) :: r(*)
36complex(8), intent(inout) :: z(*)
37! local variables
38integer, parameter :: FFTW_ESTIMATE=64
39integer p
40integer(8) plan
41real(8) t1
42!$OMP CRITICAL(fftw_)
43if (sgn == -1) then
44 call dfftw_plan_dft_r2c(plan,nd,n,r,z,fftw_estimate)
45else
46 call dfftw_plan_dft_c2r(plan,nd,n,z,r,fftw_estimate)
47end if
48!$OMP END CRITICAL(fftw_)
49call dfftw_execute(plan)
50!$OMP CRITICAL(fftw_)
51call dfftw_destroy_plan(plan)
52!$OMP END CRITICAL(fftw_)
53if (sgn == -1) then
54 p=product(n(1:nd))
55 t1=1.d0/dble(p)
56 p=p/n(1)
57 p=p*(n(1)/2+1)
58 call zdscal(p,t1,z,1)
59end if
60end subroutine
61
subroutine zfftifc(nd, n, sgn, z)
subroutine rzfftifc(nd, n, sgn, r, z)