NCEPLIBS-sp  2.3.3
sptezm.f
Go to the documentation of this file.
1 C> @file
2 C>
3 C> Perform simple scalar spherical transforms
4 C> @author IREDELL @date 96-02-29
5 
6 C> THIS SUBPROGRAM PERFORMS SPHERICAL TRANSFORMS
7 C> BETWEEN SPECTRAL COEFFICIENTS OF SCALAR QUANTITIES
8 C> AND FIELDS ON A GLOBAL CYLINDRICAL GRID.
9 C> THE WAVE-SPACE CAN BE EITHER TRIANGULAR OR RHOMBOIDAL.
10 C> THE GRID-SPACE CAN BE EITHER AN EQUALLY-SPACED GRID
11 C> (WITH OR WITHOUT POLE POINTS) OR A GAUSSIAN GRID.
12 C> WAVE FIELDS ARE IN SEQUENTIAL 'IBM ORDER'.
13 C> GRID FIELDS ARE INDEXED EAST TO WEST, THEN NORTH TO SOUTH.
14 C> FOR MORE FLEXIBILITY AND EFFICIENCY, CALL SPTRAN.
15 C> SUBPROGRAM CAN BE CALLED FROM A MULTIPROCESSING ENVIRONMENT.
16 C>
17 C> @param IROMB - INTEGER SPECTRAL DOMAIN SHAPE
18 C> (0 FOR TRIANGULAR, 1 FOR RHOMBOIDAL)
19 C> @param MAXWV - INTEGER SPECTRAL TRUNCATION
20 C> @param IDRT - INTEGER GRID IDENTIFIER
21 C> (IDRT=4 FOR GAUSSIAN GRID,
22 C> IDRT=0 FOR EQUALLY-SPACED GRID INCLUDING POLES,
23 C> IDRT=256 FOR EQUALLY-SPACED GRID EXCLUDING POLES)
24 C> @param IMAX - INTEGER EVEN NUMBER OF LONGITUDES
25 C> @param JMAX - INTEGER NUMBER OF LATITUDES
26 C> @param KMAX - INTEGER NUMBER OF FIELDS TO TRANSFORM
27 C> @param[out] WAVE - REAL (2*MX,KMAX) WAVE FIELD IF IDIR>0
28 C> WHERE MX=(MAXWV+1)*((IROMB+1)*MAXWV+2)/2
29 C> @param[out] GRID - REAL (IMAX,JMAX,KMAX) GRID FIELD (E->W,N->S) IF IDIR<0
30 C> @param IDIR - INTEGER TRANSFORM FLAG
31 C> (IDIR>0 FOR WAVE TO GRID, IDIR<0 FOR GRID TO WAVE)
32 C>
33 C> SUBPROGRAMS CALLED:
34 C> - SPTRANF PERFORM A SCALAR SPHERICAL TRANSFORM
35 C> - NCPUS GETS ENVIRONMENT NUMBER OF CPUS
36 C>
37 C> REMARKS: MINIMUM GRID DIMENSIONS FOR UNALIASED TRANSFORMS TO SPECTRAL:
38 C> DIMENSION |LINEAR |QUADRATIC
39 C> ----------------------- |--------- |-------------
40 C> IMAX |2*MAXWV+2 |3*MAXWV/2*2+2
41 C> JMAX (IDRT=4,IROMB=0) |1*MAXWV+1 |3*MAXWV/2+1
42 C> JMAX (IDRT=4,IROMB=1) |2*MAXWV+1 |5*MAXWV/2+1
43 C> JMAX (IDRT=0,IROMB=0) |2*MAXWV+3 |3*MAXWV/2*2+3
44 C> JMAX (IDRT=0,IROMB=1) |4*MAXWV+3 |5*MAXWV/2*2+3
45 C> JMAX (IDRT=256,IROMB=0) |2*MAXWV+1 |3*MAXWV/2*2+1
46 C> JMAX (IDRT=256,IROMB=1) |4*MAXWV+1 |5*MAXWV/2*2+1
47  SUBROUTINE sptezm(IROMB,MAXWV,IDRT,IMAX,JMAX,KMAX,WAVE,GRID,IDIR)
48 
49  REAL WAVE((MAXWV+1)*((IROMB+1)*MAXWV+2),KMAX)
50  REAL GRID(IMAX,JMAX,KMAX)
51 C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
52  mx=(maxwv+1)*((iromb+1)*maxwv+2)/2
53  ip=1
54  is=1
55  jn=imax
56  js=-jn
57  kw=2*mx
58  kg=imax*jmax
59  jb=1
60  je=(jmax+1)/2
61  jc=ncpus()
62  IF(idir.LT.0) wave=0
63 C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
64  CALL sptranf(iromb,maxwv,idrt,imax,jmax,kmax,
65  & ip,is,jn,js,kw,kg,jb,je,jc,
66  & wave,grid,grid(1,jmax,1),idir)
67 C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
68  END
sptezm
subroutine sptezm(IROMB, MAXWV, IDRT, IMAX, JMAX, KMAX, WAVE, GRID, IDIR)
THIS SUBPROGRAM PERFORMS SPHERICAL TRANSFORMS BETWEEN SPECTRAL COEFFICIENTS OF SCALAR QUANTITIES AND ...
Definition: sptezm.f:48
sptranf
subroutine sptranf(IROMB, MAXWV, IDRT, IMAX, JMAX, KMAX, IP, IS, JN, JS, KW, KG, JB, JE, JC, WAVE, GRIDN, GRIDS, IDIR)
This subprogram performs a spherical transform between spectral coefficients of scalar quantities and...
Definition: sptranf.f:74
ncpus
function ncpus()
Set number of cpus.
Definition: ncpus.F:21