NCEPLIBS-sp  2.5.0
sptezv.f
Go to the documentation of this file.
1 C> @file
2 C> @brief Perform a simple vector spherical transform
3 C> @author Iredell @date 96-02-29
4 
5 C> This subprogram performs a spherical transform
6 C> between spectral coefficients of divergence and curl
7 C> and a vector field on a global cylindrical grid.
8 C> The wave-space can be either triangular or rhomboidal.
9 C>
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>
13 C> The wave field is in sequential 'IBM order'.
14 C>
15 C> The grid field is indexed east to west, then north to south.
16 C>
17 C> For more flexibility and efficiency, call SPTRAN().
18 C>
19 C> Subprogram can be called from a multiprocessing environment.
20 C>
21 C> Minimum grid dimensions for unaliased transforms to spectral:
22 C> Dimension |Linear |Quadratic
23 C> ----------------------- |--------- |-------------
24 C> IMAX |2*MAXWV+2 |3*MAXWV/2*2+2
25 C> JMAX (IDRT=4,IROMB=0) |1*MAXWV+1 |3*MAXWV/2+1
26 C> JMAX (IDRT=4,IROMB=1) |2*MAXWV+1 |5*MAXWV/2+1
27 C> JMAX (IDRT=0,IROMB=0) |2*MAXWV+3 |3*MAXWV/2*2+3
28 C> JMAX (IDRT=0,IROMB=1) |4*MAXWV+3 |5*MAXWV/2*2+3
29 C> JMAX (IDRT=256,IROMB=0) |2*MAXWV+1 |3*MAXWV/2*2+1
30 C> JMAX (IDRT=256,IROMB=1) |4*MAXWV+1 |5*MAXWV/2*2+1
31 C>
32 C> @param IROMB Spectral domain shape
33 C> (0 for triangular, 1 for rhomboidal)
34 C> @param MAXWV Spectral truncation
35 C> @param IDRT Grid identifier
36 C> - IDRT=4 for Gaussian grid
37 C> - IDRT=0 for equally-spaced grid including poles
38 C> - IDRT=256 for equally-spaced grid excluding poles
39 C> @param IMAX Even number of longitudes
40 C> @param JMAX Number of latitudes
41 C> @param[out] WAVED Wave divergence field if IDIR>0
42 C> where MX=(MAXWV+1)*((IROMB+1)*MAXWV+2)/2
43 C> @param[out] WAVEZ Wave vorticity field if IDIR>0
44 C> where MX=(MAXWV+1)*((IROMB+1)*MAXWV+2)/2
45 C> @param[out] GRIDU Grid u-wind (E->W,N->S) if IDIR<0
46 C> @param[out] GRIDV Grid v-wind (E->W,N->S) if IDIR<0
47 C> @param IDIR Transform flag
48 C> (IDIR>0 for wave to grid, IDIR<0 for grid to wave)
49 C>
50 C> @author Iredell @date 96-02-29
51  SUBROUTINE sptezv(IROMB,MAXWV,IDRT,IMAX,JMAX,
52  & WAVED,WAVEZ,GRIDU,GRIDV,IDIR)
53 
54  REAL WAVED((MAXWV+1)*((IROMB+1)*MAXWV+2))
55  REAL WAVEZ((MAXWV+1)*((IROMB+1)*MAXWV+2))
56  REAL GRIDU(IMAX,JMAX)
57  REAL GRIDV(IMAX,JMAX)
58 
59  mx=(maxwv+1)*((iromb+1)*maxwv+2)/2
60  ip=1
61  is=1
62  jn=imax
63  js=-jn
64  kw=2*mx
65  kg=imax*jmax
66  jb=1
67  je=(jmax+1)/2
68  jc=ncpus()
69  IF(idir.LT.0) waved=0
70  IF(idir.LT.0) wavez=0
71 
72  CALL sptranfv(iromb,maxwv,idrt,imax,jmax,1,
73  & ip,is,jn,js,kw,kg,jb,je,jc,
74  & waved,wavez,
75  & gridu,gridu(1,jmax),gridv,gridv(1,jmax),idir)
76  END
function ncpus()
Set number of CPUs - the number of processors over which to parallelize.
Definition: ncpus.F:24
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:53
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:83