The Elk Code
 
Loading...
Searching...
No Matches
rfirftoc.f90
Go to the documentation of this file.
1
2! Copyright (C) 2020 J. K. Dewhurst and S. Sharma.
3! This file is distributed under the terms of the GNU General Public License.
4! See the file COPYING for license details.
5
6subroutine rfirftoc(rfir,rfirc)
7use modmain
8implicit none
9! arguments
10real(8), intent(in) :: rfir(ngtot)
11real(8), intent(out) :: rfirc(ngtc)
12! local variables
13integer ig,ifg
14! allocatable arrays
15complex(8), allocatable :: zfft(:)
16! automatic arrays
17complex(8) zfftc(nfgrzc)
18allocate(zfft(ngtot))
19! multiply by characteristic function and Fourier transform on fine grid
20zfft(1:ngtot)=rfir(1:ngtot)*cfunir(1:ngtot)
21call zfftifc(3,ngridg,-1,zfft)
22! Fourier transform to coarse real-space grid
23do ifg=1,nfgrzc
24 ig=igrzfc(ifg)
25 if (ig <= ngvc) then
26 zfftc(ifg)=zfft(igfft(ig))
27 else
28 zfftc(ifg)=0.d0
29 end if
30end do
31deallocate(zfft)
32! Fourier transform to real-space coarse grid
33call rzfftifc(3,ngdgc,1,rfirc,zfftc)
34end subroutine
35
integer, dimension(3) ngridg
Definition modmain.f90:386
integer, dimension(3) ngdgc
Definition modmain.f90:388
real(8), dimension(:), allocatable cfunir
Definition modmain.f90:436
integer, dimension(:), allocatable igfft
Definition modmain.f90:406
integer, dimension(:), allocatable igrzfc
Definition modmain.f90:418
integer ngvc
Definition modmain.f90:398
subroutine rfirftoc(rfir, rfirc)
Definition rfirftoc.f90:7
subroutine zfftifc(nd, n, sgn, z)
subroutine rzfftifc(nd, n, sgn, r, z)