Skip to content

Commit

Permalink
fixed some paths
Browse files Browse the repository at this point in the history
  • Loading branch information
AlysonStahl-NOAA committed May 31, 2024
1 parent 1369a23 commit 6d694c8
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 29 deletions.
10 changes: 5 additions & 5 deletions tests/run_cnvgrib_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ echo ""
echo "*** Running cnvgrib test"

# Convert test file to GRIB1.
../src/cnvgrib/cnvgrib -g21 data/ref_gdaswave.t00z.wcoast.0p16.f000.grib2 test_gdaswave.t00z.wcoast.0p16.f000.grib1
../utils/cnvgrib -g21 data/ref_gdaswave.t00z.wcoast.0p16.f000.grib2 test_gdaswave.t00z.wcoast.0p16.f000.grib1

# Generate an inventory of the GRIB1 file.
../src/wgrib/wgrib test_gdaswave.t00z.wcoast.0p16.f000.grib1 &> test_gdaswave.t00z.wcoast.0p16.f000.grib1.inventory.txt
Expand All @@ -17,20 +17,20 @@ echo "*** Running cnvgrib test"
cmp test_gdaswave.t00z.wcoast.0p16.f000.grib1.inventory.txt data/ref_gdaswave_grib1_inventory.txt

# Convert GRIB1 output back to GRIB2.
../src/cnvgrib/cnvgrib -g12 test_gdaswave.t00z.wcoast.0p16.f000.grib1 test_gdaswave.t00z.wcoast.0p16.f000.grib2
../utils/cnvgrib -g12 test_gdaswave.t00z.wcoast.0p16.f000.grib1 test_gdaswave.t00z.wcoast.0p16.f000.grib2

# Create an index of a GRIB2 file.
../src/grb2index/grb2index 1 test_gdaswave.t00z.wcoast.0p16.f000.grib2 test_gdaswave.t00z.wcoast.0p16.f000.grib2.idx
../utils/grb2index 1 test_gdaswave.t00z.wcoast.0p16.f000.grib2 test_gdaswave.t00z.wcoast.0p16.f000.grib2.idx

# Check against expected output. First 120 bytes contain differences,
# so ignore them.
cmp -i 120 test_gdaswave.t00z.wcoast.0p16.f000.grib2.idx data/ref_gdaswave.t00z.wcoast.0p16.f000.grib2.idx

# Convert test file to another GRIB2 file.
../src/cnvgrib/cnvgrib -g22 data/ref_gdaswave.t00z.wcoast.0p16.f000.grib2 test_gdaswave.t00z.wcoast.0p16.f000_2.grib2
../utils/cnvgrib -g22 data/ref_gdaswave.t00z.wcoast.0p16.f000.grib2 test_gdaswave.t00z.wcoast.0p16.f000_2.grib2

# Create an index of the new GRIB2 file.
../src/grb2index/grb2index 1 test_gdaswave.t00z.wcoast.0p16.f000_2.grib2 test_gdaswave.t00z.wcoast.0p16.f000_2.grib2.idx
../utils/grb2index 1 test_gdaswave.t00z.wcoast.0p16.f000_2.grib2 test_gdaswave.t00z.wcoast.0p16.f000_2.grib2.idx

# Check against expected output. First 120 bytes contain differences,
# so ignore them.
Expand Down
4 changes: 2 additions & 2 deletions tests/run_copygb2_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ echo ""
echo "*** Running copygb2 test"

# Copy GRIB2 file.
../src/copygb2/copygb2 -x data/ref_gdaswave.t00z.wcoast.0p16.f000.grib2 test_gdaswave_2.grib2
../utils/copygb2 -x data/ref_gdaswave.t00z.wcoast.0p16.f000.grib2 test_gdaswave_2.grib2

# Are the files the same?
g2c_compare -v data/ref_gdaswave.t00z.wcoast.0p16.f000.grib2 test_gdaswave_2.grib2

# Invoke interpolation logic.
../src/copygb2/copygb2 -g "30 6 0 0 0 0 0 0 1473 1025 12190000 226541000 8 25000000 265000000 5079000 5079000 0 64 25000000 25000000" -i"1 1" -x data/ref_gdaswave.t00z.wcoast.0p16.f000.grib2 test_gdaswave_2.ip.grib2
../utils/copygb2 -g "30 6 0 0 0 0 0 0 1473 1025 12190000 226541000 8 25000000 265000000 5079000 5079000 0 64 25000000 25000000" -i"1 1" -x data/ref_gdaswave.t00z.wcoast.0p16.f000.grib2 test_gdaswave_2.ip.grib2

