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
|
---|
15 | IFILE0=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 |
|
---|
26 | SRC_DIR=libs/bufr-24.0.2/extra
|
---|
27 | TGT_DIR=$BUFR_TABLES
|
---|
28 |
|
---|
29 | for file in bufr_codefig bufr_origcentre ; do
|
---|
30 | cp $SRC_DIR/$file $TGT_DIR
|
---|
31 | done
|
---|
32 |
|
---|
33 | IFILE=$IFILE0
|
---|
34 |
|
---|
35 | # Dump the bufr
|
---|
36 | EXEC=$ROPP_ROOT/gfortran/bin/decbufr
|
---|
37 |
|
---|
38 | TFILE1=`echo $IFILE0 |sed -es/'_bufr'/'_decbufr_old'/`
|
---|
39 |
|
---|
40 | echo "$EXEC -d $IFILE > $TFILE1 2>&1"
|
---|
41 | $EXEC -d $IFILE > $TFILE1 2>&1
|
---|
42 |
|
---|
43 | # Convert to nc
|
---|
44 | EXEC=$ROPP_ROOT/gfortran/bin/bufr2ropp
|
---|
45 |
|
---|
46 | OFILE=`echo $IFILE0 |sed -es/'_bufr'/'_nc_old'/`
|
---|
47 |
|
---|
48 | TFILE=`echo $IFILE0 |sed -es/'_bufr'/'_txt_old'/`
|
---|
49 |
|
---|
50 | echo "$EXEC $IFILE -o $OFILE -d > $TFILE 2>&1"
|
---|
51 | $EXEC $IFILE -o $OFILE -d > $TFILE 2>&1
|
---|
52 |
|
---|
53 |
|
---|
54 | echo "grep 'Originating Centre' $TFILE1"
|
---|
55 | echo "grep 'Originating Sub-Centre' $TFILE1"
|
---|
56 | echo "grep 'SATELLITE IDENTIFIER' $TFILE1"
|
---|
57 | echo "grep 'SATELLITE INSTRUMENTS' $TFILE1"
|
---|
58 | echo "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 |
|
---|
79 | echo "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 |
|
---|
94 | SRC_DIR=libs/bufr-24.0.2a/extra
|
---|
95 | TGT_DIR=$BUFR_TABLES
|
---|
96 |
|
---|
97 | for file in bufr_codefig bufr_origcentre ; do
|
---|
98 | cp $SRC_DIR/$file $TGT_DIR
|
---|
99 | done
|
---|
100 |
|
---|
101 | IFILE=$IFILE0
|
---|
102 |
|
---|
103 | # Dump the bufr
|
---|
104 | EXEC=$ROPP_ROOT/ifort12/bin/decbufr
|
---|
105 |
|
---|
106 | TFILE1=`echo $IFILE0 |sed -es/'_bufr'/'_decbufr_new'/`
|
---|
107 |
|
---|
108 | echo "$EXEC -d $IFILE > $TFILE1 2>&1"
|
---|
109 | $EXEC -d $IFILE > $TFILE1 2>&1
|
---|
110 |
|
---|
111 | # Convert to nc
|
---|
112 | EXEC=$ROPP_ROOT/ifort12/bin/bufr2ropp
|
---|
113 |
|
---|
114 | OFILE=`echo $IFILE0 |sed -es/'_bufr'/'_nc_new'/`
|
---|
115 |
|
---|
116 | TFILE=`echo $IFILE0 |sed -es/'_bufr'/'_txt_new'/`
|
---|
117 |
|
---|
118 | echo "$EXEC $IFILE -o $OFILE -d > $TFILE 2>&1"
|
---|
119 | $EXEC $IFILE -o $OFILE -d > $TFILE 2>&1
|
---|
120 |
|
---|
121 |
|
---|
122 | echo "grep 'Originating Centre' $TFILE1"
|
---|
123 | echo "grep 'Originating Sub-Centre' $TFILE1"
|
---|
124 | echo "grep 'SATELLITE IDENTIFIER' $TFILE1"
|
---|
125 | echo "grep 'SATELLITE INSTRUMENTS' $TFILE1"
|
---|
126 | echo "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 |
|
---|
147 | echo "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
|
---|