NCEPLIBS-g2  3.4.7
cmplxpack.f File Reference

Pack up a data field using a complex packing algorithm. More...

Go to the source code of this file.

Functions/Subroutines

subroutine cmplxpack (fld, ndpts, idrsnum, idrstmpl, cpack, lcpack)
 Pack up a data field using a complex packing algorithm. More...
 

Detailed Description

Pack up a data field using a complex packing algorithm.

Author
Stephen Gilbert
Date
2004-08-27

Definition in file cmplxpack.f.

Function/Subroutine Documentation

◆ cmplxpack()

subroutine cmplxpack ( real, dimension(ndpts), intent(in)  fld,
integer, intent(in)  ndpts,
integer, intent(in)  idrsnum,
integer, dimension(*), intent(inout)  idrstmpl,
character(len=1), dimension(*), intent(out)  cpack,
integer, intent(out)  lcpack 
)

Pack up a data field using a complex packing algorithm.

This subroutine supports GRIB2 complex packing templates with or without spatial differences, Data Representation Templates (DRT) [GRIB2 - DATA REPRESENTATION TEMPLATE 5.2 - Grid point data - complex packing](https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_temp5-2.shtml) and [GRIB2 - DATA REPRESENTATION TEMPLATE 5.3 - Grid point data - complex packing and spatial differencing](https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_temp5-3.shtml).

It also fills in GRIB2 Data Representation Template 5.2 or 5.3 with the appropriate values.

Parameters
[in]fldThe data values to pack.
[in]ndptsThe number of data values in array fld.
[in]idrsnumData Representation Template number. Must equal 2 or 3.
[in,out]idrstmplContains the array of values for Data Representation Template 5.2 or 5.3
  • 1 Reference value - ignored on input
  • 2 Binary Scale Factor
  • 3 Decimal Scale Factor
  • 7 Missing value management
  • 8 Primary missing value
  • 9 Secondary missing value
  • 17 Order of Spatial Differencing (1 or 2)
[out]cpackThe packed data field (character*1 array).
[out]lcpackLength of packed field cpack. -1 is returned if idrstmpl(7) is not set correctly.
Author
Stephen Gilbert
Date
2004-08-27

Definition at line 37 of file cmplxpack.f.

References compack(), and misspack().

Referenced by addfield().