33 SUBROUTINE spgradq(I,M,ENN1,ELONN1,EON,EONTOP,Q,QDX,QDY,QDYTOP)
35 REAL ENN1((M+1)*((I+1)*M+2)/2),ELONN1((M+1)*((I+1)*M+2)/2)
36 REAL EON((M+1)*((I+1)*M+2)/2),EONTOP(M+1)
37 REAL Q((M+1)*((I+1)*M+2))
38 REAL QDX((M+1)*((I+1)*M+2)),QDY((M+1)*((I+1)*M+2))
45 qdy(2*k-1)=eon(k+1)*enn1(k+1)*q(2*k+1)
46 qdy(2*k)=eon(k+1)*enn1(k+1)*q(2*k+2)
47 DO k=2,(m+1)*((i+1)*m+2)/2-1
48 qdx(2*k-1)=-elonn1(k)*enn1(k)*q(2*k)
49 qdx(2*k)=elonn1(k)*enn1(k)*q(2*k-1)
50 qdy(2*k-1)=eon(k+1)*enn1(k+1)*q(2*k+1)-eon(k)*enn1(k-1)*q(2*k-3)
51 qdy(2*k)=eon(k+1)*enn1(k+1)*q(2*k+2)-eon(k)*enn1(k-1)*q(2*k-2)
54 qdx(2*k-1)=-elonn1(k)*enn1(k)*q(2*k)
55 qdx(2*k)=elonn1(k)*enn1(k)*q(2*k-1)
56 qdy(2*k-1)=-eon(k)*enn1(k-1)*q(2*k-3)
57 qdy(2*k)=-eon(k)*enn1(k-1)*q(2*k-2)
61 k=l*(2*m+(i-1)*(l-1))/2+i*l+m+1
62 qdytop(2*l+1)=-eontop(l+1)*enn1(k)*q(2*k-1)
63 qdytop(2*l+2)=-eontop(l+1)*enn1(k)*q(2*k)
subroutine spgradq(I, M, ENN1, ELONN1, EON, EONTOP, Q, QDX, QDY, QDYTOP)
Computes the horizontal vector gradient of a scalar field in spectral space.