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