NCEPLIBS-w3emc 2.12.0
Loading...
Searching...
No Matches
w3fa13.f
Go to the documentation of this file.
1C> @file
2C> @brief Computes Trig Functions
3C> @author Joe Sela @date 1980-11-21
4
5C> Computes trig functions used in 2.5 by 2.5 lat,lon
6C> mapping routines. w3fa13() must be called at least once before
7C> calls to w3ft08(), w3ft09(), w3ft10(), w3ft11().
8C>
9C> Program history log:
10C> - Joe Sela 1980-11-21
11C> - Ralph Jones 1984-06-01 Change to vs fortran
12C>
13C> @param[out] TRIGS 216 trig values, used by subroutine w3fa12().
14C> @param[out] RCOS 37 colatitudes used by subroutines w3ft09() ,w3ft11()
15C>
16C> @author Joe Sela @date 1980-11-21
17 SUBROUTINE w3fa13(TRIGS,RCOS)
18C
19 REAL RCOS(*)
20 REAL TRIGS(*)
21C
22 SAVE
23C
24 DATA pi /3.14159265358979323846/
25C
26 n = 144
27 mode = 3
28 drad = 2.5*pi/180.
29C
30 DO 100 lat = 2,37
31 arg = (lat-1)*drad
32 rcos(lat) = 1./sin(arg)
33 100 CONTINUE
34C
35 rcos(1) = 77777.777
36 imode = iabs(mode)
37 nn = n
38 IF (imode.GT.1.AND.imode.LT.6) nn = n/2
39 angle = 0.0
40 del = (pi+pi)/float(nn)
41 l = nn+nn
42C
43 DO 200 i = 1,l,2
44 trigs(i) = cos(angle)
45 trigs(i+1) = sin(angle)
46 angle = angle+del
47 200 CONTINUE
48C
49 IF (imode.EQ.1) RETURN
50 IF (imode.EQ.8) RETURN
51 angle = 0.0
52 del = 0.5*del
53 nh = (nn+1)/2
54 l = nh+nh
55 la = nn+nn
56C
57 DO 300 i = 1,l,2
58 trigs(la+i) = cos(angle)
59 trigs(la+i+1) = sin(angle)
60 angle = angle+del
61 300 CONTINUE
62C
63 IF (imode.LE.3) RETURN
64 del = 0.5*del
65 angle = del
66 la = la+nn
67C
68 DO 400 i = 2,nn
69 trigs(la+i) = 2.0*sin(angle)
70 angle = angle+del
71 400 CONTINUE
72C
73 RETURN
74 END
subroutine w3fa13(trigs, rcos)
Computes trig functions used in 2.5 by 2.5 lat,lon mapping routines.
Definition w3fa13.f:18