da_find_fft_trig_funcs.inc
References to this file elsewhere.
1 subroutine da_find_fft_trig_funcs(n, trig_functs)
2
3 !---------------------------------------------------------------------------
4 ! Purpose: Set up constants required for Fourier, sine and cosine transforms
5 !---------------------------------------------------------------------------
6
7 implicit none
8
9 integer, intent(in) :: n
10 real, intent(out) :: trig_functs(:)
11
12 integer :: k, nil, nhl
13 real :: del, angle
14
15 ! in da_control
16 ! if (trace_use) call da_trace_entry("da_find_fft_trig_funcs")
17
18 !---------------------------------------------------------------------------
19 ! [1.0] Trig functions for real periodic transform:
20 !---------------------------------------------------------------------------
21
22 trig_functs(:) = 0.0
23
24 del=4.0*(pi/2.0)/float(n)
25 nil=0
26 nhl=(n/2)-1
27
28 do k=nil,nhl
29 angle=float(k)*del
30 trig_functs(2*k+1)=cos(angle)
31 trig_functs(2*k+2)=sin(angle)
32 end do
33
34 ! [1.1] extra trig functions for cosine transform:
35
36 del=0.5*del
37 do k=1,nhl
38 angle=float(k)*del
39 trig_functs(2*n+k)=sin(angle)
40 end do
41
42 ! [1.2] extra trig functions for shifted cosine transform:
43
44 del=0.5*del
45 do k=1,n
46 angle=float(k)*del
47 trig_functs(n+k)=sin(angle)
48 end do
49
50 !if (trace_use) call da_trace_exit("da_find_fft_trig_funcs")
51
52 end subroutine da_find_fft_trig_funcs
53
54