fft_interfaces.f90 2.67 KB
Newer Older
1
!
2 3
! Copyright (C) Quantum ESPRESSO group
!
4 5 6 7 8
! This file is distributed under the terms of the
! GNU General Public License. See the file `License'
! in the root directory of the present distribution,
! or http://www.gnu.org/copyleft/gpl.txt .
!
9 10
!=---------------------------------------------------------------------------=!
MODULE fft_interfaces
11

12 13 14
  IMPLICIT NONE
  PRIVATE

15

16
  PUBLIC :: fwfft, invfft, fft_interpolate
17

18 19
  
  INTERFACE invfft
20 21 22 23
     !! invfft is the interface to both the standard fft **invfft_x**,
     !! and to the "box-grid" version **invfft_b**, used only in CP 
     !! (the latter has an additional argument)
     
24
     SUBROUTINE invfft_y( fft_kind, f, dfft, howmany )
ccavazzoni's avatar
ccavazzoni committed
25
       USE fft_types,  ONLY: fft_type_descriptor
giannozz's avatar
giannozz committed
26
       USE fft_param,  ONLY :DP
27
       IMPLICIT NONE
28
       CHARACTER(LEN=*),  INTENT(IN) :: fft_kind
ccavazzoni's avatar
ccavazzoni committed
29
       TYPE(fft_type_descriptor), INTENT(IN) :: dfft
30
       INTEGER, OPTIONAL, INTENT(IN) :: howmany
31
       COMPLEX(DP) :: f(:)
32
     END SUBROUTINE invfft_y
33
     !
34 35
     SUBROUTINE invfft_b( f, dfft, ia )
       USE fft_smallbox_type,  ONLY: fft_box_descriptor
giannozz's avatar
giannozz committed
36
       USE fft_param,  ONLY :DP
37 38
       IMPLICIT NONE
       INTEGER, INTENT(IN) :: ia
39
       TYPE(fft_box_descriptor), INTENT(IN) :: dfft
40 41 42 43 44
       COMPLEX(DP) :: f(:)
     END SUBROUTINE invfft_b
  END INTERFACE

  INTERFACE fwfft
45
     SUBROUTINE fwfft_y( fft_kind, f, dfft, howmany )
ccavazzoni's avatar
ccavazzoni committed
46
       USE fft_types,  ONLY: fft_type_descriptor
giannozz's avatar
giannozz committed
47
       USE fft_param,  ONLY :DP
48
       IMPLICIT NONE
49
       CHARACTER(LEN=*), INTENT(IN) :: fft_kind
ccavazzoni's avatar
ccavazzoni committed
50
       TYPE(fft_type_descriptor), INTENT(IN) :: dfft
51
       INTEGER, OPTIONAL, INTENT(IN) :: howmany
52
       COMPLEX(DP) :: f(:)
53
     END SUBROUTINE fwfft_y
54 55
  END INTERFACE

56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
  INTERFACE fft_interpolate
     !! fft_interpolate  is the interface to utility that fourier interpolate
     !! real/complex arrays between two grids 
     
     SUBROUTINE fft_interpolate_real( dfft_in, v_in, dfft_out, v_out )
       USE fft_param,  ONLY :DP
       USE fft_types,  ONLY: fft_type_descriptor
       IMPLICIT NONE
       TYPE(fft_type_descriptor), INTENT(IN) :: dfft_in, dfft_out
       REAL(DP), INTENT(IN)  :: v_in(:)
       REAL(DP), INTENT(OUT) :: v_out(:)
     END SUBROUTINE fft_interpolate_real
     !
     SUBROUTINE fft_interpolate_complex( dfft_in, v_in, dfft_out, v_out )
       USE fft_param,  ONLY :DP
       USE fft_types,  ONLY: fft_type_descriptor
       IMPLICIT NONE
       TYPE(fft_type_descriptor), INTENT(IN) :: dfft_in, dfft_out
       COMPLEX(DP), INTENT(IN)  :: v_in(:)
       COMPLEX(DP), INTENT(OUT) :: v_out(:)
     END SUBROUTINE fft_interpolate_complex
  END INTERFACE

79 80
END MODULE fft_interfaces
!=---------------------------------------------------------------------------=!