NCEPLIBS-w3emc 2.12.0
Loading...
Searching...
No Matches
w3ft39.f
Go to the documentation of this file.
1C> @file
2C> @brief Computes 2.5x2.5 n. hemi. grid-vector.
3C> @author Ralph Jones @date 1993-07-23
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 vector field.
8C>
9C> ### Program History Log:
10C> Date | Programmer | Comment
11C> -----|------------|--------
12C> 1993-07-23 | Ralph Jones | New version of w3ft09(), 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 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 sr w3fa13().
26C> @param[out] GN (145,37) grid values. 5365 point grid is type 29 or 1d o.n. 84
27C>
28C> @note w3ft09() 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 1993-07-23
57 SUBROUTINE w3ft39(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
71 latn = 38 - lat
72C
73 DO 100 l = 1, 31
74 fl(l) = (0.,0.)
75 100 CONTINUE
76C
77 DO 300 l = 1, 31
78C
79 DO 200 i = 1, 32
80 fl(l) = fl(l) + cmplx(pln(i,l,lat) * real(vln(i,l)),
81 & pln(i,l,lat) * aimag(vln(i,l)) )
82 200 CONTINUE
83C
84 fl(l)=cmplx(real(fl(l))*rcos(lat),aimag(fl(l))*rcos(lat))
85 300 CONTINUE
86C
87 CALL w3ft12(fl,work,gn(1,latn),trigs)
88C
89 400 CONTINUE
90C
91C*** POLE ROW=CLOSEST LATITUDE ROW
92C
93 DO 500 i = 1,145
94 gn(i,37) = gn(i,36)
95 500 CONTINUE
96C
97 RETURN
98 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 w3ft39(vln, gn, pln, fl, work, trigs, rcos)
Computes 2.5 x 2.5 n.
Definition w3ft39.f:58