8 USE iso_c_binding,
ONLY: c_associated, &
15 USE iso_c_binding,
ONLY: &
31#include "../../base/base_uses.f90"
40 INTEGER,
SAVE :: fftw_plan_type = -1
47 MODULE PROCEDURE :: fftw_alloc_complex_1d
48 MODULE PROCEDURE :: fftw_alloc_complex_2d
49 MODULE PROCEDURE :: fftw_alloc_complex_3d
53 MODULE PROCEDURE :: fftw_dealloc_complex_1d
54 MODULE PROCEDURE :: fftw_dealloc_complex_2d
55 MODULE PROCEDURE :: fftw_dealloc_complex_3d
61 SUBROUTINE fftw_alloc_complex_1d(array, n)
62 COMPLEX(C_DOUBLE_COMPLEX),
DIMENSION(:),
CONTIGUOUS,
POINTER,
INTENT(OUT) :: array
63 INTEGER,
DIMENSION(1),
INTENT(IN) :: n
66 TYPE(c_ptr) :: data_ptr
67 data_ptr = fftw_alloc_complex(int(product(n), kind=c_size_t))
68 CALL c_f_pointer(data_ptr, array, n)
71 ALLOCATE (array(n(1)))
74 END SUBROUTINE fftw_alloc_complex_1d
76 SUBROUTINE fftw_dealloc_complex_1d(array)
77 COMPLEX(C_DOUBLE_COMPLEX),
DIMENSION(:),
CONTIGUOUS,
POINTER,
INTENT(INOUT) :: array
80 CALL fftw_free(c_loc(array))
87 END SUBROUTINE fftw_dealloc_complex_1d
89 SUBROUTINE fftw_alloc_complex_2d(array, n)
90 COMPLEX(C_DOUBLE_COMPLEX),
DIMENSION(:, :),
CONTIGUOUS,
POINTER,
INTENT(OUT) :: array
91 INTEGER,
DIMENSION(2),
INTENT(IN) :: n
94 TYPE(c_ptr) :: data_ptr
95 data_ptr = fftw_alloc_complex(int(product(n), kind=c_size_t))
96 CALL c_f_pointer(data_ptr, array, n)
99 ALLOCATE (array(n(1), n(2)))
102 END SUBROUTINE fftw_alloc_complex_2d
104 SUBROUTINE fftw_dealloc_complex_2d(array)
105 COMPLEX(C_DOUBLE_COMPLEX),
DIMENSION(:, :),
CONTIGUOUS,
POINTER,
INTENT(INOUT) :: array
108 CALL fftw_free(c_loc(array))
115 END SUBROUTINE fftw_dealloc_complex_2d
117 SUBROUTINE fftw_alloc_complex_3d(array, n)
118 COMPLEX(C_DOUBLE_COMPLEX),
DIMENSION(:, :, :),
CONTIGUOUS,
POINTER,
INTENT(OUT) :: array
119 INTEGER,
DIMENSION(3),
INTENT(IN) :: n
122 TYPE(c_ptr) :: data_ptr
123 data_ptr = fftw_alloc_complex(int(product(n), kind=c_size_t))
124 CALL c_f_pointer(data_ptr, array, n)
127 ALLOCATE (array(n(1), n(2), n(3)))
130 END SUBROUTINE fftw_alloc_complex_3d
132 SUBROUTINE fftw_dealloc_complex_3d(array)
133 COMPLEX(C_DOUBLE_COMPLEX),
DIMENSION(:, :, :),
CONTIGUOUS,
POINTER,
INTENT(INOUT) :: array
136 CALL fftw_free(c_loc(array))
143 END SUBROUTINE fftw_dealloc_complex_3d
149 SUBROUTINE dummy_routine_to_call_mark_used()
153 mark_used(fftw_redft00)
154 mark_used(fftw_redft01)
155 mark_used(fftw_redft10)
156 mark_used(fftw_redft11)
157 mark_used(fftw_rodft00)
158 mark_used(fftw_rodft01)
159 mark_used(fftw_rodft10)
160 mark_used(fftw_rodft11)
161 mark_used(fftw_forward)
162 mark_used(fftw_backward)
163 mark_used(fftw_measure)
164 mark_used(fftw_destroy_input)
165 mark_used(fftw_unaligned)
166 mark_used(fftw_conserve_memory)
167 mark_used(fftw_exhaustive)
168 mark_used(fftw_preserve_input)
169 mark_used(fftw_patient)
170 mark_used(fftw_estimate)
171 mark_used(fftw_wisdom_only)
172 mark_used(fftw_estimate_patient)
173 mark_used(fftw_believe_pcost)
174 mark_used(fftw_no_dft_r2hc)
175 mark_used(fftw_no_nonthreaded)
176 mark_used(fftw_no_buffering)
177 mark_used(fftw_no_indirect_op)
178 mark_used(fftw_allow_large_generic)
179 mark_used(fftw_no_rank_splits)
180 mark_used(fftw_no_vrank_splits)
181 mark_used(fftw_no_vrecurse)
182 mark_used(fftw_no_simd)
183 mark_used(fftw_no_slow)
184 mark_used(fftw_no_fixed_radix_large_n)
185 mark_used(fftw_allow_pruning)
186 END SUBROUTINE dummy_routine_to_call_mark_used
199 CHARACTER(LEN=*),
INTENT(IN) :: wisdom_file
201 LOGICAL,
INTENT(IN),
OPTIONAL :: export_wisdom
204 CHARACTER(LEN=1, KIND=C_CHAR),
DIMENSION(:),
ALLOCATABLE :: wisdom_file_name_c
205 INTEGER :: file_name_length, i
206 INTEGER(KIND=C_INT) :: isuccess
207 LOGICAL :: my_export_wisdom
209 my_export_wisdom = .false.
210 IF (
PRESENT(export_wisdom)) my_export_wisdom = export_wisdom
214 IF (ionode .AND. my_export_wisdom)
THEN
215 file_name_length = len_trim(wisdom_file)
216 ALLOCATE (wisdom_file_name_c(file_name_length + 1))
217 DO i = 1, file_name_length
218 wisdom_file_name_c(i) = wisdom_file(i:i)
220 wisdom_file_name_c(file_name_length + 1) = c_null_char
221 isuccess = fftw_export_wisdom_to_filename(wisdom_file_name_c)
222 IF (isuccess == 0)
THEN
223 CALL cp_warn(__location__,
"Error exporting wisdom to file "//trim(wisdom_file)//
". "// &
224 "Wisdom was not exported.")
230 mark_used(wisdom_file)
232 mark_used(export_wisdom)
243 CHARACTER(LEN=*),
INTENT(IN) :: wisdom_file
244 INTEGER,
INTENT(IN) :: plan_style
247 CHARACTER(LEN=1, KIND=C_CHAR),
DIMENSION(:),
ALLOCATABLE :: wisdom_file_name_c
248 INTEGER :: file_name_length, i
249 INTEGER(KIND=C_INT) :: isuccess
250 LOGICAL :: file_exists
252 isuccess = fftw_init_threads()
253 IF (isuccess == 0)
THEN
254 cpabort(
"Error initializing FFTW with threads")
259 INQUIRE (file=wisdom_file, exist=file_exists)
260 IF (file_exists)
THEN
261 file_name_length = len_trim(wisdom_file)
262 ALLOCATE (wisdom_file_name_c(file_name_length + 1))
263 DO i = 1, file_name_length
264 wisdom_file_name_c(i) = wisdom_file(i:i)
266 wisdom_file_name_c(file_name_length + 1) = c_null_char
267 isuccess = fftw_import_wisdom_from_filename(wisdom_file_name_c)
268 IF (isuccess == 0)
THEN
269 CALL cp_warn(__location__,
"Error importing wisdom from file "//trim(wisdom_file)//
". "// &
270 "Maybe the file was created with a different configuration than CP2K is "// &
271 "run with. CP2K continues without importing wisdom.")
275 SELECT CASE (plan_style)
277 fftw_plan_type = fftw_estimate
279 fftw_plan_type = fftw_measure
281 fftw_plan_type = fftw_patient
283 fftw_plan_type = fftw_exhaustive
285 cpabort(
"Invalid FFTW_PLAN_TYPE")
288 mark_used(wisdom_file)
289 mark_used(plan_style)
310 INTEGER,
DIMENSION(*) :: data
311 INTEGER,
INTENT(INOUT) :: max_length
313 INTEGER :: h, i, j, k, m, maxn, maxn_elevens, &
314 maxn_fives, maxn_sevens, &
315 maxn_thirteens, maxn_threes, &
316 maxn_twos, ndata, nmax, number
317 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: dlocal,
idx
335 DO i = 0, maxn_threes
337 DO k = 0, maxn_sevens
338 DO m = 0, maxn_elevens
339 number = (3**i)*(5**j)*(7**k)*(11**m)
341 IF (number > nmax) cycle
344 IF (number >= maxn) cycle
353 ALLOCATE (dlocal(ndata),
idx(ndata))
359 DO i = 0, maxn_threes
361 DO k = 0, maxn_sevens
362 DO m = 0, maxn_elevens
363 number = (3**i)*(5**j)*(7**k)*(11**m)
365 IF (number > nmax) cycle
368 IF (number >= maxn) cycle
371 dlocal(ndata) = number
378 CALL sortint(dlocal, ndata,
idx)
379 ndata = min(ndata, max_length)
380 DATA(1:ndata) = dlocal(1:ndata)
383 DEALLOCATE (dlocal,
idx)
393 SUBROUTINE sortint(iarr, n, index)
395 INTEGER,
INTENT(IN) :: n
396 INTEGER,
INTENT(INOUT) :: iarr(1:n)
397 INTEGER,
INTENT(OUT) :: index(1:n)
399 INTEGER,
PARAMETER :: m = 7, nstack = 50
401 INTEGER :: a, i, ib, ir, istack(1:nstack), itemp, &
402 j, jstack, k, l, temp
419 IF (iarr(i) <= a)
EXIT
420 iarr(i + 1) = iarr(i)
421 index(i + 1) = index(i)
426 IF (jstack == 0)
RETURN
428 l = istack(jstack - 1)
433 iarr(k) = iarr(l + 1)
436 index(k) = index(l + 1)
438 IF (iarr(l + 1) > iarr(ir))
THEN
440 iarr(l + 1) = iarr(ir)
443 index(l + 1) = index(ir)
446 IF (iarr(l) > iarr(ir))
THEN
454 IF (iarr(l + 1) > iarr(l))
THEN
456 iarr(l + 1) = iarr(l)
459 index(l + 1) = index(l)
468 DO WHILE (iarr(i) < a)
472 DO WHILE (iarr(j) > a)
488 IF (jstack > nstack) cpabort(
"Nstack too small in sortint")
489 IF (ir - i + 1 >= j - l)
THEN
491 istack(jstack - 1) = i
494 istack(jstack) = j - 1
495 istack(jstack - 1) = l
502 END SUBROUTINE sortint
523 SUBROUTINE fftw3_create_guru_plan(plan, fft_rank, dim_n, &
524 dim_istride, dim_ostride, hm_rank, &
525 hm_n, hm_istride, hm_ostride, &
526 zin, zout, fft_direction, fftw_plan_type, &
529 TYPE(c_ptr),
INTENT(INOUT) :: plan
530 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(INOUT) :: zin, zout
531 INTEGER,
INTENT(IN) :: dim_n(2), dim_istride(2), dim_ostride(2), &
532 hm_n(2), hm_istride(2), hm_ostride(2), fft_rank, &
533 fft_direction, fftw_plan_type, hm_rank
534 LOGICAL,
INTENT(OUT) :: valid
537 TYPE(fftw_iodim) :: dim(2), hm(2)
541 dim(i) = fftw_iodim(dim_n(i), dim_istride(i), dim_ostride(i))
542 hm(i) = fftw_iodim(hm_n(i), hm_istride(i), hm_ostride(i))
545 plan = fftw_plan_guru_dft(fft_rank, &
548 fft_direction, fftw_plan_type)
550 valid = c_associated(plan)
556 mark_used(dim_istride)
557 mark_used(dim_ostride)
560 mark_used(hm_istride)
561 mark_used(hm_ostride)
562 mark_used(fft_direction)
563 mark_used(fftw_plan_type)
565 IF (.false.) then; do;
IF (abs(zin(1)) > abs(zout(1))) exit;
END do;
END IF
570 END SUBROUTINE fftw3_create_guru_plan
580 FUNCTION fftw3_is_guru_supported()
RESULT(guru_supported)
581 LOGICAL :: guru_supported
583 INTEGER :: dim_n(2), dim_istride(2), dim_ostride(2), &
584 howmany_n(2), howmany_istride(2), howmany_ostride(2)
585 TYPE(c_ptr) :: test_plan
586 COMPLEX(KIND=dp),
DIMENSION(1, 1, 1) :: zin
596 howmany_istride(1) = 1
597 howmany_istride(2) = 1
598 howmany_ostride(1) = 1
599 howmany_ostride(2) = 1
601 CALL fftw3_create_guru_plan(test_plan, 1, &
602 dim_n, dim_istride, dim_ostride, &
603 2, howmany_n, howmany_istride, howmany_ostride, &
605 fftw_forward, fftw_estimate, guru_supported)
606 IF (guru_supported)
THEN
607 CALL fftw_destroy_plan(test_plan)
611 guru_supported = .false.
614 END FUNCTION fftw3_is_guru_supported
627 SUBROUTINE fftw3_compute_rows_per_th(nrows, nt, rows_per_thread, rows_per_thread_r, &
630 INTEGER,
INTENT(IN) :: nrows, nt
631 INTEGER,
INTENT(OUT) :: rows_per_thread, rows_per_thread_r, &
634 IF (mod(nrows, nt) == 0)
THEN
635 rows_per_thread = nrows/nt
636 rows_per_thread_r = 0
640 rows_per_thread = nrows/nt + 1
641 rows_per_thread_r = nrows/nt
642 th_plana = mod(nrows, nt)
643 th_planb = nt - th_plana
646 END SUBROUTINE fftw3_compute_rows_per_th
667 SUBROUTINE fftw3_create_3d_plans(plan, plan_r, dim_n, dim_istride, dim_ostride, &
668 hm_n, hm_istride, hm_ostride, &
670 fft_direction, fftw_plan_type, rows_per_th, &
673 TYPE(c_ptr),
INTENT(INOUT) :: plan, plan_r
674 INTEGER,
INTENT(INOUT) :: dim_n(2), dim_istride(2), &
675 dim_ostride(2), hm_n(2), &
676 hm_istride(2), hm_ostride(2)
677 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(INOUT) :: input, output
678 INTEGER,
INTENT(INOUT) :: fft_direction, fftw_plan_type
679 INTEGER,
INTENT(IN) :: rows_per_th, rows_per_th_r
685 hm_n(2) = rows_per_th
686 CALL fftw3_create_guru_plan(plan, 1, &
687 dim_n, dim_istride, dim_ostride, &
688 2, hm_n, hm_istride, hm_ostride, &
690 fft_direction, fftw_plan_type, valid)
692 IF (.NOT. valid)
THEN
693 cpabort(
"fftw3_create_plan")
697 hm_n(2) = rows_per_th_r
698 CALL fftw3_create_guru_plan(plan_r, 1, &
699 dim_n, dim_istride, dim_ostride, &
700 2, hm_n, hm_istride, hm_ostride, &
702 fft_direction, fftw_plan_type, valid)
703 IF (.NOT. valid)
THEN
704 cpabort(
"fftw3_create_plan (remaining)")
707 END SUBROUTINE fftw3_create_3d_plans
719 TYPE(fft_plan_type),
INTENT(INOUT) :: plan
720 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(INOUT) :: zin
721 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(INOUT) :: zout
723 INTEGER :: n1, n2, n3
725 INTEGER :: rows_per_th
726 INTEGER :: rows_per_th_r
727 INTEGER :: fft_direction
728 INTEGER :: th_plana, th_planb
729 COMPLEX(KIND=dp),
ALLOCATABLE :: tmp(:)
732 INTEGER :: dim_n(2), dim_istride(2), dim_ostride(2), &
733 howmany_n(2), howmany_istride(2), howmany_ostride(2)
735 IF (plan%fsign == +1)
THEN
736 fft_direction = fftw_forward
738 fft_direction = fftw_backward
752 IF ((.NOT. fftw3_is_guru_supported()) .OR. &
753 (.NOT. fftw_plan_type == fftw_estimate) .OR. &
754 (n1 < 256 .AND. n2 < 256 .AND. n3 < 256 .AND. nt == 1))
THEN
760 plan%separated_plans = .false.
763 IF (plan%fft_in_place)
THEN
764 plan%fftw_plan = fftw_plan_dft_3d(n3, n2, n1, zin, zin, fft_direction, fftw_plan_type)
766 plan%fftw_plan = fftw_plan_dft_3d(n3, n2, n1, zin, zout, fft_direction, fftw_plan_type)
769 ALLOCATE (tmp(n1*n2*n3))
794 CALL fftw3_compute_rows_per_th(n3, nt, rows_per_th, rows_per_th_r, &
801 howmany_n(2) = rows_per_th
802 howmany_istride(1) = n1
803 howmany_istride(2) = n1*n2
804 howmany_ostride(1) = 1
805 howmany_ostride(2) = n1*n2
806 CALL fftw3_create_3d_plans(plan%fftw_plan_nx, plan%fftw_plan_nx_r, &
807 dim_n, dim_istride, dim_ostride, howmany_n, &
808 howmany_istride, howmany_ostride, &
810 fft_direction, fftw_plan_type, rows_per_th, &
814 CALL fftw3_compute_rows_per_th(n3, nt, rows_per_th, rows_per_th_r, &
820 howmany_n(2) = rows_per_th
821 howmany_istride(1) = n2
822 howmany_istride(2) = n1*n2
824 howmany_ostride(1) = n2*n3
825 howmany_ostride(2) = 1
827 CALL fftw3_create_3d_plans(plan%fftw_plan_ny, plan%fftw_plan_ny_r, &
828 dim_n, dim_istride, dim_ostride, &
829 howmany_n, howmany_istride, howmany_ostride, &
831 fft_direction, fftw_plan_type, rows_per_th, &
835 CALL fftw3_compute_rows_per_th(n1, nt, rows_per_th, rows_per_th_r, &
841 howmany_n(2) = rows_per_th
842 howmany_istride(1) = n3
843 howmany_istride(2) = n2*n3
844 howmany_ostride(1) = n3
845 howmany_ostride(2) = n2*n3
847 CALL fftw3_create_3d_plans(plan%fftw_plan_nz, plan%fftw_plan_nz_r, &
848 dim_n, dim_istride, dim_ostride, &
849 howmany_n, howmany_istride, howmany_ostride, &
851 fft_direction, fftw_plan_type, rows_per_th, &
854 plan%separated_plans = .true.
862 IF (.false.) then; do;
IF (abs(zin(1)) > abs(zout(1))) exit;
END do;
END IF
881 SUBROUTINE fftw3_workshare_execute_dft(plan, plan_r, split_dim, nt, tid, &
882 input, istride, output, ostride)
884 INTEGER,
INTENT(IN) :: split_dim, nt, tid
885 INTEGER,
INTENT(IN) :: istride, ostride
886 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(INOUT) :: input, output
887 TYPE(c_ptr) :: plan, plan_r
889 INTEGER :: i_off, o_off
890 INTEGER :: th_plana, th_planb
891 INTEGER :: rows_per_thread, rows_per_thread_r
893 CALL fftw3_compute_rows_per_th(split_dim, nt, rows_per_thread, &
897 IF (th_planb > 0)
THEN
898 IF (tid < th_plana)
THEN
899 i_off = (tid)*(istride*(rows_per_thread)) + 1
900 o_off = (tid)*(ostride*(rows_per_thread)) + 1
901 IF (rows_per_thread > 0)
THEN
902 CALL fftw_execute_dft(plan, input(i_off), &
905 ELSE IF ((tid - th_plana) < th_planb)
THEN
907 i_off = (th_plana)*istride*(rows_per_thread) + &
908 (tid - th_plana)*istride*(rows_per_thread_r) + 1
909 o_off = (th_plana)*ostride*(rows_per_thread) + &
910 (tid - th_plana)*ostride*(rows_per_thread_r) + 1
912 CALL fftw_execute_dft(plan_r, input(i_off), &
917 i_off = (tid)*(istride*(rows_per_thread)) + 1
918 o_off = (tid)*(ostride*(rows_per_thread)) + 1
920 CALL fftw_execute_dft(plan, input(i_off), &
933 IF (.false.) then; do;
IF (abs(input(1)) > abs(output(1))) exit;
END do;
END IF
936 END SUBROUTINE fftw3_workshare_execute_dft
948 SUBROUTINE fftw33d(plan, scale, zin, zout, stat)
950 TYPE(fft_plan_type),
INTENT(IN) :: plan
951 REAL(kind=dp),
INTENT(IN) :: scale
952 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(INOUT),
TARGET:: zin
953 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(INOUT),
TARGET:: zout
954 INTEGER,
INTENT(OUT) :: stat
956 COMPLEX(KIND=dp),
POINTER :: xout(:)
957 COMPLEX(KIND=dp),
ALLOCATABLE :: tmp1(:)
958 INTEGER :: n1, n2, n3
969 IF (plan%fft_in_place)
THEN
970 xout => zin(:n1*n2*n3)
972 xout => zout(:n1*n2*n3)
976 IF (.NOT. plan%separated_plans)
THEN
977 CALL fftw_execute_dft(plan%fftw_plan, zin, xout)
980 ALLOCATE (tmp1(n1*n2*n3))
987 CALL fftw3_workshare_execute_dft(plan%fftw_plan_nx, plan%fftw_plan_nx_r, &
989 zin, n1*n2, tmp1, n1*n2)
992 CALL fftw3_workshare_execute_dft(plan%fftw_plan_ny, plan%fftw_plan_ny_r, &
994 tmp1, n1*n2, xout, 1)
996 CALL fftw3_workshare_execute_dft(plan%fftw_plan_nz, plan%fftw_plan_nz_r, &
998 xout, n2*n3, tmp1, n2*n3)
1005 xout((i - 1) + (j - 1)*n1 + (k - 1)*n1*n2 + 1) = &
1006 tmp1((k - 1) + (j - 1)*n3 + (i - 1)*n3*n2 + 1)
1015 IF (scale /= 1.0_dp)
THEN
1016 CALL zdscal(n1*n2*n3, scale, xout, 1)
1023 IF (.false.) then; do;
IF (abs(zin(1)) > abs(zout(1))) exit;
END do;
END IF
1039 TYPE(fft_plan_type),
INTENT(INOUT) :: plan
1040 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(IN) :: zin
1041 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(IN) :: zout
1043 INTEGER :: istride, idist, ostride, odist, num_threads, num_rows
1046 plan%separated_plans = .false.
1054 num_rows = plan%m/num_threads
1072 odist = plan%ldx_out
1073 IF (plan%trans_in)
THEN
1074 istride = plan%ldx_in
1077 IF (plan%trans_out)
THEN
1078 ostride = plan%ldx_out
1082 IF (plan%fsign == +1)
THEN
1083 CALL dfftw_plan_many_dft(plan%fftw_plan, 1, plan%n, num_rows, zin, 0, istride, idist, &
1084 zout, 0, ostride, odist, fftw_forward, fftw_plan_type)
1086 CALL dfftw_plan_many_dft(plan%fftw_plan, 1, plan%n, num_rows, zin, 0, istride, idist, &
1087 zout, 0, ostride, odist, fftw_backward, fftw_plan_type)
1104 IF (.false.) then; do;
IF (abs(zin(1)) > abs(zout(1))) exit;
END do;
END IF
1115 TYPE(fft_plan_type),
INTENT(INOUT) :: plan
1122 IF (.NOT. plan%separated_plans)
THEN
1123 CALL fftw_destroy_plan(plan%fftw_plan)
1127 CALL fftw_destroy_plan(plan%fftw_plan_nx)
1128 CALL fftw_destroy_plan(plan%fftw_plan_ny)
1129 CALL fftw_destroy_plan(plan%fftw_plan_nz)
1130 CALL fftw_destroy_plan(plan%fftw_plan_nx_r)
1131 CALL fftw_destroy_plan(plan%fftw_plan_ny_r)
1132 CALL fftw_destroy_plan(plan%fftw_plan_nz_r)
1150 TYPE(fft_plan_type),
INTENT(IN) :: plan
1151 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(INOUT), &
1153 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(INOUT), &
1155 REAL(kind=dp),
INTENT(IN) :: scale
1156 INTEGER,
INTENT(OUT) :: stat
1158 INTEGER :: in_offset, my_id, num_rows, out_offset, &
1160 TYPE(c_ptr) :: fftw_plan
1167 IF (plan%m <= 1)
THEN
1169 CALL fftw_execute_dft(plan%fftw_plan, zin(1), zout(1))
1170 IF (scale /= 1.0_dp)
CALL zdscal(plan%n*plan%m, scale, zout, 1)
1183 fftw_plan = plan%fftw_plan
1209 CALL fftw_execute_dft(fftw_plan, zin(in_offset), zout(out_offset))
1214 IF (scale /= 1.0_dp)
CALL zdscal(plan%n*num_rows, scale, zout(scal_offset:scal_offset), 1)
1221 IF (.false.) then; do;
IF (abs(zin(1)) > abs(zout(1))) exit;
END do;
END IF
static GRID_HOST_DEVICE int idx(const orbital a)
Return coset index of given orbital angular momentum.
Defines the basic variable types.
integer, parameter, public dp
Type to store data about a (1D or 3D) FFT, including FFTW plan.
subroutine, public fftw3_do_cleanup(wisdom_file, ionode, export_wisdom)
...
subroutine, public fftw3_destroy_plan(plan)
...
subroutine, public fftw3_get_lengths(data, max_length)
...
subroutine, public fftw3_create_plan_1d(plan, zin, zout)
...
subroutine, public fftw3_create_plan_3d(plan, zin, zout)
...
subroutine, public fftw33d(plan, scale, zin, zout, stat)
...
subroutine, public fftw3_do_init(wisdom_file, plan_style)
...
subroutine, public fftw31dm(plan, zin, zout, scale, stat)
...
Definition of mathematical constants and functions.
complex(kind=dp), parameter, public z_zero