subroutine fouri1 i (x, indpar) c Subroutine to calculate Fourier Series coefficients. c Code received 01/21/99 from Clarence Richardson. c Modified by C. R. Meyer and verified to give identical results. c real x(12) integer indpar c c x - 12 measured monthly average values (means, sd, skew). c indpar - index of the current parameter. c c s - sum of the x's. c x_bar - average (mean) of the x's. c include 'cinterp.inc' c write: c, t c c - fourier series coefficient. c t - fourier series coefficient. c c + + + LOCAL VARIABLES + + + integer i, j real s, suma, sumb, d, v, a, b c ---- sum the x's: s=0.0 do 5 i=1,12 s=s+x(i) 5 continue c c ---- compute t & c: x_bar(indpar)=s/12. do 20 j=1,6 suma = 0.0 sumb=0.0 c do 10 i=1,12 d=x(i)-x_bar(indpar) v=6.2832*float(i)*float(j)/12. suma=suma+(d*cos(v)) sumb=sumb+(d*sin(v)) 10 continue c a=suma*(2./12.) b=sumb*(2./12.) t(j,indpar)=atan(-b/a) c(j,indpar)=a/cos(t(j,indpar)) 20 continue c return end