NCEPLIBS-ip  5.0.0
sptgpsd.f File Reference

Transform spectral to polar stereographic gradients. More...

Go to the source code of this file.

Functions/Subroutines

subroutine sptgpsd (IROMB, MAXWV, KMAX, NPS, KWSKIP, KGSKIP, NISKIP, NJSKIP, TRUE, XMESH, ORIENT, WAVE, XN, YN, XS, YS)
 This subprogram performs a spherical transform from spectral coefficients of scalar fields to gradient fields on a pair of polar stereographic grids. More...
 

Detailed Description

Transform spectral to polar stereographic gradients.

Program history log:

Date Programmer Comments
96-02-29 IREDELL Initial.
1998-12-15 IREDELL OpenMP directives inserted.
Author
IREDELL
Date
96-02-29

Definition in file sptgpsd.f.

Function/Subroutine Documentation

◆ sptgpsd()

subroutine sptgpsd (   IROMB,
  MAXWV,
  KMAX,
  NPS,
  KWSKIP,
  KGSKIP,
  NISKIP,
  NJSKIP,
  TRUE,
  XMESH,
  ORIENT,
real, dimension(*)  WAVE,
real, dimension(*)  XN,
real, dimension(*)  YN,
real, dimension(*)  XS,
real, dimension(*)  YS 
)

This subprogram 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 by combining points in eight sectors of each polar stereographic grid, numbered as in the following diagram. 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.

Parameters
IROMBSpectral domain shape (0 for triangular, 1 for rhomboidal)
MAXWVSpectral truncation
KMAXNumber of fields to transform
NPSOdd order of the polar stereographic grids
KWSKIPSkip number between wave fields (defaults to (MAXWV+1)*((IROMB+1)*MAXWV+2) if KWSKIP=0)
KGSKIPSkip number between grid fields (defaults to NPS*NPS if KGSKIP=0)
NISKIPSkip number between grid i-points (defaults to 1 if NISKIP=0)
NJSKIPSkip number between grid j-points (defaults to NPS if NJSKIP=0)
TRUELatitude at which PS grid is true (usually 60.)
XMESHGrid length at true latitude (M)
ORIENTLongitude at bottom of northern PS grid (southern PS grid will have opposite orientation.)
WAVEWave fields
XNNorthern polar stereographic x-gradients
YNNorthern polar stereographic y-gradients
XSSouthern polar stereographic x-gradients
YSSouthern polar stereographic y-gradients
Author
IREDELL
Date
96-02-29

Definition at line 71 of file sptgpsd.f.

References splaplac(), sptgpsv(), and spwget().