NCEPLIBS-w3emc  2.11.0
w3ft21.f
Go to the documentation of this file.
1 C> @file
2 C> @brief Computes 2.5 x 2.5 n. hemi. grid-scaler.
3 C> @author Ralph Jones @date 1981-11-19
4 
5 C> Computes 2.5 x 2.5 n. hemi. grid of 145 x 37 points
6 C> from spectral coefficients in a rhomboidal 30 resolution
7 C> representing a scalar field. Special version of w3ft08() which
8 C> gives programmer more control of how many waves are summed
9 C> and how many points in each wave. A programmer can simulate
10 C> 24-mode, 12-mode, etc.
11 C>
12 C> ### Program History Log:
13 C> Date | Programmer | Comment
14 C> -----|------------|--------
15 C> 1981-11-19 | Ralph Jones | Initial.
16 C> 1984-06-01 | Ralph Jones | Change to ibm vs fortran.
17 C>
18 C> @param[in] FLN 961 complex coeff.
19 C> @param[in] PLN 992 real space for legendre polynomials
20 C> @param[in] EPS 992 real space for coeffs. used in computing pln.
21 C> @param[in] FL 31 complex space for fourier coeff.
22 C> @param[in] WORK 144 real work space for subr. w3ft12()
23 C> @param[in] TRIGS 216 precomputed trig funcs, used in w3ft12(), computed by
24 C> w3fa13()
25 C> @param[in] L1 Starting wave number
26 C> @param[in] L2 Ending wave number
27 C> @param[in] I2 Mode of spectral coefficients
28 C> @param[out] GN (145,37) grid values. 5365 point grid is type 29 or 1d hex o.n. 84
29 C>
30 C> @note This subroutine was optimized to run in a small amount of
31 C> memory, it is not optimized for speed, 70 percent of the time is
32 C> used by subroutine w3fa12() computing the legendre polynomials. Since
33 C> the legendre polynomials are constant they need to be computed
34 C> only once in a program. By moving w3fa12() to the main program and
35 C> computing pln as a (32,31,37) array and changing this subroutine
36 C> to use pln as a three dimension array you can cut the running time
37 C> 70 percent.
38 C>
39 C> @author Ralph Jones @date 1981-11-19
40  SUBROUTINE w3ft21(FLN,GN,PLN,EPS,FL,WORK,TRIGS,L1,L2,I2)
41 C
42  COMPLEX FL (31)
43  COMPLEX FLN (31,31)
44 C
45  REAL COLRA
46  REAL EPS (992)
47 C
48  REAL GN (145,37)
49  REAL PLN (32,31)
50  REAL TRIGS (216)
51  REAL WORK (144)
52 C
53  SAVE
54 C
55  DATA pi /3.14159265/
56 C
57  drad = 2.5 * pi / 180.0
58 C
59  k1 = l1 + 1
60  k2 = l2 + 1
61  m2 = i2 + 1
62 C
63  DO 400 lat = 1,37
64  latn = 38 - lat
65  colra = (lat-1) * drad
66  CALL w3fa12 (pln, colra, 30 ,eps)
67 C
68  DO 100 l = 1, 31
69  fl(l) = (0.,0.)
70  100 CONTINUE
71 C
72  DO 300 l = k1 , k2
73  DO 200 i = 1 , m2
74  fl(l) = fl(l) + cmplx(pln(i,l) * real(fln(i,l)) ,
75  & pln(i,l) * aimag(fln(i,l)) )
76  200 CONTINUE
77 C
78  300 CONTINUE
79 C
80  CALL w3ft12(fl,work,gn(1,latn),trigs)
81 C
82  400 CONTINUE
83 C
84  RETURN
85  END
subroutine w3ft12(COEF, WORK, GRID, TRIGS)
Fast fourier to compute 145 grid values at desired latitude from 31 complex fourier coefficients.
Definition: w3ft12.f:25
subroutine w3ft21(FLN, GN, PLN, EPS, FL, WORK, TRIGS, L1, L2, I2)
Computes 2.5 x 2.5 n.
Definition: w3ft21.f:41