SPGRADQ

The SPGRADQ routine computes the horizontal vector gradient of
            a scalar field 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 gradient of q(l,n) is simply i*l/a*q(l,n)
            while the Meridional Gradient of q(l,n) is computed as
            eps(l,n+1)*(n+2)/a*q(l,n+1)-eps(l,n+1)*(n-1)/a*q(l,n-1).
            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 SPGRADQ(I,M,ENN1,ELONN1,EON,EONTOP,Q,QDX,QDY,QDYTOP)

   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
      Q        - REAL ((M+1)*((I+1)*M+2)) SCALAR FIELD
 
   Output argument list:
      QDX      - REAL ((M+1)*((I+1)*M+2)) ZONAL GRADIENT (TIMES COSLAT)
      QDY      - REAL ((M+1)*((I+1)*M+2)) MERID GRADIENT (TIMES COSLAT)
      QDYTOP   - REAL (2*(M+1)) MERID GRADIENT (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