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, &
514 TYPE(c_ptr),
INTENT(INOUT) :: plan
515 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(INOUT) :: zin, zout
516 INTEGER,
INTENT(IN) :: dim_n(2), dim_istride(2), dim_ostride(2), &
517 hm_n(2), hm_istride(2), hm_ostride(2), fft_rank, &
518 fft_direction, fftw_plan_type, hm_rank
519 LOGICAL,
INTENT(OUT) :: valid
522 TYPE(fftw_iodim) :: dim(2), hm(2)
526 dim(i) = fftw_iodim(dim_n(i), dim_istride(i), dim_ostride(i))
527 hm(i) = fftw_iodim(hm_n(i), hm_istride(i), hm_ostride(i))
530 plan = fftw_plan_guru_dft(fft_rank, &
533 fft_direction, fftw_plan_type)
535 valid = c_associated(plan)
541 mark_used(dim_istride)
542 mark_used(dim_ostride)
545 mark_used(hm_istride)
546 mark_used(hm_ostride)
547 mark_used(fft_direction)
548 mark_used(fftw_plan_type)
550 IF (.false.) then; do;
IF (abs(zin(1)) > abs(zout(1))) exit;
END do;
END IF
555 END SUBROUTINE fftw3_create_guru_plan
565 FUNCTION fftw3_is_guru_supported()
RESULT(guru_supported)
566 LOGICAL :: guru_supported
568 INTEGER :: dim_n(2), dim_istride(2), dim_ostride(2), &
569 howmany_n(2), howmany_istride(2), howmany_ostride(2)
570 TYPE(c_ptr) :: test_plan
571 COMPLEX(KIND=dp),
DIMENSION(1, 1, 1) :: zin
581 howmany_istride(1) = 1
582 howmany_istride(2) = 1
583 howmany_ostride(1) = 1
584 howmany_ostride(2) = 1
586 CALL fftw3_create_guru_plan(test_plan, 1, &
587 dim_n, dim_istride, dim_ostride, &
588 2, howmany_n, howmany_istride, howmany_ostride, &
590 fftw_forward, fftw_estimate, guru_supported)
591 IF (guru_supported)
THEN
592 CALL fftw_destroy_plan(test_plan)
596 guru_supported = .false.
599 END FUNCTION fftw3_is_guru_supported
612 SUBROUTINE fftw3_compute_rows_per_th(nrows, nt, rows_per_thread, rows_per_thread_r, &
615 INTEGER,
INTENT(IN) :: nrows, nt
616 INTEGER,
INTENT(OUT) :: rows_per_thread, rows_per_thread_r, &
619 IF (mod(nrows, nt) == 0)
THEN
620 rows_per_thread = nrows/nt
621 rows_per_thread_r = 0
625 rows_per_thread = nrows/nt + 1
626 rows_per_thread_r = nrows/nt
627 th_plana = mod(nrows, nt)
628 th_planb = nt - th_plana
631 END SUBROUTINE fftw3_compute_rows_per_th
652 SUBROUTINE fftw3_create_3d_plans(plan, plan_r, dim_n, dim_istride, dim_ostride, &
653 hm_n, hm_istride, hm_ostride, &
655 fft_direction, fftw_plan_type, rows_per_th, &
658 TYPE(c_ptr),
INTENT(INOUT) :: plan, plan_r
659 INTEGER,
INTENT(INOUT) :: dim_n(2), dim_istride(2), &
660 dim_ostride(2), hm_n(2), &
661 hm_istride(2), hm_ostride(2)
662 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(INOUT) :: input, output
663 INTEGER,
INTENT(INOUT) :: fft_direction, fftw_plan_type
664 INTEGER,
INTENT(IN) :: rows_per_th, rows_per_th_r
670 hm_n(2) = rows_per_th
671 CALL fftw3_create_guru_plan(plan, 1, &
672 dim_n, dim_istride, dim_ostride, &
673 2, hm_n, hm_istride, hm_ostride, &
675 fft_direction, fftw_plan_type, valid)
677 IF (.NOT. valid)
THEN
678 cpabort(
"fftw3_create_plan")
682 hm_n(2) = rows_per_th_r
683 CALL fftw3_create_guru_plan(plan_r, 1, &
684 dim_n, dim_istride, dim_ostride, &
685 2, hm_n, hm_istride, hm_ostride, &
687 fft_direction, fftw_plan_type, valid)
688 IF (.NOT. valid)
THEN
689 cpabort(
"fftw3_create_plan (remaining)")
692 END SUBROUTINE fftw3_create_3d_plans
705 TYPE(fft_plan_type),
INTENT(INOUT) :: plan
706 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(INOUT) :: zin
707 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(INOUT) :: zout
708 INTEGER :: plan_style
710 INTEGER :: n1, n2, n3
712 INTEGER :: rows_per_th
713 INTEGER :: rows_per_th_r
714 INTEGER :: fft_direction
715 INTEGER :: th_plana, th_planb
716 COMPLEX(KIND=dp),
ALLOCATABLE :: tmp(:)
719 INTEGER :: dim_n(2), dim_istride(2), dim_ostride(2), &
720 howmany_n(2), howmany_istride(2), howmany_ostride(2)
722 INTEGER :: fftw_plan_type
723 SELECT CASE (plan_style)
725 fftw_plan_type = fftw_estimate
727 fftw_plan_type = fftw_measure
729 fftw_plan_type = fftw_patient
731 fftw_plan_type = fftw_exhaustive
733 cpabort(
"fftw3_create_plan_3d")
736 IF (plan%fsign == +1)
THEN
737 fft_direction = fftw_forward
739 fft_direction = fftw_backward
753 IF ((.NOT. fftw3_is_guru_supported()) .OR. &
754 (.NOT. plan_style == 1) .OR. &
755 (n1 < 256 .AND. n2 < 256 .AND. n3 < 256 .AND. nt == 1))
THEN
761 plan%separated_plans = .false.
764 IF (plan%fft_in_place)
THEN
765 plan%fftw_plan = fftw_plan_dft_3d(n3, n2, n1, zin, zin, fft_direction, fftw_plan_type)
767 plan%fftw_plan = fftw_plan_dft_3d(n3, n2, n1, zin, zout, fft_direction, fftw_plan_type)
770 ALLOCATE (tmp(n1*n2*n3))
795 CALL fftw3_compute_rows_per_th(n3, nt, rows_per_th, rows_per_th_r, &
802 howmany_n(2) = rows_per_th
803 howmany_istride(1) = n1
804 howmany_istride(2) = n1*n2
805 howmany_ostride(1) = 1
806 howmany_ostride(2) = n1*n2
807 CALL fftw3_create_3d_plans(plan%fftw_plan_nx, plan%fftw_plan_nx_r, &
808 dim_n, dim_istride, dim_ostride, howmany_n, &
809 howmany_istride, howmany_ostride, &
811 fft_direction, fftw_plan_type, rows_per_th, &
815 CALL fftw3_compute_rows_per_th(n3, nt, rows_per_th, rows_per_th_r, &
821 howmany_n(2) = rows_per_th
822 howmany_istride(1) = n2
823 howmany_istride(2) = n1*n2
825 howmany_ostride(1) = n2*n3
826 howmany_ostride(2) = 1
828 CALL fftw3_create_3d_plans(plan%fftw_plan_ny, plan%fftw_plan_ny_r, &
829 dim_n, dim_istride, dim_ostride, &
830 howmany_n, howmany_istride, howmany_ostride, &
832 fft_direction, fftw_plan_type, rows_per_th, &
836 CALL fftw3_compute_rows_per_th(n1, nt, rows_per_th, rows_per_th_r, &
842 howmany_n(2) = rows_per_th
843 howmany_istride(1) = n3
844 howmany_istride(2) = n2*n3
845 howmany_ostride(1) = n3
846 howmany_ostride(2) = n2*n3
848 CALL fftw3_create_3d_plans(plan%fftw_plan_nz, plan%fftw_plan_nz_r, &
849 dim_n, dim_istride, dim_ostride, &
850 howmany_n, howmany_istride, howmany_ostride, &
852 fft_direction, fftw_plan_type, rows_per_th, &
855 plan%separated_plans = .true.
862 mark_used(plan_style)
864 IF (.false.) then; do;
IF (abs(zin(1)) > abs(zout(1))) exit;
END do;
END IF
883 SUBROUTINE fftw3_workshare_execute_dft(plan, plan_r, split_dim, nt, tid, &
884 input, istride, output, ostride)
886 INTEGER,
INTENT(IN) :: split_dim, nt, tid
887 INTEGER,
INTENT(IN) :: istride, ostride
888 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(INOUT) :: input, output
889 TYPE(c_ptr) :: plan, plan_r
891 INTEGER :: i_off, o_off
892 INTEGER :: th_plana, th_planb
893 INTEGER :: rows_per_thread, rows_per_thread_r
895 CALL fftw3_compute_rows_per_th(split_dim, nt, rows_per_thread, &
899 IF (th_planb > 0)
THEN
900 IF (tid < th_plana)
THEN
901 i_off = (tid)*(istride*(rows_per_thread)) + 1
902 o_off = (tid)*(ostride*(rows_per_thread)) + 1
903 IF (rows_per_thread > 0)
THEN
904 CALL fftw_execute_dft(plan, input(i_off), &
907 ELSE IF ((tid - th_plana) < th_planb)
THEN
909 i_off = (th_plana)*istride*(rows_per_thread) + &
910 (tid - th_plana)*istride*(rows_per_thread_r) + 1
911 o_off = (th_plana)*ostride*(rows_per_thread) + &
912 (tid - th_plana)*ostride*(rows_per_thread_r) + 1
914 CALL fftw_execute_dft(plan_r, input(i_off), &
919 i_off = (tid)*(istride*(rows_per_thread)) + 1
920 o_off = (tid)*(ostride*(rows_per_thread)) + 1
922 CALL fftw_execute_dft(plan, input(i_off), &
935 IF (.false.) then; do;
IF (abs(input(1)) > abs(output(1))) exit;
END do;
END IF
938 END SUBROUTINE fftw3_workshare_execute_dft
950 SUBROUTINE fftw33d(plan, scale, zin, zout, stat)
952 TYPE(fft_plan_type),
INTENT(IN) :: plan
953 REAL(kind=dp),
INTENT(IN) :: scale
954 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(INOUT),
TARGET:: zin
955 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(INOUT),
TARGET:: zout
956 INTEGER,
INTENT(OUT) :: stat
958 COMPLEX(KIND=dp),
POINTER :: xout(:)
959 COMPLEX(KIND=dp),
ALLOCATABLE :: tmp1(:)
960 INTEGER :: n1, n2, n3
971 IF (plan%fft_in_place)
THEN
972 xout => zin(:n1*n2*n3)
974 xout => zout(:n1*n2*n3)
978 IF (.NOT. plan%separated_plans)
THEN
979 CALL fftw_execute_dft(plan%fftw_plan, zin, xout)
982 ALLOCATE (tmp1(n1*n2*n3))
989 CALL fftw3_workshare_execute_dft(plan%fftw_plan_nx, plan%fftw_plan_nx_r, &
991 zin, n1*n2, tmp1, n1*n2)
994 CALL fftw3_workshare_execute_dft(plan%fftw_plan_ny, plan%fftw_plan_ny_r, &
996 tmp1, n1*n2, xout, 1)
998 CALL fftw3_workshare_execute_dft(plan%fftw_plan_nz, plan%fftw_plan_nz_r, &
1000 xout, n2*n3, tmp1, n2*n3)
1007 xout((i - 1) + (j - 1)*n1 + (k - 1)*n1*n2 + 1) = &
1008 tmp1((k - 1) + (j - 1)*n3 + (i - 1)*n3*n2 + 1)
1017 IF (scale /= 1.0_dp)
THEN
1018 CALL zdscal(n1*n2*n3, scale, xout, 1)
1025 IF (.false.) then; do;
IF (abs(zin(1)) > abs(zout(1))) exit;
END do;
END IF
1042 TYPE(fft_plan_type),
INTENT(INOUT) :: plan
1043 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(IN) :: zin
1044 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(IN) :: zout
1045 INTEGER,
INTENT(IN) :: plan_style
1047 INTEGER :: istride, idist, ostride, odist, num_threads, num_rows
1049 INTEGER :: fftw_plan_type
1050 SELECT CASE (plan_style)
1052 fftw_plan_type = fftw_estimate
1054 fftw_plan_type = fftw_measure
1056 fftw_plan_type = fftw_patient
1058 fftw_plan_type = fftw_exhaustive
1060 cpabort(
"fftw3_create_plan_1dm")
1064 plan%separated_plans = .false.
1072 num_rows = plan%m/num_threads
1091 IF (plan%fsign == +1 .AND. plan%trans)
THEN
1094 ELSEIF (plan%fsign == -1 .AND. plan%trans)
THEN
1099 IF (plan%fsign == +1)
THEN
1100 CALL dfftw_plan_many_dft(plan%fftw_plan, 1, plan%n, num_rows, zin, 0, istride, idist, &
1101 zout, 0, ostride, odist, fftw_forward, fftw_plan_type)
1103 CALL dfftw_plan_many_dft(plan%fftw_plan, 1, plan%n, num_rows, zin, 0, istride, idist, &
1104 zout, 0, ostride, odist, fftw_backward, fftw_plan_type)
1120 mark_used(plan_style)
1122 IF (.false.) then; do;
IF (abs(zin(1)) > abs(zout(1))) exit;
END do;
END IF
1133 TYPE(fft_plan_type),
INTENT(INOUT) :: plan
1140 IF (.NOT. plan%separated_plans)
THEN
1141 CALL fftw_destroy_plan(plan%fftw_plan)
1145 CALL fftw_destroy_plan(plan%fftw_plan_nx)
1146 CALL fftw_destroy_plan(plan%fftw_plan_ny)
1147 CALL fftw_destroy_plan(plan%fftw_plan_nz)
1148 CALL fftw_destroy_plan(plan%fftw_plan_nx_r)
1149 CALL fftw_destroy_plan(plan%fftw_plan_ny_r)
1150 CALL fftw_destroy_plan(plan%fftw_plan_nz_r)
1168 TYPE(fft_plan_type),
INTENT(IN) :: plan
1169 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(IN),
TARGET :: zin
1170 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(INOUT), &
1172 REAL(kind=dp),
INTENT(IN) :: scale
1173 INTEGER,
INTENT(OUT) :: stat
1175 INTEGER :: in_offset, my_id, num_rows, out_offset, &
1177 TYPE(c_ptr) :: fftw_plan
1192 fftw_plan = plan%fftw_plan
1217 CALL dfftw_execute_dft(fftw_plan, zin(in_offset:in_offset), zout(out_offset:out_offset))
1222 IF (scale /= 1.0_dp)
CALL zdscal(plan%n*num_rows, scale, zout(scal_offset:scal_offset), 1)
1229 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