2010-08-26 12:23:46 +08:00
|
|
|
!
|
2015-11-21 18:37:48 +08:00
|
|
|
! Copyright (C) Quantum ESPRESSO group
|
|
|
|
!
|
2010-08-26 12:23:46 +08:00
|
|
|
! 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 .
|
|
|
|
!
|
2015-06-05 01:09:22 +08:00
|
|
|
!=---------------------------------------------------------------------------=!
|
|
|
|
MODULE fft_interfaces
|
2010-08-26 12:23:46 +08:00
|
|
|
|
2015-06-05 01:09:22 +08:00
|
|
|
IMPLICIT NONE
|
|
|
|
PRIVATE
|
|
|
|
|
2015-11-21 18:37:48 +08:00
|
|
|
|
2018-01-09 06:02:08 +08:00
|
|
|
PUBLIC :: fwfft, invfft, fft_interpolate
|
2015-11-21 18:37:48 +08:00
|
|
|
|
2015-06-05 01:09:22 +08:00
|
|
|
|
|
|
|
INTERFACE invfft
|
2015-12-01 04:32:31 +08:00
|
|
|
!! 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)
|
|
|
|
|
2018-01-03 00:45:45 +08:00
|
|
|
SUBROUTINE invfft_y( grid_type, f, dfft, howmany )
|
2016-08-10 05:38:57 +08:00
|
|
|
USE fft_types, ONLY: fft_type_descriptor
|
2016-11-28 05:43:15 +08:00
|
|
|
USE fft_param, ONLY :DP
|
2015-06-05 01:09:22 +08:00
|
|
|
IMPLICIT NONE
|
|
|
|
CHARACTER(LEN=*), INTENT(IN) :: grid_type
|
2016-08-10 05:38:57 +08:00
|
|
|
TYPE(fft_type_descriptor), INTENT(IN) :: dfft
|
2016-08-20 06:55:53 +08:00
|
|
|
INTEGER, OPTIONAL, INTENT(IN) :: howmany
|
2015-06-05 01:09:22 +08:00
|
|
|
COMPLEX(DP) :: f(:)
|
2018-01-03 00:45:45 +08:00
|
|
|
END SUBROUTINE invfft_y
|
2015-06-05 01:09:22 +08:00
|
|
|
!
|
2016-08-06 17:09:42 +08:00
|
|
|
SUBROUTINE invfft_b( f, dfft, ia )
|
|
|
|
USE fft_smallbox_type, ONLY: fft_box_descriptor
|
2016-11-28 05:43:15 +08:00
|
|
|
USE fft_param, ONLY :DP
|
2015-06-05 01:09:22 +08:00
|
|
|
IMPLICIT NONE
|
|
|
|
INTEGER, INTENT(IN) :: ia
|
2016-08-06 17:09:42 +08:00
|
|
|
TYPE(fft_box_descriptor), INTENT(IN) :: dfft
|
2015-06-05 01:09:22 +08:00
|
|
|
COMPLEX(DP) :: f(:)
|
|
|
|
END SUBROUTINE invfft_b
|
|
|
|
END INTERFACE
|
|
|
|
|
|
|
|
INTERFACE fwfft
|
2018-01-03 00:45:45 +08:00
|
|
|
SUBROUTINE fwfft_y( grid_type, f, dfft, howmany )
|
2016-08-10 05:38:57 +08:00
|
|
|
USE fft_types, ONLY: fft_type_descriptor
|
2016-11-28 05:43:15 +08:00
|
|
|
USE fft_param, ONLY :DP
|
2015-06-05 01:09:22 +08:00
|
|
|
IMPLICIT NONE
|
|
|
|
CHARACTER(LEN=*), INTENT(IN) :: grid_type
|
2016-08-10 05:38:57 +08:00
|
|
|
TYPE(fft_type_descriptor), INTENT(IN) :: dfft
|
2016-08-20 06:55:53 +08:00
|
|
|
INTEGER, OPTIONAL, INTENT(IN) :: howmany
|
2015-06-05 01:09:22 +08:00
|
|
|
COMPLEX(DP) :: f(:)
|
2018-01-03 00:45:45 +08:00
|
|
|
END SUBROUTINE fwfft_y
|
2015-06-05 01:09:22 +08:00
|
|
|
END INTERFACE
|
|
|
|
|
2018-01-09 06:02:08 +08:00
|
|
|
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
|
|
|
|
|
2015-06-05 01:09:22 +08:00
|
|
|
END MODULE fft_interfaces
|
|
|
|
!=---------------------------------------------------------------------------=!
|