NOAA-EMC / NCEPLIBS-ip2

Other
1 stars 4 forks source link

Generic descriptors for ip2 that will ease combining with ip #21

Closed kgerheiser closed 3 years ago

kgerheiser commented 3 years ago

This re-factors ip2 so that its functions take a generic ip_grid_descriptor object instead of the actual grib template arrays (from which the grid_descriptors are constructed).

Then, if a function needs to access the contents of the descriptor it calls select type which will give you either a grib1_descriptor or a grib2_descriptor that can be queried for the needed information.

This is a step towards generalizing the library so that it can be combined with NCEPLIBS-ip.

I tried to leave as much of the code intact as possible for to get it into better shape first, before a bigger re-factoring can commence.

Vector and scalar tests pass and all interfaces remain the same with the exception of a required use ip_mod

kgerheiser commented 3 years ago

Oops commited my build files

edwardhartnett commented 3 years ago

There are lots of whitespace changes. Did you reformat the code?

I have no objection to reformatting to a common indentation style, but we should agree on the style (across all NCEPLIBS) and then enforce it automatically. Also we should convert to it in one operation in which there are no code changes, only automatic reformatting.

kgerheiser commented 3 years ago

I use the style that emacs uses. I added modules around the existing code and then indented it.

kgerheiser commented 3 years ago

This is complete and ready to be merged.

The next step will be adding the grib1-specific code and interfaces.