NCEPLIBS-sp  2.5.0
sptrunl.f File Reference

Spectrally truncate to laplacian. More...

Go to the source code of this file.

Functions/Subroutines

subroutine sptrunl (IROMB, MAXWV, IDRTI, IMAXI, JMAXI, IDRTO, IMAXO, JMAXO, KMAX, IPRIME, ISKIPI, JSKIPI, KSKIPI, ISKIPO, JSKIPO, KSKIPO, JCPU, IDIR, GRIDI, GRIDO)
 THIS SUBPROGRAM SPECTRALLY TRUNCATES SCALAR FIELDS ON A GLOBAL CYLINDRICAL GRID, RETURNING THEIR LAPLACIAN OR INVERSE TO A POSSIBLY DIFFERENT GLOBAL CYLINDRICAL GRID. More...
 

Detailed Description

Spectrally truncate to laplacian.

Author
IREDELL
Date
96-02-29

Definition in file sptrunl.f.

Function/Subroutine Documentation

◆ sptrunl()

subroutine sptrunl (   IROMB,
  MAXWV,
  IDRTI,
  IMAXI,
  JMAXI,
  IDRTO,
  IMAXO,
  JMAXO,
  KMAX,
  IPRIME,
  ISKIPI,
  JSKIPI,
  KSKIPI,
  ISKIPO,
  JSKIPO,
  KSKIPO,
  JCPU,
  IDIR,
real, dimension(*)  GRIDI,
real, dimension(*)  GRIDO 
)

THIS SUBPROGRAM SPECTRALLY TRUNCATES SCALAR FIELDS ON A GLOBAL CYLINDRICAL GRID, RETURNING THEIR LAPLACIAN OR INVERSE 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.

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
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)
IDIR- INTEGER FLAG IDIR > 0 TO TAKE LAPLACIAN IDIR < 0 TO TAKE INVERSE LAPLACIAN
GRIDI- REAL (*) INPUT GRID FIELDS
GRIDO- REAL (*) OUTPUT GRID FIELDS (MAY OVERLAY INPUT FIELDS IF GRID SHAPE IS APPROPRIATE)

SUBPROGRAMS CALLED:

  • SPWGET GET WAVE-SPACE CONSTANTS
  • SPLAPLAC COMPUTE LAPLACIAN IN SPECTRAL SPACE
  • SPTRAN PERFORM A SCALAR 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 78 of file sptrunl.f.

References ncpus(), splaplac(), sptran(), and spwget().