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