ETS  \$Id: Doxyfile 2162 2020-02-26 14:16:09Z g2dpc $
 All Classes Files Functions Variables Pages
fsum2.f90
Go to the documentation of this file.
1 subroutine fsum2( f, t, ffnul, ffcos, ffsin, mharm)
2 !-----------------------------------------------------------------------
3 ! fourier synthesis of general function f(t) at single point t.
4 !-----------------------------------------------------------------------
5 
6  use itm_types
7 
8  implicit none
9 
10  integer(itm_i4), intent(in) :: mharm
11  real(r8), intent(out) :: f
12  real(r8), intent(in) :: t, ffnul
13  real(r8), dimension(mharm), intent(in) :: ffcos, ffsin
14 
15  real(r8) :: co, si, c, s, ca, sum
16  integer(itm_i4) :: m
17 
18  co = cos(t)
19  si = sin(t)
20  c = 1._r8
21  s = 0._r8
22  sum = .5_r8 * ffnul
23  do m = 1,mharm
24  ca = c * co - s * si
25  s = s * co + c * si
26  c = ca
27  sum = sum + ffcos(m) * c + ffsin(m) * s
28  end do
29  f = sum
30 
31  return
32 end subroutine fsum2
subroutine fsum2(f, t, ffnul, ffcos, ffsin, mharm)
Definition: fsum2.f90:1