# Are the files the same?
g2c_compare -v data/ref_gdaswave.t00z.wcoast.0p16.f000.ip.grib2 test_gdaswave_2.ip.grib2
Expand Down
4 changes: 2 additions & 2 deletions tests/run_copygb2_tests2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ echo ""
echo "*** Running copygb2 test"

# Copy GRIB2 file.
../src/copygb2/copygb2 -x data/ref_gdaswave.t00z.wcoast.0p16.f000.grib2 test_gdaswave_2.grib2
../utils/copygb2 -x data/ref_gdaswave.t00z.wcoast.0p16.f000.grib2 test_gdaswave_2.grib2

# Make degrib2 output for the copied file.
../src/degrib2/degrib2 test_gdaswave_2.grib2 > test_gdaswave_2.grib2.degrib2
../utils/degrib2 test_gdaswave_2.grib2 > test_gdaswave_2.grib2.degrib2

# Check against expected output.
#diff -w test_gdaswave_2.grib2.degrib2 data/ref_copygb2_test_gdaswave.degrib2.txt
Expand Down
8 changes: 4 additions & 4 deletions tests/run_copygb_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ echo ""
echo "*** Running copygb test"

# Copy GRIB1 file.
../src/copygb/copygb -x data/ref_gdaswave.t00z.wcoast.0p16.f000.grib1 test_gdaswave_2.grib1
../utils/copygb -x data/ref_gdaswave.t00z.wcoast.0p16.f000.grib1 test_gdaswave_2.grib1

# Create an index of the copied file.
../src/grbindex/grbindex test_gdaswave_2.grib1 test_gdaswave_2.grib1.idx
../utils/grbindex test_gdaswave_2.grib1 test_gdaswave_2.grib1.idx

# Check against expected output. First 120 bytes contain differences,
# so ignore them.
cmp -i 120 test_gdaswave_2.grib1.idx data/ref_gdaswave_2.grib1.idx

# Interpolate GFS landmask to NCEP grid 172
../src/copygb/copygb -g172 -x data/ref_gfs.landmask.grib1 172.land.grib1
../utils/copygb -g172 -x data/ref_gfs.landmask.grib1 172.land.grib1
cmp 172.land.grib1 data/ref_grid_172.landmask.grib1

# Interpolate GFS landmask to NCEP grid 220
../src/copygb/copygb -g220 -x data/ref_gfs.landmask.grib1 220.land.grib1
../utils/copygb -g220 -x data/ref_gfs.landmask.grib1 220.land.grib1
cmp 220.land.grib1 data/ref_grid_220.landmask.grib1

echo "*** SUCCESS!"
Expand Down
2 changes: 1 addition & 1 deletion tests/run_degrib2_extra_file_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ for f in $ftp_files
do
echo "Testing degrib2 with large file $f"
ls -l data/$f
../src/degrib2/degrib2 data/$f > ${f}.degrib2
../utils/degrib2 data/$f > ${f}.degrib2
diff -w ${f}.degrib2 data/ref_${f}.degrib2
done

Expand Down
2 changes: 1 addition & 1 deletion tests/run_degrib2_ftp_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ for f in $ftp_files
do
echo "Testing degrib2 with file $f"
# ls -l data/$f
../src/degrib2/degrib2 data/$f > ${f}.degrib2
../utils/degrib2 data/$f > ${f}.degrib2
diff -w ${f}.degrib2 data/ref_${f}.degrib2
done

Expand Down
2 changes: 1 addition & 1 deletion tests/run_degrib2_large_file_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ for f in $ftp_files
do
echo "Testing degrib2 with large file $f"
ls -l data/$f
../src/degrib2/degrib2 data/$f > ${f}.degrib2
../utils/degrib2 data/$f > ${f}.degrib2
diff -w ${f}.degrib2 data/ref_${f}.degrib2
done

Expand Down
2 changes: 1 addition & 1 deletion tests/run_degrib2_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ echo "*** Running degrib2 tests"
degrib2 && exit 1

# Degrib2 a GRIB2 file.
../src/degrib2/degrib2 data/ref_gdaswave.t00z.wcoast.0p16.f000.grib2 &> test_gdaswave.degrib2.txt
../utils/degrib2 data/ref_gdaswave.t00z.wcoast.0p16.f000.grib2 &> test_gdaswave.degrib2.txt

#echo "got:"
#cat test_gdaswave.degrib2.txt
Expand Down
12 changes: 6 additions & 6 deletions tests/run_grb2index_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,28 @@ echo "*** Running grb2index tests"

