SPTGPSD

The SPTGPSD routine performs a Spherical transform
            from spectral coefficients of scalar fields
            to gradient fields on a pair of Polar Stereographic grids.
            The wave-space can be either Triangular or Rhomboidal.
            The wave and grid fields may have general indexing,
            but each wave field is in sequential 'IBM order',
            i.e. with zonal wavenumber as the slower index.
            The two square Polar Stereographic grids are centered
            on the respective poles, with the orientation longitude
            of the Southern Hemisphere grid 180 degrees opposite
            that of the Northern Hemisphere grid.
            The vectors are automatically rotated to be resolved
            relative to the respective Polar Stereographic grids.
 
            The transform is made efficient             \ 4 | 5 /
            by combining points in eight sectors         \  |  /
            of each Polar Stereographic grid,           3 \ | / 6
            numbered as in the diagram at right.           \|/
            The pole and the sector boundaries          ----+----
            are treated specially in the code.             /|\
            unfortunately, this approach induces        2 / | \ 7
            some hairy indexing and code loquacity,      /  |  \
            For which the developer apologizes.         / 1 | 8 \
 
            The transforms are all multiprocessed over sector points.
            transform several fields at a time to improve vectorization.
            Subprogram can be called from a multiprocessing environment.
 
 
USAGE:    CALL SPTGPSD(IROMB,MAXWV,KMAX,NPS,
                       KWSKIP,KGSKIP,NISKIP,NJSKIP,
                       TRUE,XMESH,ORIENT,WAVE,XP,YP)

   Input arguments:
      IROMB    - INTEGER SPECTRAL DOMAIN SHAPE
                 (0 FOR TRIANGULAR, 1 FOR RHOMBOIDAL)
      MAXWV    - INTEGER SPECTRAL TRUNCATION
      KMAX     - INTEGER NUMBER OF FIELDS TO TRANSFORM.
      NPS      - INTEGER ODD ORDER OF THE POLAR STEREOGRAPHIC GRIDS
      KWSKIP   - INTEGER SKIP NUMBER BETWEEN WAVE FIELDS
                 (DEFAULTS TO (MAXWV+1)*((IROMB+1)*MAXWV+2) IF KWSKIP=0)
      KGSKIP   - INTEGER SKIP NUMBER BETWEEN GRID FIELDS
                 (DEFAULTS TO NPS*NPS IF KGSKIP=0)
      NISKIP   - INTEGER SKIP NUMBER BETWEEN GRID I-POINTS
                 (DEFAULTS TO 1 IF NISKIP=0)
      NJSKIP   - INTEGER SKIP NUMBER BETWEEN GRID J-POINTS
                 (DEFAULTS TO NPS IF NJSKIP=0)
      TRUE     - REAL LATITUDE AT WHICH PS GRID IS TRUE (USUALLY 60.)
      XMESH    - REAL GRID LENGTH AT TRUE LATITUDE (M)
      ORIENT   - REAL LONGITUDE AT BOTTOM OF NORTHERN PS GRID
                 (SOUTHERN PS GRID WILL HAVE OPPOSITE ORIENTATION.)
      WAVE     - REAL (*) WAVE FIELDS

   Output arguments:
      XN       - REAL (*) NORTHERN POLAR STEREOGRAPHIC X-GRADIENTS
      YN       - REAL (*) NORTHERN POLAR STEREOGRAPHIC Y-GRADIENTS
      XS       - REAL (*) SOUTHERN POLAR STEREOGRAPHIC X-GRADIENTS
      YS       - REAL (*) SOUTHERN POLAR STEREOGRAPHIC Y-GRADIENTS
 
 
SPLIB.tar Library contains routines to be be used for a variety of spectral transform functions. (Fortran90)
Date posted: 2/23/2007