40 subroutine gf_unpack7(cgrib, lcgrib, iofst, igdsnum, igdstmpl, &
41 idrsnum, idrstmpl, ndpts, fld, ierr)
44 character(len = 1),
intent(in) :: cgrib(lcgrib)
45 integer,
intent(in) :: lcgrib, ndpts, igdsnum, idrsnum
46 integer,
intent(inout) :: iofst
47 integer,
pointer,
dimension(:) :: igdstmpl, idrstmpl
48 integer,
intent(out) :: ierr
49 real,
pointer,
dimension(:) :: fld
50 integer :: ier, ipos, istat, lensec, ieee
61 allocate(fld(ndpts), stat = istat)
67 if (idrsnum .eq. 0)
then
68 call simunpack(cgrib(ipos), lensec-5, idrstmpl, ndpts, fld)
69 elseif (idrsnum.eq.2.or.idrsnum.eq.3)
then
70 call comunpack(cgrib(ipos), lensec-5, lensec, idrsnum, idrstmpl, ndpts, fld, ier)
75 elseif (idrsnum .eq. 50)
then
76 call simunpack(cgrib(ipos), lensec-5, idrstmpl, ndpts-1, fld(2))
78 call rdieee(ieee, fld(1), 1)
79 elseif (idrsnum .eq. 51)
then
80 if (igdsnum.ge.50.AND.igdsnum.le.53)
then
81 call specunpack(cgrib(ipos), lensec-5, idrstmpl, ndpts, &
82 igdstmpl(1), igdstmpl(2), igdstmpl(3), fld)
84 print *,
'gf_unpack7: Cannot use GDT 3.', igdsnum,
' to unpack Data Section 5.51.'
89 elseif (idrsnum .eq. 40 .OR. idrsnum .eq. 40000)
then
90 call jpcunpack(cgrib(ipos), lensec-5, idrstmpl, ndpts, fld)
91 elseif (idrsnum .eq. 41 .OR. idrsnum .eq. 40010)
then
92 call pngunpack(cgrib(ipos), lensec-5, idrstmpl, ndpts, fld)
94 print *,
'gf_unpack7: Data Representation Template ', idrsnum,
' not yet implemented.'
100 iofst = iofst + (8 * lensec)
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...
subroutine g2_gbytec(in, iout, iskip, nbits)
Extract arbitrary size values from a packed bit string, right justifying each value in the unpacked a...
subroutine gf_unpack7(cgrib, lcgrib, iofst, igdsnum, igdstmpl, idrsnum, idrstmpl, ndpts, fld, ierr)
Unpack Section 7 (Data Section) of a GRIB2 message.
subroutine jpcunpack(cpack, len, idrstmpl, ndpts, fld)
Unpack a data field from a JPEG2000 code stream.
subroutine pngunpack(cpack, len, idrstmpl, ndpts, fld)
Unpack a data field packed into a PNG image format.
subroutine rdieee(rieee, a, num)
Copy array of 32-bit IEEE floating point values to local floating point representation.
subroutine simunpack(cpack, len, idrstmpl, ndpts, fld)
This subroutine unpacks a data field that was packed using a simple packing algorithm as defined in t...
subroutine specunpack(cpack, len, idrstmpl, ndpts, JJ, KK, MM, fld)
This subroutine unpacks a spectral data field that was packed using the complex packing algorithm for...