EOF.test.in 1.45 KB
Newer Older
Uwe Schulzweida's avatar
Uwe Schulzweida committed
1
#! @BASH@
Uwe Schulzweida's avatar
Uwe Schulzweida committed
2
3
4
5
6
7
8
9
10
11
12
13
#
echo 1..2 # Number of tests to be executed.
#
test -n "$CDO"      || CDO=cdo
test -n "$DATAPATH" || DATAPATH=./data
#
export CDO_FILE_SUFFIX=NULL
export CDO_WEIGHT_MODE=off
#export CDO_SVD_MODE=danielson_lanczos
#
CDOOUT=cout$$
CDOERR=cerr$$
14
FORMAT="-f srv -b 32"
Uwe Schulzweida's avatar
Uwe Schulzweida committed
15
16
NTEST=1
######################################################
17
IFILE=$DATAPATH/psl_DJF_anom.grb
Uwe Schulzweida's avatar
Uwe Schulzweida committed
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
RFILE1=$DATAPATH/eval_ref
RFILE2=$DATAPATH/eof_ref
RFILE3=$DATAPATH/pcoeff00000
OFILE1=eval_res
OFILE2=eof_res
OFILE3=res_pcoeff
#
for MODE in jacobi danielson_lanczos; do
  export CDO_SVD_MODE=$MODE
  RSTAT=0
  CDOTEST="eof/eofcoeff - $MODE"
  CDOCOMMAND="$CDO $FORMAT eof,1 $IFILE $OFILE1 $OFILE2"
  echo "$CDOCOMMAND"

  $CDOCOMMAND
  test $? -eq 0 || let RSTAT+=1
#
  $CDO diff,1e-8 $OFILE1 $RFILE1 > $CDOOUT 2> $CDOERR
  test $? -eq 0 || let RSTAT+=1
  test -s $CDOOUT && let RSTAT+=1
#
  $CDO diff,1e-7 -abs $OFILE2 -abs $RFILE2 > $CDOOUT 2> $CDOERR
  test $? -eq 0 || let RSTAT+=1
  test -s $CDOOUT && let RSTAT+=1

  CDOCOMMAND="$CDO $FORMAT eofcoeff $OFILE2 $IFILE $OFILE3"
  echo "$CDOCOMMAND"

  $CDOCOMMAND
  test $? -eq 0 || let RSTAT+=1
#
  $CDO diff,0.02 -abs ${OFILE3}00000 -abs $RFILE3 > $CDOOUT 2> $CDOERR
  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
59
  rm -f $OFILE1 $OFILE2 ${OFILE3}00000
Uwe Schulzweida's avatar
Uwe Schulzweida committed
60
61
62
63
64
done
#
rm -f $CDOOUT $CDOERR
#
exit 0