Skip to content

Commit

Permalink
more tests and fixed some EOL in test files to avoid issues with cmp
Browse files Browse the repository at this point in the history
  • Loading branch information
AlysonStahl-NOAA committed May 15, 2024
1 parent ef98afb commit 71da810
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/run_wgrib2_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,23 @@ echo "*** Testing sec_len on a small file"
cat sec_len_small.txt
cmp sec_len_small.txt data/ref_sec_len.simple_packing.grib2.txt

echo "*** Testing separating grib messages into separate files then recombining into single file"
# creating comparison file using match
../wgrib2/wgrib2 data/gdas.t12z.pgrb2.1p00.anl.75r.grib2 -match ':(UGRD|VGRD|HGT|TMP):0.4 mb' -grib_out htuv.grb
# separating messages into new grib files
../wgrib2/wgrib2 data/gdas.t12z.pgrb2.1p00.anl.75r.grib2 -inv junk.inv
../wgrib2/wgrib2 -fgrep ":HGT:0.4 mb" -i_file junk.inv data/gdas.t12z.pgrb2.1p00.anl.75r.grib2 -grib_out hgt0p4.grb
../wgrib2/wgrib2 -fgrep ":TMP:0.4 mb" -i_file junk.inv data/gdas.t12z.pgrb2.1p00.anl.75r.grib2 -grib_out tmp0p4.grb
../wgrib2/wgrib2 -egrep ":(UGRD|VGRD):" -fgrep ":0.4 mb" -i_file junk.inv data/gdas.t12z.pgrb2.1p00.anl.75r.grib2 -grib_out winds0p4.grb
# recombining files
../wgrib2/wgrib2 hgt0p4.grb -grib result.grb
../wgrib2/wgrib2 tmp0p4.grb -append -grib result.grb
../wgrib2/wgrib2 winds0p4.grb -append -GRIB result.grb
cksum0=`../wgrib2/wgrib2 htuv.grb -text - | cksum`
cksum0=`../wgrib2/wgrib2 result.grb -text - | cksum`
if [ "$cksum0" != "$cksum1" ] ; then
exit 1
fi

echo "*** SUCCESS!"
exit 0
27 changes: 27 additions & 0 deletions wgrib2/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/* config.h generated by cmake */
#ifndef _CONFIG_H
#define _CONFIG_H
// #define USE_NETCDF3
#define USE_REGEX
#define USE_TIGGE
// #define USE_MYSQL
#define USE_IPOLATES 1
// #define USE_UDF
#define USE_OPENMP
// #define USE_PROJ4
// #define USE_WMO_VALIDATION
// #define DISABLE_TIMEZONE
// #define DISABLE_ALARM
#define USE_NAMES NCEP
// #define USE_G2CLIB
// #define USE_PNG
#define USE_JASPER
// #define USE_OPENJPEG
// #define MAKE_FTN_API
#define USE_AEC
#define BUILD_COMMENTS "stock build"
#define CC "/usr/bin/cc GNU"
#define FORTRAN "/usr/bin/f95 GNU"
#define CPPFLAGS "-g -DGFORTRAN"
#define FFLAGS "-g -fbacktrace "
#endif

0 comments on commit 71da810

Please sign in to comment.