NCEPLIBS-g2  3.5.0
g2unpack.F90
Go to the documentation of this file.
1 
4 
41 subroutine gf_unpack1(cgrib, lcgrib, iofst, ids, idslen, ierr)
42  implicit none
43 
44  character(len=1), intent(in) :: cgrib(lcgrib)
45  integer, intent(in) :: lcgrib
46  integer, intent(inout) :: iofst
47  integer, pointer, dimension(:) :: ids
48  integer, intent(out) :: ierr, idslen
49  integer, dimension(:) :: mapid(13)
50  integer :: i, istat, lensec, nbits
51 
52  data mapid /2, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1/
53 
54  ierr = 0
55  idslen = 13
56  nullify(ids)
57 
58  call g2_gbytec(cgrib, lensec, iofst, 32) ! Get Length of Section
59  iofst = iofst + 32
60  iofst = iofst + 8 ! skip section number
61 
62  ! Unpack each value into array ids from the the appropriate number
63  ! of octets, which are specified in corresponding entries in array
64  ! mapid.
65  istat = 0
66  allocate(ids(idslen), stat = istat)
67  if (istat .ne. 0) then
68  ierr = 6
69  nullify(ids)
70  return
71  endif
72 
73  do i = 1, idslen
74  nbits = mapid(i) * 8
75  call g2_gbytec(cgrib, ids(i), iofst, nbits)
76  iofst = iofst + nbits
77  enddo
78 end subroutine gf_unpack1
79 
99 subroutine gf_unpack2(cgrib, lcgrib, iofst, lencsec2, csec2, ierr)
100  implicit none
101 
102  character(len = 1), intent(in) :: cgrib(lcgrib)
103  integer, intent(in) :: lcgrib
104  integer, intent(inout) :: iofst
105  integer, intent(out) :: lencsec2
106  integer, intent(out) :: ierr
107  character(len = 1), pointer, dimension(:) :: csec2
108  integer :: lensec, istat, isecnum, ipos
109 
110  ierr = 0
111  lencsec2 = 0
112  nullify(csec2)
113 
114  call g2_gbytec(cgrib, lensec, iofst, 32) ! Get Length of Section
115  iofst = iofst + 32
116  lencsec2 = lensec-5
117  call g2_gbytec(cgrib, isecnum, iofst, 8) ! Get Section Number
118  iofst = iofst + 8
119  ipos = (iofst / 8) + 1
120 
121  if (isecnum .ne. 2) then
122  ierr = 6
123  print *, 'gf_unpack2: Not Section 2 data. '
124  return
125  endif
126 
127  allocate(csec2(lencsec2), stat = istat)
128  if (istat .ne. 0) then
129  ierr = 6
130  nullify(csec2)
131  return
132  endif
133 
134  csec2(1:lencsec2) = cgrib(ipos:ipos + lencsec2 - 1)
135  iofst = iofst + (lencsec2 * 8)
136 
137 end subroutine gf_unpack2
138 
182 subroutine gf_unpack3(cgrib, lcgrib, iofst, igds, igdstmpl, &
183  mapgridlen, ideflist, idefnum, ierr)
184 
185  use gridtemplates
186  use re_alloc ! needed for subroutine realloc
187  implicit none
188 
189  character(len = 1), intent(in) :: cgrib(lcgrib)
190  integer, intent(in) :: lcgrib
191  integer, intent(inout) :: iofst
192  integer, pointer, dimension(:) :: igdstmpl, ideflist
193  integer, intent(out) :: igds(5)
194  integer, intent(out) :: ierr, idefnum
195 
196  integer, allocatable :: mapgrid(:)
197  integer, intent(out) :: mapgridlen
198  integer :: ibyttem
199  logical needext
200  integer :: lensec, istat, i, nbits, isign, newmapgridlen, iret
201 
202  ierr = 0
203  nullify(igdstmpl, ideflist)
204 
205  call g2_gbytec(cgrib, lensec, iofst, 32) ! Get Length of Section
206  iofst = iofst + 32
207  iofst = iofst + 8 ! skip section number
208 
209  call g2_gbytec(cgrib, igds(1), iofst, 8) ! Get source of Grid def.
210  iofst = iofst + 8
211  call g2_gbytec(cgrib, igds(2), iofst, 32) ! Get number of grid pts.
212  iofst = iofst + 32
213  call g2_gbytec(cgrib, igds(3), iofst, 8) ! Get num octets for opt. list
214  iofst = iofst + 8
215  call g2_gbytec(cgrib, igds(4), iofst, 8) ! Get interpret. for opt. list
216  iofst = iofst + 8
217  call g2_gbytec(cgrib, igds(5), iofst, 16) ! Get Grid Def Template num.
218  iofst = iofst + 16
219 
220  if (igds(1) .eq. 0 .OR. igds(1) .eq. 255) then ! FOR ECMWF TEST ONLY
221  allocate(mapgrid(lensec))
222 
223  ! Get Grid Definition Template
224  call getgridtemplate(igds(5), mapgridlen, mapgrid, needext, iret)
225  if (iret .ne. 0) then
226  ierr = 5
227  if (allocated(mapgrid)) deallocate(mapgrid)
228  return
229  endif
230  else
231  mapgridlen = 0
232  needext = .false.
233  endif
234 
235  ! Unpack each value into array igdstmpl from the the appropriate
236  ! number of octets, which are specified in corresponding entries in
237  ! array mapgrid.
238  istat = 0
239  if (mapgridlen .gt. 0) allocate(igdstmpl(mapgridlen), stat = istat)
240  if (istat .ne. 0) then
241  ierr = 6
242  nullify(igdstmpl)
243  if (allocated(mapgrid)) deallocate(mapgrid)
244  return
245  endif
246  ibyttem = 0
247  do i = 1, mapgridlen
248  nbits = iabs(mapgrid(i)) * 8
249  if (mapgrid(i) .ge. 0) then
250  call g2_gbytec(cgrib, igdstmpl(i), iofst, nbits)
251  else
252  call g2_gbytec(cgrib, isign, iofst, 1)
253  call g2_gbytec(cgrib, igdstmpl(i), iofst + 1, nbits - 1)
254  if (isign .eq. 1) igdstmpl(i) = -igdstmpl(i)
255  endif
256  iofst = iofst + nbits
257  ibyttem = ibyttem + iabs(mapgrid(i))
258  enddo
259 
260  ! Check to see if the Grid Definition Template needs to be extended.
261  ! The number of values in a specific template may vary depending on
262  ! data specified in the "static" part of the template.
263  if (needext) then
264  call extgridtemplate(igds(5), igdstmpl, newmapgridlen, &
265  mapgrid)
266 
267  ! Unpack the rest of the Grid Definition Template.
268  call realloc(igdstmpl, mapgridlen, newmapgridlen, istat)
269  do i = mapgridlen + 1, newmapgridlen
270  nbits = iabs(mapgrid(i)) * 8
271  if (mapgrid(i) .ge. 0) then
272  call g2_gbytec(cgrib, igdstmpl(i), iofst, nbits)
273  else
274  call g2_gbytec(cgrib, isign, iofst, 1)
275  call g2_gbytec(cgrib, igdstmpl(i), iofst + 1, nbits - 1)
276  if (isign.eq.1) igdstmpl(i) = -igdstmpl(i)
277  endif
278  iofst = iofst + nbits
279  ibyttem = ibyttem + iabs(mapgrid(i))
280  enddo
281  mapgridlen = newmapgridlen
282  endif
283  if (allocated(mapgrid)) deallocate(mapgrid)
284 
285  ! Unpack optional list of numbers defining number of points in each
286  ! row or column, if included. This is used for non regular grids.
287  if (igds(3) .ne. 0) then
288  nbits = igds(3) * 8
289  idefnum = (lensec - 14 - ibyttem) / igds(3)
290  istat = 0
291  if (idefnum .gt. 0) allocate(ideflist(idefnum), stat = istat)
292  if (istat .ne. 0) then
293  ierr = 6
294  nullify(ideflist)
295  return
296  endif
297  call g2_gbytesc(cgrib, ideflist, iofst, nbits, 0, idefnum)
298  iofst = iofst + (nbits * idefnum)
299  else
300  idefnum = 0
301  nullify(ideflist)
302  endif
303 end subroutine gf_unpack3
304 
332 subroutine gf_unpack4(cgrib, lcgrib, iofst, ipdsnum, ipdstmpl, &
333  mappdslen, coordlist, numcoord, ierr)
334  use pdstemplates
335  use re_alloc ! needed for subroutine realloc
336  implicit none
337 
338  character(len = 1), intent(in) :: cgrib(lcgrib)
339  integer, intent(in) :: lcgrib
340  integer, intent(inout) :: iofst
341  real, pointer, dimension(:) :: coordlist
342  integer, pointer, dimension(:) :: ipdstmpl
343  integer, intent(out) :: ipdsnum
344  integer, intent(out) :: ierr, numcoord
345 
346  real(4), allocatable :: coordieee(:)
347  integer, allocatable :: mappds(:)
348  integer :: mappdslen
349  logical needext
350  integer :: lensec, nbits, newmappdslen
351  integer :: istat1, istat, isign, iret, i
352 
353  ierr = 0
354  nullify(ipdstmpl, coordlist)
355 
356  ! Get Length of Section.
357  call g2_gbytec(cgrib, lensec, iofst, 32)
358  iofst = iofst + 32
359  iofst = iofst + 8 ! skip section number
360  allocate(mappds(lensec))
361 
362  ! Get num of coordinate values.
363  call g2_gbytec(cgrib, numcoord, iofst, 16)
364  iofst = iofst + 16
365  ! Get Prod. Def Template num.
366  call g2_gbytec(cgrib, ipdsnum, iofst, 16)
367  iofst = iofst + 16
368  ! Get Product Definition Template.
369  call getpdstemplate(ipdsnum, mappdslen, mappds, needext, iret)
370  if (iret.ne.0) then
371  ierr = 5
372  if (allocated(mappds)) deallocate(mappds)
373  return
374  endif
375 
376  ! Unpack each value into array ipdstmpl from the the appropriate
377  ! number of octets, which are specified in corresponding entries in
378  ! array mappds.
379  istat = 0
380  if (mappdslen.gt.0) allocate(ipdstmpl(mappdslen), stat = istat)
381  if (istat.ne.0) then
382  ierr = 6
383  nullify(ipdstmpl)
384  if (allocated(mappds)) deallocate(mappds)
385  return
386  endif
387  do i = 1, mappdslen
388  nbits = iabs(mappds(i))*8
389  if (mappds(i).ge.0) then
390  call g2_gbytec(cgrib, ipdstmpl(i), iofst, nbits)
391  else
392  call g2_gbytec(cgrib, isign, iofst, 1)
393  call g2_gbytec(cgrib, ipdstmpl(i), iofst + 1, nbits-1)
394  if (isign.eq.1) ipdstmpl(i) = -ipdstmpl(i)
395  endif
396  iofst = iofst + nbits
397  enddo
398 
399  ! Check to see if the Product Definition Template needs to be
400  ! extended. The number of values in a specific template may vary
401  ! depending on data specified in the "static" part of the template.
402  if (needext) then
403  call extpdstemplate(ipdsnum, ipdstmpl, newmappdslen, mappds)
404  call realloc(ipdstmpl, mappdslen, newmappdslen, istat)
405  ! Unpack the rest of the Product Definition Template.
406  do i = mappdslen + 1, newmappdslen
407  nbits = iabs(mappds(i))*8
408  if (mappds(i).ge.0) then
409  call g2_gbytec(cgrib, ipdstmpl(i), iofst, nbits)
410  else
411  call g2_gbytec(cgrib, isign, iofst, 1)
412  call g2_gbytec(cgrib, ipdstmpl(i), iofst + 1, nbits-1)
413  if (isign.eq.1) ipdstmpl(i) = -ipdstmpl(i)
414  endif
415  iofst = iofst + nbits
416  enddo
417  mappdslen = newmappdslen
418  endif
419  if (allocated(mappds)) deallocate(mappds)
420 
421  ! Get Optional list of vertical coordinate values
422  ! after the Product Definition Template, if necessary.
423  nullify(coordlist)
424  if (numcoord .ne. 0) then
425  allocate (coordieee(numcoord), stat = istat1)
426  allocate(coordlist(numcoord), stat = istat)
427  if ((istat1 + istat).ne.0) then
428  ierr = 6
429  nullify(coordlist)
430  if (allocated(coordieee)) deallocate(coordieee)
431  return
432  endif
433  call g2_gbytescr(cgrib, coordieee, iofst, 32, 0, numcoord)
434  call rdieee(coordieee, coordlist, numcoord)
435  deallocate (coordieee)
436  iofst = iofst + (32 * numcoord)
437  endif
438 end subroutine gf_unpack4
439 
465 subroutine gf_unpack5(cgrib, lcgrib, iofst, ndpts, idrsnum, idrstmpl, &
466  mapdrslen, ierr)
467  use drstemplates
468  use re_alloc ! needed for subroutine realloc
469  implicit none
470 
471  character(len = 1), intent(in) :: cgrib(lcgrib)
472  integer, intent(in) :: lcgrib
473  integer, intent(inout) :: iofst
474  integer, intent(out) :: ndpts, idrsnum
475  integer, pointer, dimension(:) :: idrstmpl
476  integer, intent(out) :: ierr
477 
478  integer, allocatable :: mapdrs(:)
479  integer :: mapdrslen
480  logical needext
481  integer :: newmapdrslen, nbits, istat, isign, lensec, iret, i
482 
483  ierr = 0
484  nullify(idrstmpl)
485 
486  call g2_gbytec(cgrib, lensec, iofst, 32) ! Get Length of Section
487  iofst = iofst + 32
488  iofst = iofst + 8 ! skip section number
489  allocate(mapdrs(lensec))
490 
491  ! Get num of data points.
492  call g2_gbytec(cgrib, ndpts, iofst, 32)
493  iofst = iofst + 32
494  ! Get Data Rep Template Num.
495  call g2_gbytec(cgrib, idrsnum, iofst, 16)
496  iofst = iofst + 16
497  ! Gen Data Representation Template.
498  call getdrstemplate(idrsnum, mapdrslen, mapdrs, needext, iret)
499  if (iret .ne. 0) then
500  ierr = 7
501  if (allocated(mapdrs)) deallocate(mapdrs)
502  return
503  endif
504 
505  ! Unpack each value into array ipdstmpl from the the appropriate
506  ! number of octets, which are specified in corresponding entries in
507  ! array mappds.
508  istat = 0
509  if (mapdrslen .gt. 0) allocate(idrstmpl(mapdrslen), stat = istat)
510  if (istat .ne. 0) then
511  ierr = 6
512  nullify(idrstmpl)
513  if (allocated(mapdrs)) deallocate(mapdrs)
514  return
515  endif
516  do i = 1, mapdrslen
517  nbits = iabs(mapdrs(i)) * 8
518  if (mapdrs(i) .ge. 0) then
519  call g2_gbytec(cgrib, idrstmpl(i), iofst, nbits)
520  else
521  call g2_gbytec(cgrib, isign, iofst, 1)
522  call g2_gbytec(cgrib, idrstmpl(i), iofst + 1, nbits-1)
523  if (isign .eq. 1) idrstmpl(i) = -idrstmpl(i)
524  endif
525  iofst = iofst + nbits
526  enddo
527 
528  ! Check to see if the Data Representation Template needs to be
529  ! extended. The number of values in a specific template may vary
530  ! depending on data specified in the "static" part of the template.
531  if (needext) then
532  call extdrstemplate(idrsnum, idrstmpl, newmapdrslen, mapdrs)
533  call realloc(idrstmpl, mapdrslen, newmapdrslen, istat)
534 
535  ! Unpack the rest of the Data Representation Template.
536  do i = mapdrslen + 1, newmapdrslen
537  nbits = iabs(mapdrs(i)) * 8
538  if (mapdrs(i) .ge. 0) then
539  call g2_gbytec(cgrib, idrstmpl(i), iofst, nbits)
540  else
541  call g2_gbytec(cgrib, isign, iofst, 1)
542  call g2_gbytec(cgrib, idrstmpl(i), iofst + 1, nbits - 1)
543  if (isign.eq.1) idrstmpl(i) = -idrstmpl(i)
544  endif
545  iofst = iofst + nbits
546  enddo
547  mapdrslen = newmapdrslen
548  endif
549  if (allocated(mapdrs)) deallocate(mapdrs)
550 
551 end subroutine gf_unpack5
552 
575 subroutine gf_unpack6(cgrib, lcgrib, iofst, ngpts, ibmap, bmap, ierr)
576  implicit none
577 
578  character(len = 1), intent(in) :: cgrib(lcgrib)
579  integer, intent(in) :: lcgrib, ngpts
580  integer, intent(inout) :: iofst
581  integer, intent(out) :: ibmap
582  integer, intent(out) :: ierr
583 
584  logical*1, pointer, dimension(:) :: bmap
585  integer :: intbmap(ngpts)
586  integer :: istat, j
587 
588  ierr = 0
589  nullify(bmap)
590 
591  iofst = iofst + 32 ! Skip Length of Section.
592  iofst = iofst + 8 ! Skip section number.
593 
594  call g2_gbytec(cgrib, ibmap, iofst, 8) ! Get bit-map indicator.
595  iofst = iofst + 8
596 
597  if (ibmap .eq. 0) then ! Unpack bitmap
598  istat = 0
599  if (ngpts .gt. 0) allocate(bmap(ngpts), stat = istat)
600  if (istat .ne. 0) then
601  ierr = 6
602  nullify(bmap)
603  return
604  endif
605  call g2_gbytesc(cgrib, intbmap, iofst, 1, 0, ngpts)
606  iofst = iofst + ngpts
607  do j = 1, ngpts
608  bmap(j) = .true.
609  if (intbmap(j) .eq. 0) bmap(j) = .false.
610  enddo
611  endif
612 
613 end subroutine gf_unpack6
614 
648 subroutine gf_unpack7(cgrib, lcgrib, iofst, igdsnum, igdstmpl, &
649  idrsnum, idrstmpl, ndpts, fld, ierr)
650  implicit none
651 
652  character(len = 1), intent(in) :: cgrib(lcgrib)
653  integer, intent(in) :: lcgrib, ndpts, igdsnum, idrsnum
654  integer, intent(inout) :: iofst
655  integer, pointer, dimension(:) :: igdstmpl, idrstmpl
656  integer, intent(out) :: ierr
657  real, pointer, dimension(:) :: fld
658  integer :: ier, ipos, istat, lensec
659  real (kind = 4) :: ieee(1)
660  real :: tmpfld(1)
661 
662  ierr = 0
663  nullify(fld)
664 
665  call g2_gbytec(cgrib, lensec, iofst, 32) ! Get Length of Section
666  iofst = iofst + 32
667  iofst = iofst + 8 ! skip section number
668 
669  ipos = (iofst/8) + 1
670  istat = 0
671  allocate(fld(ndpts), stat = istat)
672  if (istat.ne.0) then
673  ierr = 6
674  return
675  endif
676 
677  if (idrsnum .eq. 0) then
678  call simunpack(cgrib(ipos), lensec-5, idrstmpl, ndpts, fld)
679  elseif (idrsnum.eq.2.or.idrsnum.eq.3) then
680  call comunpack(cgrib(ipos), lensec-5, lensec, idrsnum, idrstmpl, ndpts, fld, ier)
681  if (ier .ne. 0) then
682  ierr = 7
683  return
684  endif
685  elseif (idrsnum .eq. 50) then ! Spectral simple
686  call simunpack(cgrib(ipos), lensec-5, idrstmpl, ndpts-1, fld(2))
687  ieee = transfer(idrstmpl(5), ieee, 1)
688  call rdieee(ieee, tmpfld, 1)
689  fld(1) = tmpfld(1)
690  elseif (idrsnum .eq. 51) then ! Spectral complex
691  if (igdsnum.ge.50.AND.igdsnum.le.53) then
692  call specunpack(cgrib(ipos), lensec-5, idrstmpl, ndpts, &
693  igdstmpl(1), igdstmpl(2), igdstmpl(3), fld)
694  else
695  print *, 'gf_unpack7: Cannot use GDT 3.', igdsnum, ' to unpack Data Section 5.51.'
696  ierr = 5
697  nullify(fld)
698  return
699  endif
700  elseif (idrsnum .eq. 40 .OR. idrsnum .eq. 40000) then
701  call jpcunpack(cgrib(ipos), lensec-5, idrstmpl, ndpts, fld)
702  elseif (idrsnum .eq. 41 .OR. idrsnum .eq. 40010) then
703  call pngunpack(cgrib(ipos), lensec-5, idrstmpl, ndpts, fld)
704  else
705  print *, 'gf_unpack7: Data Representation Template ', idrsnum, ' not yet implemented.'
706  ierr = 4
707  nullify(fld)
708  return
709  endif
710 
711  iofst = iofst + (8 * lensec)
712 
713 end subroutine gf_unpack7
subroutine comunpack(cpack, len, lensec, idrsnum, idrstmpl, ndpts, fld, ier)
Unpack a data field that was packed using a complex packing algorithm as defined in the GRIB2 documen...
Definition: compack.F90:528
subroutine g2_gbytesc(in, iout, iskip, nbits, nskip, n)
Extract arbitrary size big-endian integer values (up to 32 bits each) from a packed bit string.
Definition: g2bytes.F90:120
subroutine rdieee(rieee, a, num)
Copy array of 32-bit IEEE floating point values to local floating point representation.
Definition: g2bytes.F90:637
subroutine g2_gbytec(in, iout, iskip, nbits)
Extract one arbitrary size big-endian value (up to 32 bits) from a packed bit string into one element...
Definition: g2bytes.F90:21
subroutine g2_gbytescr(in, rout, iskip, nbits, nskip, n)
Extract big-endian floating-point values (32 bits each) from a packed bit string.
Definition: g2bytes.F90:86
subroutine jpcunpack(cpack, len, idrstmpl, ndpts, fld)
Unpack a data field from a JPEG2000 code stream as defined in Data Representation Template 5....
Definition: g2jpc.F90:177
subroutine pngunpack(cpack, len, idrstmpl, ndpts, fld)
Unpack a data field with PNG, defined in [Data Representation Template 5.40](https://www....
Definition: g2png.F90:168
subroutine simunpack(cpack, len, idrstmpl, ndpts, fld)
Unpack a data field that was packed using a simple packing, [Data Representation Template 5....
Definition: g2sim.F90:169
subroutine specunpack(cpack, len, idrstmpl, ndpts, JJ, KK, MM, fld)
Unpack a spectral data field using the complex packing algorithm for spherical harmonic data,...
Definition: g2spec.F90:124
subroutine gf_unpack1(cgrib, lcgrib, iofst, ids, idslen, ierr)
Unpack Section 1 (Identification Section) of a GRIB2 message, starting at octet 6 of that Section.
Definition: g2unpack.F90:42
subroutine gf_unpack2(cgrib, lcgrib, iofst, lencsec2, csec2, ierr)
Unpack Section 2 (Local Use Section) of a GRIB2 message.
Definition: g2unpack.F90:100
subroutine gf_unpack7(cgrib, lcgrib, iofst, igdsnum, igdstmpl, idrsnum, idrstmpl, ndpts, fld, ierr)
Unpack Section 7 (Data Section) of a GRIB2 message.
Definition: g2unpack.F90:650
subroutine gf_unpack5(cgrib, lcgrib, iofst, ndpts, idrsnum, idrstmpl, mapdrslen, ierr)
Unpack Section 5 (Data Representation Section) of a GRIB2 message, starting at octet 6 of that Sectio...
Definition: g2unpack.F90:467
subroutine gf_unpack4(cgrib, lcgrib, iofst, ipdsnum, ipdstmpl, mappdslen, coordlist, numcoord, ierr)
Unpack Section 4 (Product Definition Section) of a GRIB2 message, starting at octet 6 of that Section...
Definition: g2unpack.F90:334
subroutine gf_unpack3(cgrib, lcgrib, iofst, igds, igdstmpl, mapgridlen, ideflist, idefnum, ierr)
Unpack Section 3 (Grid Definition Section) of a GRIB2 message, starting at octet 6 of that Section.
Definition: g2unpack.F90:184
subroutine gf_unpack6(cgrib, lcgrib, iofst, ngpts, ibmap, bmap, ierr)
Unpack Section 6 (Bit-Map Section) of a GRIB2 message, starting at octet 6 of that Section.
Definition: g2unpack.F90:576
Handles Data Representation Templates used in Section 5.
subroutine getdrstemplate(number, nummap, map, needext, iret)
Return DRS template information for a specified Data Representation Template.
subroutine extdrstemplate(number, list, nummap, map)
Generate the remaining octet map for a given Data Representation Template, if required.
This Fortran module contains info on all the available GRIB2 Grid Definition Templates used in [Secti...
subroutine getgridtemplate(number, nummap, map, needext, iret)
Get the grid template information for a specified Grid Definition Template.
subroutine extgridtemplate(number, list, nummap, map)
Generate the remaining octet map for a given Grid Definition Template, if required.
Information on all GRIB2 Product Definition Templates used in Section 4 - the Product Definition Sect...
subroutine extpdstemplate(number, list, nummap, map)
This subroutine generates the remaining octet map for a given Product Definition Template,...
subroutine getpdstemplate(number, nummap, map, needext, iret)
This subroutine returns PDS template information for a specified Product Definition Template.
Reallocate memory, preserving contents.
Definition: realloc.F90:12