8 USE iso_c_binding,
ONLY: c_associated, &
15 USE iso_c_binding,
ONLY: &
31#include "../../base/base_uses.f90"
45 MODULE PROCEDURE :: fftw_alloc_complex_1d
46 MODULE PROCEDURE :: fftw_alloc_complex_2d
47 MODULE PROCEDURE :: fftw_alloc_complex_3d
51 MODULE PROCEDURE :: fftw_dealloc_complex_1d
52 MODULE PROCEDURE :: fftw_dealloc_complex_2d
53 MODULE PROCEDURE :: fftw_dealloc_complex_3d
59 SUBROUTINE fftw_alloc_complex_1d(array, n)
60 COMPLEX(C_DOUBLE_COMPLEX),
DIMENSION(:),
CONTIGUOUS,
POINTER,
INTENT(OUT) :: array
61 INTEGER,
DIMENSION(1),
INTENT(IN) :: n
64 TYPE(c_ptr) :: data_ptr
65 data_ptr = fftw_alloc_complex(int(product(n), kind=c_size_t))
66 CALL c_f_pointer(data_ptr, array, n)
69 ALLOCATE (array(n(1)))
72 END SUBROUTINE fftw_alloc_complex_1d
74 SUBROUTINE fftw_dealloc_complex_1d(array)
75 COMPLEX(C_DOUBLE_COMPLEX),
DIMENSION(:),
CONTIGUOUS,
POINTER,
INTENT(INOUT) :: array
78 CALL fftw_free(c_loc(array))
85 END SUBROUTINE fftw_dealloc_complex_1d
87 SUBROUTINE fftw_alloc_complex_2d(array, n)
88 COMPLEX(C_DOUBLE_COMPLEX),
DIMENSION(:, :),
CONTIGUOUS,
POINTER,
INTENT(OUT) :: array
89 INTEGER,
DIMENSION(2),
INTENT(IN) :: n
92 TYPE(c_ptr) :: data_ptr
93 data_ptr = fftw_alloc_complex(int(product(n), kind=c_size_t))
94 CALL c_f_pointer(data_ptr, array, n)
97 ALLOCATE (array(n(1), n(2)))
100 END SUBROUTINE fftw_alloc_complex_2d
102 SUBROUTINE fftw_dealloc_complex_2d(array)
103 COMPLEX(C_DOUBLE_COMPLEX),
DIMENSION(:, :),
CONTIGUOUS,
POINTER,
INTENT(INOUT) :: array
106 CALL fftw_free(c_loc(array))
113 END SUBROUTINE fftw_dealloc_complex_2d
115 SUBROUTINE fftw_alloc_complex_3d(array, n)
116 COMPLEX(C_DOUBLE_COMPLEX),
DIMENSION(:, :, :),
CONTIGUOUS,
POINTER,
INTENT(OUT) :: array
117 INTEGER,
DIMENSION(3),
INTENT(IN) :: n
120 TYPE(c_ptr) :: data_ptr
121 data_ptr = fftw_alloc_complex(int(product(n), kind=c_size_t))
122 CALL c_f_pointer(data_ptr, array, n)
125 ALLOCATE (array(n(1), n(2), n(3)))
128 END SUBROUTINE fftw_alloc_complex_3d
130 SUBROUTINE fftw_dealloc_complex_3d(array)
131 COMPLEX(C_DOUBLE_COMPLEX),
DIMENSION(:, :, :),
CONTIGUOUS,
POINTER,
INTENT(INOUT) :: array
134 CALL fftw_free(c_loc(array))
141 END SUBROUTINE fftw_dealloc_complex_3d
147 SUBROUTINE dummy_routine_to_call_mark_used()
151 mark_used(fftw_redft00)
152 mark_used(fftw_redft01)
153 mark_used(fftw_redft10)
154 mark_used(fftw_redft11)
155 mark_used(fftw_rodft00)
156 mark_used(fftw_rodft01)
157 mark_used(fftw_rodft10)
158 mark_used(fftw_rodft11)
159 mark_used(fftw_forward)
160 mark_used(fftw_backward)
161 mark_used(fftw_measure)
162 mark_used(fftw_destroy_input)
163 mark_used(fftw_unaligned)
164 mark_used(fftw_conserve_memory)
165 mark_used(fftw_exhaustive)
166 mark_used(fftw_preserve_input)
167 mark_used(fftw_patient)
168 mark_used(fftw_estimate)
169 mark_used(fftw_wisdom_only)
170 mark_used(fftw_estimate_patient)
171 mark_used(fftw_believe_pcost)
172 mark_used(fftw_no_dft_r2hc)
173 mark_used(fftw_no_nonthreaded)
174 mark_used(fftw_no_buffering)
175 mark_used(fftw_no_indirect_op)
176 mark_used(fftw_allow_large_generic)
177 mark_used(fftw_no_rank_splits)
178 mark_used(fftw_no_vrank_splits)
179 mark_used(fftw_no_vrecurse)
180 mark_used(fftw_no_simd)
181 mark_used(fftw_no_slow)
182 mark_used(fftw_no_fixed_radix_large_n)
183 mark_used(fftw_allow_pruning)
194 CHARACTER(LEN=*),
INTENT(IN) :: wisdom_file
198 CHARACTER(LEN=1, KIND=C_CHAR),
DIMENSION(:),
ALLOCATABLE :: wisdom_file_name_c
199 INTEGER :: file_name_length, i, iunit, istat
200 INTEGER(KIND=C_INT) :: isuccess
206 OPEN (unit=iunit, file=wisdom_file, status=
"UNKNOWN", form=
"FORMATTED", action=
"WRITE", iostat=istat)
209 file_name_length = len_trim(wisdom_file)
210 ALLOCATE (wisdom_file_name_c(file_name_length + 1))
211 DO i = 1, file_name_length
212 wisdom_file_name_c(i) = wisdom_file(i:i)
214 wisdom_file_name_c(file_name_length + 1) = c_null_char
215 isuccess = fftw_export_wisdom_to_filename(wisdom_file_name_c)
217 CALL cp_warn(__location__,
"Error exporting wisdom to file "//trim(wisdom_file)//
". "// &
218 "Wisdom was not exported.")
224 mark_used(wisdom_file)
236 CHARACTER(LEN=*),
INTENT(IN) :: wisdom_file
239 CHARACTER(LEN=1, KIND=C_CHAR),
DIMENSION(:),
ALLOCATABLE :: wisdom_file_name_c
240 INTEGER :: file_name_length, i, istat, iunit
241 INTEGER(KIND=C_INT) :: isuccess
244 isuccess = fftw_init_threads()
246 cpabort(
"Error initializing FFTW with threads")
253 file_name_length = len_trim(wisdom_file)
255 OPEN (unit=iunit, file=wisdom_file, status=
"OLD", form=
"FORMATTED", position=
"REWIND", &
256 action=
"READ", iostat=istat)
259 file_name_length = len_trim(wisdom_file)
260 ALLOCATE (wisdom_file_name_c(file_name_length + 1))
261 DO i = 1, file_name_length
262 wisdom_file_name_c(i) = wisdom_file(i:i)
264 wisdom_file_name_c(file_name_length + 1) = c_null_char
265 isuccess = fftw_import_wisdom_from_filename(wisdom_file_name_c)
267 CALL cp_warn(__location__,
"Error importing wisdom from file "//trim(wisdom_file)//
". "// &
268 "Maybe the file was created with a different configuration than CP2K is run with. "// &
269 "CP2K continues without importing wisdom.")
273 mark_used(wisdom_file)
294 INTEGER,
DIMENSION(*) :: data
295 INTEGER,
INTENT(INOUT) :: max_length
297 INTEGER :: h, i, j, k, m, maxn, maxn_elevens, &
298 maxn_fives, maxn_sevens, &
299 maxn_thirteens, maxn_threes, &
300 maxn_twos, ndata, nmax, number
301 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: dlocal,
idx
319 DO i = 0, maxn_threes
321 DO k = 0, maxn_sevens
322 DO m = 0, maxn_elevens
323 number = (3**i)*(5**j)*(7**k)*(11**m)
325 IF (number > nmax) cycle
328 IF (number >= maxn) cycle
337 ALLOCATE (dlocal(ndata),
idx(ndata))
343 DO i = 0, maxn_threes
345 DO k = 0, maxn_sevens
346 DO m = 0, maxn_elevens
347 number = (3**i)*(5**j)*(7**k)*(11**m)
349 IF (number > nmax) cycle
352 IF (number >= maxn) cycle
355 dlocal(ndata) = number
362 CALL sortint(dlocal, ndata,
idx)
363 ndata = min(ndata, max_length)
364 DATA(1:ndata) = dlocal(1:ndata)
367 DEALLOCATE (dlocal,
idx)
377 SUBROUTINE sortint(iarr, n, index)
379 INTEGER,
INTENT(IN) :: n
380 INTEGER,
INTENT(INOUT) :: iarr(1:n)
381 INTEGER,
INTENT(OUT) :: index(1:n)
383 INTEGER,
PARAMETER :: m = 7, nstack = 50
385 INTEGER :: a, i, ib, ir, istack(1:nstack), itemp, &
386 j, jstack, k, l, temp
403 IF (iarr(i) <= a)
EXIT
404 iarr(i + 1) = iarr(i)
405 index(i + 1) = index(i)
410 IF (jstack == 0)
RETURN
412 l = istack(jstack - 1)
417 iarr(k) = iarr(l + 1)
420 index(k) = index(l + 1)
422 IF (iarr(l + 1) > iarr(ir))
THEN
424 iarr(l + 1) = iarr(ir)
427 index(l + 1) = index(ir)
430 IF (iarr(l) > iarr(ir))
THEN
438 IF (iarr(l + 1) > iarr(l))
THEN
440 iarr(l + 1) = iarr(l)
443 index(l + 1) = index(l)
452 DO WHILE (iarr(i) < a)
456 DO WHILE (iarr(j) > a)
472 IF (jstack > nstack) cpabort(
"Nstack too small in sortint")
473 IF (ir - i + 1 >= j - l)
THEN
475 istack(jstack - 1) = i
478 istack(jstack) = j - 1
479 istack(jstack - 1) = l
486 END SUBROUTINE sortint
507 SUBROUTINE fftw3_create_guru_plan(plan, fft_rank, dim_n, &
508 dim_istride, dim_ostride, hm_rank, &
509 hm_n, hm_istride, hm_ostride, &
510 zin, zout, fft_direction, fftw_plan_type, &
515 TYPE(c_ptr),
INTENT(INOUT) :: plan
516 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(INOUT) :: zin, zout
517 INTEGER,
INTENT(IN) :: dim_n(2), dim_istride(2), dim_ostride(2), &
518 hm_n(2), hm_istride(2), hm_ostride(2), fft_rank, &
519 fft_direction, fftw_plan_type, hm_rank
520 LOGICAL,
INTENT(OUT) :: valid
523 TYPE(fftw_iodim) :: dim(2), hm(2)
527 dim(i) = fftw_iodim(dim_n(i), dim_istride(i), dim_ostride(i))
528 hm(i) = fftw_iodim(hm_n(i), hm_istride(i), hm_ostride(i))
531 plan = fftw_plan_guru_dft(fft_rank, &
534 fft_direction, fftw_plan_type)
536 valid = c_associated(plan)
542 mark_used(dim_istride)
543 mark_used(dim_ostride)
546 mark_used(hm_istride)
547 mark_used(hm_ostride)
548 mark_used(fft_direction)
549 mark_used(fftw_plan_type)
551 IF (.false.) then; do;
IF (abs(zin(1)) > abs(zout(1))) exit;
END do;
END IF
566 FUNCTION fftw3_is_guru_supported()
RESULT(guru_supported)
570 LOGICAL :: guru_supported
572 INTEGER :: dim_n(2), dim_istride(2), dim_ostride(2), &
573 howmany_n(2), howmany_istride(2), howmany_ostride(2)
574 TYPE(c_ptr) :: test_plan
575 COMPLEX(KIND=dp),
DIMENSION(1, 1, 1) :: zin
585 howmany_istride(1) = 1
586 howmany_istride(2) = 1
587 howmany_ostride(1) = 1
588 howmany_ostride(2) = 1
589 zin = cmplx(0.0_dp, 0.0_dp, kind=dp)
590 CALL fftw3_create_guru_plan(test_plan, 1, &
591 dim_n, dim_istride, dim_ostride, &
592 2, howmany_n, howmany_istride, howmany_ostride, &
594 fftw_forward, fftw_estimate, guru_supported)
595 IF (guru_supported)
THEN
596 CALL fftw_destroy_plan(test_plan)
600 guru_supported = .false.
616 SUBROUTINE fftw3_compute_rows_per_th(nrows, nt, rows_per_thread, rows_per_thread_r, &
619 INTEGER,
INTENT(IN) :: nrows, nt
620 INTEGER,
INTENT(OUT) :: rows_per_thread, rows_per_thread_r, &
623 IF (mod(nrows, nt) .EQ. 0)
THEN
624 rows_per_thread = nrows/nt
625 rows_per_thread_r = 0
629 rows_per_thread = nrows/nt + 1
630 rows_per_thread_r = nrows/nt
631 th_plana = mod(nrows, nt)
632 th_planb = nt - th_plana
656 SUBROUTINE fftw3_create_3d_plans(plan, plan_r, dim_n, dim_istride, dim_ostride, &
657 hm_n, hm_istride, hm_ostride, &
659 fft_direction, fftw_plan_type, rows_per_th, &
662 TYPE(c_ptr),
INTENT(INOUT) :: plan, plan_r
663 INTEGER,
INTENT(INOUT) :: dim_n(2), dim_istride(2), &
664 dim_ostride(2), hm_n(2), &
665 hm_istride(2), hm_ostride(2)
666 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(INOUT) :: input, output
667 INTEGER,
INTENT(INOUT) :: fft_direction, fftw_plan_type
668 INTEGER,
INTENT(IN) :: rows_per_th, rows_per_th_r
674 hm_n(2) = rows_per_th
675 CALL fftw3_create_guru_plan(plan, 1, &
676 dim_n, dim_istride, dim_ostride, &
677 2, hm_n, hm_istride, hm_ostride, &
679 fft_direction, fftw_plan_type, valid)
681 IF (.NOT. valid)
THEN
682 cpabort(
"fftw3_create_plan")
686 hm_n(2) = rows_per_th_r
687 CALL fftw3_create_guru_plan(plan_r, 1, &
688 dim_n, dim_istride, dim_ostride, &
689 2, hm_n, hm_istride, hm_ostride, &
691 fft_direction, fftw_plan_type, valid)
692 IF (.NOT. valid)
THEN
693 cpabort(
"fftw3_create_plan (remaining)")
709 TYPE(fft_plan_type),
INTENT(INOUT) :: plan
710 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(INOUT) :: zin
711 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(INOUT) :: zout
712 INTEGER :: plan_style
714 INTEGER :: n1, n2, n3
716 INTEGER :: rows_per_th
717 INTEGER :: rows_per_th_r
718 INTEGER :: fft_direction
719 INTEGER :: th_plana, th_planb
720 COMPLEX(KIND=dp),
ALLOCATABLE :: tmp(:)
723 INTEGER :: dim_n(2), dim_istride(2), dim_ostride(2), &
724 howmany_n(2), howmany_istride(2), howmany_ostride(2)
726 INTEGER :: fftw_plan_type
727 SELECT CASE (plan_style)
729 fftw_plan_type = fftw_estimate
731 fftw_plan_type = fftw_measure
733 fftw_plan_type = fftw_patient
735 fftw_plan_type = fftw_exhaustive
737 cpabort(
"fftw3_create_plan_3d")
740#if defined(__FFTW3_UNALIGNED)
741 fftw_plan_type = fftw_plan_type + fftw_unaligned
744 IF (plan%fsign == +1)
THEN
745 fft_direction = fftw_forward
747 fft_direction = fftw_backward
761 IF ((.NOT. fftw3_is_guru_supported()) .OR. &
762 (.NOT. plan_style == 1) .OR. &
763 (n1 < 256 .AND. n2 < 256 .AND. n3 < 256 .AND. nt == 1))
THEN
769 plan%separated_plans = .false.
772 IF (plan%fft_in_place)
THEN
773 plan%fftw_plan = fftw_plan_dft_3d(n3, n2, n1, zin, zin, fft_direction, fftw_plan_type)
775 plan%fftw_plan = fftw_plan_dft_3d(n3, n2, n1, zin, zout, fft_direction, fftw_plan_type)
778 ALLOCATE (tmp(n1*n2*n3))
803 CALL fftw3_compute_rows_per_th(n3, nt, rows_per_th, rows_per_th_r, &
810 howmany_n(2) = rows_per_th
811 howmany_istride(1) = n1
812 howmany_istride(2) = n1*n2
813 howmany_ostride(1) = 1
814 howmany_ostride(2) = n1*n2
815 CALL fftw3_create_3d_plans(plan%fftw_plan_nx, plan%fftw_plan_nx_r, &
816 dim_n, dim_istride, dim_ostride, howmany_n, &
817 howmany_istride, howmany_ostride, &
819 fft_direction, fftw_plan_type, rows_per_th, &
823 CALL fftw3_compute_rows_per_th(n3, nt, rows_per_th, rows_per_th_r, &
829 howmany_n(2) = rows_per_th
830 howmany_istride(1) = n2
831 howmany_istride(2) = n1*n2
833 howmany_ostride(1) = n2*n3
834 howmany_ostride(2) = 1
836 CALL fftw3_create_3d_plans(plan%fftw_plan_ny, plan%fftw_plan_ny_r, &
837 dim_n, dim_istride, dim_ostride, &
838 howmany_n, howmany_istride, howmany_ostride, &
840 fft_direction, fftw_plan_type, rows_per_th, &
844 CALL fftw3_compute_rows_per_th(n1, nt, rows_per_th, rows_per_th_r, &
850 howmany_n(2) = rows_per_th
851 howmany_istride(1) = n3
852 howmany_istride(2) = n2*n3
853 howmany_ostride(1) = n3
854 howmany_ostride(2) = n2*n3
856 CALL fftw3_create_3d_plans(plan%fftw_plan_nz, plan%fftw_plan_nz_r, &
857 dim_n, dim_istride, dim_ostride, &
858 howmany_n, howmany_istride, howmany_ostride, &
860 fft_direction, fftw_plan_type, rows_per_th, &
863 plan%separated_plans = .true.
870 mark_used(plan_style)
872 IF (.false.) then; do;
IF (abs(zin(1)) > abs(zout(1))) exit;
END do;
END IF
891 SUBROUTINE fftw3_workshare_execute_dft(plan, plan_r, split_dim, nt, tid, &
892 input, istride, output, ostride)
894 INTEGER,
INTENT(IN) :: split_dim, nt, tid
895 INTEGER,
INTENT(IN) :: istride, ostride
896 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(INOUT) :: input, output
897 TYPE(c_ptr) :: plan, plan_r
899 INTEGER :: i_off, o_off
900 INTEGER :: th_plana, th_planb
901 INTEGER :: rows_per_thread, rows_per_thread_r
903 CALL fftw3_compute_rows_per_th(split_dim, nt, rows_per_thread, &
907 IF (th_planb .GT. 0)
THEN
908 IF (tid .LT. th_plana)
THEN
909 i_off = (tid)*(istride*(rows_per_thread)) + 1
910 o_off = (tid)*(ostride*(rows_per_thread)) + 1
911 IF (rows_per_thread .GT. 0)
THEN
912 CALL fftw_execute_dft(plan, input(i_off), &
915 ELSE IF ((tid - th_plana) < th_planb)
THEN
917 i_off = (th_plana)*istride*(rows_per_thread) + &
918 (tid - th_plana)*istride*(rows_per_thread_r) + 1
919 o_off = (th_plana)*ostride*(rows_per_thread) + &
920 (tid - th_plana)*ostride*(rows_per_thread_r) + 1
922 CALL fftw_execute_dft(plan_r, input(i_off), &
927 i_off = (tid)*(istride*(rows_per_thread)) + 1
928 o_off = (tid)*(ostride*(rows_per_thread)) + 1
930 CALL fftw_execute_dft(plan, input(i_off), &
943 IF (.false.) then; do;
IF (abs(input(1)) > abs(output(1))) exit;
END do;
END IF
958 SUBROUTINE fftw33d(plan, scale, zin, zout, stat)
960 TYPE(fft_plan_type),
INTENT(IN) :: plan
961 REAL(kind=dp),
INTENT(IN) :: scale
962 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(INOUT),
TARGET:: zin
963 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(INOUT),
TARGET:: zout
964 INTEGER,
INTENT(OUT) :: stat
966 COMPLEX(KIND=dp),
POINTER :: xout(:)
967 COMPLEX(KIND=dp),
ALLOCATABLE :: tmp1(:)
968 INTEGER :: n1, n2, n3
979 IF (plan%fft_in_place)
THEN
980 xout => zin(:n1*n2*n3)
982 xout => zout(:n1*n2*n3)
986 IF (.NOT. plan%separated_plans)
THEN
987 CALL fftw_execute_dft(plan%fftw_plan, zin, xout)
990 ALLOCATE (tmp1(n1*n2*n3))
997 CALL fftw3_workshare_execute_dft(plan%fftw_plan_nx, plan%fftw_plan_nx_r, &
999 zin, n1*n2, tmp1, n1*n2)
1002 CALL fftw3_workshare_execute_dft(plan%fftw_plan_ny, plan%fftw_plan_ny_r, &
1004 tmp1, n1*n2, xout, 1)
1006 CALL fftw3_workshare_execute_dft(plan%fftw_plan_nz, plan%fftw_plan_nz_r, &
1008 xout, n2*n3, tmp1, n2*n3)
1015 xout((i - 1) + (j - 1)*n1 + (k - 1)*n1*n2 + 1) = &
1016 tmp1((k - 1) + (j - 1)*n3 + (i - 1)*n3*n2 + 1)
1025 IF (scale /= 1.0_dp)
THEN
1026 CALL zdscal(n1*n2*n3, scale, xout, 1)
1033 IF (.false.) then; do;
IF (abs(zin(1)) > abs(zout(1))) exit;
END do;
END IF
1053 TYPE(fft_plan_type),
INTENT(INOUT) :: plan
1054 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(IN) :: zin
1055 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(IN) :: zout
1056 INTEGER,
INTENT(IN) :: plan_style
1058 INTEGER :: ii, di, io, do, num_threads, num_rows
1060 INTEGER :: fftw_plan_type
1061 SELECT CASE (plan_style)
1063 fftw_plan_type = fftw_estimate
1065 fftw_plan_type = fftw_measure
1067 fftw_plan_type = fftw_patient
1069 fftw_plan_type = fftw_exhaustive
1071 cpabort(
"fftw3_create_plan_1dm")
1074#if defined(__FFTW3_UNALIGNED)
1075 fftw_plan_type = fftw_plan_type + fftw_unaligned
1078 plan%separated_plans = .false.
1086 num_rows = plan%m/num_threads
1105 IF (plan%fsign == +1 .AND. plan%trans)
THEN
1108 ELSEIF (plan%fsign == -1 .AND. plan%trans)
THEN
1113 IF (plan%fsign == +1)
THEN
1114 CALL dfftw_plan_many_dft(plan%fftw_plan, 1, plan%n, num_rows, zin, 0, ii, di, &
1115 zout, 0, io,
DO, fftw_forward, fftw_plan_type)
1117 CALL dfftw_plan_many_dft(plan%fftw_plan, 1, plan%n, num_rows, zin, 0, ii, di, &
1118 zout, 0, io,
DO, fftw_backward, fftw_plan_type)
1134 mark_used(plan_style)
1136 IF (.false.) then; do;
IF (abs(zin(1)) > abs(zout(1))) exit;
END do;
END IF
1147 TYPE(fft_plan_type),
INTENT(INOUT) :: plan
1154 IF (.NOT. plan%separated_plans)
THEN
1155 CALL fftw_destroy_plan(plan%fftw_plan)
1159 CALL fftw_destroy_plan(plan%fftw_plan_nx)
1160 CALL fftw_destroy_plan(plan%fftw_plan_ny)
1161 CALL fftw_destroy_plan(plan%fftw_plan_nz)
1162 CALL fftw_destroy_plan(plan%fftw_plan_nx_r)
1163 CALL fftw_destroy_plan(plan%fftw_plan_ny_r)
1164 CALL fftw_destroy_plan(plan%fftw_plan_nz_r)
1182 TYPE(fft_plan_type),
INTENT(IN) :: plan
1183 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(IN),
TARGET :: zin
1184 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(INOUT), &
1186 REAL(kind=dp),
INTENT(IN) :: scale
1187 INTEGER,
INTENT(OUT) :: stat
1189 INTEGER :: in_offset, my_id, num_rows, out_offset, &
1191 TYPE(c_ptr) :: fftw_plan
1206 fftw_plan = plan%fftw_plan
1231 CALL dfftw_execute_dft(fftw_plan, zin(in_offset:in_offset), zout(out_offset:out_offset))
1236 IF (scale /= 1.0_dp)
CALL zdscal(plan%n*num_rows, scale, zout(scal_offset:scal_offset), 1)
1243 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)
...