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