NCEPLIBS-sp  2.5.0
sptezm.f
Go to the documentation of this file.
1 C> @file
2 C> @brief Perform simple scalar spherical transforms.
3 C> @author Iredell @date 96-02-29
4 
5 C> This subprogram performs spherical transforms
6 C> between spectral coefficients of scalar quantities
7 C> and fields on a global cylindrical grid.
8 C>
9 C> The wave-space can be either triangular or rhomboidal.
10 C>
11 C> The grid-space can be either an equally-spaced grid
12 C> (with or without pole points) or a Gaussian grid.
13 C>
14 C> Wave fields are in sequential 'IBM ORDER'.
15 C>
16 C> Grid fields are indexed East to West, then North to South.
17 C>
18 C> For more flexibility and efficiency, call sptran().
19 C>
20 C> Subprogram can be called from a multiprocessing environment.
21 C>
22 C> Minimum grid dimensions for unaliased transforms to spectral:
23 C> DIMENSION |LINEAR |QUADRATIC
24 C> ----------------------- |--------- |-------------
25 C> IMAX |2*MAXWV+2 |3*MAXWV/2*2+2
26 C> JMAX (IDRT=4,IROMB=0) |1*MAXWV+1 |3*MAXWV/2+1
27 C> JMAX (IDRT=4,IROMB=1) |2*MAXWV+1 |5*MAXWV/2+1
28 C> JMAX (IDRT=0,IROMB=0) |2*MAXWV+3 |3*MAXWV/2*2+3
29 C> JMAX (IDRT=0,IROMB=1) |4*MAXWV+3 |5*MAXWV/2*2+3
30 C> JMAX (IDRT=256,IROMB=0) |2*MAXWV+1 |3*MAXWV/2*2+1
31 C> JMAX (IDRT=256,IROMB=1) |4*MAXWV+1 |5*MAXWV/2*2+1
32 C>
33 C> @param IROMB spectral domain shape
34 C> (0 for triangular, 1 for rhomboidal)
35 C> @param MAXWV spectral truncation
36 C> @param IDRT grid identifier
37 C> - IDRT=4 for Gaussian grid
38 C> - IDRT=0 for equally-spaced grid including poles
39 C> - IDRT=256 for equally-spaced grid excluding poles
40 C> @param IMAX even number of longitudes
41 C> @param JMAX number of latitudes
42 C> @param KMAX number of fields to transform
43 C> @param[out] WAVE wave field if IDIR>0
44 C> where MX=(MAXWV+1)*((IROMB+1)*MAXWV+2)/2
45 C> @param[out] GRID grid field (E->W,N->S) if IDIR<0
46 C> @param IDIR transform flag
47 C> (IDIR>0 for wave to grid, IDIR<0 for grid to wave).
48 C>
49 C> @author Iredell @date 96-02-29
50  SUBROUTINE sptezm(IROMB,MAXWV,IDRT,IMAX,JMAX,KMAX,WAVE,GRID,IDIR)
51 
52  REAL WAVE((MAXWV+1)*((IROMB+1)*MAXWV+2),KMAX)
53  REAL GRID(IMAX,JMAX,KMAX)
54 
55  mx=(maxwv+1)*((iromb+1)*maxwv+2)/2
56  ip=1
57  is=1
58  jn=imax
59  js=-jn
60  kw=2*mx
61  kg=imax*jmax
62  jb=1
63  je=(jmax+1)/2
64  jc=ncpus()
65  IF(idir.LT.0) wave=0
66 
67  CALL sptranf(iromb,maxwv,idrt,imax,jmax,kmax,
68  & ip,is,jn,js,kw,kg,jb,je,jc,
69  & wave,grid,grid(1,jmax,1),idir)
70  END
function ncpus()
Set number of CPUs - the number of processors over which to parallelize.
Definition: ncpus.F:24
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:51
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:77