From 27b4f5e4954f25ad4cf9bc4b402f65ac88c1cd09 Mon Sep 17 00:00:00 2001
From: giannozz
Date: Fri, 2 Oct 2020 08:47:51 +0200
Subject: [PATCH] Direct call to fft_parallel replaced by call to interface
routine. This removes the only instance of USE fft_parallel in QE BEWARE: not
guaranteed to work
---
GWW/pw4gww/fft_custom.f90 | 70 +++++++++------------------------------
GWW/pw4gww/make.depend | 3 +-
2 files changed, 17 insertions(+), 56 deletions(-)
diff --git a/GWW/pw4gww/fft_custom.f90 b/GWW/pw4gww/fft_custom.f90
index aa817ec28..b8e2c8456 100644
--- a/GWW/pw4gww/fft_custom.f90
+++ b/GWW/pw4gww/fft_custom.f90
@@ -664,68 +664,30 @@ SUBROUTINE cft3t( fc, f, n1, n2, n3, nx1, nx2, nx3, sign )
! ... and all planes(i) are set to 1
!
- USE kinds, ONLY : DP
- USE fft_parallel, ONLY : tg_cft3s
- USE fft_scalar, ONLY : cfft3ds, cfft3d ! common scalar fft driver
- USE io_global, ONLY : stdout
+ USE kinds, ONLY : DP
+ USE fft_interfaces,ONLY : fwfft, invfft
!
IMPLICIT NONE
!
TYPE(fft_cus) :: fc
INTEGER, INTENT(IN) :: n1, n2, n3, nx1, nx2, nx3, sign
-
-#if defined (__MPI) && !defined(__USE_3D_FFT)
-!
- COMPLEX(DP), INTENT(INOUT) :: f( fc%dfftt%nnr )
+ COMPLEX(DP), INTENT(INOUT) :: f(:)
+ CHARACTER(LEN=4) :: fft_kind
!
- ! ... call the general purpose parallel driver
- !
-
- call start_clock('cft3t')
- CALL tg_cft3s( f, fc%dfftt, sign )
- call stop_clock('cft3t')
- !
-#else
-
- !
- ! ... serial case
- !
- COMPLEX(DP), INTENT(INOUT) :: f(nx1*nx2*nx3)
- !
- !
-
- !
- ! ... sign = +-1 : complete 3d fft (for rho and for the potential)
- !
- IF ( sign == 1 ) THEN
- !
- CALL cfft3d( f, n1, n2, n3, nx1, nx2, nx3, 1, 1 )
- !
- ELSE IF ( sign == -1 ) THEN
- !
- CALL cfft3d( f, n1, n2, n3, nx1, nx2, nx3, 1, -1 )
- !
- ! ... sign = +-2 : if available, call the "short" fft (for psi's)
- !
- ELSE IF ( sign == 2 ) THEN
- !
- CALL cfft3ds( f, n1, n2, n3, nx1, nx2, nx3, 1, 1, fc%dfftt%isind, fc%dfftt%iplw )
- !
- ELSE IF ( sign == -2 ) THEN
- !
- CALL cfft3ds( f, n1, n2, n3, nx1, nx2, nx3, 1, -1, fc%dfftt%isind, fc%dfftt%iplw )
- !
+ IF ( ABS(sign) == 1 ) THEN
+ fft_kind = 'Rho'
+ ELSE IF ( ABS(sign) == 2 ) THEN
+ fft_kind = 'Wave'
ELSE
- !
- CALL errore( 'cft3t', 'what should i do?', 1 )
- !
+ CALL errore('cft3t','wrong argument "sign"?',1)
END IF
- !
-
- !
-#endif
- !
-
+ CALL start_clock('cft3t')
+ IF ( sign < 0 ) THEN
+ CALL fwfft ( fft_kind, f, fc%dfftt )
+ ELSE
+ CALL invfft( fft_kind, f, fc%dfftt )
+ END IF
+ CALL stop_clock('cft3t')
RETURN
!
END SUBROUTINE cft3t
diff --git a/GWW/pw4gww/make.depend b/GWW/pw4gww/make.depend
index daee1619a..d40dc530a 100644
--- a/GWW/pw4gww/make.depend
+++ b/GWW/pw4gww/make.depend
@@ -117,8 +117,7 @@ fake_conduction.o : ../../UtilXlib/mp.o
fake_conduction.o : ../../upflib/uspp.o
fake_conduction.o : fft_custom.o
fake_conduction.o : mp_wave_parallel.o
-fft_custom.o : ../../FFTXlib/fft_parallel.o
-fft_custom.o : ../../FFTXlib/fft_scalar.o
+fft_custom.o : ../../FFTXlib/fft_interfaces.o
fft_custom.o : ../../FFTXlib/fft_support.o
fft_custom.o : ../../FFTXlib/fft_types.o
fft_custom.o : ../../FFTXlib/stick_base.o