NCEPLIBS-g2  3.4.5
comunpack.f File Reference

This subroutine unpacks a data field that was packed using a complex packing algorithm as defined in the GRIB2 documention. More...

Go to the source code of this file.

Functions/Subroutines

subroutine comunpack (cpack, len, lensec, idrsnum, idrstmpl, ndpts, fld, ier)
 This subroutine unpacks a data field that was packed using a complex packing algorithm as defined in the GRIB2 documention. More...
 

Detailed Description

This subroutine unpacks a data field that was packed using a complex packing algorithm as defined in the GRIB2 documention.

Author
Stephen Gilbert
Date
2000-06-21

Definition in file comunpack.f.

Function/Subroutine Documentation

◆ comunpack()

subroutine comunpack ( character(len=1), dimension(len), intent(in)  cpack,
integer, intent(in)  len,
  lensec,
  idrsnum,
integer, dimension(*), intent(in)  idrstmpl,
integer, intent(in)  ndpts,
real, dimension(ndpts), intent(out)  fld,
  ier 
)

This subroutine unpacks a data field that was packed using a complex packing algorithm as defined in the GRIB2 documention.

Using info from the GRIB2 Data Representation Template 5.2 or 5.3. Supports GRIB2 complex packing templates with or without spatial differences (i.e. DRTs 5.2 and 5.3).

PROGRAM HISTORY LOG:

  • 2000-06-21 Stephen Gilbert
  • 2004-12-29 Stephen Gilbert - Added test ( provided by Arthur Taylor/MDL ) to verify that group widths and lengths are consistent with section length.
  • 2016-02-26 update unpacking for template 5.3
Parameters
[in]cpackThe packed data field (character*1 array)
[in]lenlength of packed field cpack.
[in]lenseclength of section 7 (used for error checking).
[in]idrsnumData Representation Template number 5.N Must equal 2 or 3.
[in]idrstmplContains the array of values for Data Representation Template 5.2 or 5.3
[in]ndptsThe number of data values to unpack
[out]fldContains the unpacked data values
[out]ierError return:
  • 0 = OK
  • 1 = Problem - inconsistent group lengths of widths.
Author
Stephen Gilbert
Date
2000-06-21

Definition at line 37 of file comunpack.f.