40 SUBROUTINE w3fp12(ID8, IFLAG, IDPDS, ICENT, ISCALE, IER)
50 INTEGER(8) MSK1,MSK2,MSK3,MSK4,MSK5,MSK6,MSK7
63 CHARACTER*1 IDPDS (28)
65 CHARACTER*1 IHOLD ( 8)
66 CHARACTER*1 IPDS1 ( 8)
67 CHARACTER*1 KDATE ( 8)
68 CHARACTER*1 LIDWK (32)
70 equivalence(idwk(1),lidwk(1))
71 equivalence(l,ipds1(1))
72 equivalence(nbytes,ihold(1))
73 equivalence(jdate,kdate(1))
75 INTEGER NDATE(8), MDATE(8)
77 DATA ll / 8, 8, 9, 255, 255, 255, 1, 6, 255, 255,
78 & 16, 24, 19, 23, 20, 21, 17, 18, 255, 180,
79 & 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
80 & 55, 50, 48, 56, 49, 57, 80, 81, 71, 255,
81 & 40, 42, 72, 74, 73, 255, 255, 255, 255, 255,
82 & 304, 305, 95, 88, 101, 89, 104, 255, 117, 255,
83 & 97, 98, 90, 105, 94, 255, 255, 93, 188, 255,
84 & 255, 255, 255, 211, 255, 255, 255, 255, 255, 255,
85 & 255, 384, 161, 255, 255, 169, 22, 255, 255, 255,
86 & 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
87 & 255, 400, 389, 385, 388, 391, 386, 390, 402, 401,
88 & 404, 403, 204, 255, 255, 255, 255, 255, 255, 255,
89 & 255, 255, 195, 194, 255, 255, 255, 255, 255, 255,
90 & 255, 255, 112, 116, 114, 255, 103, 52, 255, 255,
91 & 255, 255, 119, 157, 158, 159, 255, 176, 177, 392,
92 & 192, 190, 199, 216, 189, 193, 191, 210, 198, 255,
94 DATA hh / 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
95 & 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
96 & 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
97 & 31, 32, 33, 33, 34, 34, 35, 36, 37, 38,
98 & 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
99 & 49, 50, 51, 52, 53, 54, 55, 56, 57, 58,
100 & 59, 60, 61, 62, 63, 64, 65, 66, 67, 68,
101 & 69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
102 & 79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
103 & 89, 90, 91, 92, 93, 94, 95, 96, 97, 98,
104 & 99, 100, 101, 102, 103, 104, 105, 106, 107, 108,
105 & 109, 110, 111, 112, 113, 114, 115, 116, 117, 118,
106 & 119, 120, 121, 122, 123, 124, 125, 126, 127, 128,
107 & 129, 130, 131, 132, 133, 134, 135, 136, 137, 150,
108 & 151, 152, 156, 157, 158, 159, 175, 176, 177, 201,
109 & 204, 205, 207, 208, 209, 211, 212, 213, 216, 218,
123 & msk5 /z
'00000000F0000000'/
151 IF (jscale.LT.0)
THEN
153 idpds(27) = char(128)
154 idpds(28) = char(jscale)
157 idpds(28) = char(jscale)
160 IF (lidwk(30) .EQ. char(69))
THEN
161 IF (lidwk(29) .EQ. char(3))
THEN
163 ELSE IF (lidwk(29) .EQ. char(4))
THEN
167 IF (lidwk(30) .EQ. char(78))
THEN
168 IF (lidwk(29) .EQ. char(3))
THEN
170 ELSE IF (lidwk(29) .EQ. char(4))
THEN
175 IF (lidwk(20) .EQ. char(26)) idpds(7) = char(6)
183 q = ishft(idwk(1),-52_8)
186 IF (q .EQ. ll(i))
GO TO 310
190 print 320, ier, q, id8
191 320
FORMAT (
' W3FP12 (320) - IER = ',i2,
', Q = ',i3,/,
192 &
' OFFICE NOTE 84 PARAMETER N.A. IN GRIB',
197 s1 = iand(ishft(idwk(1),-40_8),msk1)
198 c1 = ishft(iand(idwk(1),msk2),-8_8)
199 isig1 = iand(idwk(1),msk4)
200 e1 = iand(idwk(1),msk3)
201 IF (isig1 .NE. 0) e1 = -e1
202 m = ishft(iand(ishft(idwk(2),-32_8),msk5),-28_8)
203 n = ishft(iand(idwk(2),msk5),-28_8)
204 ks = ishft(iand(ishft(idwk(3),-32_8),msk6),-8_8)
206 c2 = ishft(iand(idwk(2),msk2),-8_8)
207 isig2 = iand(idwk(2),msk4)
208 e2 = iand(idwk(2),msk3)
209 IF (isig2 .NE. 0) e2 = -e2
211 idpds(9) = char(hh(i))
216 IF (n .EQ. 5 .AND. q .EQ. 1)
THEN
220 IF (m .EQ. 0 .AND. q .EQ. 8)
THEN
224 IF (m .EQ. 0 .AND. q .EQ. 1)
THEN
228 IF (m .EQ. 1 .AND. q .EQ. 1)
THEN
231 330
FORMAT (
' W3FP12 (330) - IER =',i2,/,
232 &
' OFFICE NOTE 84 PARAMETER N.A. IN GRIB',
244 IF (s1.EQ.0.AND.(q.EQ.176.OR.q.EQ.177))
THEN
249 ELSE IF (s1 .EQ. 8)
THEN
250 idpds(10) = char(100)
251 l = c1 * (10. ** e1) + .5
255 ELSE IF (s1 .EQ. 1)
THEN
256 idpds(10) = char(103)
257 l = c1 * (10. ** e1) + .5
261 ELSE IF (s1 .EQ. 6)
THEN
262 idpds(10) = char(105)
263 l = c1 * (10. ** e1) + .5
267 ELSE IF (s1 .EQ. 7)
THEN
268 idpds(10) = char(111)
270 IF (isig1 .NE. 0) e1 = e1 + 2
271 l = c1 * (10. ** e1) + .5
275 ELSE IF (s1.EQ.148 .OR. s1 .EQ. 144 .OR. s1 .EQ. 145)
THEN
276 idpds(10) = char(107)
277 l = (c1 * (10. ** e1) * 10**4) + .5
281 ELSE IF (s1 .EQ. 16)
THEN
282 l = c1 * (10. ** e1) + .5
289 print 410, ier, s1, id8
293 ELSE IF (s1 .EQ. 19)
THEN
294 l = c1 * (10. ** e1) + .5
295 idpds(10) = char(113)
301 ELSE IF (s1 .EQ. 128)
THEN
305 idpds(10) = char(102)
309 ELSE IF (s1 .EQ. 129)
THEN
314 ELSE IF (s1 .EQ. 130)
THEN
319 ELSE IF (s1 .EQ. 131)
THEN
324 ELSE IF (s1 .EQ. 133)
THEN
329 ELSE IF (s1 .EQ. 136)
THEN
331 IF (t.EQ.2.AND.f1.EQ.0.AND.f2.EQ.3)
THEN
337 idpds(10) = char(102)
341 ELSE IF (s1 .EQ. 137)
THEN
345 idpds(10) = char(102)
349 ELSE IF (s1 .EQ. 138)
THEN
353 idpds(10) = char(102)
359 print 410, ier, s1, id8
360 410
FORMAT (
' W3FP12 (410) - IER = ',i2,
', S1 = ',i5,/,
361 &
' SURFACE TYPE N.A. IN GRIB',/,
' ID8 = ',
366 ELSE IF (m .EQ. 1)
THEN
367 IF ((s1 .EQ. 8) .AND. (q .EQ. 1))
THEN
369 idpds(10) = char(101)
370 jjj = ((c1 * 10. ** e1) * .1) + .5
371 idpds(11) = char(jjj)
372 kkk = ((c2 * 10. ** e2) * .1) + .5
373 idpds(12) = char(kkk)
376 ELSE IF (m .EQ. 2)
THEN
378 idpds(10) = char(101)
379 jjj = ((c1 * 10. ** e1) * .1) + .5
380 idpds(11) = char(jjj)
381 kkk = ((c2 * 10. ** e2) * .1) + .5
382 idpds(12) = char(kkk)
383 IF (idpds(9) .EQ. char(131)) idpds(12) = char(100)
385 ELSE IF (s1 .EQ. 1)
THEN
386 idpds(10) = char(104)
387 jjj = ((c1 * 10. ** e1) * .1) + .5
388 idpds(11) = char(jjj)
389 kkk = ((c2 * 10. ** e2) * .1) + .5
390 idpds(12) = char(kkk)
392 ELSE IF (s1 .EQ. 6)
THEN
393 idpds(10) = char(106)
394 jjj = ((c1 * 10. ** e1) * .1) + .5
395 idpds(11) = char(jjj)
396 kkk = ((c2 * 10. ** e2) * .1) + .5
397 idpds(12) = char(kkk)
399 ELSE IF (s1.EQ.148 .OR. s1 .EQ. 144 .OR. s1 .EQ. 145)
THEN
400 idpds(10) = char(108)
401 jjj = ((c1 * 10. ** e1) * 10**2) + .5
402 idpds(11) = char(jjj)
403 kkk = ((c2 * 10. ** e2) * 10**2) + .5
404 idpds(12) = char(kkk)
408 print 420, ier, s1, id8
409 420
FORMAT (
' W3FP12 (420) - IER = ',i2,
', S1 = ',i5,/,
410 &
' SURFACE LAYERS N.A. IN GRIB',
411 & /,
' ID8= ',4(z16,
' '))
414 ELSE IF (m .GT. 2)
THEN
416 print 500, ier, m, id8
417 500
FORMAT (
'W3FP12 (500) - IER = ',i2,
', M = ',/,
418 &
' THE M FROM O.N. 84 N.A. IN GRIB',
419 & /,
' ID8 = ',4(z16,
' '))
425 idpds(13) = lidwk(25)
426 idpds(14) = lidwk(26)
427 idpds(15) = lidwk(27)
428 idpds(16) = lidwk(28)
430 idpds(25) = char(icent)
438 t = ishft((iand(idwk(1),msk5)),-28_8)
439 f1 = iand(ishft(idwk(1),-32_8),msk7)
440 f2 = iand(ishft(idwk(2),-32_8),msk7)
449 ELSE IF (t .EQ. 1)
THEN
454 ELSE IF (t .EQ. 2)
THEN
455 IF (
mova2i(idpds(9)).NE.137)
THEN
461 ELSE IF (t .EQ. 3)
THEN
462 IF (q .EQ. 89 .OR. q .EQ. 90 .OR. q .EQ. 94
463 & .OR. q .EQ. 105)
THEN
468 IF (itemp.LT.0) itemp = 0
470 idpds(19) = char(itemp)
480 IF (itemp.LT.0) itemp = 0
482 idpds(19) = char(itemp)
489 ELSE IF (t .EQ. 4)
THEN
491 IF (f1 .EQ. 0 .AND. f2 .NE. 0)
THEN
495 idpds(21) = char(124)
500 ELSE IF (f1 .NE. 0 .AND. f2 .EQ. 0)
THEN
504 idpds(21) = char(124)
511 ELSE IF (t .EQ. 5)
THEN
515 IF (itemp.LT.0) itemp = 0
517 idpds(19) = char(itemp)
523 ELSE IF (t .EQ. 6)
THEN
524 jsign = iand(ishft(idwk(1),-32_8),msk4)
525 jsigo = iand(ishft(idwk(2),-32_8),msk4)
526 f1 = iand(ishft(idwk(1),-32_8),msk3)
527 f2 = iand(ishft(idwk(2),-32_8),msk3)
528 IF (jsign .NE. 0) f1 = -f1
529 IF (jsigo .NE. 0) f2 = -f2
557 idpds(13) = lidwk(25)
558 idpds(14) = lidwk(26)
559 idpds(15) = lidwk(27)
560 idpds(16) = lidwk(28)
563 idpds(21) = char(123)
566 idpds(19) = char(nf1)
567 idpds(21) = char(113)
577 ELSE IF (t .EQ. 7)
THEN
582 ELSE IF (t .EQ. 10)
THEN
587 710
FORMAT (
' W3FP12 (710) - NOT APPLICABLE (YET) TO GRIB. ',
589 &
' O.N. 84 IDS ARE ',/,