NCEPLIBS-w3emc  2.11.0
w3ft38.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 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 scaler 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 w3ft08(), takes out w3fa12()
13 C> makes pln 3 dimensions, pln is computed one time in main program, trades\
14 C> memory for more speed. w3fa12() used 70% of cpu time.
15 C>
16 C> @param[in] FLN 961 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 real 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[out] GN (145,37) grid values. 5365 point grid is type 29 or 1d hex o.n. 84
24 C>
25 C> @note w3ft08() was optimized to run in a small amount of
26 C> memory, it was not optimized for speed, 70 percent of the time was
27 C> used by subroutine w3fa12() computing the legendre polynomials. Since
28 C> the legendre polynomials are constant they need to be computed
29 C> only once in a program. By moving w3fa12() to the main program and
30 C> computing pln as a (32,31,37) array and changing this subroutine
31 C> to use pln as a three dimension array the running time was cut
32 C> 70 percent. Add following code to main program to compute eps, pln,
33 C> trigs, and rcos one time in program.
34 C> @code
35 C> DOUBLE PRECISION EPS(992) (REAL ON CRAY)
36 C> DOUBLE PRECISION COLRA (REAL ON CRAY)
37 C>
38 C> REAL PLN( 32, 31, 37 )
39 C> REAL RCOS(37)
40 C> REAL TRIGS(216)
41 C>
42 C> DATA PI /3.14159265/
43 C>
44 C> DRAD = 2.5 * PI / 180.0
45 C> CALL W3FA11(EPS,30)
46 C> CALL W3FA13(TRIGS,RCOS)
47 C> DO LAT = 1,37
48 C> COLRA = (LAT - 1) * DRAD
49 C> CALL W3FA12 (PLN(1,1,LAT), COLRA, 30, EPS)
50 C> END DO
51 C> @endcode
52 C>
53  SUBROUTINE w3ft38(FLN,GN,PLN,FL,WORK,TRIGS)
54 C
55  COMPLEX FL( 31 )
56  COMPLEX FLN( 31 , 31 )
57 C
58  REAL GN(145,37)
59  REAL PLN( 32, 31, 37 )
60  REAL TRIGS(216)
61  REAL WORK(144)
62 C
63  SAVE
64 C
65  DO 400 lat = 1,37
66  latn = 38 - lat
67 C
68  DO 100 l = 1, 31
69  fl(l) = (0.,0.)
70  100 CONTINUE
71 C
72  DO 300 l = 1, 31
73  DO 200 i = 1, 31
74  fl(l) = fl(l) + cmplx(pln(i,l,lat) * real(fln(i,l)) ,
75  & pln(i,l,lat) * 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 w3ft38(FLN, GN, PLN, FL, WORK, TRIGS)
Computes 2.5 x 2.5 n.
Definition: w3ft38.f:54