NCEPLIBS-sp 2.4.0
sptezmv.f
Go to the documentation of this file.
1C> @file
2C> @brief Perform simple vector spherical transforms.
3C> @author Iredell @date 96-02-29
4
5C> This subprogram performs spherical transforms
6C> between spectral coefficients of divergence and curl
7C> and vector fields 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> Wave fields are in sequential 'IBM ORDER'.
15C>
16C> Grid fields are 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 KMAX number of fields to transform
43C> @param[out] WAVED wave divergence field if IDIR<0
44C> where MX=(MAXWV+1)*((IROMB+1)*MAXWV+2)/2
45C> @param[out] WAVEZ wave vorticity field if IDIR>0
46C> where MX=(MAXWV+1)*((IROMB+1)*MAXWV+2)/2
47C> @param[out] GRIDU grid u-wind (E->W,N->S) if IDIR>0
48C> @param[out] GRIDV grid v-wind (E->W,N->S) if IDIR>0
49C> @param IDIR transform flag
50C> (IDIR>0 for wave to grid, IDIR<0 for grid to wave).
51C>
52C> @author Iredell @date 96-02-29
53 SUBROUTINE sptezmv(IROMB,MAXWV,IDRT,IMAX,JMAX,KMAX,
54 & WAVED,WAVEZ,GRIDU,GRIDV,IDIR)
55
56 REAL WAVED((MAXWV+1)*((IROMB+1)*MAXWV+2),KMAX)
57 REAL WAVEZ((MAXWV+1)*((IROMB+1)*MAXWV+2),KMAX)
58 REAL GRIDU(IMAX,JMAX,KMAX)
59 REAL GRIDV(IMAX,JMAX,KMAX)
60
61 mx=(maxwv+1)*((iromb+1)*maxwv+2)/2
62 ip=1
63 is=1
64 jn=imax
65 js=-jn
66 kw=2*mx
67 kg=imax*jmax
68 jb=1
69 je=(jmax+1)/2
70 jc=ncpus()
71 IF(idir.LT.0) waved=0
72 IF(idir.LT.0) wavez=0
73
74 CALL sptranfv(iromb,maxwv,idrt,imax,jmax,kmax,
75 & ip,is,jn,js,kw,kg,jb,je,jc,
76 & waved,wavez,
77 & gridu,gridu(1,jmax,1),gridv,gridv(1,jmax,1),idir)
78 END
function ncpus()
Set number of CPUs - the number of processors over which to parallelize.
Definition: ncpus.F:24
subroutine sptezmv(IROMB, MAXWV, IDRT, IMAX, JMAX, KMAX, WAVED, WAVEZ, GRIDU, GRIDV, IDIR)
This subprogram performs spherical transforms between spectral coefficients of divergence and curl an...
Definition: sptezmv.f:55
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