ctest UNRES-Dock wham update
[unres.git] / ctest / dock / wham_check.sh
1 #!/bin/bash
2
3 if [ "$1" == "wham" ]; then
4  file=wham.thermal
5 else
6  exit 1
7 fi
8
9 # Check if file exist
10 if [ ! -f $file ]; then
11     echo "CRITICAL: out $file do not exist"
12     exit 2
13 fi
14
15 error=0
16 max=`awk '{print $1,$7*1}' $file | sort -n -k 2 | awk 'END{print $1}'`
17 echo 'T of max Cv(T) ' $max
18 rms=`awk '{if ($1<280) {a=a+$5;n++}}END{print a/n}' $file`
19 echo 'average rms for T<280 ' $rms
20
21  if [ `grep differs wham.out* |wc -l` != "0" ]; then
22   echo 'ERROR: energy differs remarkably from  the value read in'  
23   echo 'first 10 warnings'
24   grep differs wham.out*|head -10
25   error=1
26  fi
27
28  if [ `echo "a=$max-268;if(0>a)a*=-1;a>100.0"|bc -l` != "0" ]; then
29   echo 'ERROR wrong T max of Cv(T) by more than 100 K'
30   error=1
31  fi
32
33  if [ `echo "$rms>1 && $rms <11"|bc -l` != "0" ]; then
34   echo 'ERROR wrong average rms not >1 && <11'
35   error=1
36  fi
37
38  if [ "$error" != "0" ];then
39    exit 1
40  fi
41