NCEPLIBS-g2  3.4.5
misspack.f File Reference

This subroutine packs up a data field using a GRIB2 algorithm. More...

Go to the source code of this file.

Functions/Subroutines

subroutine misspack (fld, ndpts, idrsnum, idrstmpl, cpack, lcpack)
 This subroutine packs up a data field using a complex packing algorithm as defined in the GRIB2 documention. More...
 

Detailed Description

This subroutine packs up a data field using a GRIB2 algorithm.

Author
Stephen Gilbert
Date
2000-06-21

Definition in file misspack.f.

Function/Subroutine Documentation

◆ misspack()

subroutine misspack ( 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 
)

This subroutine packs up a data field using a complex packing algorithm as defined in the GRIB2 documention.

It supports GRIB2 complex packing templates with or without spatial differences (i.e. DRTs 5.2 and 5.3). It also fills in GRIB2 Data Representation Template 5.2 or 5.3 with the appropriate values. This version assumes that Missing Value Management is being used and that1 or 2 missing values appear in the data.

PROGRAM HISTORY LOG:

  • 2000-06-21 Stephen Gilbert
  • 2004-12-29 Stephen Gilbert Corrected bug when encoding secondary missing values.
  • 2012-05-10 Boi Vuong Added variable rmin4 for 4 byte real.
Parameters
[in]fldContains the data values to pack.
[in]ndptsThe number of data values in array fld.
[in]idrsnumData Representation Template number 5.N Must equal 2 or 3.
[in,out]idrstmplContains the array of values for Data Representation Template 5.2 or 5.3
  • idrstmpl(1) Reference value - ignored on input set by compack routine.
  • idrstmpl(2) Binary Scale Factor.
  • idrstmpl(3) Decimal Scale Factor.
  • idrstmpl(4) number of bits for each data value - ignored on input.
  • idrstmpl(5) Original field type, currently ignored on input, set = 0 on !output, Data values assumed to be reals.
  • idrstmpl(6) = 0 use lossless compression or = 1 use lossy compression.
  • idrstmpl(7) Missing value management.
  • idrstmpl(8) Primary missing value.
  • idrstmpl(9) Secondary missing value.
  • idrstmpl(17) Order of Spatial Differencing (1 or 2).
[out]cpackThe packed data field (character*1 array).
[out]lcpacklength of packed field cpack.
Author
Stephen Gilbert
Date
2000-06-21

Definition at line 44 of file misspack.f.