NCEPLIBS-g2  3.4.5
getgb2s.f
Go to the documentation of this file.
1 C> @file
2 C> @brief This subroutine find a reference to the grib field
3 C> requested in the index file.
4 C> @author Stephen Gilbert @date 2002-01-15
5 C>
6 
7 C> This subroutine find in the index file for a reference to the grib
8 C> field requested. The grib field request specifies the number of
9 C> messages to skip and the unpacked identification section, grid
10 C> definition template and product defintion section parameters.
11 C> (a requested parameter of -9999 means to allow any value of this
12 C> parameter to be found.)
13 C> Each index record has the following form:
14 C> - byte 001 - 004 length of index record
15 C> - byte 005 - 008 bytes to skip in data file before grib message
16 C> - byte 009 - 012 bytes to skip in message before lus (local use)
17 C> set = 0, if no local use section in grib2 message.
18 C> - byte 013 - 016 bytes to skip in message before gds
19 C> - byte 017 - 020 bytes to skip in message before pds
20 C> - byte 021 - 024 bytes to skip in message before drs
21 C> - byte 025 - 028 bytes to skip in message before bms
22 C> - byte 029 - 032 bytes to skip in message before data section
23 C> - byte 033 - 040 bytes total in the message
24 C> - byte 041 - 041 grib version number ( currently 2 )
25 C> - byte 042 - 042 message discipline
26 C> - byte 043 - 044 field number within grib2 message
27 C> - byte 045 - ii identification section (ids)
28 C> - byte ii+1- jj grid definition section (gds)
29 C> - byte jj+1- kk product definition section (pds)
30 C> - byte kk+1- ll the data representation section (drs)
31 C> - byte ll+1-ll+6 first 6 bytes of the bit map section (bms)
32 C> Most of the decoded information for the selected grib field is
33 C> returned in a derived type variable, GFLD. GFLD is of type
34 C> gribfield, which is defined in module grib_mod, so users of this
35 C> routine will need to include the line "use grib_mod" in their
36 C> calling routine. Each component of the gribfield type is described
37 C> in the output argument list section below. Only the unpacked
38 C> bitmap and data field components are not set by this routine.
39 C>
40 C> Program History log:
41 C> - 1995-10-31 Mark Iredell Initial development
42 C> - 2002-01-02 Stephen Gilbert Modified from getg1s to work with grib2
43 C> - 2011-06-24 Boi Vuong initialize variable gfld%idsect and gfld%local
44 C>
45 C> @param[in] CBUF character*1 (nlen) buffer containing index data.
46 C> @param[in] NLEN integer total length of all index records.
47 C> @param[in] NNUM integer number of index records.
48 C> @param[in] J integer number of fields to skip
49 C> (=0 to search from beginning)
50 C> @param[in] JDISC grib2 discipline number of requested field
51 C> (if = -1, accept any discipline see code table 0.0)
52 C> - 0 meteorological products
53 C> - 1 hydrological products
54 C> - 2 land surface products
55 C> - 3 space products
56 C> - 10 oceanographic products
57 C> @param[in] JIDS integer array of values in the identification section
58 C> (=-9999 for wildcard)
59 C> - JIDS(1) identification of originating centre
60 C> (see common code table c-1)
61 C> - JIDS(2) identification of originating sub-centre
62 C> - JIDS(3) grib master tables version number
63 C> (see code table 1.0)
64 C> - 0 experimental
65 C> - 1 initial operational version number.
66 C> - JIDS(4) grib local tables version number (see code table 1.1)
67 C> - 0 local tables not used
68 C> - 1-254 number of local tables version used.
69 C> - JIDS(5) significance of reference time (code table 1.2)
70 C> - 0 analysis
71 C> - 1 start of forecast
72 C> - 2 verifying time of forecast
73 C> - 3 observation time
74 C> - JIDS(6) year (4 digits)
75 C> - JIDS(7) month
76 C> - JIDS(8) day
77 C> - JIDS(9) hour
78 C> - JIDS(10) minute
79 C> - JIDS(11) second
80 C> - JIDS(12) production status of processed data (see code table 1.3)
81 C> - 0 operational products
82 C> - 1 operational test products;
83 C> - 2 research products
84 C> - 3 re-analysis products.
85 C> - JIDS(13) type of processed data (see code table 1.4)
86 C> - 0 analysis products
87 C> - 1 forecast products
88 C> - 2 analysis and forecast products
89 C> - 3 control forecast products
90 C> - 4 perturbed forecast products
91 C> - 5 control and perturbed forecast products
92 C> - 6 processed satellite observations
93 C> - 7 processed radar observations.
94 C> @param[in] JPDTN integer product definition template number (n)
95 C> (if = -1, don't bother matching pdt - accept any)
96 C> @param[in] JPDT integer array of values defining the product definition
97 C> template 4.n of the field for which to search (=-9999 for wildcard)
98 C> @param[in] JGDTN integer grid definition template number (m)
99 C> (if = -1, don't bother matching gdt - accept any )
100 C> @param[in] JGDT integer array of values defining the grid definition
101 C> template 3.m of the field for which to search (=-9999 for wildcard)
102 C> @param[out] K integer field number unpacked.
103 C> @param[out] GFLD derived type gribfield (defined in module grib_mod)
104 C> (NOTE: See Remarks Section)
105 C> - gfld\%version GRIB edition number (currently 2)
106 C> - gfld\%discipline Message Discipline (see Code Table 0.0)
107 C> - gfld\%idsect Contains the entries in the Identification Section
108 C> (Section 1) This element is actually a pointer to an array
109 C> that holds the data.
110 C> - gfld\%idsect(1) Identification of originating Centre
111 C> (see Common Code Table C-1) 7 US National Weather Service
112 C> - gfld\%idsect(2) Identification of originating Sub-centre
113 C> - gfld\%idsect(3) GRIB Master Tables Version Number
114 C> (see Code Table 1.0) 0 Experimental; 1 Initial operational version number
115 C> - gfld\%idsect(4) GRIB Local Tables Version Number (see Code Table 1.1)
116 C> - 0 Local tables not used
117 C> - 0 1-254 Number of local tables version used
118 C> - gfld\%idsect(5) Significance of Reference Time (Code Table 1.2)
119 C> - 0 Analysis
120 C> - 1 Start of forecast
121 C> - 2 Verifying time of forecast
122 C> - 3 Observation time.
123 C> - gfld\%idsect(6) Year (4 digits)
124 C> - gfld\%idsect(7) Month
125 C> - gfld\%idsect(8) Day
126 C> - gfld\%idsect(9) Hour
127 C> - gfld\%idsect(10) Minute
128 C> - gfld\%idsect(11) Second
129 C> - gfld\%idsect(12) Production status of processed data (see Code
130 C> Table 1.3)
131 C> - 0 Operational products
132 C> - 1 Operational test products
133 C> - 2 Research products
134 C> - 3 Re-analysis products
135 C> - gfld\%idsect(13) Type of processed data (see Code Table 1.4)
136 C> - 0 Analysis products
137 C> - 1 Forecast products
138 C> - 2 Analysis and forecast products
139 C> - 3 Control forecast products
140 C> - 4 Perturbed forecast products
141 C> - 5 Control and perturbed forecast products
142 C> - 6 Processed satellite observations
143 C> - 7 Processed radar observations
144 C> - gfld\%idsectlen Number of elements in gfld\%idsect
145 C> - gfld\%local Pointer to character array containing contents
146 C> of Local Section 2, if included
147 C> - gfld\%locallen length of array gfld\%local
148 C> - gfld\%ifldnum field number within GRIB message
149 C> - gfld\%griddef Source of grid definition (see Code Table 3.0)
150 C> - 0 Specified in Code table 3.1
151 C> - 1 Predetermined grid Defined by originating centre
152 C> - gfld\%ngrdpts Number of grid points in the defined grid.
153 C> Note that the number of actual data values returned from getgb2
154 C> (in gfld\%ndpts) may be less than this value if a logical bitmap
155 C> is in use with grid points that are being masked out.
156 C> - gfld\%numoct_opt Number of octets needed for each additional grid
157 C> points definition. Used to define number of points in each row (or
158 C> column) for non-regular grids. = 0, if using regular grid.
159 C> - gfld\%interp_opt Interpretation of list for optional points
160 C> definition.(Code Table 3.11)
161 C> - gfld\%igdtnum Grid Definition Template Number (Code Table 3.1)
162 C> - gfld\%igdtmpl Contains the data values for the specified Grid
163 C> Definition Template (NN=gfld\%igdtnum). Each element of this
164 C> integer array contains an entry (in the order specified) of Grid
165 C> Defintion Template 3.NN This element is actually a pointer to an
166 C> array that holds the data.
167 C> - gfld\%igdtlen Number of elements in gfld\%igdtmpl. i.e. number
168 C> of entries in Grid Defintion Template 3.NN (NN=gfld\%igdtnum).
169 C> - gfld\%list_opt (Used if gfld\%numoct_opt .ne. 0) This array
170 C> contains the number of grid points contained in each row (or
171 C> column). (part of Section 3) This element is actually a pointer
172 C> to an array that holds the data. This pointer is nullified
173 C> if gfld\%numoct_opt=0.
174 C> - gfld\%num_opt (Used if gfld\%numoct_opt .ne. 0) The number of
175 C> entries in array ideflist. i.e. number of rows (or columns) for which
176 C> optional grid points are defined. This value is set to zero,
177 C> if gfld\%numoct_opt=0.
178 C> - gfdl\%ipdtnum Product Definition Template Number (Code Table 4.0)
179 C> - gfld\%ipdtmpl Contains the data values for the specified Product
180 C> Definition Template (N=gfdl\%ipdtnum). Each element of this integer
181 C> array contains an entry (in the order specified) of Product Defintion
182 C> Template 4.N. This element is actually a pointer to an array
183 C> that holds the data.
184 C> - gfld\%ipdtlen Number of elements in gfld\%ipdtmpl. i.e. number of
185 C> entries in Product Defintion Template 4.N (N=gfdl\%ipdtnum).
186 C> - gfld\%coord_list Real array containing floating point values
187 C> intended to document the vertical discretisation associated to
188 C> model data on hybrid coordinate vertical levels.(part of Section 4)
189 C> This element is actually a pointer to an array
190 C> that holds the data.
191 C> - gfld\%num_coord number of values in array gfld\%coord_list.
192 C> - gfld\%ndpts Number of data points unpacked and returned.
193 C> Note that this number may be different from the value of
194 C> - gfld\%ngrdpts if a logical bitmap is in use with grid points
195 C> that are being masked out.
196 C> - gfld\%idrtnum Data Representation Template Number (Code Table 5.0)
197 C> - gfld\%idrtmpl Contains the data values for the specified Data
198 C> Representation Template (N=gfld\%idrtnum). Each element of this
199 C> integer array contains an entry (in the order specified) of
200 C> Product Defintion Template 5.N. This element is actually a
201 C> pointer to an array that holds the data.
202 C> - gfld\%idrtlen Number of elements in gfld\%idrtmpl. i.e. number
203 C> of entries in Data Representation Template 5.N (N=gfld\%idrtnum).
204 C> - gfld\%unpacked logical value indicating whether the bitmap and
205 C> data values were unpacked. If false, gfld\%bmap and gfld\%fld
206 C> pointers are nullified.
207 C> - gfld\%expanded Logical value indicating whether the data field
208 C> was expanded to the grid in the case where a bit-map is present.
209 C> If true, the data points in gfld\%fld match the grid points and
210 C> zeros were inserted at grid points where data was bit-mapped out.
211 C> If false, the data values in gfld\%fld were not expanded to the
212 C> grid and are just a consecutive array of data points corresponding
213 C> to each value of "1" in gfld\%bmap.
214 C> - gfld\%ibmap Bitmap indicator (see Code Table 6.0)
215 C> - 0 bitmap applies and is included in Section 6.
216 C> - 1-253 Predefined bitmap applies
217 C> - 254 Previously defined bitmap applies to this field
218 C> - 255 Bit map does not apply to this product.
219 C> - gfld\%bmap Logical*1 array containing decoded bitmap, if ibmap=0
220 C> or ibap=254. Otherwise nullified. This element is actually a
221 C> pointer to an array that holds the data.
222 C> - gfld\%fld Array of gfld\%ndpts unpacked data points. This element
223 C> is actually a pointer to an array that holds the data.
224 C> @param[out] LPOS starting position of the found index record
225 C> within the complete index buffer, CBUF. = 0, if request not found.
226 C> @param[out] IRET integer return code
227 C> - 0 all ok
228 C> - 97 error reading grib file
229 C> - other gf_getfld grib2 unpacker return code
230 C>
231 C> @note This subprogram is intended for private use by getgb2
232 C> routines only. Note that derived type gribfield contains pointers
233 C> to many arrays of data. The memory for these arrays is allocated
234 C> when the values in the arrays are set, to help minimize problems
235 C> with array overloading. Because of this users are encouraged to
236 C> free up this memory, when it is no longer needed, by an explicit
237 C> call to subroutine gf_free().
238 C>
239 C> @author Stephen Gilbert @date 2002-01-15
240 C>
241 
242 C-----------------------------------------------------------------------
243  SUBROUTINE getgb2s(CBUF,NLEN,NNUM,J,JDISC,JIDS,JPDTN,JPDT,JGDTN,
244  & JGDT,K,GFLD,LPOS,IRET)
245 
246  USE grib_mod
247 
248 ! CHARACTER(LEN=1),POINTER,DIMENSION(:) :: CBUF
249  CHARACTER(LEN=1),INTENT(IN) :: CBUF(NLEN)
250  INTEGER,INTENT(IN) :: NLEN,NNUM,J,JDISC,JPDTN,JGDTN
251  INTEGER,DIMENSION(:) :: JIDS(*),JPDT(*),JGDT(*)
252  INTEGER,INTENT(OUT) :: K,LPOS,IRET
253  TYPE(gribfield),INTENT(OUT) :: GFLD
254 
255  INTEGER :: KGDS(5)
256  LOGICAL :: MATCH1,MATCH3,MATCH4
257 ! INTEGER,POINTER,DIMENSION(:) :: KIDS,KPDT,KGDT
258 ! INTEGER,POINTER,DIMENSION(:) :: IDEF
259 ! REAL,POINTER,DIMENSION(:) :: COORD
260 
261  interface
262  subroutine gf_unpack1(cgrib,lcgrib,iofst,ids,idslen,ierr)
263  character(len=1),intent(in) :: cgrib(lcgrib)
264  integer,intent(in) :: lcgrib
265  integer,intent(inout) :: iofst
266  integer,pointer,dimension(:) :: ids
267  integer,intent(out) :: ierr,idslen
268  end subroutine gf_unpack1
269  subroutine gf_unpack3(cgrib,lcgrib,iofst,igds,igdstmpl,
270  & mapgridlen,ideflist,idefnum,ierr)
271  character(len=1),intent(in) :: cgrib(lcgrib)
272  integer,intent(in) :: lcgrib
273  integer,intent(inout) :: iofst
274  integer,pointer,dimension(:) :: igdstmpl,ideflist
275  integer,intent(out) :: igds(5)
276  integer,intent(out) :: ierr,idefnum
277  end subroutine gf_unpack3
278  subroutine gf_unpack4(cgrib,lcgrib,iofst,ipdsnum,ipdstmpl,
279  & mappdslen,coordlist,numcoord,ierr)
280  character(len=1),intent(in) :: cgrib(lcgrib)
281  integer,intent(in) :: lcgrib
282  integer,intent(inout) :: iofst
283  real,pointer,dimension(:) :: coordlist
284  integer,pointer,dimension(:) :: ipdstmpl
285  integer,intent(out) :: ipdsnum
286  integer,intent(out) :: ierr,numcoord
287  end subroutine gf_unpack4
288  subroutine gf_unpack5(cgrib,lcgrib,iofst,ndpts,idrsnum,
289  & idrstmpl,mapdrslen,ierr)
290  character(len=1),intent(in) :: cgrib(lcgrib)
291  integer,intent(in) :: lcgrib
292  integer,intent(inout) :: iofst
293  integer,intent(out) :: ndpts,idrsnum
294  integer,pointer,dimension(:) :: idrstmpl
295  integer,intent(out) :: ierr
296  end subroutine gf_unpack5
297  end interface
298 
299 C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
300 C INITIALIZE
301  k=0
302  lpos=0
303  iret=1
304  ipos=0
305  nullify(gfld%idsect,gfld%local)
306  nullify(gfld%list_opt,gfld%igdtmpl,gfld%ipdtmpl)
307  nullify(gfld%coord_list,gfld%idrtmpl,gfld%bmap,gfld%fld)
308 C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
309 C SEARCH FOR REQUEST
310  dowhile(iret.NE.0.AND.k.LT.nnum)
311  k=k+1
312  CALL g2_gbytec(cbuf,inlen,ipos*8,4*8) ! GET LENGTH OF CURRENT
313  ! INDEX RECORD
314  IF ( k.LE.j ) THEN ! SKIP THIS INDEX
315  ipos=ipos+inlen
316  cycle
317  ENDIF
318 C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
319 C CHECK IF GRIB2 DISCIPLINE IS A MATCH
320  CALL g2_gbytec(cbuf,gfld%DISCIPLINE,(ipos+41)*8,1*8)
321  IF ( (jdisc.NE.-1).AND.(jdisc.NE.gfld%DISCIPLINE) ) THEN
322  ipos=ipos+inlen
323  cycle
324  ENDIF
325 C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
326 C CHECK IF IDENTIFICATION SECTION IS A MATCH
327  match1=.false.
328  CALL g2_gbytec(cbuf,lsec1,(ipos+44)*8,4*8) ! GET LENGTH OF IDS
329  iof=0
330  CALL gf_unpack1(cbuf(ipos+45),lsec1,iof,gfld%IDSECT,
331  & gfld%IDSECTLEN,icnd)
332  IF ( icnd.EQ.0 ) THEN
333  match1=.true.
334  DO i=1,gfld%IDSECTLEN
335  IF ( (jids(i).NE.-9999).AND.
336  & (jids(i).NE.gfld%IDSECT(i)) ) THEN
337  match1=.false.
338  EXIT
339  ENDIF
340  ENDDO
341  ENDIF
342  IF ( .NOT. match1 ) THEN
343  DEALLOCATE(gfld%IDSECT)
344  ipos=ipos+inlen
345  cycle
346  ENDIF
347 C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
348 C CHECK IF GRID DEFINITION TEMPLATE IS A MATCH
349  jpos=ipos+44+lsec1
350  match3=.false.
351  CALL g2_gbytec(cbuf,lsec3,jpos*8,4*8) ! GET LENGTH OF GDS
352  IF ( jgdtn.EQ.-1 ) THEN
353  match3=.true.
354  ELSE
355  CALL g2_gbytec(cbuf,numgdt,(jpos+12)*8,2*8) ! GET GDT TEMPLATE NO.
356  IF ( jgdtn.EQ.numgdt ) THEN
357  iof=0
358  CALL gf_unpack3(cbuf(jpos+1),lsec3,iof,kgds,gfld%IGDTMPL,
359  & gfld%IGDTLEN,gfld%LIST_OPT,gfld%NUM_OPT,icnd)
360  IF ( icnd.EQ.0 ) THEN
361  match3=.true.
362  DO i=1,gfld%IGDTLEN
363  IF ( (jgdt(i).NE.-9999).AND.
364  & (jgdt(i).NE.gfld%IGDTMPL(i)) ) THEN
365  match3=.false.
366  EXIT
367  ENDIF
368  ENDDO
369 C WHERE ( JGDT(1:GFLD%IGDTLEN).NE.-9999 )
370 C & MATCH3=ALL(JGDT(1:GFLD%IGDTLEN).EQ.GFLD%IGDTMPL(1:GFLD%IGDTLEN))
371  ENDIF
372  ENDIF
373  ENDIF
374  IF ( .NOT. match3 ) THEN
375  IF (ASSOCIATED(gfld%IGDTMPL)) DEALLOCATE(gfld%IGDTMPL)
376  IF (ASSOCIATED(gfld%LIST_OPT)) DEALLOCATE(gfld%LIST_OPT)
377  ipos=ipos+inlen
378  cycle
379  ELSE
380  gfld%GRIDDEF=kgds(1)
381  gfld%NGRDPTS=kgds(2)
382  gfld%NUMOCT_OPT=kgds(3)
383  gfld%INTERP_OPT=kgds(4)
384  gfld%IGDTNUM=kgds(5)
385  ENDIF
386 C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
387 C CHECK IF PRODUCT DEFINITION TEMPLATE IS A MATCH
388  jpos=jpos+lsec3
389  match4=.false.
390  CALL g2_gbytec(cbuf,lsec4,jpos*8,4*8) ! GET LENGTH OF PDS
391  IF ( jpdtn.EQ.-1 ) THEN
392  match4=.true.
393  ELSE
394  CALL g2_gbytec(cbuf,numpdt,(jpos+7)*8,2*8) ! GET PDT TEMPLATE NO.
395  IF ( jpdtn.EQ.numpdt ) THEN
396  iof=0
397  CALL gf_unpack4(cbuf(jpos+1),lsec4,iof,gfld%IPDTNUM,
398  & gfld%IPDTMPL,gfld%IPDTLEN,
399  & gfld%COORD_LIST,gfld%NUM_COORD,icnd)
400  IF ( icnd.EQ.0 ) THEN
401  match4=.true.
402  DO i=1,gfld%IPDTLEN
403  IF ( (jpdt(i).NE.-9999).AND.
404  & (jpdt(i).NE.gfld%IPDTMPL(i)) ) THEN
405  match4=.false.
406  EXIT
407  ENDIF
408  ENDDO
409 c WHERE ( JPDT.NE.-9999)
410 c & MATCH4=ALL( JPDT(1:GFLD%IPDTLEN) .EQ. GFLD%IPDTMPL(1:GFLD%IPDTLEN) )
411  ENDIF
412  ENDIF
413  ENDIF
414  IF ( .NOT. match4 ) THEN
415  IF (ASSOCIATED(gfld%IPDTMPL)) DEALLOCATE(gfld%IPDTMPL)
416  IF (ASSOCIATED(gfld%COORD_LIST)) DEALLOCATE(gfld%COORD_LIST)
417  ENDIF
418 C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
419 C IF REQUEST IS FOUND
420 C SET VALUES FOR DERIVED TYPE GFLD AND RETURN
421  IF(match1.AND.match3.AND.match4) THEN
422  lpos=ipos+1
423  CALL g2_gbytec(cbuf,gfld%VERSION,(ipos+40)*8,1*8)
424  CALL g2_gbytec(cbuf,gfld%IFLDNUM,(ipos+42)*8,2*8)
425  gfld%UNPACKED=.false.
426  jpos=ipos+44+lsec1
427  IF ( jgdtn.EQ.-1 ) THEN ! UNPACK GDS, IF NOT DONE BEFORE
428  iof=0
429  CALL gf_unpack3(cbuf(jpos+1),lsec3,iof,kgds,gfld%IGDTMPL,
430  & gfld%IGDTLEN,gfld%LIST_OPT,gfld%NUM_OPT,icnd)
431  gfld%GRIDDEF=kgds(1)
432  gfld%NGRDPTS=kgds(2)
433  gfld%NUMOCT_OPT=kgds(3)
434  gfld%INTERP_OPT=kgds(4)
435  gfld%IGDTNUM=kgds(5)
436  ENDIF
437  jpos=jpos+lsec3
438  IF ( jpdtn.EQ.-1 ) THEN ! UNPACK PDS, IF NOT DONE BEFORE
439  iof=0
440  CALL gf_unpack4(cbuf(jpos+1),lsec4,iof,gfld%IPDTNUM,
441  & gfld%IPDTMPL,gfld%IPDTLEN,
442  & gfld%COORD_LIST,gfld%NUM_COORD,icnd)
443  ENDIF
444  jpos=jpos+lsec4
445  CALL g2_gbytec(cbuf,lsec5,jpos*8,4*8) ! GET LENGTH OF DRS
446  iof=0
447  CALL gf_unpack5(cbuf(jpos+1),lsec5,iof,gfld%NDPTS,
448  & gfld%IDRTNUM,gfld%IDRTMPL,
449  & gfld%IDRTLEN,icnd)
450  jpos=jpos+lsec5
451  CALL g2_gbytec(cbuf,gfld%IBMAP,(jpos+5)*8,1*8) ! GET IBMAP
452  iret=0
453  ELSE ! PDT DID NOT MATCH
454  ipos=ipos+inlen
455  ENDIF
456  ENDDO
457 C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
458  RETURN
459  END
gf_unpack4
subroutine gf_unpack4(cgrib, lcgrib, iofst, ipdsnum, ipdstmpl, mappdslen, coordlist, numcoord, ierr)
This subroutine unpacks Section 4 (Product Definition Section) starting at octet 6 of that Section.
Definition: gf_unpack4.f:43
getgb2s
subroutine getgb2s(CBUF, NLEN, NNUM, J, JDISC, JIDS, JPDTN, JPDT, JGDTN, JGDT, K, GFLD, LPOS, IRET)
This subroutine find in the index file for a reference to the grib field requested.
Definition: getgb2s.f:245
grib_mod::gribfield
Definition: gribmod.f:155
grib_mod
PROGRAM HISTORY LOG:
Definition: gribmod.f:151
gf_unpack3
subroutine gf_unpack3(cgrib, lcgrib, iofst, igds, igdstmpl, mapgridlen, ideflist, idefnum, ierr)
This subroutine unpacks Section 3 (Grid Definition Section) starting at octet 6 of that Section.
Definition: gf_unpack3.f:54
gf_unpack5
subroutine gf_unpack5(cgrib, lcgrib, iofst, ndpts, idrsnum, idrstmpl, mapdrslen, ierr)
This subroutine unpacks Section 5 (Data Representation Section) starting at octet 6 of that Section.
Definition: gf_unpack5.f:38
g2_gbytec
subroutine g2_gbytec(IN, IOUT, ISKIP, NBYTE)
This subrountine is to extract arbitrary size values from a packed bit string, right justifying each ...
Definition: g2_gbytesc.f:20
gf_unpack1
subroutine gf_unpack1(cgrib, lcgrib, iofst, ids, idslen, ierr)
This subroutine unpacks Section 1 (Identification Section) starting at octet 6 of that Section.
Definition: gf_unpack1.f:43