Commit b0d2c489 authored by Uliana Alekseeva's avatar Uliana Alekseeva

Interface to MKL fft in fft3d.f90 added

parent 354a0318
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
!* pgfft(i) contains the phases of the G-vectors of sph. * !* pgfft(i) contains the phases of the G-vectors of sph. *
!* * !* *
!************************************************************ !************************************************************
USE m_cfft
USE m_types USE m_types
USE m_fft_interface
IMPLICIT NONE IMPLICIT NONE
INTEGER, INTENT (IN) :: isn INTEGER, INTENT (IN) :: isn
...@@ -30,6 +30,9 @@ ...@@ -30,6 +30,9 @@
INTEGER i,ifftd INTEGER i,ifftd
REAL scale REAL scale
COMPLEX ctmp COMPLEX ctmp
LOGICAL forw
INTEGER length_zfft(3)
complex :: zfft(0:27*stars%mx1*stars%mx2*stars%mx3-1)
ifftd=27*stars%mx1*stars%mx2*stars%mx3 ifftd=27*stars%mx1*stars%mx2*stars%mx3
...@@ -48,9 +51,19 @@ ...@@ -48,9 +51,19 @@
!---> now do the fft (isn=+1 : G -> r ; isn=-1 : r -> G) !---> now do the fft (isn=+1 : G -> r ; isn=-1 : r -> G)
CALL cfft(afft,bfft,ifftd,3*stars%mx1,3*stars%mx1,isn) zfft = cmplx(afft,bfft)
CALL cfft(afft,bfft,ifftd,3*stars%mx2,9*stars%mx1*stars%mx2,isn) if (isn == -1) then
CALL cfft(afft,bfft,ifftd,3*stars%mx3,ifftd,isn) forw = .true.
else
forw = .false.
end if
length_zfft(1) = 3*stars%mx1
length_zfft(2) = 3*stars%mx2
length_zfft(3) = 3*stars%mx3
call fft_interface(3,length_zfft,zfft,forw)
afft = real(zfft)
bfft = aimag(zfft)
IF (isn.LT.0) THEN IF (isn.LT.0) THEN
! !
...@@ -61,7 +74,7 @@ ...@@ -61,7 +74,7 @@
ENDDO ENDDO
DO i=0,stars%kimax DO i=0,stars%kimax
fg3(stars%igfft(i,1)) = fg3(stars%igfft(i,1)) + CONJG( stars%pgfft(i) ) * & fg3(stars%igfft(i,1)) = fg3(stars%igfft(i,1)) + CONJG( stars%pgfft(i) ) * &
& CMPLX(afft(stars%igfft(i,2)),bfft(stars%igfft(i,2))) & zfft(stars%igfft(i,2))
ENDDO ENDDO
scale=1.0/ifftd scale=1.0/ifftd
IF (PRESENT(scaled)) THEN IF (PRESENT(scaled)) THEN
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment