Ticket #377: test1b.sh

File test1b.sh, 4.6 KB (added by Ian Culverwell, 5 years ago)

test1b.sh

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