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