88SUBROUTINE ipxwafs3(IDIR, NUMPTS_THIN, NUMPTS_FULL, KM, NUM_OPT, OPT_PTS, &
89 IGDTLEN, IGDTMPL_THIN, DATA_THIN, IB_THIN, BITMAP_THIN, &
90 IGDTMPL_FULL, DATA_FULL, IB_FULL, BITMAP_FULL, IRET)
93 INTEGER,
INTENT(IN ) :: NUM_OPT
94 INTEGER,
INTENT(INOUT) :: OPT_PTS(NUM_OPT)
95 INTEGER,
INTENT(IN ) :: IDIR, KM, NUMPTS_THIN, NUMPTS_FULL
96 INTEGER,
INTENT(IN ) :: IGDTLEN
97 INTEGER,
INTENT(INOUT) :: IGDTMPL_THIN(IGDTLEN)
98 INTEGER,
INTENT(INOUT) :: IGDTMPL_FULL(IGDTLEN)
99 INTEGER,
INTENT(INOUT) :: IB_THIN(KM), IB_FULL(KM)
100 INTEGER,
INTENT( OUT) :: IRET
102 LOGICAL(KIND=1),
INTENT(INOUT) :: BITMAP_THIN(NUMPTS_THIN,KM)
103 LOGICAL(KIND=1),
INTENT(INOUT) :: BITMAP_FULL(NUMPTS_FULL,KM)
105 REAL,
INTENT(INOUT) :: DATA_THIN(NUMPTS_THIN,KM)
106 REAL,
INTENT(INOUT) :: DATA_FULL(NUMPTS_FULL,KM)
108 INTEGER,
PARAMETER :: MISSING=-1
110 INTEGER :: SCAN_MODE, I, J, K, IDLAT, IDLON
111 INTEGER :: IA, IB, IM, IM1, IM2, NPWAFS(73)
112 INTEGER :: IS1, IS2, ISCAN, ISCALE
114 LOGICAL :: TEST1, TEST2
117 REAL :: RAT1, RAT2, RLON1, RLON2
118 REAL :: WA, WB, X1, X2
121 73, 73, 73, 73, 73, 73, 73, 73, 72, 72, 72, 71, 71, 71, 70,&
122 70, 69, 69, 68, 67, 67, 66, 65, 65, 64, 63, 62, 61, 60, 60,&
123 59, 58, 57, 56, 55, 54, 52, 51, 50, 49, 48, 47, 45, 44, 43,&
124 42, 40, 39, 38, 36, 35, 33, 32, 30, 29, 28, 26, 25, 23, 22,&
125 20, 19, 17, 16, 14, 12, 11, 9, 8, 6, 5, 3, 2/
131 IF (igdtlen /= 19 .OR. numpts_thin/=3447 .OR. numpts_full/=5329)
THEN
138 scan_mode=igdtmpl_thin(19)
139 iscale=igdtmpl_thin(10)*igdtmpl_thin(11)
140 IF(iscale==0) iscale=10**6
141 idlat=nint(1.25*float(iscale))
142 test1=all(opt_pts==npwafs)
143 test2=all(opt_pts==npwafs(73:1:-1))
146 IF(scan_mode==64 .AND. igdtmpl_thin(9)==73 .AND. &
147 idlat==igdtmpl_thin(18) .AND. (test1 .OR. test2) )
THEN
148 igdtmpl_full=igdtmpl_thin
151 rlon1=float(igdtmpl_full(13))/float(iscale)
152 rlon2=float(igdtmpl_full(16))/float(iscale)
153 iscan=mod(igdtmpl_full(19)/128,2)
155 dlon=hi*(mod(hi*(rlon2-rlon1)-1+3600,360.)+1)/(im-1)
156 igdtmpl_full(17)=nint(dlon*float(iscale))
162 ELSEIF(idir.LT.0)
THEN
163 scan_mode=igdtmpl_full(19)
164 iscale=igdtmpl_full(10)*igdtmpl_full(11)
165 IF(iscale==0) iscale=10**6
166 idlat=nint(1.25*float(iscale))
170 IF(scan_mode==64 .AND. igdtmpl_full(8)==73 .AND. igdtmpl_full(9)==73 .AND. &
171 num_opt==73 .AND. idlat==igdtmpl_full(18) .AND. idlon==igdtmpl_full(17))
THEN
172 igdtmpl_thin=igdtmpl_full
173 igdtmpl_thin(8)=missing
174 igdtmpl_thin(17)=missing
175 IF(igdtmpl_thin(12)==0)
THEN
178 opt_pts=npwafs(73:1:-1)
194 DO j=1,igdtmpl_full(9)
197 rat1=float(im1-1)/float(im2-1)
201 ia=min(max(ia,1),im1-1)
206 IF(ib_thin(k).EQ.0.OR.bitmap_thin(is1+ia,k))
THEN
207 data_full(is2+i,k)=data_thin(is1+ia,k)
208 bitmap_full(is2+i,k)=.true.
210 data_full(is2+i,k)=0.0
211 bitmap_full(is2+i,k)=.false.
215 IF(ib_thin(k).EQ.0.OR.bitmap_thin(is1+ib,k))
THEN
216 data_full(is2+i,k)=data_thin(is1+ib,k)
217 bitmap_full(is2+i,k)=.true.
219 data_full(is2+i,k)=0.0
220 bitmap_full(is2+i,k)=.false.
231 ELSEIF(idir.EQ.-1)
THEN
236 DO j=1,igdtmpl_full(9)
239 rat2=float(im2-1)/float(im1-1)
243 ia=min(max(ia,1),im2-1)
248 IF(ib_full(k).EQ.0.OR.bitmap_full(is2+ia,k))
THEN
249 data_thin(is1+i,k)=data_full(is2+ia,k)
250 bitmap_thin(is1+i,k)=.true.
252 data_thin(is1+i,k)=0.0
253 bitmap_thin(is1+i,k)=.false.
257 IF(ib_full(k).EQ.0.OR.bitmap_full(is2+ib,k))
THEN
258 data_thin(is1+i,k)=data_full(is2+ib,k)
259 bitmap_thin(is1+i,k)=.true.
261 data_thin(is1+i,k)=0.0
262 bitmap_thin(is1+i,k)=.false.