NCEPLIBS-w3emc 2.12.0
Loading...
Searching...
No Matches
w3ft41.f
Go to the documentation of this file.
1C> @file
2C> @brief Computes 2.5x2.5 s. hemi. grid vector.
3C> @author Ralph Jones @date 1992-07-23
4
5C> Computes 2.5 x 2.5 s. hemi. grid of 145 x 37 points
6C> from spectral coefficients in a rhomboidal 30 resolution
7C> representing a vector field.
8C>
9C> ### Program History Log:
10C> Date | Programmer | Comment
11C> -----|------------|--------
12C> 1993-07-23 | Ralph Jones | New version of w3ft11(), takes out w3fa12()
13C> makes pln 3 dimensions, pln is computed one time in main program, trades memory
14C> for more speed. w3fa12() used 70% of cpu time.
15C>
16C> @param[in] VLN 992 complex coeff.
17C> @param[in] PLN (32,31,37) real space with legendre polynomials
18C> computed by w3fa12().
19C> @param[in] FL 31 complex space for fourier coeff.
20C> @param[in] WORK 144 real work space for subr. w3ft12()
21C> @param[in] TRIGS 216 precomputed trig funcs. used
22C> in w3ft12(), computed by w3fa13()
23C> @param[in] RCOS 37 reciprocal cosine latitudes of
24C> 2.5 x 2.5 grid must be computed before
25C> first call to w3ft11 using subr. w3fa13().
26C> @param[out] GN (145,37) grid values. 5365 point grid is type 30 or 1e hex o.n. 84
27C>
28C> @note w3ft11() was optimized to run in a small amount of
29C> memory, it was not optimized for speed, 70 percent of the time was
30C> used by subroutine w3fa12() computing the legendre polynomials. Since
31C> the legendre polynomials are constant they need to be computed
32C> only once in a program. By moving w3fa12() to the main program and
33C> computing pln as a (32,31,37) array and changing this subroutine
34C> to use pln as a three dimension array the running time was cut
35C> 70 percent. Add following code to main program to compute eps, pln,
36C> trigs, and rcos one time in program.
37C> @code
38C> DOUBLE PRECISION EPS(992)
39C> DOUBLE PRECISION COLRA
40C>
41C> REAL PLN( 32, 31, 37 )
42C> REAL RCOS(37)
43C> REAL TRIGS(216)
44C>
45C> DATA PI /3.14159265/
46C>
47C> DRAD = 2.5 * PI / 180.0
48C> CALL W3FA11(EPS,30)
49C> CALL W3FA13(TRIGS,RCOS)
50C> DO LAT = 1,37
51C> COLRA = (LAT - 1) * DRAD
52C> CALL W3FA12 (PLN(1,1,LAT), COLRA, 30, EPS)
53C> END DO
54C> @endcode
55C>
56C> @author Ralph Jones @date 1992-07-23
57 SUBROUTINE w3ft41(VLN,GN,PLN,FL,WORK,TRIGS,RCOS)
58C
59 COMPLEX FL( 31 )
60 COMPLEX VLN( 32 , 31 )
61C
62 REAL GN(145,37)
63 REAL PLN( 32, 31, 37 )
64 REAL RCOS(37)
65 REAL TRIGS(216)
66 REAL WORK(144)
67C
68 SAVE
69C
70 DO 400 lat = 2,37
71C
72 DO 100 l = 1, 31
73 fl(l) = (0.,0.)
74 100 CONTINUE
75C
76 DO 300 l = 1, 31
77C
78 DO 200 i = 1, 31 ,2
79 fl(l) = fl(l)+cmplx(pln(i,l,lat) * real(vln(i,l)) ,
80 & pln(i,l,lat) * aimag(vln(i,l)) )
81 fl(l) = fl(l)-cmplx(pln(i+1,l,lat) * real(vln(i+1,l)),
82 & pln(i+1,l,lat) * aimag(vln(i+1,l)))
83 200 CONTINUE
84C
85 fl(l) = cmplx(real(fl(l))*rcos(lat),aimag(fl(l))*rcos(lat))
86C
87 300 CONTINUE
88C
89 CALL w3ft12(fl,work,gn(1,lat ),trigs)
90C
91 400 CONTINUE
92C
93C*** POLE ROW = CLOSEST LATITUDE ROW
94C
95 DO 500 i = 1,145
96 gn(i,1) = gn(i,2)
97 500 CONTINUE
98 RETURN
99 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 w3ft41(vln, gn, pln, fl, work, trigs, rcos)
Computes 2.5 x 2.5 s.
Definition w3ft41.f:58