NCEPLIBS-w3emc 2.12.0
Loading...
Searching...
No Matches
w3ft209.f
Go to the documentation of this file.
1C> @file
2C> @brief Convert (361,91) grid to (101,81) lambert grid.
3C> @author Ralph Jones @date 1994-05-18
4
5C> Convert a northern hemisphere 1.0 degree lat.,lon. 361 by
6C> 91 grid to a lambert conformal 101 by 81 awips grib 209.
7C>
8C> ### Program History Log:
9C> Date | Programmer | Comment
10C> -----|------------|--------
11C> 1994-05-18 | Ralph Jones | Initial.
12C>
13C> @param[in] ALOLA 361*91 grid 1.0 deg. lat,lon grid n. hemi.
14C> 32851 point grid. 360 * 181 one degree
15C> grib grid 3 was flipped, greenwish added
16C> to right side and cut to 361 * 91.
17C> @param[in] INTERP 1 linear interpolation , ne.1 biquadratic
18C> @param[out] ALAMB 101*81 regional - central us mard double res.
19C> (lambert conformal). 8181 point grid is awips grid type 209
20C>
21C> @note
22C> - 1. W1 and w2 are used to store sets of constants which are
23C> reusable for repeated calls to the subroutine. 11 other array
24C> are saved and reused on the next call.
25C> - 2. Wind components are not rotated to the 101*81 grid orientation
26C> after interpolation. You may use w3fc08() to do this.
27C>
28C> @author Ralph Jones @date 1994-05-18
29 SUBROUTINE w3ft209(ALOLA,ALAMB,INTERP)
30C
31C
32 parameter(npts=8181,ii=101,jj=81)
33 parameter(alatan=25.000)
34 parameter(pi=3.1416)
35 parameter(dx=40635.250)
36 parameter(alat1=22.289)
37 parameter(elon1=242.00962)
38 parameter(elonv=265.000)
39 parameter(iii=361,jjj=91)
40C
41 REAL ALOLA(III,JJJ)
42 REAL ALAMB(NPTS)
43 REAL W1(NPTS), W2(NPTS), ERAS(NPTS,4)
44 REAL XDELI(NPTS), XDELJ(NPTS)
45 REAL XI2TM(NPTS), XJ2TM(NPTS)
46C
47 INTEGER IV(NPTS), JV(NPTS), JY(NPTS,4)
48 INTEGER IM1(NPTS), IP1(NPTS), IP2(NPTS)
49C
50 LOGICAL LIN
51C
52 SAVE
53C
54 DATA iswt /0/
55 DATA intrpo/99/
56C
57 lin = .false.
58 IF (interp.EQ.1) lin = .true.
59C
60 IF (iswt.EQ.1) GO TO 900
61c print *,'iswt = ',iswt
62 n = 0
63 DO j = 1,jj
64 DO i = 1,ii
65 xj = j
66 xi = i
67 CALL w3fb12(xi,xj,alat1,elon1,dx,elonv,alatan,alat,
68 & elon,ierr)
69 n = n + 1
70 w1(n) = elon + 1.0
71 w2(n) = alat + 1.0
72 END DO
73 END DO
74C
75 iswt = 1
76 intrpo = interp
77 GO TO 1000
78C
79C AFTER THE 1ST CALL TO W3FT209 TEST INTERP, IF IT HAS
80C CHANGED RECOMPUTE SOME CONSTANTS
81C
82 900 CONTINUE
83 IF (interp.EQ.intrpo) GO TO 2100
84 intrpo = interp
85C
86 1000 CONTINUE
87 DO 1100 k = 1,npts
88 iv(k) = w1(k)
89 jv(k) = w2(k)
90 xdeli(k) = w1(k) - iv(k)
91 xdelj(k) = w2(k) - jv(k)
92 ip1(k) = iv(k) + 1
93 jy(k,3) = jv(k) + 1
94 jy(k,2) = jv(k)
95 1100 CONTINUE
96C
97 IF (lin) GO TO 2100
98C
99 DO 1200 k = 1,npts
100 ip2(k) = iv(k) + 2
101 im1(k) = iv(k) - 1
102 jy(k,1) = jv(k) - 1
103 jy(k,4) = jv(k) + 2
104 xi2tm(k) = xdeli(k) * (xdeli(k) - 1.0) * .25
105 xj2tm(k) = xdelj(k) * (xdelj(k) - 1.0) * .25
106 1200 CONTINUE
107C
108 2100 CONTINUE
109 IF (lin) THEN
110C
111C LINEAR INTERPOLATION
112C
113 DO 2200 kk = 1,npts
114 eras(kk,2) = (alola(ip1(kk),jy(kk,2))-alola(iv(kk),jy(kk,2)))
115 & * xdeli(kk) + alola(iv(kk),jy(kk,2))
116 eras(kk,3) = (alola(ip1(kk),jy(kk,3))-alola(iv(kk),jy(kk,3)))
117 & * xdeli(kk) + alola(iv(kk),jy(kk,3))
118 2200 CONTINUE
119C
120 DO 2300 kk = 1,npts
121 alamb(kk) = eras(kk,2) + (eras(kk,3) - eras(kk,2))
122 & * xdelj(kk)
123 2300 CONTINUE
124C
125 ELSE
126C
127C QUADRATIC INTERPOLATION
128C
129 DO 2400 kk = 1,npts
130 eras(kk,1)=(alola(ip1(kk),jy(kk,1))-alola(iv(kk),jy(kk,1)))
131 & * xdeli(kk) + alola(iv(kk),jy(kk,1)) +
132 & ( alola(im1(kk),jy(kk,1)) - alola(iv(kk),jy(kk,1))
133 & - alola(ip1(kk),jy(kk,1))+alola(ip2(kk),jy(kk,1)))
134 & * xi2tm(kk)
135 eras(kk,2)=(alola(ip1(kk),jy(kk,2))-alola(iv(kk),jy(kk,2)))
136 & * xdeli(kk) + alola(iv(kk),jy(kk,2)) +
137 & ( alola(im1(kk),jy(kk,2)) - alola(iv(kk),jy(kk,2))
138 & - alola(ip1(kk),jy(kk,2))+alola(ip2(kk),jy(kk,2)))
139 & * xi2tm(kk)
140 eras(kk,3)=(alola(ip1(kk),jy(kk,3))-alola(iv(kk),jy(kk,3)))
141 & * xdeli(kk) + alola(iv(kk),jy(kk,3)) +
142 & ( alola(im1(kk),jy(kk,3)) - alola(iv(kk),jy(kk,3))
143 & - alola(ip1(kk),jy(kk,3))+alola(ip2(kk),jy(kk,3)))
144 & * xi2tm(kk)
145 eras(kk,4)=(alola(ip1(kk),jy(kk,4))-alola(iv(kk),jy(kk,4)))
146 & * xdeli(kk) + alola(iv(kk),jy(kk,4)) +
147 & ( alola(im1(kk),jy(kk,4)) - alola(iv(kk),jy(kk,4))
148 & - alola(ip1(kk),jy(kk,4))+alola(ip2(kk),jy(kk,4)))
149 & * xi2tm(kk)
150 2400 CONTINUE
151C
152 DO 2500 kk = 1,npts
153 alamb(kk) = eras(kk,2) + (eras(kk,3) - eras(kk,2))
154 & * xdelj(kk) + (eras(kk,1) - eras(kk,2)
155 & - eras(kk,3) + eras(kk,4)) * xj2tm(kk)
156 2500 CONTINUE
157C
158 ENDIF
159C
160 RETURN
161 END
subroutine w3fb12(xi, xj, alat1, elon1, dx, elonv, alatan, alat, elon, ierr)
Converts the coordinates of a location on Earth given in a grid coordinate system overlaid on a lambe...
Definition w3fb12.f:53
subroutine w3ft209(alola, alamb, interp)
Convert a northern hemisphere 1.0 degree lat.,lon.
Definition w3ft209.f:30