42 SUBROUTINE getgb1s(CBUF,NLEN,NNUM,J,JPDS,JGDS,JENS,
43 & K,KPDS,KGDS,KENS,LSKIP,LGRIB,IRET)
44 CHARACTER CBUF(NLEN*NNUM)
45 INTEGER JPDS(200),JGDS(200),JENS(200)
46 INTEGER KPDS(200),KGDS(200),KENS(200)
47 parameter(lpds=23,lgds=22,lens=5)
48 CHARACTER CPDS(400)*1,CGDS(400)*1
50 INTEGER IPDSP(LPDS),JPDSP(LPDS)
51 INTEGER IGDSP(LGDS),JGDSP(LGDS)
52 INTEGER IENSP(LENS),JENSP(LENS)
62 IF(jpds(i).NE.-1)
THEN
70 IF(jpds(3).EQ.255)
THEN
72 IF(jgds(i).NE.-1)
THEN
81 IF(jpds(23).EQ.2)
THEN
83 IF(jens(i).NE.-1)
THEN
92 dowhile(iret.NE.0.AND.k.LT.nnum)
98 cpds(1:28)=cbuf((k-1)*nlen+26:(k-1)*nlen+53)
100 cpds(29:40-nless)=cbuf((k-1)*nlen+173:(k-1)*nlen+184-nless)
102 CALL gbytec(cbuf,kptr(3),(k-1)*nlen*8+25*8,3*8)
104 CALL gbytec(cpds,kpds(4),7*8,8)
105 CALL fi632(cpds,kptr,kpds,kret)
108 lt=lt+abs(jpds(ip)-kpds(ip))
112 IF(lt.EQ.0.AND.lgdsp.GT.0)
THEN
114 cgds(1:42)=cbuf((k-1)*nlen+54:(k-1)*nlen+95)
115 nless=max(320-nlen,0)
116 cgds(43:178-nless)=cbuf((k-1)*nlen+185:(k-1)*nlen+320-nless)
118 CALL fi633(cgds,kptr,kgds,kret)
121 lt=lt+abs(jgds(ip)-kgds(ip))
125 IF(lt.EQ.0.AND.lensp.GT.0)
THEN
126 nless=max(172-nlen,0)
127 cpds(41:100-nless)=cbuf((k-1)*nlen+113:(k-1)*nlen+172-nless)
128 CALL pdseup(kens,kprob,xprob,kclust,kmembr,45,cpds)
131 lt=lt+abs(jens(ip)-kens(ip))
136 CALL gbytec(cbuf,lskip,(k-1)*nlen*8,4*8)
137 CALL gbytec(cbuf,lgrib,(k-1)*nlen*8+20*8,4*8)
140 cpds(1:28)=cbuf((k-1)*nlen+26:(k-1)*nlen+53)
141 nless=max(184-nlen,0)
142 cpds(29:40-nless)=cbuf((k-1)*nlen+173:(k-1)*nlen+184-nless)
144 CALL gbytec(cbuf,kptr(3),(k-1)*nlen*8+25*8,3*8)
146 CALL gbytec(cpds,kpds(4),7*8,8)
147 CALL fi632(cpds,kptr,kpds,kret)
151 cgds(1:42)=cbuf((k-1)*nlen+54:(k-1)*nlen+95)
152 nless=max(320-nlen,0)
153 cgds(43:178-nless)=cbuf((k-1)*nlen+185:(k-1)*nlen+320-nless)
155 CALL fi633(cgds,kptr,kgds,kret)
157 IF(kpds(23).EQ.2.AND.lensp.EQ.0)
THEN
158 nless=max(172-nlen,0)
159 cpds(41:100-nless)=cbuf((k-1)*nlen+113:(k-1)*nlen+172-nless)
160 CALL pdseup(kens,kprob,xprob,kclust,kmembr,45,cpds)
subroutine getgb1s(cbuf, nlen, nnum, j, jpds, jgds, jens, k, kpds, kgds, kens, lskip, lgrib, iret)
Find a grib message.
subroutine pdseup(kens, kprob, xprob, kclust, kmembr, ilast, msga)
Unpacks grib pds extension starting on byte 41 for ensemble forecast products.