NCEPLIBS-w3emc 2.12.0
Loading...
Searching...
No Matches
w3ft33.f
Go to the documentation of this file.
1C> @file
2C> @brief Thicken thinned wafs grib grid 37-44
3C> @author Ralph Peterson @date 1994
4
5C> Subroutine thickens one thinned wafs grib grid to a
6C> real array of 5329 numbers (73,73) 1.25 degree grid.
7C>
8C> ### Program History Log:
9C> Date | Programmer | Comment
10C> -----|------------|--------
11C> 1994-??-?? | Ralph Peterson
12C> 1994-11-07 | Ralph Jones | Add doc block, change call to 3 parameters.
13C> Replace cos with table lookup.
14C> 1995-06-02 | Ralph Peterson | Changes to correct miss-position
15C> between + or - 8.75 n/s.
16C> 1995-06-03 | Ralph Jones | Changes so 8 rows with 73 values
17C> are not thickened, 10% faster.
18C>
19C> @param[in] AIN Real 3447 word array with unpacked thinned wafs
20C> grib type 37-44.
21C> @param[in] NSFLAG Integer = 1 AIN is wafs grib grid 37-40 n. hemi.
22C> = -1 AIN is wafs grib grid 41-44 s. hemi.
23C> @param[out] OUT Real (73,73) word array with thickened wafs grib grid 37-44.
24C>
25C> @remark The pole point for u and v wind components will have only
26C> one point. If you need the pole row corrected see page 9 section
27C> 1 in office note 388. You need both u and v to make the
28C> correction.
29C>
30C> @author Ralph Peterson @date 1994
31 SUBROUTINE w3ft33(AIN,OUT,NSFLAG)
32C
33 parameter(nx=73,ny=73)
34 parameter(nin=3447)
35C
36 REAL AIN(*)
37 REAL OUT(NX,NY)
38C
39 INTEGER IPOINT(NX)
40C
41 SAVE
42C
43 DATA ipoint/
44 & 73, 73, 73, 73, 73, 73, 73, 73, 72, 72, 72, 71, 71, 71, 70,
45 & 70, 69, 69, 68, 67, 67, 66, 65, 65, 64, 63, 62, 61, 60, 60,
46 & 59, 58, 57, 56, 55, 54, 52, 51, 50, 49, 48, 47, 45, 44, 43,
47 & 42, 40, 39, 38, 36, 35, 33, 32, 30, 29, 28, 26, 25, 23, 22,
48 & 20, 19, 17, 16, 14, 12, 11, 9, 8, 6, 5, 3, 2/
49C
50 nxm = nx - 1
51 fnxm = float(nxm)
52C
53C TEST FOR GRIDS (37-40)
54C
55 IF (nsflag.GT.0) THEN
56C
57C DO NOT THICKEN 8 ROWS WITH 73 VALUES, MOVE DATA
58C TO OUT ARRAY. GRIDS (37-40) N.
59C
60 is = 0
61 DO j = 1,8
62 DO i = 1,nx
63 is = is + 1
64 out(i,j) = ain(is)
65 END DO
66 END DO
67C
68 ie = nx * 8
69 DO j = 9,ny
70 npoint = ipoint(j)
71 is = ie + 1
72 ie = is + npoint - 1
73 dpts = (float(npoint)-1.) / fnxm
74 pw = 1.0
75 pe = pw + dpts
76 out(1,j) = ain(is)
77 valw = ain(is)
78 vale = ain(is+1)
79 dval = (vale-valw)
80 DO i = 2,nxm
81 wght = pe -float(ifix(pe))
82 out(i,j) = valw + wght * dval
83 pw = pe
84 pe = pe + dpts
85 IF (ifix(pw).NE.ifix(pe)) THEN
86 is = is + 1
87 valw = vale
88 vale = ain(is+1)
89 dval = (vale - valw)
90 END IF
91 END DO
92 out(nx,j) = ain(ie)
93 END DO
94C
95 ELSE
96C
97C DO NOT THICKEN 8 ROWS WITH 73 VALUES, MOVE DATA
98C TO OUT ARRAY. GRIDS (41-44) S.
99C
100 is = nin - (8 * nx)
101 DO j = 66,ny
102 DO i = 1,nx
103 is = is + 1
104 out(i,j) = ain(is)
105 END DO
106 END DO
107C
108 ie = 0
109 DO j = 1,65
110 npoint = ipoint(74-j)
111 is = ie + 1
112 ie = is + npoint - 1
113 dpts = (float(npoint)-1.) / fnxm
114 pw = 1.0
115 pe = pw + dpts
116 out(1,j) = ain(is)
117 valw = ain(is)
118 vale = ain(is+1)
119 dval = (vale-valw)
120 DO i = 2,nxm
121 wght = pe -float(ifix(pe))
122 out(i,j) = valw + wght * dval
123 pw = pe
124 pe = pe + dpts
125 IF (ifix(pw).NE.ifix(pe)) THEN
126 is = is + 1
127 valw = vale
128 vale = ain(is+1)
129 dval = (vale - valw)
130 END IF
131 END DO
132 out(nx,j) = ain(ie)
133 END DO
134 END IF
135C
136 RETURN
137 END
subroutine w3ft33(ain, out, nsflag)
Subroutine thickens one thinned wafs grib grid to a real array of 5329 numbers (73,...
Definition w3ft33.f:32