NOAA-EMC / NCEPLIBS-g2c

This library contains C decoder/encoder routines for GRIB edition 2.
Other
18 stars 11 forks source link

changing GRIB2 read/write macros to functions #374

Closed edwardhartnett closed 1 year ago

edwardhartnett commented 1 year ago

Fixes #373

In this PR I add some g2c_fileio*() functions, which will perform reads and writes of different types of integer to GRIB2 files, including special negative number handling.

These functions replace the macros I was using for this purpose. (Which did not handle negative numbers.)

I also replace the function that reads/writes template numbers so it also handles negative and positive values correctly.

I am added more testing but this code is ready for review.