NCEPLIBS-g2  3.4.7
simpack.f File Reference

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

Go to the source code of this file.

Functions/Subroutines

subroutine simpack (fld, ndpts, idrstmpl, cpack, lcpack)
 Pack up a data field using a simple packing algorithm as defined in the GRIB2 documention. More...
 

Detailed Description

Pack up a data field using simple packing algorithm.

Author
Stephen Gilbert
Date
2000-06-21

Definition in file simpack.f.

Function/Subroutine Documentation

◆ simpack()

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

Pack up a data field using a simple packing algorithm as defined in the GRIB2 documention.

It also fills in GRIB2 Data Representation Template 5.0 with the appropriate values.

Parameters
[in]fldContains the data values to pack.
[in]ndptsThe number of data values in array fld.
[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
  • (4) Number of bits used to pack data, if value is > 0 and <=
  1. If this input value is 0 or outside above range then the num of bits is calculated based on given data and scale factors.
  • (5) Original field type - currently ignored on input Data values assumed to be reals.
[out]cpackThe packed data field (character*1 array).
[out]lcpacklength of packed field cpack.
Author
Stephen Gilbert
Date
2000-06-21

Definition at line 25 of file simpack.f.

References g2_sbytec(), g2_sbytesc(), and mkieee().

Referenced by addfield(), and specpack().