Afterburner.test.in 3.72 KB
Newer Older
Uwe Schulzweida's avatar
Uwe Schulzweida committed
1
#! @BASH@
2
3
#
AFTERTESTFILE=ECHAM5_T42L19.grb
4
5
if [ -f "$CDOTESTDATA/$AFTERTESTFILE" -a "@ENABLE_CGRIBEX@" = yes ]; then
  echo 1..4 # Number of tests to be executed.
6
else
7
  echo 1..1 # Number of tests to be executed.
8
fi
Uwe Schulzweida's avatar
Uwe Schulzweida committed
9
10
11
12
#
test -n "$CDO"      || CDO=cdo
test -n "$DATAPATH" || DATAPATH=./data
#
13
ABSLIMMAX=0.0001
14
15
CDOOUT=cout$$
CDOERR=cerr$$
Uwe Schulzweida's avatar
Uwe Schulzweida committed
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
FORMAT=""
NTEST=1
######################################################
IFILE=$DATAPATH/gp2sp_ref
RFILE=$DATAPATH/sp2gp_ref
OFILE=sp2gp_res
#
RSTAT=0
SELECT="TYPE=20 FORMAT=1"
CDOTEST="$SELECT"
CDOCOMMAND="$CDO $FORMAT after $IFILE $OFILE"
echo "$CDOCOMMAND"
echo $SELECT | $CDOCOMMAND
test $? -eq 0 || let RSTAT+=1
#
31
$CDO diff,$ABSLIMMAX $OFILE $RFILE > $CDOOUT 2> $CDOERR
Uwe Schulzweida's avatar
Uwe Schulzweida committed
32
33
34
35
36
37
38
39
40
41
test $? -eq 0 || let RSTAT+=1
test -s $CDOOUT && let RSTAT+=1
cat $CDOOUT $CDOERR
#
test $RSTAT -eq 0 && echo "ok $NTEST - $CDOTEST"
test $RSTAT -eq 0 || echo "not ok $NTEST - $CDOTEST"
#
let NTEST+=1
rm -f $OFILE
rm -f $CDOOUT $CDOERR
42
######################################################
43
if [ -f "$CDOTESTDATA/$AFTERTESTFILE" -a "@ENABLE_CGRIBEX@" = yes ]; then
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
######################################################
SELECT=bot
IFILE=$CDOTESTDATA/$AFTERTESTFILE
RFILE=$CDOTESTDATA/after_${SELECT}_ref
OFILE=after_${SELECT}_res
#
RSTAT=0
CDOTEST="$SELECT"
CDOCOMMAND="$CDO $FORMAT after $IFILE $OFILE"
echo "$CDOCOMMAND"
$CDOCOMMAND << EOR
  CODE=91,92,93,94,95,96,97,102,103,104,105,106,107,108,109,110,111,112,113,
       114,115,116,117,119,120,121,122,123,124,125,126,
       129,134,139,140,141,142,143,144,145,146,147,150,151,160,161,164,165,166,
       167,168,169,171,175,176,177,178,179,180,181,182,184,
       185,186,187,188,193,197,203,204,205,206,207,208,209,
       210,211,213,214,216,218,221,222,230,231,233,260
  TYPE=20
  FORMAT=1
  MEAN=1
EOR
test $? -eq 0 || let RSTAT+=1
#
67
$CDO diff,$ABSLIMMAX $OFILE $RFILE > $CDOOUT 2> $CDOERR
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
test $? -eq 0 || let RSTAT+=1
test -s $CDOOUT && let RSTAT+=1
cat $CDOOUT $CDOERR
#
test $RSTAT -eq 0 && echo "ok $NTEST - $CDOTEST"
test $RSTAT -eq 0 || echo "not ok $NTEST - $CDOTEST"
#
let NTEST+=1
rm -f $OFILE
rm -f $CDOOUT $CDOERR
######################################################
SELECT=atm
IFILE=$CDOTESTDATA/$AFTERTESTFILE
RFILE=$CDOTESTDATA/after_${SELECT}_ref
OFILE=after_${SELECT}_res
#
RSTAT=0
CDOTEST="$SELECT"
CDOCOMMAND="$CDO $FORMAT after $IFILE $OFILE"
echo "$CDOCOMMAND"
$CDOCOMMAND << EOR
  CODE=130,131,132,133,135,153,154,156,157,223
  LEVEL=100000,92500,85000,77500,70000,60000,50000,40000,30000,25000,
         20000,15000,10000,7000,5000,3000,2000,1000,700,500,300,200,100,50,20,10
  TYPE=30
  FORMAT=1
  MEAN=1
EOR
test $? -eq 0 || let RSTAT+=1
#
98
$CDO diff,$ABSLIMMAX $OFILE $RFILE > $CDOOUT 2> $CDOERR
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
test $? -eq 0 || let RSTAT+=1
test -s $CDOOUT && let RSTAT+=1
cat $CDOOUT $CDOERR
#
test $RSTAT -eq 0 && echo "ok $NTEST - $CDOTEST"
test $RSTAT -eq 0 || echo "not ok $NTEST - $CDOTEST"
#
let NTEST+=1
rm -f $OFILE
rm -f $CDOOUT $CDOERR
######################################################
SELECT=atm2
IFILE=$CDOTESTDATA/$AFTERTESTFILE
RFILE=$CDOTESTDATA/after_${SELECT}_ref
OFILE=after_${SELECT}_res
#
RSTAT=0
CDOTEST="$SELECT"
CDOCOMMAND="$CDO $FORMAT after $IFILE $OFILE"
echo "$CDOCOMMAND"
$CDOCOMMAND << EOR
  CODE=138,148,149,155
  LEVEL=100000,92500,85000,77500,70000,60000,50000,40000,30000,25000,
         20000,15000,10000,7000,5000,3000,2000,1000,700,500,300,200,100,50,20,10
  TYPE=70
  FORMAT=1
  MEAN=1
EOR
test $? -eq 0 || let RSTAT+=1
#
129
$CDO diff,$ABSLIMMAX $OFILE $RFILE > $CDOOUT 2> $CDOERR
130
131
132
133
134
135
136
137
138
139
140
141
test $? -eq 0 || let RSTAT+=1
test -s $CDOOUT && let RSTAT+=1
cat $CDOOUT $CDOERR
#
test $RSTAT -eq 0 && echo "ok $NTEST - $CDOTEST"
test $RSTAT -eq 0 || echo "not ok $NTEST - $CDOTEST"
#
let NTEST+=1
rm -f $OFILE
rm -f $CDOOUT $CDOERR
######################################################
fi
Uwe Schulzweida's avatar
Uwe Schulzweida committed
142
143
#
exit 0