```
SPDZ2UV

The SPDZ2UV routine computes the wind components from divergence
and vorticity in spectral space.
Subprogram SPEPS should be called already.
If l is the zonal wavenumber, n is the total wavenumber,
eps(l,n)=sqrt((n**2-l**2)/(4*n**2-1)) and a is earth radius,
then the zonal wind component u is computed as
U(L,N)=-I*L/(N*(N+1))*A*D(L,N)
+EPS(L,N+1)/(N+1)*A*Z(L,N+1)-EPS(L,N)/N*A*Z(L,N-1)

and the meridional wind component v is computed as
V(L,N)=-I*L/(N*(N+1))*A*Z(L,N)
-EPS(L,N+1)/(N+1)*A*D(L,N+1)+EPS(L,N)/N*A*D(L,N-1)

Where d is divergence and z is vorticity.
u and v are weighted by the cosine of latitude.
extra terms are computed over top of the spectral domain.
advantage is taken of the fact that eps(l,l)=0
in order to vectorize over the entire spectral domain.

USAGE:    CALL SPDZ2UV(I,M,ENN1,ELONN1,EON,EONTOP,D,Z,U,V,UTOP,VTOP)

Input argument list:
I        - INTEGER SPECTRAL DOMAIN SHAPE
(0 FOR TRIANGULAR, 1 FOR RHOMBOIDAL)
M        - INTEGER SPECTRAL TRUNCATION
ENN1     - REAL ((M+1)*((I+1)*M+2)/2) N*(N+1)/A**2
ELONN1   - REAL ((M+1)*((I+1)*M+2)/2) L/(N*(N+1))*A
EON      - REAL ((M+1)*((I+1)*M+2)/2) EPSILON/N*A
EONTOP   - REAL (M+1) EPSILON/N*A OVER TOP
D        - REAL ((M+1)*((I+1)*M+2)) DIVERGENCE
Z        - REAL ((M+1)*((I+1)*M+2)) VORTICITY

Output argument list:
U        - REAL ((M+1)*((I+1)*M+2)) ZONAL WIND (TIMES COSLAT)
V        - REAL ((M+1)*((I+1)*M+2)) MERID WIND (TIMES COSLAT)
UTOP     - REAL (2*(M+1)) ZONAL WIND (TIMES COSLAT) OVER TOP
VTOP     - REAL (2*(M+1)) MERID WIND (TIMES COSLAT) OVER TOP

SPLIB.tar
Library contains routines to be
be used for a variety of spectral transform functions. (Fortran90)
Date posted: 2/23/2007

```