NCEPLIBS-sp  2.5.0
sptrund.f File Reference

Spectrally truncate to gradients. More...

Go to the source code of this file.

Functions/Subroutines

subroutine sptrund (IROMB, MAXWV, IDRTI, IMAXI, JMAXI, IDRTO, IMAXO, JMAXO, KMAX, IPRIME, ISKIPI, JSKIPI, KSKIPI, ISKIPO, JSKIPO, KSKIPO, JCPU, GRID, GRIDMN, GRIDX, GRIDY)
 THIS SUBPROGRAM SPECTRALLY TRUNCATES SCALAR FIELDS ON A GLOBAL CYLINDRICAL GRID, RETURNING THEIR MEANS AND GRADIENTS TO A POSSIBLY DIFFERENT GLOBAL CYLINDRICAL GRID. More...
 

Detailed Description

Spectrally truncate to gradients.

Author
IREDELL
Date
96-02-29

Definition in file sptrund.f.

Function/Subroutine Documentation

◆ sptrund()

subroutine sptrund (   IROMB,
  MAXWV,
  IDRTI,
  IMAXI,
  JMAXI,
  IDRTO,
  IMAXO,
  JMAXO,
  KMAX,
  IPRIME,
  ISKIPI,
  JSKIPI,
  KSKIPI,
  ISKIPO,
  JSKIPO,
  KSKIPO,
  JCPU,
real, dimension(*)  GRID,
  GRIDMN,
real, dimension(*)  GRIDX,
real, dimension(*)  GRIDY 
)

THIS SUBPROGRAM SPECTRALLY TRUNCATES SCALAR FIELDS ON A GLOBAL CYLINDRICAL GRID, RETURNING THEIR MEANS AND GRADIENTS TO A POSSIBLY DIFFERENT GLOBAL CYLINDRICAL GRID.

THE WAVE-SPACE CAN BE EITHER TRIANGULAR OR RHOMBOIDAL. EITHER GRID-SPACE CAN BE EITHER AN EQUALLY-SPACED GRID (WITH OR WITHOUT POLE POINTS) OR A GAUSSIAN GRID. THE GRID FIELDS MAY HAVE GENERAL INDEXING. THE TRANSFORMS ARE ALL MULTIPROCESSED. OVER ZONAL WAVENUMBER TO ENSURE REPRODUCIBILITY. TRANSFORM SEVERAL FIELDS AT A TIME TO IMPROVE VECTORIZATION. SUBPROGRAM CAN BE CALLED FROM A MULTIPROCESSING ENVIRONMENT.

Parameters
IROMB- INTEGER SPECTRAL DOMAIN SHAPE (0 FOR TRIANGULAR, 1 FOR RHOMBOIDAL)
MAXWV- INTEGER SPECTRAL TRUNCATION
IDRTI- INTEGER INPUT GRID IDENTIFIER (IDRTI=4 FOR GAUSSIAN GRID, IDRTI=0 FOR EQUALLY-SPACED GRID INCLUDING POLES, IDRTI=256 FOR EQUALLY-SPACED GRID EXCLUDING POLES)
IMAXI- INTEGER EVEN NUMBER OF INPUT LONGITUDES.
JMAXI- INTEGER NUMBER OF INPUT LATITUDES.
IDRTO- INTEGER OUTPUT GRID IDENTIFIER (IDRTO=4 FOR GAUSSIAN GRID, IDRTO=0 FOR EQUALLY-SPACED GRID INCLUDING POLES, IDRTO=256 FOR EQUALLY-SPACED GRID EXCLUDING POLES)
IMAXO- INTEGER EVEN NUMBER OF OUTPUT LONGITUDES.
JMAXO- INTEGER NUMBER OF OUTPUT LATITUDES.
KMAX- INTEGER NUMBER OF FIELDS TO TRANSFORM.
IPRIME- INTEGER INPUT LONGITUDE INDEX FOR THE PRIME MERIDIAN. (DEFAULTS TO 1 IF IPRIME=0) (OUTPUT LONGITUDE INDEX FOR PRIME MERIDIAN ASSUMED 1.)
ISKIPI- INTEGER SKIP NUMBER BETWEEN INPUT LONGITUDES (DEFAULTS TO 1 IF ISKIPI=0)
JSKIPI- INTEGER SKIP NUMBER BETWEEN INPUT LATITUDES FROM SOUTH (DEFAULTS TO -IMAXI IF JSKIPI=0)
KSKIPI- INTEGER SKIP NUMBER BETWEEN INPUT GRID FIELDS (DEFAULTS TO IMAXI*JMAXI IF KSKIPI=0)
ISKIPO- INTEGER SKIP NUMBER BETWEEN OUTPUT LONGITUDES (DEFAULTS TO 1 IF ISKIPO=0)
JSKIPO- INTEGER SKIP NUMBER BETWEEN OUTPUT LATITUDES FROM SOUTH (DEFAULTS TO -IMAXO IF JSKIPO=0)
KSKIPO- INTEGER SKIP NUMBER BETWEEN OUTPUT GRID FIELDS (DEFAULTS TO IMAXO*JMAXO IF KSKIPO=0)
JCPU- INTEGER NUMBER OF CPUS OVER WHICH TO MULTIPROCESS (DEFAULTS TO ENVIRONMENT NCPUS IF JCPU=0)
GRID- REAL (*) INPUT GRID FIELDS
GRIDMN- REAL (KMAX) OUTPUT GLOBAL MEANS
GRIDX- REAL (*) OUTPUT X-GRADIENTS
GRIDY- REAL (*) OUTPUT Y-GRADIENTS

SUBPROGRAMS CALLED:

  • SPTRAN PERFORM A SCALAR SPHERICAL TRANSFORM
  • SPTRAND PERFORM A GRADIENT SPHERICAL TRANSFORM
  • NCPUS GETS ENVIRONMENT NUMBER OF CPUS

REMARKS: MINIMUM GRID DIMENSIONS FOR UNALIASED TRANSFORMS TO SPECTRAL:

DIMENSION LINEAR QUADRATIC
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

Definition at line 71 of file sptrund.f.

References ncpus(), sptran(), and sptrand().