NCEPLIBS-sp  2.3.3
sptezmv.f
Go to the documentation of this file.
1 C> @file
2 C>
3 C> Perform simple vector spherical transforms
4 C> @author IREDELL @date 96-02-29
5 
6 C> THIS SUBPROGRAM PERFORMS SPHERICAL TRANSFORMS
7 C> BETWEEN SPECTRAL COEFFICIENTS OF DIVERGENCE AND CURL
8 C> AND VECTOR FIELDS 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> WAVE FIELDS ARE IN SEQUENTIAL 'IBM ORDER'.
13 C> GRID FIELDS ARE 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 KMAX - INTEGER NUMBER OF FIELDS TO TRANSFORM
27 C> @param[out] WAVED - REAL (2*MX,KMAX) WAVE DIVERGENCE FIELD IF IDIR<0
28 C> WHERE MX=(MAXWV+1)*((IROMB+1)*MAXWV+2)/2
29 C> @param[out] WAVEZ - REAL (2*MX,KMAX) WAVE VORTICITY FIELD IF IDIR>0
30 C> WHERE MX=(MAXWV+1)*((IROMB+1)*MAXWV+2)/2
31 C> @param[out] GRIDU - REAL (IMAX,JMAX,KMAX) GRID U-WIND (E->W,N->S) IF IDIR>0
32 C> @param[out] GRIDV - REAL (IMAX,JMAX,KMAX) GRID V-WIND (E->W,N->S) IF IDIR>0
33 C> @param IDIR - INTEGER TRANSFORM FLAG
34 C> (IDIR>0 FOR WAVE TO GRID, IDIR<0 FOR GRID TO WAVE)
35 C>
36 C> SUBPROGRAMS CALLED:
37 C> - SPTRANFV PERFORM A VECTOR SPHERICAL TRANSFORM
38 C> - NCPUS GETS ENVIRONMENT NUMBER OF CPUS
39 C>
40 C> REMARKS: MINIMUM GRID DIMENSIONS FOR UNALIASED TRANSFORMS TO SPECTRAL:
41 C> DIMENSION |LINEAR |QUADRATIC
42 C> ----------------------- |--------- |-------------
43 C> IMAX |2*MAXWV+2 |3*MAXWV/2*2+2
44 C> JMAX (IDRT=4,IROMB=0) |1*MAXWV+1 |3*MAXWV/2+1
45 C> JMAX (IDRT=4,IROMB=1) |2*MAXWV+1 |5*MAXWV/2+1
46 C> JMAX (IDRT=0,IROMB=0) |2*MAXWV+3 |3*MAXWV/2*2+3
47 C> JMAX (IDRT=0,IROMB=1) |4*MAXWV+3 |5*MAXWV/2*2+3
48 C> JMAX (IDRT=256,IROMB=0) |2*MAXWV+1 |3*MAXWV/2*2+1
49 C> JMAX (IDRT=256,IROMB=1) |4*MAXWV+1 |5*MAXWV/2*2+1
50  SUBROUTINE sptezmv(IROMB,MAXWV,IDRT,IMAX,JMAX,KMAX,
51  & WAVED,WAVEZ,GRIDU,GRIDV,IDIR)
52 
53  REAL WAVED((MAXWV+1)*((IROMB+1)*MAXWV+2),KMAX)
54  REAL WAVEZ((MAXWV+1)*((IROMB+1)*MAXWV+2),KMAX)
55  REAL GRIDU(IMAX,JMAX,KMAX)
56  REAL GRIDV(IMAX,JMAX,KMAX)
57 C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
58  mx=(maxwv+1)*((iromb+1)*maxwv+2)/2
59  ip=1
60  is=1
61  jn=imax
62  js=-jn
63  kw=2*mx
64  kg=imax*jmax
65  jb=1
66  je=(jmax+1)/2
67  jc=ncpus()
68  IF(idir.LT.0) waved=0
69  IF(idir.LT.0) wavez=0
70 C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
71  CALL sptranfv(iromb,maxwv,idrt,imax,jmax,kmax,
72  & ip,is,jn,js,kw,kg,jb,je,jc,
73  & waved,wavez,
74  & gridu,gridu(1,jmax,1),gridv,gridv(1,jmax,1),idir)
75 C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
76  END
ncpus
function ncpus()
Set number of cpus.
Definition: ncpus.F:21
sptezmv
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:52
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