NCEPLIBS-sp  2.3.3
sptezmd.f
Go to the documentation of this file.
1 C> @file
2 C>
3 C> Perform simple gradient 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 FIELDS
8 C> AND THEIR MEANS AND GRADIENTS 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> THE WAVE FIELDS ARE IN SEQUENTIAL 'IBM ORDER'.
13 C> THE 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
27 C> @param[out] WAVE - REAL (MX,KMAX) WAVE FIELD IF IDIR>0
28 C> WHERE MX=(MAXWV+1)*((IROMB+1)*MAXWV+2)
29 C> @param[out] GRIDMN - REAL (KMAX) GLOBAL MEAN IF IDIR<0
30 C> @param[out] GRIDX - REAL (IMAX,JMAX,KMAX) GRID X-GRADIENTS (E->W,N->S) IF IDIR<0
31 C> @param[out] GRIDY - REAL (IMAX,JMAX,KMAX) GRID Y-GRADIENTS (E->W,N->S) IF IDIR<0
32 C> @param IDIR - INTEGER TRANSFORM FLAG
33 C> (IDIR>0 FOR WAVE TO GRID, IDIR<0 FOR GRID TO WAVE)
34 C>
35 C> SUBPROGRAMS CALLED:
36 C> - SPTRAND PERFORM A GRADIENT SPHERICAL TRANSFORM
37 C> - NCPUS GETS ENVIRONMENT NUMBER OF CPUS
38 C>
39 C> REMARKS: MINIMUM GRID DIMENSIONS FOR UNALIASED TRANSFORMS TO SPECTRAL:
40 C> DIMENSION |LINEAR |QUADRATIC
41 C> ----------------------- |--------- |-------------
42 C> IMAX |2*MAXWV+2 |3*MAXWV/2*2+2
43 C> JMAX (IDRT=4,IROMB=0) |1*MAXWV+1 |3*MAXWV/2+1
44 C> JMAX (IDRT=4,IROMB=1) |2*MAXWV+1 |5*MAXWV/2+1
45 C> JMAX (IDRT=0,IROMB=0) |2*MAXWV+3 |3*MAXWV/2*2+3
46 C> JMAX (IDRT=0,IROMB=1) |4*MAXWV+3 |5*MAXWV/2*2+3
47 C> JMAX (IDRT=256,IROMB=0) |2*MAXWV+1 |3*MAXWV/2*2+1
48 C> JMAX (IDRT=256,IROMB=1) |4*MAXWV+1 |5*MAXWV/2*2+1
49  SUBROUTINE sptezmd(IROMB,MAXWV,IDRT,IMAX,JMAX,KMAX,
50  & WAVE,GRIDMN,GRIDX,GRIDY,IDIR)
51 
52  REAL WAVE((MAXWV+1)*((IROMB+1)*MAXWV+2),KMAX)
53  REAL GRIDMN(KMAX),GRIDX(IMAX,JMAX,KMAX),GRIDY(IMAX,JMAX,KMAX)
54 C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
55  jc=ncpus()
56  CALL sptrand(iromb,maxwv,idrt,imax,jmax,kmax,
57  & 0,0,0,0,0,0,0,0,jc,
58  & wave,gridmn,
59  & gridx,gridx(1,jmax,1),gridy,gridy(1,jmax,1),idir)
60 C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
61  END
ncpus
function ncpus()
Set number of cpus.
Definition: ncpus.F:21
sptezmd
subroutine sptezmd(IROMB, MAXWV, IDRT, IMAX, JMAX, KMAX, WAVE, GRIDMN, GRIDX, GRIDY, IDIR)
THIS SUBPROGRAM PERFORMS SPHERICAL TRANSFORMS BETWEEN SPECTRAL COEFFICIENTS OF SCALAR FIELDS AND THEI...
Definition: sptezmd.f:51
sptrand
subroutine sptrand(IROMB, MAXWV, IDRT, IMAX, JMAX, KMAX, IPRIME, ISKIP, JNSKIP, JSSKIP, KWSKIP, KGSKIP, JBEG, JEND, JCPU, WAVE, GRIDMN, GRIDXN, GRIDXS, GRIDYN, GRIDYS, IDIR)
THIS SUBPROGRAM PERFORMS A SPHERICAL TRANSFORM BETWEEN SPECTRAL COEFFICIENTS OF SCALAR FIELDS AND THE...
Definition: sptrand.f:87