NCEPLIBS-sp 2.4.0
spanaly.f
Go to the documentation of this file.
1C> @file
2C> @brief Analyze spectral from Fourier.
3C>
4C> ### Program History Log
5C> Date | Programmer | Comments
6C> -----|------------|---------
7C> 91-10-31 | Mark Iredell | Initial.
8C> 94-08-01 | Mark Iredell | Moved zonal wavenumber loop inside.
9C> 1998-12-15 | Iredell | Openmp directives inserted.
10C>
11C> @author Iredell @date 91-10-31
12
13C> Analyzes spectral coefficients from Fourier coefficients
14C> for a latitude pair (Northern and Southern hemispheres).
15C>
16C> Vector components are multiplied by cosine of latitude.
17C>
18C> @param I spectral domain shape (0 for triangular, 1 for rhomboidal)
19C> @param M spectral truncation
20C> @param IM even number of Fourier coefficients
21C> @param IX dimension of Fourier coefficients (IX>=IM+2)
22C> @param NC dimension of spectral coefficients (NC>=(M+1)*((I+1)*M+2))
23C> @param NCTOP dimension of spectral coefficients over top (NCTOP>=2*(M+1))
24C> @param KM number of fields
25C> @param WGT Gaussian weight
26C> @param CLAT cosine of latitude
27C> @param PLN Legendre polynomials
28C> @param PLNTOP Legendre polynomial over top
29C> @param MP identifiers (0 for scalar, 1 for vector)
30C> @param F Fourier coefficients combined
31C> @param SPC spectral coefficients
32C> @param SPCTOP spectral coefficients over top
33C>
34C> @author Iredell @date 91-10-31
35 SUBROUTINE spanaly(I,M,IM,IX,NC,NCTOP,KM,WGT,CLAT,PLN,PLNTOP,MP,
36 & F,SPC,SPCTOP)
37 INTEGER MP(KM)
38 REAL PLN((M+1)*((I+1)*M+2)/2),PLNTOP(M+1)
39 REAL F(IX,2,KM)
40 REAL SPC(NC,KM),SPCTOP(NCTOP,KM)
41 REAL FW(2,2)
42
43C FOR EACH ZONAL WAVENUMBER, ANALYZE TERMS OVER TOTAL WAVENUMBER.
44C ANALYZE EVEN AND ODD POLYNOMIALS SEPARATELY.
45 lx=min(m,im/2)
46!C$OMP PARALLEL DO PRIVATE(L,NT,KS,KP,FW)
47 DO k=1,km
48 DO l=0,lx
49 nt=mod(m+1+(i-1)*l,2)+1
50 ks=l*(2*m+(i-1)*(l-1))
51 kp=ks/2+1
52 IF(mp(k).EQ.0) THEN
53 fw(1,1)=wgt*(f(2*l+1,1,k)+f(2*l+1,2,k))
54 fw(2,1)=wgt*(f(2*l+2,1,k)+f(2*l+2,2,k))
55 fw(1,2)=wgt*(f(2*l+1,1,k)-f(2*l+1,2,k))
56 fw(2,2)=wgt*(f(2*l+2,1,k)-f(2*l+2,2,k))
57 ELSE
58 fw(1,1)=wgt*clat*(f(2*l+1,1,k)+f(2*l+1,2,k))
59 fw(2,1)=wgt*clat*(f(2*l+2,1,k)+f(2*l+2,2,k))
60 fw(1,2)=wgt*clat*(f(2*l+1,1,k)-f(2*l+1,2,k))
61 fw(2,2)=wgt*clat*(f(2*l+2,1,k)-f(2*l+2,2,k))
62 spctop(2*l+1,k)=spctop(2*l+1,k)+plntop(l+1)*fw(1,nt)
63 spctop(2*l+2,k)=spctop(2*l+2,k)+plntop(l+1)*fw(2,nt)
64 ENDIF
65 DO n=l,i*l+m,2
66 spc(ks+2*n+1,k)=spc(ks+2*n+1,k)+pln(kp+n)*fw(1,1)
67 spc(ks+2*n+2,k)=spc(ks+2*n+2,k)+pln(kp+n)*fw(2,1)
68 ENDDO
69 DO n=l+1,i*l+m,2
70 spc(ks+2*n+1,k)=spc(ks+2*n+1,k)+pln(kp+n)*fw(1,2)
71 spc(ks+2*n+2,k)=spc(ks+2*n+2,k)+pln(kp+n)*fw(2,2)
72 ENDDO
73 ENDDO
74 ENDDO
75 RETURN
76 END
subroutine spanaly(I, M, IM, IX, NC, NCTOP, KM, WGT, CLAT, PLN, PLNTOP, MP, F, SPC, SPCTOP)
Analyzes spectral coefficients from Fourier coefficients for a latitude pair (Northern and Southern h...
Definition: spanaly.f:37