NCEPLIBS-sp 2.4.0
sptezv.f
Go to the documentation of this file.
1C> @file
2C> @brief Perform a simple vector spherical transform
3C> @author Iredell @date 96-02-29
4
5C> This subprogram performs a spherical transform
6C> between spectral coefficients of divergence and curl
7C> and a vector field on a global cylindrical grid.
8C> The wave-space can be either triangular or rhomboidal.
9C>
10C> The grid-space can be either an equally-spaced grid
11C> (with or without pole points) or a Gaussian grid.
12C>
13C> The wave field is in sequential 'IBM order'.
14C>
15C> The grid field is indexed east to west, then north to south.
16C>
17C> For more flexibility and efficiency, call SPTRAN().
18C>
19C> Subprogram can be called from a multiprocessing environment.
20C>
21C> Minimum grid dimensions for unaliased transforms to spectral:
22C> Dimension |Linear |Quadratic
23C> ----------------------- |--------- |-------------
24C> IMAX |2*MAXWV+2 |3*MAXWV/2*2+2
25C> JMAX (IDRT=4,IROMB=0) |1*MAXWV+1 |3*MAXWV/2+1
26C> JMAX (IDRT=4,IROMB=1) |2*MAXWV+1 |5*MAXWV/2+1
27C> JMAX (IDRT=0,IROMB=0) |2*MAXWV+3 |3*MAXWV/2*2+3
28C> JMAX (IDRT=0,IROMB=1) |4*MAXWV+3 |5*MAXWV/2*2+3
29C> JMAX (IDRT=256,IROMB=0) |2*MAXWV+1 |3*MAXWV/2*2+1
30C> JMAX (IDRT=256,IROMB=1) |4*MAXWV+1 |5*MAXWV/2*2+1
31C>
32C> @param IROMB Spectral domain shape
33C> (0 for triangular, 1 for rhomboidal)
34C> @param MAXWV Spectral truncation
35C> @param IDRT Grid identifier
36C> - IDRT=4 for Gaussian grid
37C> - IDRT=0 for equally-spaced grid including poles
38C> - IDRT=256 for equally-spaced grid excluding poles
39C> @param IMAX Even number of longitudes
40C> @param JMAX Number of latitudes
41C> @param[out] WAVED Wave divergence field if IDIR>0
42C> where MX=(MAXWV+1)*((IROMB+1)*MAXWV+2)/2
43C> @param[out] WAVEZ Wave vorticity field if IDIR>0
44C> where MX=(MAXWV+1)*((IROMB+1)*MAXWV+2)/2
45C> @param[out] GRIDU Grid u-wind (E->W,N->S) if IDIR<0
46C> @param[out] GRIDV Grid v-wind (E->W,N->S) if IDIR<0
47C> @param IDIR Transform flag
48C> (IDIR>0 for wave to grid, IDIR<0 for grid to wave)
49C>
50C> @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