```
SPUV2DZ

The SPUV2DZ routine computes the divergence and vorticity from
wind components 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 divergence d is computed as
d(l,n)=i*l*a*u(l,n)
+eps(l,n+1)*n*a*v(l,n+1)-eps(l,n)*(n+1)*a*v(l,n-1)
and the vorticity z is computed as
z(l,n)=i*l*a*v(l,n)
-eps(l,n+1)*n*a*u(l,n+1)+eps(l,n)*(n+1)*a*u(l,n-1)
where u is the zonal wind and v is the meridional wind.
u and v are weighted by the secant of latitude.
Extra terms are used 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 SPUV2DZ(I,M,ENN1,ELONN1,EON,EONTOP,U,V,UTOP,VTOP,D,Z)

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
U        - REAL ((M+1)*((I+1)*M+2)) ZONAL WIND (OVER COSLAT)
V        - REAL ((M+1)*((I+1)*M+2)) MERID WIND (OVER COSLAT)
UTOP     - REAL (2*(M+1)) ZONAL WIND (OVER COSLAT) OVER TOP
VTOP     - REAL (2*(M+1)) MERID WIND (OVER COSLAT) OVER TOP

Output argument list:
D        - REAL ((M+1)*((I+1)*M+2)) DIVERGENCE
Z        - REAL ((M+1)*((I+1)*M+2)) VORTICITY

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

```