Skip Navigation Links www.nws.noaa.gov 
NOAA logo - Click to go to the NOAA home page National Weather Service   NWS logo - Click to go to the NWS home page
Climate Prediction Center
 
 

 
About Us
   Our Mission
   Who We Are

Contact Us
   CPC Information
   CPC Web Team

 
HOME > Monitoring_and_Data > Oceanic and Atmospheric Data > Reanalysis: Atmospheric Data > wgrib2 Changes with v3.1.3
 

wgrib2: v3.1.3

Changes from wgrib2 v3.1.2 to v3.1.3

Bug fix for -set_bitmap 1

Complex-packed grib files have good compression with highly parallelized decompression. Complex packing has two ways of storing undefined values, either in bitmap or by encoding a special value. A bitmap takes 1 bit per grid point, and a high resolution gfs files typically uses 3-5 bits per grid point. So storing undefined values typically takes 25% more space than using a special value. Using a bitmap is inefficient; however, some codes cannot handle storing undefined as a bitmap. So some operational files from NCEP use complex packing with a bitmap. To generate such files using wgrib2, the option "-set_bitmap 1" has to be used.

A bug was introduced to the wgrib2 where creating complex files with a bitmap was flawed. The calculation of the range of the field as flawed and field was truncated to a constant field. The "optimization" was fixed removing this bug. This bug only affected new versions of wgrib2 when using "-set_bitmap 1".

ECMWF uses AEC compression

ECMWF is producing grib files using AEC compression. By making AEC a default option, wgrib2 needs to be built using a recent version of CMake. Once CMake becomes a requirement for the default build, Jasper can be replaced by the long planned OpenJPEG for jpeg2000 support. You can still build wgrib2 without CMake but you will have to turn off AEC and replace OpenJPEG by Jasper in the makefile. The output files created by Jasper and OpenJPEG are not bit identical but decode to identical numbers in my testing.

Wgrib2 v3.1.3 is still including proj4 as one of its geolocation libraries. Removing proj4 means that aspherical-earth equal area Lambert is unsupported. Some compilers do not support proj4 which is an old version of the Proj library. Moving to a new version of Proj is ideal but there were some API changes.

Changes for v3.1.3

  • Support for OpenMP 3.1, 4.0, 4.5, 5.0 (prior: 3.1)
  • added SIMD pragmas which are used if OpenMP support them
  • testing AVX2 and AVX512 enabled
  • support for proj4 on Mac
  • makefile fixes to compiling shared lib, OpenJPEG
  • NCEP grib tables updated 4/2022.
The trade offs between using SIMD vs threading is an interesting subject. For short loops, SIMD has no overhead and will be faster than threading. For long loops, memory bandwidth will limit the speed. So threading could use more memory controllers and have a faster speed. The ideal is for the threaded section to have loops that can be speed up using SIMD. Unfortunately that doesn't occur that frequently.

Future Changes for v3.1.4

  • integrate development with NCEPlibs: github, cmake
  • until the v3.1.4 is released, the github will be used to get convert to the new workflow
  • updated grib tables
  • added -lvl, -set_lvl1, -set_lvl2 (low level level options)
  • added more levels

NOAA/ National Weather Service
National Centers for Environmental Prediction
Climate Prediction Center
5830 University Research Court
College Park, Maryland 20740
Climate Prediction Center Web Team
Page dates: 4/2022
Disclaimer Privacy Policy