updated top-level README and version_decl for V4.4.2 (#1795)
[WRF.git] / external / io_grib1 / diffwrf
blob946e198f985cf6fb2db5f15415dffd5b50d31f5a
1 #!/bin/csh
3 if ( ( ${#argv} != 2 ) && ( ${#argv} != 3 ) ) then
4 echo usage: diffwrf gribfile1 gribfile2 <wgrib_exe_dir>
5 exit ( 1 )
6 endif
8 set file1 = $1
9 set file2 = $2
10 set dir = $3
12 if ( -e fort.88 ) rm fort.88
13 if ( -e fort.98 ) rm fort.98
15 if ( -e outfile1 ) rm outfile1
16 if ( -e outfile2 ) rm outfile2
18 if ( ( ! -e $file1 ) || ( ! -e $file2 ) ) then
19 touch fort.88
20 exit ( 0 )
21 endif
23 if ( ${#argv} == 2 ) then
24 if ( ! -e ../../external/io_grib1/wgrib.exe ) then
25 touch fort.88
26 exit ( 0 )
27 endif
28 ../../external/io_grib1/wgrib.exe -s $file1 | ../../external/io_grib1/wgrib.exe -s -i -o outfile1 $file1 >& /dev/null
29 ../../external/io_grib1/wgrib.exe -s $file2 | ../../external/io_grib1/wgrib.exe -s -i -o outfile2 $file2 >& /dev/null
30 else if ( ${#argv} == 3 ) then
31 if ( ! -e ${dir}/wgrib.exe ) then
32 touch fort.88
33 exit ( 0 )
34 endif
35 ${dir}/wgrib.exe -s $file1 | ${dir}/wgrib.exe -s -i -o outfile1 $file1 >& /dev/null
36 ${dir}/wgrib.exe -s $file2 | ${dir}/wgrib.exe -s -i -o outfile2 $file2 >& /dev/null
37 endif
39 cmp outfile1 outfile2
41 set ok = $status
43 if ( $ok == 0 ) then
45 else
46 touch fort.88
47 endif
49 exit ( 0 )