NCEPLIBS-w3emc  2.11.0
w3ft40.f
Go to the documentation of this file.
1 C> @file
2 C> @brief Computes 2.5 x 2.5 s. hemi. grid-scaler
3 C> @author Ralph Jones @date 1993-07-23
4 
5 C> Computes 2.5 x 2.5 s. 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 w3ft10(), 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] 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 30 or 1e o.n. 84
24 C>
25 C> @note w3ft10() 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) [CHANGE TO REAL ON CRAY]
36 C> DOUBLE PRECISION COLRA [CHANGE TO 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 DOC
51 C> @endcode
52 C>
53 C> @author Ralph Jones @date 1993-07-23
54  SUBROUTINE w3ft40(FLN,GN,PLN,FL,WORK,TRIGS)
55 C
56  COMPLEX FL( 31 )
57  COMPLEX FLN( 31 , 31 )
58 C
59  REAL GN(145,37)
60  REAL PLN( 32, 31, 37 )
61  REAL TRIGS(216)
62  REAL WORK(144)
63 C
64  SAVE
65 C
66  DO 400 lat = 1,37
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  i = 1
74  fl(l) = fl(l)+cmplx(pln(i,l,lat) * real(fln(i,l)) ,
75  & pln(i,l,lat) * aimag(fln(i,l)) )
76 C
77  DO 200 i = 2, 30 ,2
78  fl(l) = fl(l)-cmplx(pln(i,l,lat) * real(fln(i,l)) ,
79  & pln(i,l,lat) * aimag(fln(i,l)) )
80  fl(l) = fl(l)+cmplx(pln(i+1,l,lat) * real(fln(i+1,l)),
81  & pln(i+1,l,lat) * aimag(fln(i+1,l)))
82  200 CONTINUE
83 C
84  300 CONTINUE
85 C
86  CALL w3ft12(fl,work,gn(1,lat ),trigs)
87  400 CONTINUE
88 C
89  RETURN
90  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 w3ft40(FLN, GN, PLN, FL, WORK, TRIGS)
Computes 2.5 x 2.5 s.
Definition: w3ft40.f:55