simpack.c(3)
π simpack.c(3) π
okay bestie, welcome to the Library Functions Manual corner of the internet, because today we're talking about simpack.c β the little file that does Big Things. grab a strawberry π, we're packing data fields.
β¨ NAME β¨
simpack.c β Pack a data field using the simple packing algorithm.
like. that's it. that's the whole job. and she does it flawlessly. periodt. π
πΈ SYNOPSIS πΈ
#include 'grib2_int.h'
#include <math.h>
#include <stdlib.h>
π Functions
void simpack (float *fld, g2int ndpts, g2int *idrstmpl, unsigned char *cpack, g2int *lcpack)β Packs a data field using the simple packing algorithm.
π Detailed Description π
Pack a data field using the simple packing algorithm.
Author Stephen Gilbert
Date 2002-11-06
Definition in file simpack.c.
π Function Documentation π
π« void simpack (float * fld, g2int ndpts, g2int * idrstmpl, unsigned char * cpack, g2int * lcpack)
Packs a data field using the simple packing algorithm. no cap, this function also fills in GRIB2 Data Representation Template 5.0 with the appropriate values. she multitasks. she's giving main character energy. β¨
π¦ Parameters
fldβ Contains the data values to pack. the raw material, bestie.ndptsβ The number of data values in arrayfld. she needs a headcount before the party starts.idrstmplβ Contains the array of values for [Data Representation Template 5.0](https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_temp5-0.shtml). (https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_temp5-0.shtmlβ yes I'm dropping the link text, it's literally the template, iykyk.)0β Reference value - ignored on input - set bysimpackroutine. so don't bother passing anything, she's overwriting it anyway π1β Binary Scale Factor - unchanged from input. she respects your choices here.2β Decimal Scale Factor - unchanged from input. also untouched. icon behavior.3β Number of bits used to pack data, if value is > 0 and <= 31. If this input value is0or outside above range then the num of bits is calculated based on given data and scale factors. so like β give her a valid number and she uses it, give her nonsense and she does the math herself. adaptable queen. π4β Original field type - currently ignored on input. Data values assumed to be reals. Set to0bysimpackroutine. lowkey ignored but highkey set to0. π
cpackβ The packed data field. this is the glow-up result, the finished fit.lcpackβ length of packed field starting atcpack. the measurements, bestie. π
Author Stephen Gilbert
Date 2002-11-06
Definition at line 36 of file simpack.c.
References ALOG2, int_power(), LOG, mkieee(), sbit(), and sbits(). the whole squad showed up. π«Ά
Referenced by g2_addfield(), and specpack(). and everyone wants a piece of her, as they should. π
π Author π
Generated automatically by Doxygen for NCEPLIBS-g2c from the source code. not a human, just a very diligent robot doing its little task. we love that for it. π€β¨
and that's the whole page!! this was NCEPLIBS-g2c, Version 2.3.0, filed under simpack.c(3) β written back on 2002-11-06 and still serving looks in the Library Functions Manual. mwah, bye bestie πππ¦
π¦ where this page comes from
- ubuntu resolute: libg2c-dev 2.3.0-4 Β· LGPL-3.0-only
- ubuntu stonking: libg2c-dev 2.3.0-7 Β· LGPL-3.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms