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