1 subroutine da_find_fft_factors(n, n_ok, fft_factors)
3 !---------------------------------------------------------------------------
4 ! Purpose: Calculates prime factors of input number.
5 !---------------------------------------------------------------------------
9 integer, intent(in) :: n
10 logical, intent(out) :: n_ok
11 integer, intent(out) :: fft_factors(:)
14 integer :: nfax, nu, ifac
15 integer :: jfax(num_fft_factors)
18 data lfax /6,8,5,4,3,2,1/
21 !if (trace_use) call da_trace_entry("da_find_fft_factors")
23 !---------------------------------------------------------------------------
24 ! [1.0] Find factors of vector size (8,6,5,4,3,2; only one 8 allowed):
25 !---------------------------------------------------------------------------
30 ! look for sixes first, store factors in descending order
38 if (mod(nu,ifac).ne.0) goto 30
43 if (ifac.ne.8) goto 25
51 if (ifac.ne.8) goto 20
56 if (ifac .gt. 1) goto 20
59 ! write (unit=message(1),fmt='(a,i4,a)') 'n = ', n, ' contains illegal factors.'
60 ! call da_warning(__file__,__line__,message(1:1))
64 ! now reverse order of factors
69 fft_factors(nfax+2-i)=jfax(i)
76 !if (trace_use) call da_trace_exit("da_find_fft_factors")
78 end subroutine da_find_fft_factors