NCEPLIBS-w3emc 2.12.0
Loading...
Searching...
No Matches
w3ft40.f
Go to the documentation of this file.
1C> @file
2C> @brief Computes 2.5 x 2.5 s. hemi. grid-scaler
3C> @author Ralph Jones @date 1993-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 scaler field.
8C>
9C> ### Program History Log:
10C> Date | Programmer | Comment
11C> -----|------------|--------
12C> 1993-07-23 | Ralph Jones | New version of w3ft10(), 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] FLN 961 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[out] GN (145,37) grid values. 5365 point grid is type 30 or 1e o.n. 84
24C>
25C> @note w3ft10() was optimized to run in a small amount of
26C> memory, it was not optimized for speed, 70 percent of the time was
27C> used by subroutine w3fa12() computing the legendre polynomials. Since
28C> the legendre polynomials are constant they need to be computed
29C> only once in a program. By moving w3fa12() to the main program and
30C> computing pln as a (32,31,37) array and changing this subroutine
31C> to use pln as a three dimension array the running time was cut
32C> 70 percent. Add following code to main program to compute eps, pln,
33C> trigs, and rcos one time in program.
34C> @code
35C> DOUBLE PRECISION EPS(992) [CHANGE TO REAL ON CRAY]
36C> DOUBLE PRECISION COLRA [CHANGE TO REAL ON CRAY]
37C>
38C> REAL PLN( 32, 31, 37 )
39C> REAL RCOS(37)
40C> REAL TRIGS(216)
41C>
42C> DATA PI /3.14159265/
43C>
44C> DRAD = 2.5 * PI / 180.0
45C> CALL W3FA11(EPS,30)
46C> CALL W3FA13(TRIGS,RCOS)
47C> DO LAT = 1,37
48C> COLRA = (LAT - 1) * DRAD
49C> CALL W3FA12 (PLN(1,1,LAT), COLRA, 30, EPS)
50C> END DOC
51C> @endcode
52C>
53C> @author Ralph Jones @date 1993-07-23
54 SUBROUTINE w3ft40(FLN,GN,PLN,FL,WORK,TRIGS)
55C
56 COMPLEX FL( 31 )
57 COMPLEX FLN( 31 , 31 )
58C
59 REAL GN(145,37)
60 REAL PLN( 32, 31, 37 )
61 REAL TRIGS(216)
62 REAL WORK(144)
63C
64 SAVE
65C
66 DO 400 lat = 1,37
67C
68 DO 100 l = 1, 31
69 fl(l) = (0.,0.)
70 100 CONTINUE
71C
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)) )
76C
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
83C
84 300 CONTINUE
85C
86 CALL w3ft12(fl,work,gn(1,lat ),trigs)
87 400 CONTINUE
88C
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