9 USE iso_c_binding,
ONLY: c_associated, &
16 USE iso_c_binding,
ONLY: &
32 #include "../../base/base_uses.f90"
39 PUBLIC :: fftw_alloc, fftw_dealloc
41 #if defined ( __FFTW3 )
42 #if defined ( __FFTW3_MKL )
43 #include "fftw/fftw3.f03"
50 MODULE PROCEDURE :: fftw_alloc_complex_1d
51 MODULE PROCEDURE :: fftw_alloc_complex_2d
52 MODULE PROCEDURE :: fftw_alloc_complex_3d
55 INTERFACE fftw_dealloc
56 MODULE PROCEDURE :: fftw_dealloc_complex_1d
57 MODULE PROCEDURE :: fftw_dealloc_complex_2d
58 MODULE PROCEDURE :: fftw_dealloc_complex_3d
64 SUBROUTINE fftw_alloc_complex_1d(array, n)
65 COMPLEX(C_DOUBLE_COMPLEX),
DIMENSION(:),
CONTIGUOUS,
POINTER,
INTENT(OUT) :: array
66 INTEGER,
DIMENSION(1),
INTENT(IN) :: n
69 TYPE(C_PTR) :: data_ptr
70 data_ptr = fftw_alloc_complex(int(product(n), kind=c_size_t))
71 CALL c_f_pointer(data_ptr, array, n)
74 ALLOCATE (array(n(1)))
77 END SUBROUTINE fftw_alloc_complex_1d
79 SUBROUTINE fftw_dealloc_complex_1d(array)
80 COMPLEX(C_DOUBLE_COMPLEX),
DIMENSION(:),
CONTIGUOUS,
POINTER,
INTENT(INOUT) :: array
83 CALL fftw_free(c_loc(array))
90 END SUBROUTINE fftw_dealloc_complex_1d
92 SUBROUTINE fftw_alloc_complex_2d(array, n)
93 COMPLEX(C_DOUBLE_COMPLEX),
DIMENSION(:, :),
CONTIGUOUS,
POINTER,
INTENT(OUT) :: array
94 INTEGER,
DIMENSION(2),
INTENT(IN) :: n
97 TYPE(C_PTR) :: data_ptr
98 data_ptr = fftw_alloc_complex(int(product(n), kind=c_size_t))
99 CALL c_f_pointer(data_ptr, array, n)
102 ALLOCATE (array(n(1), n(2)))
105 END SUBROUTINE fftw_alloc_complex_2d
107 SUBROUTINE fftw_dealloc_complex_2d(array)
108 COMPLEX(C_DOUBLE_COMPLEX),
DIMENSION(:, :),
CONTIGUOUS,
POINTER,
INTENT(INOUT) :: array
111 CALL fftw_free(c_loc(array))
118 END SUBROUTINE fftw_dealloc_complex_2d
120 SUBROUTINE fftw_alloc_complex_3d(array, n)
121 COMPLEX(C_DOUBLE_COMPLEX),
DIMENSION(:, :, :),
CONTIGUOUS,
POINTER,
INTENT(OUT) :: array
122 INTEGER,
DIMENSION(3),
INTENT(IN) :: n
125 TYPE(C_PTR) :: data_ptr
126 data_ptr = fftw_alloc_complex(int(product(n), kind=c_size_t))
127 CALL c_f_pointer(data_ptr, array, n)
130 ALLOCATE (array(n(1), n(2), n(3)))
133 END SUBROUTINE fftw_alloc_complex_3d
135 SUBROUTINE fftw_dealloc_complex_3d(array)
136 COMPLEX(C_DOUBLE_COMPLEX),
DIMENSION(:, :, :),
CONTIGUOUS,
POINTER,
INTENT(INOUT) :: array
139 CALL fftw_free(c_loc(array))
146 END SUBROUTINE fftw_dealloc_complex_3d
148 #if defined ( __FFTW3 )
152 SUBROUTINE dummy_routine_to_call_mark_used()
156 mark_used(fftw_redft00)
157 mark_used(fftw_redft01)
158 mark_used(fftw_redft10)
159 mark_used(fftw_redft11)
160 mark_used(fftw_rodft00)
161 mark_used(fftw_rodft01)
162 mark_used(fftw_rodft10)
163 mark_used(fftw_rodft11)
164 mark_used(fftw_forward)
165 mark_used(fftw_backward)
166 mark_used(fftw_measure)
167 mark_used(fftw_destroy_input)
168 mark_used(fftw_unaligned)
169 mark_used(fftw_conserve_memory)
170 mark_used(fftw_exhaustive)
171 mark_used(fftw_preserve_input)
172 mark_used(fftw_patient)
173 mark_used(fftw_estimate)
174 mark_used(fftw_wisdom_only)
175 mark_used(fftw_estimate_patient)
176 mark_used(fftw_believe_pcost)
177 mark_used(fftw_no_dft_r2hc)
178 mark_used(fftw_no_nonthreaded)
179 mark_used(fftw_no_buffering)
180 mark_used(fftw_no_indirect_op)
181 mark_used(fftw_allow_large_generic)
182 mark_used(fftw_no_rank_splits)
183 mark_used(fftw_no_vrank_splits)
184 mark_used(fftw_no_vrecurse)
185 mark_used(fftw_no_simd)
186 mark_used(fftw_no_slow)
187 mark_used(fftw_no_fixed_radix_large_n)
188 mark_used(fftw_allow_pruning)
199 CHARACTER(LEN=*),
INTENT(IN) :: wisdom_file
202 #if defined ( __FFTW3 )
203 INTEGER :: iunit, istat
204 INTEGER(KIND=C_INT) :: isuccess
209 OPEN (unit=iunit, file=wisdom_file, status=
"UNKNOWN", form=
"FORMATTED", action=
"WRITE", iostat=istat)
211 isuccess = fftw_export_wisdom_to_filename(wisdom_file//c_null_char)
213 cpabort(
"Error exporting wisdom to file "//wisdom_file)
220 mark_used(wisdom_file)
232 CHARACTER(LEN=*),
INTENT(IN) :: wisdom_file
234 #if defined ( __FFTW3 )
235 INTEGER :: istat, iunit
236 INTEGER(KIND=C_INT) :: isuccess
249 #if defined (__INTEL_COMPILER) && defined (__MKL)
259 #elif defined (__MKL)
261 #include <mkl_version.h>
266 INQUIRE (file=wisdom_file, exist=exist)
269 OPEN (unit=iunit, file=wisdom_file, status=
"OLD", form=
"FORMATTED", position=
"REWIND", &
270 action=
"READ", iostat=istat)
272 isuccess = fftw_import_wisdom_from_filename(wisdom_file//c_null_char)
274 cpabort(
"Error importing wisdom from file "//wisdom_file)
287 #if defined(INTEL_MKL_VERSION) && (110100 < INTEL_MKL_VERSION)
289 #elif defined (__INTEL_COMPILER)
311 mark_used(wisdom_file)
332 INTEGER,
DIMENSION(*) :: data
333 INTEGER,
INTENT(INOUT) :: max_length
335 INTEGER :: h, i, j, k, m, maxn, maxn_elevens, &
336 maxn_fives, maxn_sevens, &
337 maxn_thirteens, maxn_threes, &
338 maxn_twos, ndata, nmax, number
339 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: dlocal,
idx
357 DO i = 0, maxn_threes
359 DO k = 0, maxn_sevens
360 DO m = 0, maxn_elevens
361 number = (3**i)*(5**j)*(7**k)*(11**m)
363 IF (number > nmax) cycle
366 IF (number >= maxn) cycle
375 ALLOCATE (dlocal(ndata),
idx(ndata))
381 DO i = 0, maxn_threes
383 DO k = 0, maxn_sevens
384 DO m = 0, maxn_elevens
385 number = (3**i)*(5**j)*(7**k)*(11**m)
387 IF (number > nmax) cycle
390 IF (number >= maxn) cycle
393 dlocal(ndata) = number
400 CALL sortint(dlocal, ndata,
idx)
401 ndata = min(ndata, max_length)
402 DATA(1:ndata) = dlocal(1:ndata)
405 DEALLOCATE (dlocal,
idx)
415 SUBROUTINE sortint(iarr, n, index)
417 INTEGER,
INTENT(IN) :: n
418 INTEGER,
INTENT(INOUT) :: iarr(1:n)
419 INTEGER,
INTENT(OUT) :: index(1:n)
421 INTEGER,
PARAMETER :: m = 7, nstack = 50
423 INTEGER :: a, i, ib, ir, istack(1:nstack), itemp, &
424 j, jstack, k, l, temp
441 IF (iarr(i) <= a)
EXIT
442 iarr(i + 1) = iarr(i)
443 index(i + 1) = index(i)
448 IF (jstack == 0)
RETURN
450 l = istack(jstack - 1)
455 iarr(k) = iarr(l + 1)
458 index(k) = index(l + 1)
460 IF (iarr(l + 1) > iarr(ir))
THEN
462 iarr(l + 1) = iarr(ir)
465 index(l + 1) = index(ir)
468 IF (iarr(l) > iarr(ir))
THEN
476 IF (iarr(l + 1) > iarr(l))
THEN
478 iarr(l + 1) = iarr(l)
481 index(l + 1) = index(l)
490 DO WHILE (iarr(i) < a)
494 DO WHILE (iarr(j) > a)
510 IF (jstack > nstack) cpabort(
" Nstack too small in sortr")
511 IF (ir - i + 1 >= j - l)
THEN
513 istack(jstack - 1) = i
516 istack(jstack) = j - 1
517 istack(jstack - 1) = l
524 END SUBROUTINE sortint
545 SUBROUTINE fftw3_create_guru_plan(plan, fft_rank, dim_n, &
546 dim_istride, dim_ostride, hm_rank, &
547 hm_n, hm_istride, hm_ostride, &
548 zin, zout, fft_direction, fftw_plan_type, &
553 TYPE(c_ptr),
INTENT(INOUT) :: plan
554 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(INOUT) :: zin, zout
555 INTEGER,
INTENT(IN) :: dim_n(2), dim_istride(2), dim_ostride(2), &
556 hm_n(2), hm_istride(2), hm_ostride(2), fft_rank, &
557 fft_direction, fftw_plan_type, hm_rank
558 LOGICAL,
INTENT(OUT) :: valid
560 #if defined (__FFTW3)
561 TYPE(fftw_iodim) :: dim(2), hm(2)
565 dim(i) = fftw_iodim(dim_n(i), dim_istride(i), dim_ostride(i))
566 hm(i) = fftw_iodim(hm_n(i), hm_istride(i), hm_ostride(i))
569 plan = fftw_plan_guru_dft(fft_rank, &
572 fft_direction, fftw_plan_type)
574 valid = c_associated(plan)
580 mark_used(dim_istride)
581 mark_used(dim_ostride)
584 mark_used(hm_istride)
585 mark_used(hm_ostride)
586 mark_used(fft_direction)
587 mark_used(fftw_plan_type)
589 IF (.false.) then; do;
IF (abs(zin(1)) > abs(zout(1))) exit;
END do;
END IF
602 FUNCTION fftw3_is_mkl_wrapper()
RESULT(is_mkl)
607 #if defined ( __FFTW3 )
608 LOGICAL :: guru_supported
609 INTEGER :: dim_n(2), dim_istride(2), dim_ostride(2), &
610 howmany_n(2), howmany_istride(2), howmany_ostride(2)
611 TYPE(c_ptr) :: test_plan
612 COMPLEX(KIND=dp),
DIMENSION(1, 1, 1) :: zin
622 howmany_istride(1) = 1
623 howmany_istride(2) = 1
624 howmany_ostride(1) = 1
625 howmany_ostride(2) = 1
626 zin = cmplx(0.0_dp, 0.0_dp, kind=dp)
627 CALL fftw3_create_guru_plan(test_plan, 1, &
628 dim_n, dim_istride, dim_ostride, &
629 2, howmany_n, howmany_istride, howmany_ostride, &
631 fftw_forward, fftw_estimate, guru_supported)
632 IF (guru_supported)
THEN
633 CALL fftw_destroy_plan(test_plan)
656 SUBROUTINE fftw3_compute_rows_per_th(nrows, nt, rows_per_thread, rows_per_thread_r, &
659 INTEGER,
INTENT(IN) :: nrows, nt
660 INTEGER,
INTENT(OUT) :: rows_per_thread, rows_per_thread_r, &
663 IF (mod(nrows, nt) .EQ. 0)
THEN
664 rows_per_thread = nrows/nt
665 rows_per_thread_r = 0
669 rows_per_thread = nrows/nt + 1
670 rows_per_thread_r = nrows/nt
671 th_plana = mod(nrows, nt)
672 th_planb = nt - th_plana
696 SUBROUTINE fftw3_create_3d_plans(plan, plan_r, dim_n, dim_istride, dim_ostride, &
697 hm_n, hm_istride, hm_ostride, &
699 fft_direction, fftw_plan_type, rows_per_th, &
702 TYPE(c_ptr),
INTENT(INOUT) :: plan, plan_r
703 INTEGER,
INTENT(INOUT) :: dim_n(2), dim_istride(2), &
704 dim_ostride(2), hm_n(2), &
705 hm_istride(2), hm_ostride(2)
706 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(INOUT) :: input, output
707 INTEGER,
INTENT(INOUT) :: fft_direction, fftw_plan_type
708 INTEGER,
INTENT(IN) :: rows_per_th, rows_per_th_r
714 hm_n(2) = rows_per_th
715 CALL fftw3_create_guru_plan(plan, 1, &
716 dim_n, dim_istride, dim_ostride, &
717 2, hm_n, hm_istride, hm_ostride, &
719 fft_direction, fftw_plan_type, valid)
721 IF (.NOT. valid)
THEN
722 cpabort(
"fftw3_create_plan")
726 hm_n(2) = rows_per_th_r
727 CALL fftw3_create_guru_plan(plan_r, 1, &
728 dim_n, dim_istride, dim_ostride, &
729 2, hm_n, hm_istride, hm_ostride, &
731 fft_direction, fftw_plan_type, valid)
732 IF (.NOT. valid)
THEN
733 cpabort(
"fftw3_create_plan (remaining)")
749 TYPE(fft_plan_type),
INTENT(INOUT) :: plan
750 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(INOUT) :: zin
751 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(INOUT) :: zout
752 INTEGER :: plan_style
753 #if defined ( __FFTW3 )
754 INTEGER :: n1, n2, n3
756 INTEGER :: rows_per_th
757 INTEGER :: rows_per_th_r
758 INTEGER :: fft_direction
759 INTEGER :: th_plana, th_planb
760 COMPLEX(KIND=dp),
ALLOCATABLE :: tmp(:)
763 INTEGER :: dim_n(2), dim_istride(2), dim_ostride(2), &
764 howmany_n(2), howmany_istride(2), howmany_ostride(2)
766 INTEGER :: fftw_plan_type
767 SELECT CASE (plan_style)
769 fftw_plan_type = fftw_estimate
771 fftw_plan_type = fftw_measure
773 fftw_plan_type = fftw_patient
775 fftw_plan_type = fftw_exhaustive
777 cpabort(
"fftw3_create_plan_3d")
780 #if defined (__FFTW3_UNALIGNED)
781 fftw_plan_type = fftw_plan_type + fftw_unaligned
784 IF (plan%fsign == +1)
THEN
785 fft_direction = fftw_forward
787 fft_direction = fftw_backward
801 IF ((fftw3_is_mkl_wrapper()) .OR. &
802 (.NOT. plan_style == 1) .OR. &
803 (n1 < 256 .AND. n2 < 256 .AND. n3 < 256 .AND. nt == 1))
THEN
809 plan%separated_plans = .false.
812 IF (plan%fft_in_place)
THEN
813 plan%fftw_plan = fftw_plan_dft_3d(n3, n2, n1, zin, zin, fft_direction, fftw_plan_type)
815 plan%fftw_plan = fftw_plan_dft_3d(n3, n2, n1, zin, zout, fft_direction, fftw_plan_type)
818 ALLOCATE (tmp(n1*n2*n3))
843 CALL fftw3_compute_rows_per_th(n3, nt, rows_per_th, rows_per_th_r, &
850 howmany_n(2) = rows_per_th
851 howmany_istride(1) = n1
852 howmany_istride(2) = n1*n2
853 howmany_ostride(1) = 1
854 howmany_ostride(2) = n1*n2
855 CALL fftw3_create_3d_plans(plan%fftw_plan_nx, plan%fftw_plan_nx_r, &
856 dim_n, dim_istride, dim_ostride, howmany_n, &
857 howmany_istride, howmany_ostride, &
859 fft_direction, fftw_plan_type, rows_per_th, &
863 CALL fftw3_compute_rows_per_th(n3, nt, rows_per_th, rows_per_th_r, &
869 howmany_n(2) = rows_per_th
870 howmany_istride(1) = n2
871 howmany_istride(2) = n1*n2
873 howmany_ostride(1) = n2*n3
874 howmany_ostride(2) = 1
876 CALL fftw3_create_3d_plans(plan%fftw_plan_ny, plan%fftw_plan_ny_r, &
877 dim_n, dim_istride, dim_ostride, &
878 howmany_n, howmany_istride, howmany_ostride, &
880 fft_direction, fftw_plan_type, rows_per_th, &
884 CALL fftw3_compute_rows_per_th(n1, nt, rows_per_th, rows_per_th_r, &
890 howmany_n(2) = rows_per_th
891 howmany_istride(1) = n3
892 howmany_istride(2) = n2*n3
893 howmany_ostride(1) = n3
894 howmany_ostride(2) = n2*n3
896 CALL fftw3_create_3d_plans(plan%fftw_plan_nz, plan%fftw_plan_nz_r, &
897 dim_n, dim_istride, dim_ostride, &
898 howmany_n, howmany_istride, howmany_ostride, &
900 fft_direction, fftw_plan_type, rows_per_th, &
903 plan%separated_plans = .true.
910 mark_used(plan_style)
912 IF (.false.) then; do;
IF (abs(zin(1)) > abs(zout(1))) exit;
END do;
END IF
931 SUBROUTINE fftw3_workshare_execute_dft(plan, plan_r, split_dim, nt, tid, &
932 input, istride, output, ostride)
934 INTEGER,
INTENT(IN) :: split_dim, nt, tid
935 INTEGER,
INTENT(IN) :: istride, ostride
936 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(INOUT) :: input, output
937 TYPE(c_ptr) :: plan, plan_r
938 #if defined (__FFTW3)
939 INTEGER :: i_off, o_off
940 INTEGER :: th_plana, th_planb
941 INTEGER :: rows_per_thread, rows_per_thread_r
943 CALL fftw3_compute_rows_per_th(split_dim, nt, rows_per_thread, &
947 IF (th_planb .GT. 0)
THEN
948 IF (tid .LT. th_plana)
THEN
949 i_off = (tid)*(istride*(rows_per_thread)) + 1
950 o_off = (tid)*(ostride*(rows_per_thread)) + 1
951 IF (rows_per_thread .GT. 0)
THEN
952 CALL fftw_execute_dft(plan, input(i_off), &
955 ELSE IF ((tid - th_plana) < th_planb)
THEN
957 i_off = (th_plana)*istride*(rows_per_thread) + &
958 (tid - th_plana)*istride*(rows_per_thread_r) + 1
959 o_off = (th_plana)*ostride*(rows_per_thread) + &
960 (tid - th_plana)*ostride*(rows_per_thread_r) + 1
962 CALL fftw_execute_dft(plan_r, input(i_off), &
967 i_off = (tid)*(istride*(rows_per_thread)) + 1
968 o_off = (tid)*(ostride*(rows_per_thread)) + 1
970 CALL fftw_execute_dft(plan, input(i_off), &
983 IF (.false.) then; do;
IF (abs(input(1)) > abs(output(1))) exit;
END do;
END IF
998 SUBROUTINE fftw33d(plan, scale, zin, zout, stat)
1000 TYPE(fft_plan_type),
INTENT(IN) :: plan
1001 REAL(kind=dp),
INTENT(IN) :: scale
1002 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(INOUT),
TARGET:: zin
1003 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(INOUT),
TARGET:: zout
1004 INTEGER,
INTENT(OUT) :: stat
1005 #if defined ( __FFTW3 )
1006 COMPLEX(KIND=dp),
POINTER :: xout(:)
1007 COMPLEX(KIND=dp),
ALLOCATABLE :: tmp1(:)
1008 INTEGER :: n1, n2, n3
1019 IF (plan%fft_in_place)
THEN
1020 xout => zin(:n1*n2*n3)
1022 xout => zout(:n1*n2*n3)
1026 IF (.NOT. plan%separated_plans)
THEN
1027 CALL fftw_execute_dft(plan%fftw_plan, zin, xout)
1030 ALLOCATE (tmp1(n1*n2*n3))
1037 CALL fftw3_workshare_execute_dft(plan%fftw_plan_nx, plan%fftw_plan_nx_r, &
1039 zin, n1*n2, tmp1, n1*n2)
1042 CALL fftw3_workshare_execute_dft(plan%fftw_plan_ny, plan%fftw_plan_ny_r, &
1044 tmp1, n1*n2, xout, 1)
1046 CALL fftw3_workshare_execute_dft(plan%fftw_plan_nz, plan%fftw_plan_nz_r, &
1048 xout, n2*n3, tmp1, n2*n3)
1055 xout((i - 1) + (j - 1)*n1 + (k - 1)*n1*n2 + 1) = &
1056 tmp1((k - 1) + (j - 1)*n3 + (i - 1)*n3*n2 + 1)
1065 IF (scale /= 1.0_dp)
THEN
1066 CALL zdscal(n1*n2*n3, scale, xout, 1)
1073 IF (.false.) then; do;
IF (abs(zin(1)) > abs(zout(1))) exit;
END do;
END IF
1093 TYPE(fft_plan_type),
INTENT(INOUT) :: plan
1094 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(IN) :: zin
1095 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(IN) :: zout
1096 INTEGER,
INTENT(IN) :: plan_style
1097 #if defined ( __FFTW3 )
1098 INTEGER :: ii, di, io, do, num_threads, num_rows
1100 INTEGER :: fftw_plan_type
1101 SELECT CASE (plan_style)
1103 fftw_plan_type = fftw_estimate
1105 fftw_plan_type = fftw_measure
1107 fftw_plan_type = fftw_patient
1109 fftw_plan_type = fftw_exhaustive
1111 cpabort(
"fftw3_create_plan_1dm")
1114 #if defined (__FFTW3_UNALIGNED)
1115 fftw_plan_type = fftw_plan_type + fftw_unaligned
1118 plan%separated_plans = .false.
1126 num_rows = plan%m/num_threads
1145 IF (plan%fsign == +1 .AND. plan%trans)
THEN
1148 ELSEIF (plan%fsign == -1 .AND. plan%trans)
THEN
1153 IF (plan%fsign == +1)
THEN
1154 CALL dfftw_plan_many_dft(plan%fftw_plan, 1, plan%n, num_rows, zin, 0, ii, di, &
1155 zout, 0, io,
DO, fftw_forward, fftw_plan_type)
1157 CALL dfftw_plan_many_dft(plan%fftw_plan, 1, plan%n, num_rows, zin, 0, ii, di, &
1158 zout, 0, io,
DO, fftw_backward, fftw_plan_type)
1174 mark_used(plan_style)
1176 IF (.false.) then; do;
IF (abs(zin(1)) > abs(zout(1))) exit;
END do;
END IF
1187 TYPE(fft_plan_type),
INTENT(INOUT) :: plan
1189 #if defined ( __FFTW3 )
1194 IF (.NOT. plan%separated_plans)
THEN
1195 CALL fftw_destroy_plan(plan%fftw_plan)
1199 CALL fftw_destroy_plan(plan%fftw_plan_nx)
1200 CALL fftw_destroy_plan(plan%fftw_plan_ny)
1201 CALL fftw_destroy_plan(plan%fftw_plan_nz)
1202 CALL fftw_destroy_plan(plan%fftw_plan_nx_r)
1203 CALL fftw_destroy_plan(plan%fftw_plan_ny_r)
1204 CALL fftw_destroy_plan(plan%fftw_plan_nz_r)
1222 TYPE(fft_plan_type),
INTENT(IN) :: plan
1223 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(IN),
TARGET :: zin
1224 COMPLEX(KIND=dp),
DIMENSION(*),
INTENT(INOUT), &
1226 REAL(kind=dp),
INTENT(IN) :: scale
1227 INTEGER,
INTENT(OUT) :: stat
1229 INTEGER :: in_offset, my_id, num_rows, out_offset, &
1231 TYPE(c_ptr) :: fftw_plan
1246 fftw_plan = plan%fftw_plan
1267 #if defined ( __FFTW3 )
1271 CALL dfftw_execute_dft(fftw_plan, zin(in_offset:in_offset), zout(out_offset:out_offset))
1276 IF (scale /= 1.0_dp)
CALL zdscal(plan%n*num_rows, scale, zout(scal_offset:scal_offset), 1)
1283 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.
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)
...