NCEPLIBS-sp  2.3.3
sptezd.f
Go to the documentation of this file.
1 C> @file
2 C>
3 C> Perform a simple gradient spherical transform
4 C> @author IREDELL @date 96-02-29
5 
6 C> THIS SUBPROGRAM PERFORMS A SPHERICAL TRANSFORM
7 C> BETWEEN SPECTRAL COEFFICIENTS OF A SCALAR FIELD
8 C> AND ITS MEAN AND GRADIENT 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 FIELD IS IN SEQUENTIAL 'IBM ORDER'.
13 C> THE GRID FIELS IS 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[out] WAVE - REAL (*) WAVE FIELD IF IDIR>0
27 C> @param[out] GRIDMN - REAL GLOBAL MEAN IF IDIR<0
28 C> @param[out] GRIDX - REAL (IMAX,JMAX) GRID X-GRADIENTS (E->W,N->S) IF IDIR<0
29 C> @param[out] GRIDY - REAL (IMAX,JMAX) GRID Y-GRADIENTS (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> - SPTRAND PERFORM A GRADIENT 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 sptezd(IROMB,MAXWV,IDRT,IMAX,JMAX,
48  & WAVE,GRIDMN,GRIDX,GRIDY,IDIR)
49 
50  REAL WAVE(*),GRIDX(IMAX,JMAX),GRIDY(IMAX,JMAX)
51 C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
52  jc=ncpus()
53  CALL sptrand(iromb,maxwv,idrt,imax,jmax,1,
54  & 0,0,0,0,0,0,0,0,jc,
55  & wave,gridmn,
56  & gridx,gridx(1,jmax),gridy,gridy(1,jmax),1)
57 C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
58  END
sptezd
subroutine sptezd(IROMB, MAXWV, IDRT, IMAX, JMAX, WAVE, GRIDMN, GRIDX, GRIDY, IDIR)
THIS SUBPROGRAM PERFORMS A SPHERICAL TRANSFORM BETWEEN SPECTRAL COEFFICIENTS OF A SCALAR FIELD AND IT...
Definition: sptezd.f:49
ncpus
function ncpus()
Set number of cpus.
Definition: ncpus.F:21
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