NCEPLIBS-sp  2.3.3
spgrady.f
Go to the documentation of this file.
1 C> @file
2 C>
3 C> Compute y-gradient in spectral space
4 C> @author IREDELL @date 92-10-31
5 
6 C> COMPUTES THE HORIZONTAL VECTOR Y-GRADIENT OF A SCALAR FIELD
7 C> IN SPECTRAL SPACE.
8 C> SUBPROGRAM SPEPS SHOULD BE CALLED ALREADY.
9 C> IF L IS THE ZONAL WAVENUMBER, N IS THE TOTAL WAVENUMBER,
10 C> EPS(L,N)=SQRT((N**2-L**2)/(4*N**2-1)) AND A IS EARTH RADIUS,
11 C> THEN THE MERIDIONAL GRADIENT OF Q(L,N) IS COMPUTED AS
12 C> EPS(L,N+1)*(N+2)/A*Q(L,N+1)-EPS(L,N+1)*(N-1)/A*Q(L,N-1).
13 C> EXTRA TERMS ARE COMPUTED OVER TOP OF THE SPECTRAL DOMAIN.
14 C> ADVANTAGE IS TAKEN OF THE FACT THAT EPS(L,L)=0
15 C> IN ORDER TO VECTORIZE OVER THE ENTIRE SPECTRAL DOMAIN.
16 C>
17 C> @param I - INTEGER SPECTRAL DOMAIN SHAPE
18 C> (0 FOR TRIANGULAR, 1 FOR RHOMBOIDAL)
19 C> @param M - INTEGER SPECTRAL TRUNCATION
20 C> @param ENN1 - REAL ((M+1)*((I+1)*M+2)/2) N*(N+1)/A**2
21 C> @param EON - REAL ((M+1)*((I+1)*M+2)/2) EPSILON/N*A
22 C> @param EONTOP - REAL (M+1) EPSILON/N*A OVER TOP
23 C> @param Q - REAL ((M+1)*((I+1)*M+2)) SCALAR FIELD
24 C> @param QDY - REAL ((M+1)*((I+1)*M+2)) MERID GRADIENT (TIMES COSLAT)
25 C> @param QDYTOP - REAL (2*(M+1)) MERID GRADIENT (TIMES COSLAT) OVER TOP
26  SUBROUTINE spgrady(I,M,ENN1,EON,EONTOP,Q,QDY,QDYTOP)
27 
28  REAL ENN1((M+1)*((I+1)*M+2)/2)
29  REAL EON((M+1)*((I+1)*M+2)/2),EONTOP(M+1)
30  REAL Q((M+1)*((I+1)*M+2))
31  REAL QDY((M+1)*((I+1)*M+2))
32  REAL QDYTOP(2*(M+1))
33 C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
34 C TAKE MERIDIONAL GRADIENT
35  k=1
36  qdy(2*k-1)=eon(k+1)*enn1(k+1)*q(2*k+1)
37  qdy(2*k)=eon(k+1)*enn1(k+1)*q(2*k+2)
38  DO k=2,(m+1)*((i+1)*m+2)/2-1
39  qdy(2*k-1)=eon(k+1)*enn1(k+1)*q(2*k+1)-eon(k)*enn1(k-1)*q(2*k-3)
40  qdy(2*k)=eon(k+1)*enn1(k+1)*q(2*k+2)-eon(k)*enn1(k-1)*q(2*k-2)
41  ENDDO
42  k=(m+1)*((i+1)*m+2)/2
43  qdy(2*k-1)=-eon(k)*enn1(k-1)*q(2*k-3)
44  qdy(2*k)=-eon(k)*enn1(k-1)*q(2*k-2)
45 C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
46 C TAKE MERIDIONAL GRADIENT OVER TOP
47  DO l=0,m
48  k=l*(2*m+(i-1)*(l-1))/2+i*l+m+1
49  qdytop(2*l+1)=-eontop(l+1)*enn1(k)*q(2*k-1)
50  qdytop(2*l+2)=-eontop(l+1)*enn1(k)*q(2*k)
51  ENDDO
52 C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
53  RETURN
54  END
spgrady
subroutine spgrady(I, M, ENN1, EON, EONTOP, Q, QDY, QDYTOP)
COMPUTES THE HORIZONTAL VECTOR Y-GRADIENT OF A SCALAR FIELD IN SPECTRAL SPACE.
Definition: spgrady.f:27