45 SUBROUTINE w3fp13 (GRIB, PDS, ID8, IERR )
82 INTEGER NDATE(8), MDATE(8)
83 CHARACTER * 1 IWORK ( 8)
84 CHARACTER * 1 JWORK ( 8)
85 CHARACTER * 1 PDS ( *)
89 equivalence(hh(1),hh1(1))
90 equivalence(hh(128),hh2(1))
91 equivalence(ll(1),ll1(1))
92 equivalence(ll(128),ll2(1))
93 equivalence(idate,iwork(1))
94 equivalence(jdate,jwork(1))
96 DATA hh1 / 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
97 & 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
98 & 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
99 & 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
100 & 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
101 & 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
102 & 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
103 & 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
104 & 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,
105 & 91, 92, 93, 94, 95, 96, 97, 98, 99, 100,
106 & 101, 102, 103, 104, 105, 106, 107, 108, 109, 110,
107 & 111, 112, 113, 114, 115, 116, 117, 118, 119, 120,
108 & 121, 122, 123, 124, 125, 126, 127/
109 DATA hh2 / 128, 129, 130,
110 & 131, 132, 133, 134, 135, 136, 137, 138, 139, 140,
111 & 141, 142, 143, 144, 145, 146, 147, 148, 149, 150,
112 & 151, 152, 153, 154, 155, 156, 157, 158, 159, 160,
113 & 161, 162, 163, 164, 165, 166, 167, 168, 169, 170,
114 & 171, 172, 173, 174, 175, 176, 177, 178, 179, 180,
115 & 181, 182, 183, 184, 185, 186, 187, 188, 189, 190,
116 & 191, 192, 193, 194, 195, 196, 197, 198, 199, 200,
117 & 201, 202, 203, 204, 205, 206, 207, 208, 209, 210,
118 & 211, 212, 213, 214, 215, 216, 217, 218, 219, 220,
119 & 221, 222, 223, 224, 225, 226, 227, 228, 229, 230,
120 & 231, 232, 233, 234, 235, 236, 237, 238, 239, 240,
121 & 241, 242, 243, 244, 245, 246, 247, 248, 249, 250,
122 & 251, 252, 253, 254, 255/
124 DATA igen / 7, 58, 66, 98/
132 DATA icxg2 /z
'00002710', z
'00017FB6', z
'000178D6',
133 a z
'00014C08', z
'00014990', z
'0000B857',
134 a z
'00004663', z
'00013EA5', z
'000061B3'/
142 DATA icxgb2/z
'00002710', z
'00017ED0', z
'00017700',
143 a z
'00014C00', z
'00014820', z
'0000B798',
144 a z
'00004650', z
'00014050', z
'000061A8'/
151 DATA icxg1 /z
'00017FB6', z
'00015E47', z
'00013293',
152 a z
'0001706C', z
'0001498F', z
'0000863C', z
'000061B3'/
159 DATA icxgb1/z
'00017FB6', z
'00015E46', z
'00013290',
160 a z
'00017070', z
'00014992', z
'000185D8', z
'000061A8'/
162 DATA ll1 / 8, 8, 9, 255, 255, 255, 1, 6, 255, 255,
163 & 16, 24, 19, 23, 20, 21, 17, 18, 255, 180,
164 & 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
165 & 55, 50, 48, 49, 80, 81, 71, 255, 40, 42,
166 & 72, 74, 73, 255, 255, 255, 255, 255, 304, 305,
167 & 95, 88, 101, 89, 104, 255, 117, 255, 97, 98,
168 & 90, 105, 94, 255, 255, 93, 188, 255, 255, 255,
169 & 255, 211, 255, 255, 255, 255, 255, 255, 255, 384,
170 & 161, 255, 255, 169, 22, 255, 255, 255, 255, 255,
171 & 255, 255, 255, 255, 255, 255, 255, 255, 255, 400,
172 & 389, 385, 388, 391, 386, 390, 402, 401, 404, 403,
173 & 204, 255, 255, 255, 255, 255, 255, 255, 255, 255,
174 & 195, 194, 255, 255, 255, 255, 255/
175 DATA ll2 / 255, 255, 255,
176 & 112, 116, 114, 255, 103, 52, 255, 255, 255, 255,
177 & 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
178 & 255, 255, 255, 255, 255, 119, 157, 158, 159, 255,
179 & 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
180 & 255, 255, 255, 255, 255, 176, 177, 255, 255, 255,
181 & 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
182 & 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
183 & 392, 255, 255, 192, 190, 255, 199, 216, 189, 255,
184 & 193, 191, 210, 107, 255, 198, 255, 255, 255, 255,
185 & 255, 1, 255, 255, 255, 255, 255, 255, 255, 255,
186 & 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
187 & 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
188 & 255, 160, 255, 255, 255/
190 DATA npts / 1679, 259920, 3021, 2385, 5104, 4225,
191 & 4225, 5365, 5365, 8326, 8326,
192 & 5967, 6177, 6177, 12321, 12321, 12321,
193 & 32400, 32400, 5022, 12902, 25803,
194 & 24162, 48232, 18048, 6889, 10283,
195 & 3640, 16170, 6889, 19305, 11040,
198 DATA ngrd / 1, 4, 5, 6, 8, 27,
199 & 28, 29, 30, 33, 34,
200 & 53, 55, 56, 75, 76, 77,
201 & 85, 86, 87, 90, 91,
202 & 92, 93, 98, 100, 101,
203 & 103, 104, 105, 106, 107,
219 igrib(1:1) = char(71)
220 igrib(2:2) = char(82)
221 igrib(3:3) = char(73)
222 igrib(4:4) = char(66)
326 IF (.NOT. grib(1:4) .EQ. igrib(1:4))
THEN
333 IF (id(1).NE.28)
THEN
335 print *,
'IERR = ',ierr,
',LENGTH OF PDS = ',id(1)
344 IF (id(3) .NE. 7)
THEN
345 CALL sbyte(id8,id(3),232,8)
347 CALL sbyte(id8,id(4),232,8)
351 IF (id(5) .EQ. ngrd(kk))
THEN
353 IF (id(5) .EQ. 6) id(5) = 26
354 CALL sbyte(id8,id(5),152,8)
355 IF (igrdpt.LE.32743)
THEN
356 CALL sbyte(id8,igrdpt,240,16)
358 CALL sbyte(id8,igrdpt,352,32)
364 print *,
'IERR = ',ierr,
',GRID TYPE = ',id(5)
373 IF (id(4).EQ.19.OR.id(4).EQ.53.OR.id(4).EQ.83.OR.
374 & id(4).EQ.84.OR.id(4).EQ.85)
THEN
375 CALL sbyte(id8,0,224,8)
377 ELSE IF (id(4).EQ.25)
THEN
378 CALL sbyte(id8,1,224,8)
380 ELSE IF (id(4).EQ.39.OR.id(4).EQ.64)
THEN
381 CALL sbyte(id8,2,224,8)
383 ELSE IF (id(4).EQ.10.OR.id(4).EQ.42.OR.
384 & id(4).EQ.68.OR.id(4).EQ.73.OR.
385 & id(4).EQ.74.OR.id(4).EQ.75.OR.
386 & id(4).EQ.77.OR.id(4).EQ.81.OR.
388 CALL sbyte(id8,3,224,8)
390 ELSE IF (id(4).EQ.69.OR.id(4).EQ.76.OR.
391 & id(4).EQ.78.OR.id(4).EQ.79.OR.
392 & id(4).EQ.80.oR.id(4).EQ.87)
THEN
393 CALL sbyte(id8,4,224,8)
395 ELSE IF (id(4).EQ.43.OR.id(4).EQ.44.OR.
397 CALL sbyte(id8,5,224,8)
399 ELSE IF ( id(4).EQ.70)
THEN
400 CALL sbyte(id8,6,224,8)
402 ELSE IF ( id(4).EQ.86)
THEN
403 CALL sbyte(id8,7,224,8)
406 CALL sbyte(id8,255,224,8)
414 IF (id(8) .EQ. hh(ii))
THEN
415 IF (ll(ii).NE.255)
GO TO 410
416 print *,
'PDS PARAMETER HAS NO OFFICE NOTE 84 Q TYPE'
417 print *,
'PDS BYTE 9 PARAMETER = ',id(8)
423 print *,
'PDS BYTE 9, PARAMETER = ',id(8)
430 CALL sbyte(id8,ll(iii),0,12)
435 IF (id(8) .EQ. 211) id8(5) = ior(id8(5),msk4)
436 IF (id(8) .EQ. 210) id8(5) = ior(id8(5),msk4)
438 IF (id(8) .EQ. 211) id8(3) = ior(id8(3),ishft(msk4,32))
439 IF (id(8) .EQ. 210) id8(3) = ior(id8(3),ishft(msk4,32))
444 IF (id(9) .EQ. 100)
THEN
447 CALL sbyte(id8,s1,12,12)
448 CALL sbyte(id8,m,64,4)
450 IF (level .GE. 1 .AND. level .LE. 9)
THEN
452 ELSE IF (level .GE. 10 .AND. level .LE. 99)
THEN
454 ELSE IF (level .GE. 100 .AND. level .LE. 999)
THEN
456 ELSE IF (level .GE. 1000 .AND. level .LE. 9999)
THEN
459 c1 = level * 10 ** e1
460 CALL sbyte(id8,c1,36,20)
462 CALL sbyte(id8,e1,56,8)
464 ELSE IF (id(9) .EQ. 103)
THEN
467 CALL sbyte(id8,s1,12,12)
468 CALL sbyte(id8,m,64,4)
470 IF (level .GE. 1 .AND. level .LE. 9)
THEN
472 ELSE IF (level .GE. 10 .AND. level .LE. 99)
THEN
474 ELSE IF (level .GE. 100 .AND. level .LE. 999)
THEN
476 ELSE IF (level .GE. 1000 .AND. level .LE. 9999)
THEN
479 c1 = level * 10 ** e1
480 CALL sbyte(id8,c1,36,20)
482 CALL sbyte(id8,e1,56,8)
484 ELSE IF (id(9) .EQ. 105)
THEN
487 CALL sbyte(id8,s1,12,12)
488 CALL sbyte(id8,m,64,4)
490 IF (level .GE. 1 .AND. level .LE. 9)
THEN
492 ELSE IF (level .GE. 10 .AND. level .LE. 99)
THEN
494 ELSE IF (level .GE. 100 .AND. level .LE. 999)
THEN
496 ELSE IF (level .GE. 1000 .AND. level .LE. 9999)
THEN
499 c1 = level * 10 ** e1
500 CALL sbyte(id8,c1,36,20)
502 CALL sbyte(id8,e1,56,8)
504 ELSE IF (id(9) .EQ. 111)
THEN
507 CALL sbyte(id8,s1,12,12)
508 CALL sbyte(id8,m,64,4)
510 IF (level .GE. 1 .AND. level .LE. 9)
THEN
512 ELSE IF (level .GE. 10 .AND. level .LE. 99)
THEN
514 ELSE IF (level .GE. 100 .AND. level .LE. 999)
THEN
516 ELSE IF (level .GE. 1000 .AND. level .LE. 9999)
THEN
519 c1 = level * 10 ** e1
520 CALL sbyte(id8,c1,36,20)
527 CALL sbyte(id8,e1,56,8)
529 ELSE IF (id(9) .EQ. 107)
THEN
532 CALL sbyte(id8,s1,12,12)
533 CALL sbyte(id8,m,64,4)
535 IF (level .GE. 1 .AND. level .LE. 9)
THEN
537 ELSE IF (level .GE. 10 .AND. level .LE. 99)
THEN
539 ELSE IF (level .GE. 100 .AND. level .LE. 999)
THEN
541 ELSE IF (level .GE. 1000 .AND. level .LE. 9999)
THEN
546 c1 = level * 10 ** e1
548 IF (c1 .EQ. icxgb1(isi))
THEN
552 CALL sbyte(id8,c1,36,20)
559 CALL sbyte(id8,e1,56,8)
561 ELSE IF (id(9) .EQ. 4)
THEN
564 CALL sbyte(id8,s1,12,12)
565 CALL sbyte(id8,m,64,4)
579 c1 = (273.16 * 10 ** e1) + .5
580 CALL sbyte(id8,c1,36,20)
582 CALL sbyte(id8,e1,56,8)
584 ELSE IF (id(9) .EQ. 102)
THEN
587 CALL sbyte(id8,s1,12,12)
588 CALL sbyte(id8,0,64,32)
590 ELSE IF (id(9) .EQ. 1)
THEN
594 CALL sbyte(id8,s1,12,12)
595 CALL sbyte(id8,0,64,32)
597 ELSE IF (id(9) .EQ. 7)
THEN
600 CALL sbyte(id8,s1,12,12)
601 CALL sbyte(id8,0,64,32)
603 ELSE IF (id(9) .EQ. 6)
THEN
606 CALL sbyte(id8,s1,12,12)
607 CALL sbyte(id8,0,64,32)
609 ELSE IF (id(9) .EQ. 101)
THEN
612 CALL sbyte(id8,s1,12,12)
613 CALL sbyte(id8,m,64,4)
614 CALL sbyte(id8,s1,76,12)
616 level = (level * .1) * 10 ** 2
617 IF (level .GE. 1 .AND. level .LE. 9)
THEN
619 ELSE IF (level .GE. 10 .AND. level .LE. 99)
THEN
621 ELSE IF (level .GE. 100 .AND. level .LE. 999)
THEN
623 ELSE IF (level .GE. 1000 .AND. level .LE. 9999)
THEN
626 c1 = level * 10 ** e1
627 CALL sbyte(id8,c1,36,20)
629 CALL sbyte(id8,e1,56,8)
631 level2 = (level2 * .1) * 10 ** 2
632 IF (level2 .GE. 1 .AND. level2 .LE. 9)
THEN
634 ELSE IF (level2 .GE. 10 .AND. level2 .LE. 99)
THEN
636 ELSE IF (level2 .GE. 100 .AND. level2 .LE. 999)
THEN
638 ELSE IF (level2 .GE. 1000 .AND. level2 .LE. 9999)
THEN
641 c2 = level2 * 10 ** e2
642 CALL sbyte(id8,c2,100,20)
643 IF (c2 .EQ. 0) e2 = 0
645 CALL sbyte(id8,e2,120,8)
647 ELSE IF (id(9) .EQ. 104)
THEN
650 CALL sbyte(id8,s1,12,12)
651 CALL sbyte(id8,m,64,4)
652 CALL sbyte(id8,s1,76,12)
654 level = (level * .1) * 10 ** 2
655 IF (level .GE. 1 .AND. level .LE. 9)
THEN
657 ELSE IF (level .GE. 10 .AND. level .LE. 99)
THEN
659 ELSE IF (level .GE. 100 .AND. level .LE. 999)
THEN
661 ELSE IF (level .GE. 1000 .AND. level .LE. 9999)
THEN
664 c1 = level * 10 ** e1
665 CALL sbyte(id8,c1,36,20)
667 CALL sbyte(id8,e1,56,8)
669 level2 = (level2 * .1) * 10 ** 2
670 IF (level2 .GE. 1 .AND. level2 .LE. 9)
THEN
672 ELSE IF (level2 .GE. 10 .AND. level2 .LE. 99)
THEN
674 ELSE IF (level2 .GE. 100 .AND. level2 .LE. 999)
THEN
676 ELSE IF (level2 .GE. 1000 .AND. level2 .LE. 9999)
THEN
679 c2 = level2 * 10 ** e2
680 CALL sbyte(id8,c2,100,20)
682 CALL sbyte(id8,e2,120,8)
684 ELSE IF (id(9) .EQ. 106)
THEN
687 CALL sbyte(id8,s1,12,12)
688 CALL sbyte(id8,m,64,4)
689 CALL sbyte(id8,s1,76,12)
691 level = (level * .1) * 10**2
692 IF (level .GE. 1 .AND. level .LE. 9)
THEN
694 ELSE IF (level .GE. 10 .AND. level .LE. 99)
THEN
696 ELSE IF (level .GE. 100 .AND. level .LE. 999)
THEN
698 ELSE IF (level .GE. 1000 .AND. level .LE. 9999)
THEN
701 c1 = level * 10 ** e1
702 CALL sbyte(id8,c1,36,20)
704 CALL sbyte(id8,e1,56,8)
706 level2 = (level2 * .1) * 10 ** 2
707 IF (level2 .GE. 1 .AND. level2 .LE. 9)
THEN
709 ELSE IF (level2 .GE. 10 .AND. level2 .LE. 99)
THEN
711 ELSE IF (level2 .GE. 100 .AND. level2 .LE. 999)
THEN
713 ELSE IF (level2 .GE. 1000 .AND. level2 .LE. 9999)
THEN
716 c2 = level2 * 10 ** e2
717 CALL sbyte(id8,c2,100,20)
719 CALL sbyte(id8,e2,120,8)
721 ELSE IF (id(9) .EQ. 108)
THEN
726 CALL sbyte(id8,s1,12,12)
727 CALL sbyte(id8,m,64,4)
728 CALL sbyte(id8,s1,76,12)
731 IF (level .GE. 1 .AND. level .LE. 9)
THEN
733 ELSE IF (level .GE. 10 .AND. level .LE. 99)
THEN
735 ELSE IF (level .GE. 100 .AND. level .LE. 999)
THEN
737 ELSE IF (level .GE. 1000 .AND. level .LE. 9999)
THEN
740 c1 = level * (10 ** e1)
742 IF (c1 .EQ. icxgb2(isi))
THEN
746 CALL sbyte(id8,c1,36,20)
749 CALL sbyte(id8,e1,56,8)
755 CALL sbyte(id8,e1,56,8)
760 IF (level2 .GE. 1 .AND. level2 .LE. 9)
THEN
762 ELSE IF (level2 .GE. 10 .AND. level2 .LE. 99)
THEN
764 ELSE IF (level2 .GE. 100 .AND. level2 .LE. 999)
THEN
766 ELSE IF (level2 .GE. 1000 .AND. level2 .LE. 9999)
THEN
769 c2 = level2 * 10 ** e2
771 IF (c2 .EQ. icxgb2(isi))
THEN
775 CALL sbyte(id8,c2,100,20)
777 CALL sbyte(id8,e2,120,8)
781 CALL sbyte(id8,e2,120,8)
789 CALL sbyte(id8,id(18),24,8)
790 ELSE IF (tr .EQ. 4)
THEN
792 CALL sbyte(id8,p2,24,8)
794 CALL sbyte(id8,(p2 - p1),88,8)
796 CALL sbyte(id8,t,32,4)
797 ELSE IF (tr .EQ. 5)
THEN
799 CALL sbyte(id8,p2,24,8)
801 CALL sbyte(id8,(p2 - p1),88,8)
803 CALL sbyte(id8,t,32,4)
805 ELSE IF (tr .EQ. 124)
THEN
809 CALL sbyte(id8,f1,24,8)
811 CALL sbyte(id8,t,32,4)
812 ELSE IF (ftu .EQ. 4)
THEN
814 CALL sbyte(id8,f2,88,8)
816 CALL sbyte(id8,t,32,4)
819 ELSE IF (tr .EQ.123)
THEN
822 CALL sbyte(id8,f1,24,8)
824 CALL sbyte(id8,f2,88,8)
826 CALL sbyte(id8,t,32,4)
830 print *,
'IYR = ', iyr
836 mdate(2) =
mova2i(pds(14))
837 mdate(3) =
mova2i(pds(15))
838 mdate(5) =
mova2i(pds(16))
844 iyear = mod(ndate(1),100)
845 jwork(1) = char(iyear)
846 jwork(2) = char(ndate(2))
847 jwork(3) = char(ndate(3))
848 jwork(4) = char(ndate(5))
852 ELSE IF (tr .EQ.3)
THEN
856 CALL sbyte(id8,f1,24,8)
864 CALL sbyte(id8,f2,88,8)
866 CALL sbyte(id8,t,32,4)
870 print *,
'IYR = ', iyr
876 mdate(2) =
mova2i(pds(14))
877 mdate(3) =
mova2i(pds(15))
878 mdate(5) =
mova2i(pds(16))
884 iyear = mod(ndate(1),100)
885 jwork(1) = char(iyear)
886 jwork(2) = char(ndate(2))
887 jwork(3) = char(ndate(3))
888 jwork(4) = char(ndate(5))
904 IF (lw.EQ.8) idate = ishft(idate,-32)
905 CALL sbyte(id8,idate,192,32)