NCEPLIBS-sp  2.3.3
sptez.f
Go to the documentation of this file.
1 C> @file
2 C>
3 C> Perform a simple scalar 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 QUANTITY
8 C> AND A FIELD 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 FIELD 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 (2*MX) WAVE FIELD IF IDIR>0
27 C> WHERE MX=(MAXWV+1)*((IROMB+1)*MAXWV+2)/2
28 C> @param[out] GRID - REAL (IMAX,JMAX) GRID FIELD (E->W,N->S) IF IDIR<0
29 C> @param IDIR - INTEGER TRANSFORM FLAG
30 C> (IDIR>0 FOR WAVE TO GRID, IDIR<0 FOR GRID TO WAVE)
31 C>
32 C> SUBPROGRAMS CALLED:
33 C> - SPTRANF PERFORM A SCALAR SPHERICAL TRANSFORM
34 C> - NCPUS GETS ENVIRONMENT NUMBER OF CPUS
35 C>
36 C> REMARKS: MINIMUM GRID DIMENSIONS FOR UNALIASED TRANSFORMS TO SPECTRAL:
37 C> DIMENSION |LINEAR |QUADRATIC
38 C> ----------------------- |--------- |-------------
39 C> IMAX |2*MAXWV+2 |3*MAXWV/2*2+2
40 C> JMAX (IDRT=4,IROMB=0) |1*MAXWV+1 |3*MAXWV/2+1
41 C> JMAX (IDRT=4,IROMB=1) |2*MAXWV+1 |5*MAXWV/2+1
42 C> JMAX (IDRT=0,IROMB=0) |2*MAXWV+3 |3*MAXWV/2*2+3
43 C> JMAX (IDRT=0,IROMB=1) |4*MAXWV+3 |5*MAXWV/2*2+3
44 C> JMAX (IDRT=256,IROMB=0) |2*MAXWV+1 |3*MAXWV/2*2+1
45 C> JMAX (IDRT=256,IROMB=1) |4*MAXWV+1 |5*MAXWV/2*2+1
46  SUBROUTINE sptez(IROMB,MAXWV,IDRT,IMAX,JMAX,WAVE,GRID,IDIR)
47 
48  REAL WAVE((MAXWV+1)*((IROMB+1)*MAXWV+2))
49  REAL GRID(IMAX,JMAX)
50 C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
51  mx=(maxwv+1)*((iromb+1)*maxwv+2)/2
52  ip=1
53  is=1
54  jn=imax
55  js=-jn
56  kw=2*mx
57  kg=imax*jmax
58  jb=1
59  je=(jmax+1)/2
60  jc=ncpus()
61 ! print *, " EM: SPTEZ:::JJJJJJJJJJJJJJJJJJJCCCCCCCCCCC=" ,JC
62  IF(idir.LT.0) wave=0
63 C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
64  CALL sptranf(iromb,maxwv,idrt,imax,jmax,1,
65  & ip,is,jn,js,kw,kg,jb,je,jc,
66  & wave,grid,grid(1,jmax),idir)
67 C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
68  END
sptez
subroutine sptez(IROMB, MAXWV, IDRT, IMAX, JMAX, WAVE, GRID, IDIR)
THIS SUBPROGRAM PERFORMS A SPHERICAL TRANSFORM BETWEEN SPECTRAL COEFFICIENTS OF A SCALAR QUANTITY AND...
Definition: sptez.f:47
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