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)
218 CALL cp_warn(__location__,
"Error exporting wisdom to file "//trim(wisdom_file)//
". "// &
219 "Wisdom was not exported.")
225 mark_used(wisdom_file)
237 CHARACTER(LEN=*),
INTENT(IN) :: wisdom_file
240 CHARACTER(LEN=1, KIND=C_CHAR),
DIMENSION(:),
ALLOCATABLE :: wisdom_file_name_c
241 INTEGER :: file_name_length, i, istat, iunit
242 INTEGER(KIND=C_INT) :: isuccess
245 isuccess = fftw_init_threads()
247 cpabort(
"Error initializing FFTW with threads")
254 file_name_length = len_trim(wisdom_file)
256 OPEN (unit=iunit, file=wisdom_file, status=
"OLD", form=
"FORMATTED", position=
"REWIND", &
257 action=
"READ", iostat=istat)
260 file_name_length = len_trim(wisdom_file)
261 ALLOCATE (wisdom_file_name_c(file_name_length + 1))
262 DO i = 1, file_name_length
263 wisdom_file_name_c(i) = wisdom_file(i:i)
265 wisdom_file_name_c(file_name_length + 1) = c_null_char
266 isuccess = fftw_import_wisdom_from_filename(wisdom_file_name_c)
268 CALL cp_warn(__location__,
"Error importing wisdom from file "//trim(wisdom_file)//
". "// &
269 "Maybe the file was created with a different configuration than CP2K is run with. "// &
270 "CP2K continues without importing wisdom.")
274 mark_used(wisdom_file)
295 INTEGER,
DIMENSION(*) :: data
296 INTEGER,
INTENT(INOUT) :: max_length
298 INTEGER :: h, i, j, k, m, maxn, maxn_elevens, &
299 maxn_fives, maxn_sevens, &
300 maxn_thirteens, maxn_threes, &
301 maxn_twos, ndata, nmax, number
302 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: dlocal,
idx
320 DO i = 0, maxn_threes
322 DO k = 0, maxn_sevens
323 DO m = 0, maxn_elevens
324 number = (3**i)*(5**j)*(7**k)*(11**m)
326 IF (number > nmax) cycle
329 IF (number >= maxn) cycle
338 ALLOCATE (dlocal(ndata),
idx(ndata))
344 DO i = 0, maxn_threes
346 DO k = 0, maxn_sevens
347 DO m = 0, maxn_elevens
348 number = (3**i)*(5**j)*(7**k)*(11**m)
350 IF (number > nmax) cycle
353 IF (number >= maxn) cycle
356 dlocal(ndata) = number
363 CALL sortint(dlocal, ndata,
idx)
364 ndata = min(ndata, max_length)
365 DATA(1:ndata) = dlocal(1:ndata)
368 DEALLOCATE (dlocal,
idx)
378 SUBROUTINE sortint(iarr, n, index)
380 INTEGER,
INTENT(IN) :: n
381 INTEGER,
INTENT(INOUT) :: iarr(1:n)
382 INTEGER,
INTENT(OUT) :: index(1:n)
384 INTEGER,
PARAMETER :: m = 7, nstack = 50
386 INTEGER :: a, i, ib, ir, istack(1:nstack), itemp, &
387 j, jstack, k, l, temp
404 IF (iarr(i) <= a)
EXIT
405 iarr(i + 1) = iarr(i)
406 index(i + 1) = index(i)
411 IF (jstack == 0)
RETURN
413 l = istack(jstack - 1)
418 iarr(k) = iarr(l + 1)
421 index(k) = index(l + 1)
423 IF (iarr(l + 1) > iarr(ir))
THEN
425 iarr(l + 1) = iarr(ir)
428 index(l + 1) = index(ir)
431 IF (iarr(l) > iarr(ir))
THEN
439 IF (iarr(l + 1) > iarr(l))
THEN
441 iarr(l + 1) = iarr(l)
444 index(l + 1) = index(l)
453 DO WHILE (iarr(i) < a)
457 DO WHILE (iarr(j) > a)
473 IF (jstack > nstack) cpabort(
"Nstack too small in sortint")
474 IF (ir - i + 1 >= j - l)
THEN
476 istack(jstack - 1) = i
479 istack(jstack) = j - 1
480 istack(jstack - 1) = l
487 END SUBROUTINE sortint
508 SUBROUTINE fftw3_create_guru_plan(plan, fft_rank, dim_n, &
509 dim_istride, dim_ostride, hm_rank, &
510 hm_n, hm_istride, hm_ostride, &
511 zin, zout, fft_direction, fftw_plan_type, &
516 TYPE(c_ptr),
INTENT(INOUT) :: plan
517 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(INOUT) :: zin, zout
518 INTEGER,
INTENT(IN) :: dim_n(2), dim_istride(2), dim_ostride(2), &
519 hm_n(2), hm_istride(2), hm_ostride(2), fft_rank, &
520 fft_direction, fftw_plan_type, hm_rank
521 LOGICAL,
INTENT(OUT) :: valid
524 TYPE(fftw_iodim) :: dim(2), hm(2)
528 dim(i) = fftw_iodim(dim_n(i), dim_istride(i), dim_ostride(i))
529 hm(i) = fftw_iodim(hm_n(i), hm_istride(i), hm_ostride(i))
532 plan = fftw_plan_guru_dft(fft_rank, &
535 fft_direction, fftw_plan_type)
537 valid = c_associated(plan)
543 mark_used(dim_istride)
544 mark_used(dim_ostride)
547 mark_used(hm_istride)
548 mark_used(hm_ostride)
549 mark_used(fft_direction)
550 mark_used(fftw_plan_type)
552 IF (.false.) then; do;
IF (abs(zin(1)) > abs(zout(1))) exit;
END do;
END IF
557 END SUBROUTINE fftw3_create_guru_plan
567 FUNCTION fftw3_is_guru_supported()
RESULT(guru_supported)
571 LOGICAL :: guru_supported
573 INTEGER :: dim_n(2), dim_istride(2), dim_ostride(2), &
574 howmany_n(2), howmany_istride(2), howmany_ostride(2)
575 TYPE(c_ptr) :: test_plan
576 COMPLEX(KIND=dp),
DIMENSION(1, 1, 1) :: zin
586 howmany_istride(1) = 1
587 howmany_istride(2) = 1
588 howmany_ostride(1) = 1
589 howmany_ostride(2) = 1
591 CALL fftw3_create_guru_plan(test_plan, 1, &
592 dim_n, dim_istride, dim_ostride, &
593 2, howmany_n, howmany_istride, howmany_ostride, &
595 fftw_forward, fftw_estimate, guru_supported)
596 IF (guru_supported)
THEN
597 CALL fftw_destroy_plan(test_plan)
601 guru_supported = .false.
604 END FUNCTION fftw3_is_guru_supported
617 SUBROUTINE fftw3_compute_rows_per_th(nrows, nt, rows_per_thread, rows_per_thread_r, &
620 INTEGER,
INTENT(IN) :: nrows, nt
621 INTEGER,
INTENT(OUT) :: rows_per_thread, rows_per_thread_r, &
624 IF (mod(nrows, nt) == 0)
THEN
625 rows_per_thread = nrows/nt
626 rows_per_thread_r = 0
630 rows_per_thread = nrows/nt + 1
631 rows_per_thread_r = nrows/nt
632 th_plana = mod(nrows, nt)
633 th_planb = nt - th_plana
636 END SUBROUTINE fftw3_compute_rows_per_th
657 SUBROUTINE fftw3_create_3d_plans(plan, plan_r, dim_n, dim_istride, dim_ostride, &
658 hm_n, hm_istride, hm_ostride, &
660 fft_direction, fftw_plan_type, rows_per_th, &
663 TYPE(c_ptr),
INTENT(INOUT) :: plan, plan_r
664 INTEGER,
INTENT(INOUT) :: dim_n(2), dim_istride(2), &
665 dim_ostride(2), hm_n(2), &
666 hm_istride(2), hm_ostride(2)
667 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(INOUT) :: input, output
668 INTEGER,
INTENT(INOUT) :: fft_direction, fftw_plan_type
669 INTEGER,
INTENT(IN) :: rows_per_th, rows_per_th_r
675 hm_n(2) = rows_per_th
676 CALL fftw3_create_guru_plan(plan, 1, &
677 dim_n, dim_istride, dim_ostride, &
678 2, hm_n, hm_istride, hm_ostride, &
680 fft_direction, fftw_plan_type, valid)
682 IF (.NOT. valid)
THEN
683 cpabort(
"fftw3_create_plan")
687 hm_n(2) = rows_per_th_r
688 CALL fftw3_create_guru_plan(plan_r, 1, &
689 dim_n, dim_istride, dim_ostride, &
690 2, hm_n, hm_istride, hm_ostride, &
692 fft_direction, fftw_plan_type, valid)
693 IF (.NOT. valid)
THEN
694 cpabort(
"fftw3_create_plan (remaining)")
697 END SUBROUTINE fftw3_create_3d_plans
710 TYPE(fft_plan_type),
INTENT(INOUT) :: plan
711 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(INOUT) :: zin
712 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(INOUT) :: zout
713 INTEGER :: plan_style
715 INTEGER :: n1, n2, n3
717 INTEGER :: rows_per_th
718 INTEGER :: rows_per_th_r
719 INTEGER :: fft_direction
720 INTEGER :: th_plana, th_planb
721 COMPLEX(KIND=dp),
ALLOCATABLE :: tmp(:)
724 INTEGER :: dim_n(2), dim_istride(2), dim_ostride(2), &
725 howmany_n(2), howmany_istride(2), howmany_ostride(2)
727 INTEGER :: fftw_plan_type
728 SELECT CASE (plan_style)
730 fftw_plan_type = fftw_estimate
732 fftw_plan_type = fftw_measure
734 fftw_plan_type = fftw_patient
736 fftw_plan_type = fftw_exhaustive
738 cpabort(
"fftw3_create_plan_3d")
741#if defined(__FFTW3_UNALIGNED)
742 fftw_plan_type = fftw_plan_type + fftw_unaligned
745 IF (plan%fsign == +1)
THEN
746 fft_direction = fftw_forward
748 fft_direction = fftw_backward
762 IF ((.NOT. fftw3_is_guru_supported()) .OR. &
763 (.NOT. plan_style == 1) .OR. &
764 (n1 < 256 .AND. n2 < 256 .AND. n3 < 256 .AND. nt == 1))
THEN
770 plan%separated_plans = .false.
773 IF (plan%fft_in_place)
THEN
774 plan%fftw_plan = fftw_plan_dft_3d(n3, n2, n1, zin, zin, fft_direction, fftw_plan_type)
776 plan%fftw_plan = fftw_plan_dft_3d(n3, n2, n1, zin, zout, fft_direction, fftw_plan_type)
779 ALLOCATE (tmp(n1*n2*n3))
804 CALL fftw3_compute_rows_per_th(n3, nt, rows_per_th, rows_per_th_r, &
811 howmany_n(2) = rows_per_th
812 howmany_istride(1) = n1
813 howmany_istride(2) = n1*n2
814 howmany_ostride(1) = 1
815 howmany_ostride(2) = n1*n2
816 CALL fftw3_create_3d_plans(plan%fftw_plan_nx, plan%fftw_plan_nx_r, &
817 dim_n, dim_istride, dim_ostride, howmany_n, &
818 howmany_istride, howmany_ostride, &
820 fft_direction, fftw_plan_type, rows_per_th, &
824 CALL fftw3_compute_rows_per_th(n3, nt, rows_per_th, rows_per_th_r, &
830 howmany_n(2) = rows_per_th
831 howmany_istride(1) = n2
832 howmany_istride(2) = n1*n2
834 howmany_ostride(1) = n2*n3
835 howmany_ostride(2) = 1
837 CALL fftw3_create_3d_plans(plan%fftw_plan_ny, plan%fftw_plan_ny_r, &
838 dim_n, dim_istride, dim_ostride, &
839 howmany_n, howmany_istride, howmany_ostride, &
841 fft_direction, fftw_plan_type, rows_per_th, &
845 CALL fftw3_compute_rows_per_th(n1, nt, rows_per_th, rows_per_th_r, &
851 howmany_n(2) = rows_per_th
852 howmany_istride(1) = n3
853 howmany_istride(2) = n2*n3
854 howmany_ostride(1) = n3
855 howmany_ostride(2) = n2*n3
857 CALL fftw3_create_3d_plans(plan%fftw_plan_nz, plan%fftw_plan_nz_r, &
858 dim_n, dim_istride, dim_ostride, &
859 howmany_n, howmany_istride, howmany_ostride, &
861 fft_direction, fftw_plan_type, rows_per_th, &
864 plan%separated_plans = .true.
871 mark_used(plan_style)
873 IF (.false.) then; do;
IF (abs(zin(1)) > abs(zout(1))) exit;
END do;
END IF
892 SUBROUTINE fftw3_workshare_execute_dft(plan, plan_r, split_dim, nt, tid, &
893 input, istride, output, ostride)
895 INTEGER,
INTENT(IN) :: split_dim, nt, tid
896 INTEGER,
INTENT(IN) :: istride, ostride
897 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(INOUT) :: input, output
898 TYPE(c_ptr) :: plan, plan_r
900 INTEGER :: i_off, o_off
901 INTEGER :: th_plana, th_planb
902 INTEGER :: rows_per_thread, rows_per_thread_r
904 CALL fftw3_compute_rows_per_th(split_dim, nt, rows_per_thread, &
908 IF (th_planb > 0)
THEN
909 IF (tid < th_plana)
THEN
910 i_off = (tid)*(istride*(rows_per_thread)) + 1
911 o_off = (tid)*(ostride*(rows_per_thread)) + 1
912 IF (rows_per_thread > 0)
THEN
913 CALL fftw_execute_dft(plan, input(i_off), &
916 ELSE IF ((tid - th_plana) < th_planb)
THEN
918 i_off = (th_plana)*istride*(rows_per_thread) + &
919 (tid - th_plana)*istride*(rows_per_thread_r) + 1
920 o_off = (th_plana)*ostride*(rows_per_thread) + &
921 (tid - th_plana)*ostride*(rows_per_thread_r) + 1
923 CALL fftw_execute_dft(plan_r, input(i_off), &
928 i_off = (tid)*(istride*(rows_per_thread)) + 1
929 o_off = (tid)*(ostride*(rows_per_thread)) + 1
931 CALL fftw_execute_dft(plan, input(i_off), &
944 IF (.false.) then; do;
IF (abs(input(1)) > abs(output(1))) exit;
END do;
END IF
947 END SUBROUTINE fftw3_workshare_execute_dft
959 SUBROUTINE fftw33d(plan, scale, zin, zout, stat)
961 TYPE(fft_plan_type),
INTENT(IN) :: plan
962 REAL(kind=dp),
INTENT(IN) :: scale
963 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(INOUT),
TARGET:: zin
964 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(INOUT),
TARGET:: zout
965 INTEGER,
INTENT(OUT) :: stat
967 COMPLEX(KIND=dp),
POINTER :: xout(:)
968 COMPLEX(KIND=dp),
ALLOCATABLE :: tmp1(:)
969 INTEGER :: n1, n2, n3
980 IF (plan%fft_in_place)
THEN
981 xout => zin(:n1*n2*n3)
983 xout => zout(:n1*n2*n3)
987 IF (.NOT. plan%separated_plans)
THEN
988 CALL fftw_execute_dft(plan%fftw_plan, zin, xout)
991 ALLOCATE (tmp1(n1*n2*n3))
998 CALL fftw3_workshare_execute_dft(plan%fftw_plan_nx, plan%fftw_plan_nx_r, &
1000 zin, n1*n2, tmp1, n1*n2)
1003 CALL fftw3_workshare_execute_dft(plan%fftw_plan_ny, plan%fftw_plan_ny_r, &
1005 tmp1, n1*n2, xout, 1)
1007 CALL fftw3_workshare_execute_dft(plan%fftw_plan_nz, plan%fftw_plan_nz_r, &
1009 xout, n2*n3, tmp1, n2*n3)
1016 xout((i - 1) + (j - 1)*n1 + (k - 1)*n1*n2 + 1) = &
1017 tmp1((k - 1) + (j - 1)*n3 + (i - 1)*n3*n2 + 1)
1026 IF (scale /= 1.0_dp)
THEN
1027 CALL zdscal(n1*n2*n3, scale, xout, 1)
1034 IF (.false.) then; do;
IF (abs(zin(1)) > abs(zout(1))) exit;
END do;
END IF
1054 TYPE(fft_plan_type),
INTENT(INOUT) :: plan
1055 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(IN) :: zin
1056 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(IN) :: zout
1057 INTEGER,
INTENT(IN) :: plan_style
1059 INTEGER :: istride, idist, ostride, odist, num_threads, num_rows
1061 INTEGER :: fftw_plan_type
1062 SELECT CASE (plan_style)
1064 fftw_plan_type = fftw_estimate
1066 fftw_plan_type = fftw_measure
1068 fftw_plan_type = fftw_patient
1070 fftw_plan_type = fftw_exhaustive
1072 cpabort(
"fftw3_create_plan_1dm")
1075#if defined(__FFTW3_UNALIGNED)
1076 fftw_plan_type = fftw_plan_type + fftw_unaligned
1079 plan%separated_plans = .false.
1087 num_rows = plan%m/num_threads
1106 IF (plan%fsign == +1 .AND. plan%trans)
THEN
1109 ELSEIF (plan%fsign == -1 .AND. plan%trans)
THEN
1114 IF (plan%fsign == +1)
THEN
1115 CALL dfftw_plan_many_dft(plan%fftw_plan, 1, plan%n, num_rows, zin, 0, istride, idist, &
1116 zout, 0, ostride, odist, fftw_forward, fftw_plan_type)
1118 CALL dfftw_plan_many_dft(plan%fftw_plan, 1, plan%n, num_rows, zin, 0, istride, idist, &
1119 zout, 0, ostride, odist, fftw_backward, fftw_plan_type)
1135 mark_used(plan_style)
1137 IF (.false.) then; do;
IF (abs(zin(1)) > abs(zout(1))) exit;
END do;
END IF
1148 TYPE(fft_plan_type),
INTENT(INOUT) :: plan
1155 IF (.NOT. plan%separated_plans)
THEN
1156 CALL fftw_destroy_plan(plan%fftw_plan)
1160 CALL fftw_destroy_plan(plan%fftw_plan_nx)
1161 CALL fftw_destroy_plan(plan%fftw_plan_ny)
1162 CALL fftw_destroy_plan(plan%fftw_plan_nz)
1163 CALL fftw_destroy_plan(plan%fftw_plan_nx_r)
1164 CALL fftw_destroy_plan(plan%fftw_plan_ny_r)
1165 CALL fftw_destroy_plan(plan%fftw_plan_nz_r)
1183 TYPE(fft_plan_type),
INTENT(IN) :: plan
1184 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(IN),
TARGET :: zin
1185 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(INOUT), &
1187 REAL(kind=dp),
INTENT(IN) :: scale
1188 INTEGER,
INTENT(OUT) :: stat
1190 INTEGER :: in_offset, my_id, num_rows, out_offset, &
1192 TYPE(c_ptr) :: fftw_plan
1207 fftw_plan = plan%fftw_plan
1232 CALL dfftw_execute_dft(fftw_plan, zin(in_offset:in_offset), zout(out_offset:out_offset))
1237 IF (scale /= 1.0_dp)
CALL zdscal(plan%n*num_rows, scale, zout(scal_offset:scal_offset), 1)
1244 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