# Confirm that 2 arguments are required, otherwise an error code of 2
# is returned.
../src/grb2index/grb2index && exit 1
../utils/grb2index && exit 1
[ $? -ne 2 ] && exit 2
../src/grb2index/grb2index one && exit 1
../utils/grb2index one && exit 1
[ $? -ne 2 ] && exit 2

# Confirm that input file can be read, otherwise an error code of 8 is returned.
../src/grb2index/grb2index missing1 missing2 && exit 1
../utils/grb2index missing1 missing2 && exit 1
[ $? -ne 8 ] && exit 2

# When there are no grib2 messages in the file, an error code of 1 is returned.
../src/grb2index/grb2index data/ref_gdaswave_2.idx missing2 && exit 1
../utils/grb2index data/ref_gdaswave_2.idx missing2 && exit 1
[ $? -ne 1 ] && exit 2

# Create an index of a GRIB2 file.
../src/grb2index/grb2index 1 data/ref_gdaswave.t00z.wcoast.0p16.f000.grib2 test_gdaswave.grb2index.idx
../utils/grb2index 1 data/ref_gdaswave.t00z.wcoast.0p16.f000.grib2 test_gdaswave.grb2index.idx

# Check against expected output. First 140 bytes contain differences,
# so ignore them.
cmp -i 140 test_gdaswave.grb2index.idx data/ref_gdaswave.grb2index.idx

# Create an index of a GRIB2 file.
../src/grb2index/grb2index 2 data/ref_gdaswave.t00z.wcoast.0p16.f000.grib2 test_gdaswave.grb2index.idx2
../utils/grb2index 2 data/ref_gdaswave.t00z.wcoast.0p16.f000.grib2 test_gdaswave.grb2index.idx2

# Check against expected output. First 140 bytes contain differences,
# so ignore them.
Expand Down
2 changes: 1 addition & 1 deletion tests/run_grbindex_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ echo ""
echo "*** Running grbindex test"

# Create an index of a GRIB2 file.
../src/grbindex/grbindex data/ref_gdaswave.t00z.wcoast.0p16.f000.grib1 test_gdaswave.grbindex.grib1.idx
../utils/grbindex data/ref_gdaswave.t00z.wcoast.0p16.f000.grib1 test_gdaswave.grbindex.grib1.idx

# Check against expected output. First 120 bytes contain differences,
# so ignore them.
Expand Down
4 changes: 2 additions & 2 deletions tests/run_tocgrib2_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ echo "*** Running tocgrib2 tests"
echo "*** Running tocgrib2 with input/output defined, but one missing field. It will fail."
export FORT11="data/rrfs.t12z.prslevfaa.f010.na3km.grib2"
export FORT51=out.grib2
../src/tocgrib2/tocgrib2 < data/tocgrib2_bad.nml && exit 1
../utils/tocgrib2 < data/tocgrib2_bad.nml && exit 1

echo "*** Running tocgrib2 with input/output defined. It will succeed."
export FORT11="data/rrfs.t12z.prslevfaa.f010.na3km.grib2"
export FORT51=out.grib2
../src/tocgrib2/tocgrib2 < data/tocgrib2.nml
../utils/tocgrib2 < data/tocgrib2.nml

echo "*** SUCCESS!"
exit 0
6 changes: 3 additions & 3 deletions tests/run_util_ftp_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ echo ""
echo "*** Running FTP file tests"

# Convert test file to GRIB1.
../src/cnvgrib/cnvgrib -g21 data/WW3_Regional_US_West_Coast_20220718_0000.grib2 test_WW3_West.grib1
../utils/cnvgrib -g21 data/WW3_Regional_US_West_Coast_20220718_0000.grib2 test_WW3_West.grib1

# Generate an inventory of the GRIB1 file.
../src/wgrib/wgrib test_WW3_West.grib1 &> test_WW3_West.grib1.inventory.txt
Expand All @@ -19,10 +19,10 @@ echo "*** Running FTP file tests"
cmp test_gdaswave.t00z.wcoast.0p16.f000.grib1.inventory.txt data/ref_gdaswave_grib1_inventory.txt

# Convert GRIB1 output back to GRIB2.
../src/cnvgrib/cnvgrib -g12 test_WW3_West.grib1 test_WW3_West.grib2
../utils/cnvgrib -g12 test_WW3_West.grib1 test_WW3_West.grib2

# Create an index of a GRIB2 file.
../src/grb2index/grb2index 1 test_WW3_West.grib2 test_WW3_West.grib2.idx
../utils/grb2index 1 test_WW3_West.grib2 test_WW3_West.grib2.idx

# Check against expected output. First 120 bytes contain differences,
# so ignore them.
Expand Down

0 comments on commit 6d694c8

Please sign in to comment.