8 USE iso_c_binding,
ONLY: c_associated, &
15 USE iso_c_binding,
ONLY: &
32#include "../../base/base_uses.f90"
46 MODULE PROCEDURE :: fftw_alloc_complex_1d
47 MODULE PROCEDURE :: fftw_alloc_complex_2d
48 MODULE PROCEDURE :: fftw_alloc_complex_3d
52 MODULE PROCEDURE :: fftw_dealloc_complex_1d
53 MODULE PROCEDURE :: fftw_dealloc_complex_2d
54 MODULE PROCEDURE :: fftw_dealloc_complex_3d
60 SUBROUTINE fftw_alloc_complex_1d(array, n)
61 COMPLEX(C_DOUBLE_COMPLEX),
DIMENSION(:),
CONTIGUOUS,
POINTER,
INTENT(OUT) :: array
62 INTEGER,
DIMENSION(1),
INTENT(IN) :: n
65 TYPE(c_ptr) :: data_ptr
66 data_ptr = fftw_alloc_complex(int(product(n), kind=c_size_t))
67 CALL c_f_pointer(data_ptr, array, n)
70 ALLOCATE (array(n(1)))
73 END SUBROUTINE fftw_alloc_complex_1d
75 SUBROUTINE fftw_dealloc_complex_1d(array)
76 COMPLEX(C_DOUBLE_COMPLEX),
DIMENSION(:),
CONTIGUOUS,
POINTER,
INTENT(INOUT) :: array
79 CALL fftw_free(c_loc(array))
86 END SUBROUTINE fftw_dealloc_complex_1d
88 SUBROUTINE fftw_alloc_complex_2d(array, n)
89 COMPLEX(C_DOUBLE_COMPLEX),
DIMENSION(:, :),
CONTIGUOUS,
POINTER,
INTENT(OUT) :: array
90 INTEGER,
DIMENSION(2),
INTENT(IN) :: n
93 TYPE(c_ptr) :: data_ptr
94 data_ptr = fftw_alloc_complex(int(product(n), kind=c_size_t))
95 CALL c_f_pointer(data_ptr, array, n)
98 ALLOCATE (array(n(1), n(2)))
101 END SUBROUTINE fftw_alloc_complex_2d
103 SUBROUTINE fftw_dealloc_complex_2d(array)
104 COMPLEX(C_DOUBLE_COMPLEX),
DIMENSION(:, :),
CONTIGUOUS,
POINTER,
INTENT(INOUT) :: array
107 CALL fftw_free(c_loc(array))
114 END SUBROUTINE fftw_dealloc_complex_2d
116 SUBROUTINE fftw_alloc_complex_3d(array, n)
117 COMPLEX(C_DOUBLE_COMPLEX),
DIMENSION(:, :, :),
CONTIGUOUS,
POINTER,
INTENT(OUT) :: array
118 INTEGER,
DIMENSION(3),
INTENT(IN) :: n
121 TYPE(c_ptr) :: data_ptr
122 data_ptr = fftw_alloc_complex(int(product(n), kind=c_size_t))
123 CALL c_f_pointer(data_ptr, array, n)
126 ALLOCATE (array(n(1), n(2), n(3)))
129 END SUBROUTINE fftw_alloc_complex_3d
131 SUBROUTINE fftw_dealloc_complex_3d(array)
132 COMPLEX(C_DOUBLE_COMPLEX),
DIMENSION(:, :, :),
CONTIGUOUS,
POINTER,
INTENT(INOUT) :: array
135 CALL fftw_free(c_loc(array))
142 END SUBROUTINE fftw_dealloc_complex_3d
148 SUBROUTINE dummy_routine_to_call_mark_used()
152 mark_used(fftw_redft00)
153 mark_used(fftw_redft01)
154 mark_used(fftw_redft10)
155 mark_used(fftw_redft11)
156 mark_used(fftw_rodft00)
157 mark_used(fftw_rodft01)
158 mark_used(fftw_rodft10)
159 mark_used(fftw_rodft11)
160 mark_used(fftw_forward)
161 mark_used(fftw_backward)
162 mark_used(fftw_measure)
163 mark_used(fftw_destroy_input)
164 mark_used(fftw_unaligned)
165 mark_used(fftw_conserve_memory)
166 mark_used(fftw_exhaustive)
167 mark_used(fftw_preserve_input)
168 mark_used(fftw_patient)
169 mark_used(fftw_estimate)
170 mark_used(fftw_wisdom_only)
171 mark_used(fftw_estimate_patient)
172 mark_used(fftw_believe_pcost)
173 mark_used(fftw_no_dft_r2hc)
174 mark_used(fftw_no_nonthreaded)
175 mark_used(fftw_no_buffering)
176 mark_used(fftw_no_indirect_op)
177 mark_used(fftw_allow_large_generic)
178 mark_used(fftw_no_rank_splits)
179 mark_used(fftw_no_vrank_splits)
180 mark_used(fftw_no_vrecurse)
181 mark_used(fftw_no_simd)
182 mark_used(fftw_no_slow)
183 mark_used(fftw_no_fixed_radix_large_n)
184 mark_used(fftw_allow_pruning)
185 END SUBROUTINE dummy_routine_to_call_mark_used
195 CHARACTER(LEN=*),
INTENT(IN) :: wisdom_file
199 CHARACTER(LEN=1, KIND=C_CHAR),
DIMENSION(:),
ALLOCATABLE :: wisdom_file_name_c
200 INTEGER :: file_name_length, i, iunit, istat
201 INTEGER(KIND=C_INT) :: isuccess
207 OPEN (unit=iunit, file=wisdom_file, status=
"UNKNOWN", form=
"FORMATTED", action=
"WRITE", iostat=istat)
210 file_name_length = len_trim(wisdom_file)
211 ALLOCATE (wisdom_file_name_c(file_name_length + 1))
212 DO i = 1, file_name_length
213 wisdom_file_name_c(i) = wisdom_file(i:i)
215 wisdom_file_name_c(file_name_length + 1) = c_null_char
216 isuccess = fftw_export_wisdom_to_filename(wisdom_file_name_c)
217 IF (isuccess == 0)
THEN
218 CALL cp_warn(__location__,
"Error exporting wisdom to file "//trim(wisdom_file)//
". "// &
219 "Wisdom was not exported.")
226 mark_used(wisdom_file)
238 CHARACTER(LEN=*),
INTENT(IN) :: wisdom_file
241 CHARACTER(LEN=1, KIND=C_CHAR),
DIMENSION(:),
ALLOCATABLE :: wisdom_file_name_c
242 INTEGER :: file_name_length, i, istat, iunit
243 INTEGER(KIND=C_INT) :: isuccess
246 isuccess = fftw_init_threads()
247 IF (isuccess == 0)
THEN
248 cpabort(
"Error initializing FFTW with threads")
256 file_name_length = len_trim(wisdom_file)
258 OPEN (unit=iunit, file=wisdom_file, status=
"OLD", form=
"FORMATTED", position=
"REWIND", &
259 action=
"READ", iostat=istat)
262 file_name_length = len_trim(wisdom_file)
263 ALLOCATE (wisdom_file_name_c(file_name_length + 1))
264 DO i = 1, file_name_length
265 wisdom_file_name_c(i) = wisdom_file(i:i)
267 wisdom_file_name_c(file_name_length + 1) = c_null_char
268 isuccess = fftw_import_wisdom_from_filename(wisdom_file_name_c)
269 IF (isuccess == 0)
THEN
270 CALL cp_warn(__location__,
"Error importing wisdom from file "//trim(wisdom_file)//
". "// &
271 "Maybe the file was created with a different configuration than CP2K is run with. "// &
272 "CP2K continues without importing wisdom.")
277 mark_used(wisdom_file)
298 INTEGER,
DIMENSION(*) :: data
299 INTEGER,
INTENT(INOUT) :: max_length
301 INTEGER :: h, i, j, k, m, maxn, maxn_elevens, &
302 maxn_fives, maxn_sevens, &
303 maxn_thirteens, maxn_threes, &
304 maxn_twos, ndata, nmax, number
305 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: dlocal,
idx
323 DO i = 0, maxn_threes
325 DO k = 0, maxn_sevens
326 DO m = 0, maxn_elevens
327 number = (3**i)*(5**j)*(7**k)*(11**m)
329 IF (number > nmax) cycle
332 IF (number >= maxn) cycle
341 ALLOCATE (dlocal(ndata),
idx(ndata))
347 DO i = 0, maxn_threes
349 DO k = 0, maxn_sevens
350 DO m = 0, maxn_elevens
351 number = (3**i)*(5**j)*(7**k)*(11**m)
353 IF (number > nmax) cycle
356 IF (number >= maxn) cycle
359 dlocal(ndata) = number
366 CALL sortint(dlocal, ndata,
idx)
367 ndata = min(ndata, max_length)
368 DATA(1:ndata) = dlocal(1:ndata)
371 DEALLOCATE (dlocal,
idx)
381 SUBROUTINE sortint(iarr, n, index)
383 INTEGER,
INTENT(IN) :: n
384 INTEGER,
INTENT(INOUT) :: iarr(1:n)
385 INTEGER,
INTENT(OUT) :: index(1:n)
387 INTEGER,
PARAMETER :: m = 7, nstack = 50
389 INTEGER :: a, i, ib, ir, istack(1:nstack), itemp, &
390 j, jstack, k, l, temp
407 IF (iarr(i) <= a)
EXIT
408 iarr(i + 1) = iarr(i)
409 index(i + 1) = index(i)
414 IF (jstack == 0)
RETURN
416 l = istack(jstack - 1)
421 iarr(k) = iarr(l + 1)
424 index(k) = index(l + 1)
426 IF (iarr(l + 1) > iarr(ir))
THEN
428 iarr(l + 1) = iarr(ir)
431 index(l + 1) = index(ir)
434 IF (iarr(l) > iarr(ir))
THEN
442 IF (iarr(l + 1) > iarr(l))
THEN
444 iarr(l + 1) = iarr(l)
447 index(l + 1) = index(l)
456 DO WHILE (iarr(i) < a)
460 DO WHILE (iarr(j) > a)
476 IF (jstack > nstack) cpabort(
"Nstack too small in sortint")
477 IF (ir - i + 1 >= j - l)
THEN
479 istack(jstack - 1) = i
482 istack(jstack) = j - 1
483 istack(jstack - 1) = l
490 END SUBROUTINE sortint
511 SUBROUTINE fftw3_create_guru_plan(plan, fft_rank, dim_n, &
512 dim_istride, dim_ostride, hm_rank, &
513 hm_n, hm_istride, hm_ostride, &
514 zin, zout, fft_direction, fftw_plan_type, &
517 TYPE(c_ptr),
INTENT(INOUT) :: plan
518 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(INOUT) :: zin, zout
519 INTEGER,
INTENT(IN) :: dim_n(2), dim_istride(2), dim_ostride(2), &
520 hm_n(2), hm_istride(2), hm_ostride(2), fft_rank, &
521 fft_direction, fftw_plan_type, hm_rank
522 LOGICAL,
INTENT(OUT) :: valid
525 TYPE(fftw_iodim) :: dim(2), hm(2)
529 dim(i) = fftw_iodim(dim_n(i), dim_istride(i), dim_ostride(i))
530 hm(i) = fftw_iodim(hm_n(i), hm_istride(i), hm_ostride(i))
533 plan = fftw_plan_guru_dft(fft_rank, &
536 fft_direction, fftw_plan_type)
538 valid = c_associated(plan)
544 mark_used(dim_istride)
545 mark_used(dim_ostride)
548 mark_used(hm_istride)
549 mark_used(hm_ostride)
550 mark_used(fft_direction)
551 mark_used(fftw_plan_type)
553 IF (.false.) then; do;
IF (abs(zin(1)) > abs(zout(1))) exit;
END do;
END IF
558 END SUBROUTINE fftw3_create_guru_plan
568 FUNCTION fftw3_is_guru_supported()
RESULT(guru_supported)
569 LOGICAL :: guru_supported
571 INTEGER :: dim_n(2), dim_istride(2), dim_ostride(2), &
572 howmany_n(2), howmany_istride(2), howmany_ostride(2)
573 TYPE(c_ptr) :: test_plan
574 COMPLEX(KIND=dp),
DIMENSION(1, 1, 1) :: zin
584 howmany_istride(1) = 1
585 howmany_istride(2) = 1
586 howmany_ostride(1) = 1
587 howmany_ostride(2) = 1
589 CALL fftw3_create_guru_plan(test_plan, 1, &
590 dim_n, dim_istride, dim_ostride, &
591 2, howmany_n, howmany_istride, howmany_ostride, &
593 fftw_forward, fftw_estimate, guru_supported)
594 IF (guru_supported)
THEN
595 CALL fftw_destroy_plan(test_plan)
599 guru_supported = .false.
602 END FUNCTION fftw3_is_guru_supported
615 SUBROUTINE fftw3_compute_rows_per_th(nrows, nt, rows_per_thread, rows_per_thread_r, &
618 INTEGER,
INTENT(IN) :: nrows, nt
619 INTEGER,
INTENT(OUT) :: rows_per_thread, rows_per_thread_r, &
622 IF (mod(nrows, nt) == 0)
THEN
623 rows_per_thread = nrows/nt
624 rows_per_thread_r = 0
628 rows_per_thread = nrows/nt + 1
629 rows_per_thread_r = nrows/nt
630 th_plana = mod(nrows, nt)
631 th_planb = nt - th_plana
634 END SUBROUTINE fftw3_compute_rows_per_th
655 SUBROUTINE fftw3_create_3d_plans(plan, plan_r, dim_n, dim_istride, dim_ostride, &
656 hm_n, hm_istride, hm_ostride, &
658 fft_direction, fftw_plan_type, rows_per_th, &
661 TYPE(c_ptr),
INTENT(INOUT) :: plan, plan_r
662 INTEGER,
INTENT(INOUT) :: dim_n(2), dim_istride(2), &
663 dim_ostride(2), hm_n(2), &
664 hm_istride(2), hm_ostride(2)
665 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(INOUT) :: input, output
666 INTEGER,
INTENT(INOUT) :: fft_direction, fftw_plan_type
667 INTEGER,
INTENT(IN) :: rows_per_th, rows_per_th_r
673 hm_n(2) = rows_per_th
674 CALL fftw3_create_guru_plan(plan, 1, &
675 dim_n, dim_istride, dim_ostride, &
676 2, hm_n, hm_istride, hm_ostride, &
678 fft_direction, fftw_plan_type, valid)
680 IF (.NOT. valid)
THEN
681 cpabort(
"fftw3_create_plan")
685 hm_n(2) = rows_per_th_r
686 CALL fftw3_create_guru_plan(plan_r, 1, &
687 dim_n, dim_istride, dim_ostride, &
688 2, hm_n, hm_istride, hm_ostride, &
690 fft_direction, fftw_plan_type, valid)
691 IF (.NOT. valid)
THEN
692 cpabort(
"fftw3_create_plan (remaining)")
695 END SUBROUTINE fftw3_create_3d_plans
708 TYPE(fft_plan_type),
INTENT(INOUT) :: plan
709 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(INOUT) :: zin
710 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(INOUT) :: zout
711 INTEGER :: plan_style
713 INTEGER :: n1, n2, n3
715 INTEGER :: rows_per_th
716 INTEGER :: rows_per_th_r
717 INTEGER :: fft_direction
718 INTEGER :: th_plana, th_planb
719 COMPLEX(KIND=dp),
ALLOCATABLE :: tmp(:)
722 INTEGER :: dim_n(2), dim_istride(2), dim_ostride(2), &
723 howmany_n(2), howmany_istride(2), howmany_ostride(2)
725 INTEGER :: fftw_plan_type
726 SELECT CASE (plan_style)
728 fftw_plan_type = fftw_estimate
730 fftw_plan_type = fftw_measure
732 fftw_plan_type = fftw_patient
734 fftw_plan_type = fftw_exhaustive
736 cpabort(
"fftw3_create_plan_3d")
739 IF (plan%fsign == +1)
THEN
740 fft_direction = fftw_forward
742 fft_direction = fftw_backward
756 IF ((.NOT. fftw3_is_guru_supported()) .OR. &
757 (.NOT. plan_style == 1) .OR. &
758 (n1 < 256 .AND. n2 < 256 .AND. n3 < 256 .AND. nt == 1))
THEN
764 plan%separated_plans = .false.
767 IF (plan%fft_in_place)
THEN
768 plan%fftw_plan = fftw_plan_dft_3d(n3, n2, n1, zin, zin, fft_direction, fftw_plan_type)
770 plan%fftw_plan = fftw_plan_dft_3d(n3, n2, n1, zin, zout, fft_direction, fftw_plan_type)
773 ALLOCATE (tmp(n1*n2*n3))
798 CALL fftw3_compute_rows_per_th(n3, nt, rows_per_th, rows_per_th_r, &
805 howmany_n(2) = rows_per_th
806 howmany_istride(1) = n1
807 howmany_istride(2) = n1*n2
808 howmany_ostride(1) = 1
809 howmany_ostride(2) = n1*n2
810 CALL fftw3_create_3d_plans(plan%fftw_plan_nx, plan%fftw_plan_nx_r, &
811 dim_n, dim_istride, dim_ostride, howmany_n, &
812 howmany_istride, howmany_ostride, &
814 fft_direction, fftw_plan_type, rows_per_th, &
818 CALL fftw3_compute_rows_per_th(n3, nt, rows_per_th, rows_per_th_r, &
824 howmany_n(2) = rows_per_th
825 howmany_istride(1) = n2
826 howmany_istride(2) = n1*n2
828 howmany_ostride(1) = n2*n3
829 howmany_ostride(2) = 1
831 CALL fftw3_create_3d_plans(plan%fftw_plan_ny, plan%fftw_plan_ny_r, &
832 dim_n, dim_istride, dim_ostride, &
833 howmany_n, howmany_istride, howmany_ostride, &
835 fft_direction, fftw_plan_type, rows_per_th, &
839 CALL fftw3_compute_rows_per_th(n1, nt, rows_per_th, rows_per_th_r, &
845 howmany_n(2) = rows_per_th
846 howmany_istride(1) = n3
847 howmany_istride(2) = n2*n3
848 howmany_ostride(1) = n3
849 howmany_ostride(2) = n2*n3
851 CALL fftw3_create_3d_plans(plan%fftw_plan_nz, plan%fftw_plan_nz_r, &
852 dim_n, dim_istride, dim_ostride, &
853 howmany_n, howmany_istride, howmany_ostride, &
855 fft_direction, fftw_plan_type, rows_per_th, &
858 plan%separated_plans = .true.
865 mark_used(plan_style)
867 IF (.false.) then; do;
IF (abs(zin(1)) > abs(zout(1))) exit;
END do;
END IF
886 SUBROUTINE fftw3_workshare_execute_dft(plan, plan_r, split_dim, nt, tid, &
887 input, istride, output, ostride)
889 INTEGER,
INTENT(IN) :: split_dim, nt, tid
890 INTEGER,
INTENT(IN) :: istride, ostride
891 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(INOUT) :: input, output
892 TYPE(c_ptr) :: plan, plan_r
894 INTEGER :: i_off, o_off
895 INTEGER :: th_plana, th_planb
896 INTEGER :: rows_per_thread, rows_per_thread_r
898 CALL fftw3_compute_rows_per_th(split_dim, nt, rows_per_thread, &
902 IF (th_planb > 0)
THEN
903 IF (tid < th_plana)
THEN
904 i_off = (tid)*(istride*(rows_per_thread)) + 1
905 o_off = (tid)*(ostride*(rows_per_thread)) + 1
906 IF (rows_per_thread > 0)
THEN
907 CALL fftw_execute_dft(plan, input(i_off), &
910 ELSE IF ((tid - th_plana) < th_planb)
THEN
912 i_off = (th_plana)*istride*(rows_per_thread) + &
913 (tid - th_plana)*istride*(rows_per_thread_r) + 1
914 o_off = (th_plana)*ostride*(rows_per_thread) + &
915 (tid - th_plana)*ostride*(rows_per_thread_r) + 1
917 CALL fftw_execute_dft(plan_r, input(i_off), &
922 i_off = (tid)*(istride*(rows_per_thread)) + 1
923 o_off = (tid)*(ostride*(rows_per_thread)) + 1
925 CALL fftw_execute_dft(plan, input(i_off), &
938 IF (.false.) then; do;
IF (abs(input(1)) > abs(output(1))) exit;
END do;
END IF
941 END SUBROUTINE fftw3_workshare_execute_dft
953 SUBROUTINE fftw33d(plan, scale, zin, zout, stat)
955 TYPE(fft_plan_type),
INTENT(IN) :: plan
956 REAL(kind=dp),
INTENT(IN) :: scale
957 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(INOUT),
TARGET:: zin
958 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(INOUT),
TARGET:: zout
959 INTEGER,
INTENT(OUT) :: stat
961 COMPLEX(KIND=dp),
POINTER :: xout(:)
962 COMPLEX(KIND=dp),
ALLOCATABLE :: tmp1(:)
963 INTEGER :: n1, n2, n3
974 IF (plan%fft_in_place)
THEN
975 xout => zin(:n1*n2*n3)
977 xout => zout(:n1*n2*n3)
981 IF (.NOT. plan%separated_plans)
THEN
982 CALL fftw_execute_dft(plan%fftw_plan, zin, xout)
985 ALLOCATE (tmp1(n1*n2*n3))
992 CALL fftw3_workshare_execute_dft(plan%fftw_plan_nx, plan%fftw_plan_nx_r, &
994 zin, n1*n2, tmp1, n1*n2)
997 CALL fftw3_workshare_execute_dft(plan%fftw_plan_ny, plan%fftw_plan_ny_r, &
999 tmp1, n1*n2, xout, 1)
1001 CALL fftw3_workshare_execute_dft(plan%fftw_plan_nz, plan%fftw_plan_nz_r, &
1003 xout, n2*n3, tmp1, n2*n3)
1010 xout((i - 1) + (j - 1)*n1 + (k - 1)*n1*n2 + 1) = &
1011 tmp1((k - 1) + (j - 1)*n3 + (i - 1)*n3*n2 + 1)
1020 IF (scale /= 1.0_dp)
THEN
1021 CALL zdscal(n1*n2*n3, scale, xout, 1)
1028 IF (.false.) then; do;
IF (abs(zin(1)) > abs(zout(1))) exit;
END do;
END IF
1045 TYPE(fft_plan_type),
INTENT(INOUT) :: plan
1046 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(IN) :: zin
1047 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(IN) :: zout
1048 INTEGER,
INTENT(IN) :: plan_style
1050 INTEGER :: istride, idist, ostride, odist, num_threads, num_rows
1052 INTEGER :: fftw_plan_type
1053 SELECT CASE (plan_style)
1055 fftw_plan_type = fftw_estimate
1057 fftw_plan_type = fftw_measure
1059 fftw_plan_type = fftw_patient
1061 fftw_plan_type = fftw_exhaustive
1063 cpabort(
"fftw3_create_plan_1dm")
1067 plan%separated_plans = .false.
1075 num_rows = plan%m/num_threads
1094 IF (plan%fsign == +1 .AND. plan%trans)
THEN
1097 ELSE IF (plan%fsign == -1 .AND. plan%trans)
THEN
1102 IF (plan%fsign == +1)
THEN
1103 CALL dfftw_plan_many_dft(plan%fftw_plan, 1, plan%n, num_rows, zin, 0, istride, idist, &
1104 zout, 0, ostride, odist, fftw_forward, fftw_plan_type)
1106 CALL dfftw_plan_many_dft(plan%fftw_plan, 1, plan%n, num_rows, zin, 0, istride, idist, &
1107 zout, 0, ostride, odist, fftw_backward, fftw_plan_type)
1123 mark_used(plan_style)
1125 IF (.false.) then; do;
IF (abs(zin(1)) > abs(zout(1))) exit;
END do;
END IF
1136 TYPE(fft_plan_type),
INTENT(INOUT) :: plan
1143 IF (.NOT. plan%separated_plans)
THEN
1144 CALL fftw_destroy_plan(plan%fftw_plan)
1148 CALL fftw_destroy_plan(plan%fftw_plan_nx)
1149 CALL fftw_destroy_plan(plan%fftw_plan_ny)
1150 CALL fftw_destroy_plan(plan%fftw_plan_nz)
1151 CALL fftw_destroy_plan(plan%fftw_plan_nx_r)
1152 CALL fftw_destroy_plan(plan%fftw_plan_ny_r)
1153 CALL fftw_destroy_plan(plan%fftw_plan_nz_r)
1171 TYPE(fft_plan_type),
INTENT(IN) :: plan
1172 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(INOUT), &
1174 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(INOUT), &
1176 REAL(kind=dp),
INTENT(IN) :: scale
1177 INTEGER,
INTENT(OUT) :: stat
1179 INTEGER :: in_offset, my_id, num_rows, out_offset, &
1181 TYPE(c_ptr) :: fftw_plan
1188 IF (plan%m <= 1)
THEN
1190 CALL fftw_execute_dft(plan%fftw_plan, zin(1), zout(1))
1191 IF (scale /= 1.0_dp)
CALL zdscal(plan%n*plan%m, scale, zout, 1)
1204 fftw_plan = plan%fftw_plan
1229 CALL fftw_execute_dft(fftw_plan, zin(in_offset), zout(out_offset))
1234 IF (scale /= 1.0_dp)
CALL zdscal(plan%n*num_rows, scale, zout(scal_offset:scal_offset), 1)
1241 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.
Utility routines to open and close files. Tracking of preconnections.
integer function, public get_unit_number(file_name)
Returns the first logical unit that is not preconnected.
logical function, public file_exists(file_name)
Checks if file exists, considering also the file discovery mechanism.
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)
...
subroutine, public fftw3_destroy_plan(plan)
...
subroutine, public fftw3_create_plan_3d(plan, zin, zout, plan_style)
...
subroutine, public fftw3_get_lengths(data, max_length)
...
subroutine, public fftw33d(plan, scale, zin, zout, stat)
...
subroutine, public fftw31dm(plan, zin, zout, scale, stat)
...
subroutine, public fftw3_do_init(wisdom_file)
...
subroutine, public fftw3_create_plan_1dm(plan, zin, zout, plan_style)
...
Definition of mathematical constants and functions.
complex(kind=dp), parameter, public z_zero