I download WPS4.2 and compiled WPS using option 17 "Linux x86_64, Intel compiler (serial)". I use 2019 grib2 GFS data. The corresponding Vtable I used is Vtable.GFS provided in ungrib/Variable_Tables. When I run ungrib, I got the error message (see below the asterisk line). It seems like ungrib.exe identifies my grib2 files as grib1 files. I used g2print.exe to check the files and everything looks fine.
******************************************************************
*** stopping in gribcode ***\n
\tI was expecting a Grib1 file, but this is a Grib2 file.
\tIt is possible this is because your GRIBFILE.XXX files
\tare not all of the same type.
\tWPS can handle both file types, but a separate ungrib
\tjob must be run for each Grib type.\n
gribsize in gribcode
******************************************************************
*** stopping in gribcode ***\n
\tI was expecting a Grib1 file, but this is a Grib2 file.
\tIt is possible this is because your GRIBFILE.XXX files
\tare not all of the same type.
\tWPS can handle both file types, but a separate ungrib
\tjob must be run for each Grib type.\n
gribsize in gribcode