NCEPLIBS-sp 2.4.0
spvar.f
Go to the documentation of this file.
1C> @file
2C> @brief Compute variance by total wavenumber.
3C> @author Iredell @date 92-10-31
4
5C> Computes the variances by total wavenumber
6C> of a scalar field in spectral space.
7C>
8C> @param I spectral domain shape
9C> (0 for triangular, 1 for rhomboidal)
10C> @param M spectral truncation
11C> @param Q ((M+1)*((I+1)*M+2)) scalar field
12C> @param QVAR (0:(I+1)*M) variances
13C>
14C> @author Iredell @date 92-10-31
15 SUBROUTINE spvar(I,M,Q,QVAR)
16 REAL Q((M+1)*((I+1)*M+2))
17 REAL QVAR(0:(I+1)*M)
18
19 l=0
20 DO n=0,m
21 ks=l*(2*m+(i-1)*(l-1))+2*n
22 qvar(n)=0.5*q(ks+1)**2
23 ENDDO
24 DO n=m+1,(i+1)*m
25 qvar(n)=0.
26 ENDDO
27 DO n=0,(i+1)*m
28 DO l=max(1,n-m),min(n,m)
29 ks=l*(2*m+(i-1)*(l-1))+2*n
30 qvar(n)=qvar(n)+q(ks+1)**2+q(ks+2)**2
31 ENDDO
32 ENDDO
33
34 RETURN
35 END
subroutine spvar(I, M, Q, QVAR)
Computes the variances by total wavenumber of a scalar field in spectral space.
Definition: spvar.f:16