Ticket #377: test2b.sh

File test2b.sh, 5.1 KB (added by Ian Culverwell, 5 years ago)

test2b.sh

Line 
1#/usr/bin/ksh
2#
3# Script to compare old and revised ECMWF BUFR libaries,
4# as used at ROPP9.0 and ROPP9.1.
5#
6
7IFILE0=data2/ropp_test_bufr # Metop-A data
8IFILE0=data2/bfrPrf_KOM5.2018.182.00.04.G27_0001.0007_bufr # K5 data
9IFILE0=data2/A_IUTA14BAWX160008_C_BAWX_20170616025049_bufr # FY3C data
10IFILE0=data2/A_IUTA14BAWX160008_C_BAWX_20170616025049_new_bufr # FY3D data
11IFILE0=data2/T_IUTF14_C_DEMS_20180223075850_G05_ROSA_MT1_bufr # MT-ROSA data
12IFILE0=data2/GA-AI-3-NRT+2011_052_1100_G23_zdif_006_bufr # GRACE-A data
13IFILE0=data2/GB-AI-3-NRT+2011_052_1100_G23_zdif_006_bufr # GRACE-B data
14IFILE0=data2/GC-AI-3-NRT+2011_052_1100_G23_zdif_006_bufr # GRACE-C FO data
15IFILE0=data2/GD-AI-3-NRT+2011_052_1100_G23_zdif_006_bufr # GRACE-D FO data
16
17#------------------------------------------------------
18#0. Cntl: Old ECMWF BUFR: bufr_000387, built with gfortran
19#------------------------------------------------------
20
21#if false ; then # bypass the control
22
23# Move the appropriate files are placed in $BUFR_TABLES, in case
24# the other BUFR lib was built last. Note that we have to use the MetDB files,
25# because decbufr is only an element of the MetDB BUFR library.
26
27#SRC_DIR=libs/bufr_000387/bufrtables
28#TGT_DIR=$BUFR_LIBRARY
29
30#for file in C0000000000098013001.TXT ; do
31# cp $SRC_DIR/$file $TGT_DIR
32#done
33
34SRC_DIR=libs/bufr-24.0.2/extra
35TGT_DIR=$BUFR_TABLES
36
37for file in bufr_codefig bufr_origcentre ; do
38 cp $SRC_DIR/$file $TGT_DIR
39done
40
41
42IFILE=$IFILE0
43
44# Dump the bufr
45EXEC=$ROPP_ROOT/gfortran/bin/decbufr
46
47TFILE1=`echo $IFILE0 |sed -es/'_bufr'/'_decbufr_old'/`
48
49echo "$EXEC -d $IFILE > $TFILE1 2>&1"
50 $EXEC -d $IFILE > $TFILE1 2>&1
51
52# Convert to nc
53EXEC=$ROPP_ROOT/gfortran/bin/bufr2ropp
54
55OFILE=`echo $IFILE0 |sed -es/'_bufr'/'_nc_old'/`
56
57TFILE=`echo $IFILE0 |sed -es/'_bufr'/'_txt_old'/`
58
59echo "$EXEC $IFILE -o $OFILE -d > $TFILE 2>&1"
60 $EXEC $IFILE -o $OFILE -d > $TFILE 2>&1
61
62
63echo "grep 'Originating Centre' $TFILE1"
64echo "grep 'Originating Sub-Centre' $TFILE1"
65echo "grep 'SATELLITE IDENTIFIER' $TFILE1"
66echo "grep 'SATELLITE INSTRUMENTS' $TFILE1"
67echo "grep 'IDENTIFICATION OF ORIGINATING/GENERATING CENTRE' $TFILE1"
68
69 grep 'Originating Centre' $TFILE1
70 grep 'Originating Centre' $TFILE1 >> $TFILE
71
72 grep 'Originating Sub-Centre' $TFILE1
73 grep 'Originating Sub-Centre' $TFILE1 >> $TFILE
74
75 grep 'SATELLITE IDENTIFIER' $TFILE1
76 grep 'SATELLITE IDENTIFIER' $TFILE1 >> $TFILE
77
78 grep 'SATELLITE INSTRUMENTS' $TFILE1
79 grep 'SATELLITE INSTRUMENTS' $TFILE1 >> $TFILE
80
81 grep 'SATELLITE CLASSIFICATION' $TFILE1
82 grep 'SATELLITE CLASSIFICATION' $TFILE1 >> $TFILE
83
84 grep 'IDENTIFICATION OF ORIGINATING/GENERATING CENTRE' $TFILE1
85 grep 'IDENTIFICATION OF ORIGINATING/GENERATING CENTRE' $TFILE1 >> $TFILE
86
87
88echo "ncks -H -Q -vleo_id,gns_id,occ_id $OFILE"
89 ncks -H -Q -vleo_id,gns_id,occ_id $OFILE
90 ncks -H -Q -vleo_id,gns_id,occ_id $OFILE >> $TFILE
91
92#fi # bypass the control
93
94#------------------------------------------------------
95#1. Test: New ECMWF BUFR: bufr_000387a, built with ifort12
96#------------------------------------------------------
97
98#if false ; then # bypass the test
99
100# Move the appropriate files are placed in $BUFR_TABLES, in case
101# the other BUFR lib was built last. Note that we have to use the MetDB files,
102# because decbufr is only an element of the MetDB BUFR library.
103
104#SRC_DIR=libs/bufr_000387a/bufrtables
105#TGT_DIR=$BUFR_LIBRARY
106
107#for file in C0000000000098013001.TXT ; do
108# cp $SRC_DIR/$file $TGT_DIR
109#done
110
111SRC_DIR=libs/bufr-24.0.2a/extra
112TGT_DIR=$BUFR_TABLES
113
114for file in bufr_codefig bufr_origcentre ; do
115 cp $SRC_DIR/$file $TGT_DIR
116done
117
118
119IFILE=$IFILE0
120
121# Dump the bufr
122EXEC=$ROPP_ROOT/ifort12/bin/decbufr
123
124TFILE1=`echo $IFILE0 |sed -es/'_bufr'/'_decbufr_new'/`
125
126echo "$EXEC -d $IFILE > $TFILE1 2>&1"
127 $EXEC -d $IFILE > $TFILE1 2>&1
128
129# Convert to nc
130EXEC=$ROPP_ROOT/ifort12/bin/bufr2ropp
131
132OFILE=`echo $IFILE0 |sed -es/'_bufr'/'_nc_new'/`
133
134TFILE=`echo $IFILE0 |sed -es/'_bufr'/'_txt_new'/`
135
136echo "$EXEC $IFILE -o $OFILE -d > $TFILE 2>&1"
137 $EXEC $IFILE -o $OFILE -d > $TFILE 2>&1
138
139
140echo "grep 'Originating Centre' $TFILE1"
141echo "grep 'Originating Sub-Centre' $TFILE1"
142echo "grep 'SATELLITE IDENTIFIER' $TFILE1"
143echo "grep 'SATELLITE INSTRUMENTS' $TFILE1"
144echo "grep 'IDENTIFICATION OF ORIGINATING/GENERATING CENTRE' $TFILE1"
145
146 grep 'Originating Centre' $TFILE1
147 grep 'Originating Centre' $TFILE1 >> $TFILE
148
149 grep 'Originating Sub-Centre' $TFILE1
150 grep 'Originating Sub-Centre' $TFILE1 >> $TFILE
151
152 grep 'SATELLITE IDENTIFIER' $TFILE1
153 grep 'SATELLITE IDENTIFIER' $TFILE1 >> $TFILE
154
155 grep 'SATELLITE INSTRUMENTS' $TFILE1
156 grep 'SATELLITE INSTRUMENTS' $TFILE1 >> $TFILE
157
158 grep 'SATELLITE CLASSIFICATION' $TFILE1
159 grep 'SATELLITE CLASSIFICATION' $TFILE1 >> $TFILE
160
161 grep 'IDENTIFICATION OF ORIGINATING/GENERATING CENTRE' $TFILE1
162 grep 'IDENTIFICATION OF ORIGINATING/GENERATING CENTRE' $TFILE1 >> $TFILE
163
164
165echo "ncks -H -Q -vleo_id,gns_id,occ_id $OFILE"
166 ncks -H -Q -vleo_id,gns_id,occ_id $OFILE
167 ncks -H -Q -vleo_id,gns_id,occ_id $OFILE >> $TFILE
168
169#fi # bypass the test