NCEPLIBS-sp  2.3.3
sptgpsv.f File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine sptgpsv (IROMB, MAXWV, KMAX, NPS, KWSKIP, KGSKIP, NISKIP, NJSKIP, TRUE, XMESH, ORIENT, WAVED, WAVEZ, UN, VN, US, VS)
 This subprogram performs a spherical transform from spectral coefficients of divergences and curls to vector fields on a pair of polar stereographic grids. More...
 

Detailed Description

Transform spectral vector to polar stereo.

Author
IREDELL
Date
96-02-29

Definition in file sptgpsv.f.

Function/Subroutine Documentation

◆ sptgpsv()

subroutine sptgpsv (   IROMB,
  MAXWV,
  KMAX,
  NPS,
  KWSKIP,
  KGSKIP,
  NISKIP,
  NJSKIP,
  TRUE,
  XMESH,
  ORIENT,
real, dimension(*)  WAVED,
real, dimension(*)  WAVEZ,
real, dimension(*)  UN,
real, dimension(*)  VN,
real, dimension(*)  US,
real, dimension(*)  VS 
)

This subprogram performs a spherical transform from spectral coefficients of divergences and curls to vector 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 by combining points in eight sectors of each polar stereographic grid,
numbered as in the diagram below. The pole and the sector boundaries
are treated specially in the code.
Unfortunately, this approach induces some hairy indexing and code loquacity, for which the developer apologizes.

              \ 4 | 5 /
               \  |  /
              3 \ | / 6
                 |/
              ----+----
                 /|\
              2 / | \ 7
               /  |  \
              / 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.

PROGRAM HISTORY LOG:

  • 96-02-29 IREDELL
  • 1998-12-15 IREDELL OPENMP DIRECTIVES INSERTED
Parameters
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.)
WAVED- REAL (*) WAVE DIVERGENCE FIELDS
WAVEZ- REAL (*) WAVE VORTICITY FIELDS
UN- REAL (*) NORTHERN POLAR STEREOGRAPHIC U-WINDS
VN- REAL (*) NORTHERN POLAR STEREOGRAPHIC V-WINDS
US- REAL (*) SOUTHERN POLAR STEREOGRAPHIC U-WINDS
VS- REAL (*) SOUTHERN POLAR STEREOGRAPHIC V-WINDS

SUBPROGRAMS CALLED:

  • SPWGET() GET WAVE-SPACE CONSTANTS
  • SPLEGEND() COMPUTE LEGENDRE POLYNOMIALS
  • SPSYNTH() SYNTHESIZE FOURIER FROM SPECTRAL
  • SPDZ2UV() COMPUTE WINDS FROM DIVERGENCE AND VORTICITY

Definition at line 81 of file sptgpsv.f.