```
SPTEZM

The SPTEZM routine performs spherical transforms
between spectral coefficients of scalar quantities
and fields on a global cylindrical grid.
The wave-space can be either Triangular or Rhomboidal.
The grid-space can be either an equally-spaced grid
(with or without pole points) or a Gaussian grid.
wave fields are in sequential 'IBM order'.
Grid fields are indexed East to West, Then North to South.
For more flexibility and efficiency, call SPTRAN.
Subprogram can be called from a multiprocessing environment.

USAGE:    CALL SPTEZM(IROMB,MAXWV,IDRT,IMAX,JMAX,KMAX,WAVE,GRID,IDIR)

Input arguments:
IROMB    - INTEGER SPECTRAL DOMAIN SHAPE
(0 FOR TRIANGULAR, 1 FOR RHOMBOIDAL)
MAXWV    - INTEGER SPECTRAL TRUNCATION
IDRT     - INTEGER GRID IDENTIFIER
(IDRT=4 FOR GAUSSIAN GRID,
IDRT=0 FOR EQUALLY-SPACED GRID INCLUDING POLES,
IDRT=256 FOR EQUALLY-SPACED GRID EXCLUDING POLES)
IMAX     - INTEGER EVEN NUMBER OF LONGITUDES
JMAX     - INTEGER NUMBER OF LATITUDES
KMAX     - INTEGER NUMBER OF FIELDS TO TRANSFORM
WAVE     - REAL (2*MX,KMAX) WAVE FIELD IF IDIR>0
WHERE MX=(MAXWV+1)*((IROMB+1)*MAXWV+2)/2
GRID     - REAL (IMAX,JMAX,KMAX) GRID FIELD (E->W,N->S) IF IDIR<0
IDIR     - INTEGER TRANSFORM FLAG
(IDIR>0 FOR WAVE TO GRID, IDIR<0 FOR GRID TO WAVE)

Output arguments:
WAVE     - REAL (2*MX,KMAX) WAVE FIELD IF IDIR<0
WHERE MX=(MAXWV+1)*((IROMB+1)*MAXWV+2)/2
GRID     - REAL (IMAX,JMAX,KMAX) GRID FIELD (E->W,N->S) IF IDIR>0

REMARKS:
MINIMUM GRID DIMENSIONS FOR UNALIASED TRANSFORMS TO SPECTRAL:

-----------------------      ---------           -------------
IMAX                         2*MAXWV+2           3*MAXWV/2*2+2
JMAX (IDRT=4,IROMB=0)        1*MAXWV+1           3*MAXWV/2+1
JMAX (IDRT=4,IROMB=1)        2*MAXWV+1           5*MAXWV/2+1
JMAX (IDRT=0,IROMB=0)        2*MAXWV+3           3*MAXWV/2*2+3
JMAX (IDRT=0,IROMB=1)        4*MAXWV+3           5*MAXWV/2*2+3
JMAX (IDRT=256,IROMB=0)      2*MAXWV+1           3*MAXWV/2*2+1
JMAX (IDRT=256,IROMB=1)      4*MAXWV+1           5*MAXWV/2*2+1

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

```