NCEPLIBS-sp  2.3.3
sptezv.f
Go to the documentation of this file.
1 C> @file
2 C>
3 C> Perform a simple vector 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 divergence and curl
8 C> and a vector 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 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] WAVED - REAL (2*MX) WAVE DIVERGENCE FIELD IF IDIR>0
27 C> WHERE MX=(MAXWV+1)*((IROMB+1)*MAXWV+2)/2
28 C> @param[out] WAVEZ - REAL (2*MX) WAVE VORTICITY FIELD IF IDIR>0
29 C> WHERE MX=(MAXWV+1)*((IROMB+1)*MAXWV+2)/2
30 C> @param[out] GRIDU - REAL (IMAX,JMAX) GRID U-WIND (E->W,N->S) IF IDIR<0
31 C> @param[out] GRIDV - REAL (IMAX,JMAX) GRID V-WIND (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> - SPTRANFV() PERFORM A VECTOR SPHERICAL TRANSFORM
37 C> - NCPUS() GETS ENVIRONMENT NUMBER OF CPUS
38 C>
39 C> @note 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 sptezv(IROMB,MAXWV,IDRT,IMAX,JMAX,
50  & WAVED,WAVEZ,GRIDU,GRIDV,IDIR)
51 
52  REAL WAVED((MAXWV+1)*((IROMB+1)*MAXWV+2))
53  REAL WAVEZ((MAXWV+1)*((IROMB+1)*MAXWV+2))
54  REAL GRIDU(IMAX,JMAX)
55  REAL GRIDV(IMAX,JMAX)
56 C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
57  mx=(maxwv+1)*((iromb+1)*maxwv+2)/2
58  ip=1
59  is=1
60  jn=imax
61  js=-jn
62  kw=2*mx
63  kg=imax*jmax
64  jb=1
65  je=(jmax+1)/2
66  jc=ncpus()
67  IF(idir.LT.0) waved=0
68  IF(idir.LT.0) wavez=0
69 C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
70  CALL sptranfv(iromb,maxwv,idrt,imax,jmax,1,
71  & ip,is,jn,js,kw,kg,jb,je,jc,
72  & waved,wavez,
73  & gridu,gridu(1,jmax),gridv,gridv(1,jmax),idir)
74 C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
75  END
ncpus
function ncpus()
Set number of cpus.
Definition: ncpus.F:21
sptezv
subroutine sptezv(IROMB, MAXWV, IDRT, IMAX, JMAX, WAVED, WAVEZ, GRIDU, GRIDV, IDIR)
This subprogram performs a spherical transform between spectral coefficients of divergence and curl a...
Definition: sptezv.f:51
sptranfv
subroutine sptranfv(IROMB, MAXWV, IDRT, IMAX, JMAX, KMAX, IP, IS, JN, JS, KW, KG, JB, JE, JC, WAVED, WAVEZ, GRIDUN, GRIDUS, GRIDVN, GRIDVS, IDIR)
THIS SUBPROGRAM PERFORMS A SPHERICAL TRANSFORM BETWEEN SPECTRAL COEFFICIENTS OF DIVERGENCES AND CURLS...
Definition: sptranfv.f:81