g2_addgrid.c(3)

πŸ“¦
version 2.3.0 Β· 2 versions
, in ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

g2_addgrid.c β€” the icon that packs a Grid Definition Section (Section 3) and adds it to a GRIB2 message. That's it, that's the whole personality, and honestly? Slay. πŸ’…


✨ SYNOPSIS ✨

#include 'grib2_int.h'
#include <stdio.h>
#include <stdlib.h>

🌸 Functions

  • g2int g2_addgrid (unsigned char *cgrib, g2int *igds, g2int *igdstmpl, g2int *ideflist, g2int idefnum) β€” packs a Grid Definition Section (Section 3) and adds it to a GRIB2 message. bestie it literally does exactly what it says on the tin πŸ’–

πŸ¦‹ Detailed Description πŸ¦‹

Okay so real talk: this thing packs a Grid Definition Section (Section 3) and adds it to a GRIB2 message. That's the whole assignment, and it ate. πŸ”₯

πŸ‘‘ Author

Stephen Gilbeert

πŸŽ€ Date

2002-11-01

Definition in file g2_addgrid.c. πŸ—‚οΈ


🧚 Function Documentation 🧚

g2int g2_addgrid (unsigned char * cgrib, g2int * igds, g2int * igdstmpl, g2int * ideflist, g2int idefnum)

Packs a Grid Definition Section (Section 3) and adds it to a GRIB2 message. She does not work alone, no cap β€” she's part of a whole squad: this function is used with routines g2_create(), g2_addlocal(), g2_addfield(), and g2_gribend() to create a complete GRIB2 message. And like... g2_create() must be called first to initialize a new GRIB2 message. Do not skip the pre-game, bestie, it's giving chaos. πŸ’€

🌈 Parameters 🌈

  • cgrib β€” Char array that contains the GRIB2 message to which section should be added. Must be allocated large enough to store the entire GRIB2 message. Like, the whole thing, so don't be out here under-allocating and acting surprised. πŸ™ˆ
  • igds β€” Contains information needed for GRIB Grid Definition Section 3. Must be dimensioned >= 5. And here's the breakdown, bestie, write it down:
    • igds[0] Source of grid definition (see Code Table 3.0).
    • igds[1] Number of grid points in the defined grid.
    • igds[2] Number of octets needed for each additional grid points definition. Used to define number of points in each row (or column) for non-regular grids. = 0, if using regular grid.
    • igds[3] Interpretation of list for optional points definition. (See Code Table 3.11).
    • igds[4] Grid Definition Template Number (See Code Table 3.1).
  • igdstmpl β€” Contains the data values for the specified Grid Definition Template (igds[4]). Each element of this integer array contains an entry (in the order specified) of Grid Defintion Template. Order matters, so no freestyling. ⭐
  • ideflist β€” (Used if igds[2] != 0) This array contains the number of grid points contained in each row (or column).
  • idefnum β€” (Used if igds[2] != 0) The number of entries in array ideflist. i.e. number of rows (or columns) for which optional grid points are defined.

🫢 Returns 🫢

  • > 0 β€” Current size of updated GRIB2 message. the good ending ✨
  • G2_ADD_MSG_INIT β€” GRIB message was not initialized. Need to call routine gribcreate first.
  • G2_ADD_MSG_COMPLETE β€” GRIB message already complete. Cannot add new section.
  • G2_BAD_SEC_COUNTS β€” Sum of Section byte counts doesn't add to total byte count.
  • G2_BAD_SEC β€” Previous Section was not 1, 2 or 7.
  • G2_ADDGRID_BAD_GDT β€” Could not find requested Grid Definition Template.

πŸ’œ Note πŸ’œ

The Grid Def Section (Section 3) can only follow Section 1, 2 or Section 7 in a GRIB2 message. That's the seating chart, bestie, and she does not switch seats. πŸͺ‘

πŸ‘‘ Author

Stephen Gilbeert

πŸŽ€ Date

2002-11-01

Definition at line 66 of file g2_addgrid.c.

References gtemplate::ext, extgridtemplate(), gtemplate::extlen, G2_ADD_MSG_COMPLETE, G2_ADD_MSG_INIT, G2_ADDGRID_BAD_GDT, G2_BAD_SEC, G2_BAD_SEC_COUNTS, g2c_check_msg(), G2C_EMSGCOMPLETE, G2C_ENOTGRIB, gbit(), getgridtemplate(), gtemplate::map, gtemplate::maplen, gtemplate::needext, sbit(), and sbits(). the whole friend group fr fr πŸ«‚


πŸ’« Author πŸ’«

Generated automatically by Doxygen for NCEPLIBS-g2c from the source code. not a human, just a robot doing her little documentation dance πŸ€–βœ¨


okay that's the whole page, bestie β€” go forth and pack those Grid Definition Sections. This one's from NCEPLIBS-g2c, Version 2.3.0. mwah, bye!! πŸ’‹πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from