Statistiques
| Révision :

root / examples / Test / Dep_tscan_p @ 5

Historique | Voir | Annoter | Télécharger (3,23 ko)

1 4 pfleura2
#!/bin/bash
2 4 pfleura2
export LANG=C
3 4 pfleura2
if [ $# -lt 1 ]; then
4 4 pfleura2
 echo "Use: $0 File.out  [PES] [T]"
5 4 pfleura2
 exit
6 4 pfleura2
fi
7 4 pfleura2
Fout=$1
8 4 pfleura2
ItMax=`grep MAXCYC $Fout | tail -1 | awk '{print $3}'`
9 4 pfleura2
Nom=`grep PATHNAME $Fout | tail -1 | awk '{print $3}'`
10 4 pfleura2
PES=$2
11 4 pfleura2
Tgt=$3
12 4 pfleura2
13 4 pfleura2
WDir=`dirname $0`
14 4 pfleura2
15 4 pfleura2
16 4 pfleura2
NomGplot=${Nom}_p.gplot
17 4 pfleura2
if [ ! -s list ]; then
18 4 pfleura2
 echo "File list is missing"
19 4 pfleura2
 exit
20 4 pfleura2
fi
21 4 pfleura2
22 4 pfleura2
if [ -s ${Nom}_cart.0 ]; then
23 4 pfleura2
 Ext=_cart
24 4 pfleura2
elif [ -s ${Nom}.0 ]; then
25 4 pfleura2
 Ext=""
26 4 pfleura2
else
27 4 pfleura2
 echo "Cannot find ${Nom}.0 nor ${Nom}_cart.0 -- ERROR"
28 4 pfleura2
 exit
29 4 pfleura2
fi
30 4 pfleura2
31 4 pfleura2
awk -f $WDir/Dep_tgt.awk $Fout
32 4 pfleura2
cat <<EOF > $NomGplot
33 4 pfleura2
#!/usr/bin/gnuplot -persist
34 4 pfleura2
 set term x11
35 4 pfleura2
 set pointsize 2
36 4 pfleura2
 set origin 0.,0.
37 4 pfleura2
 set size square 1
38 4 pfleura2
EOF
39 4 pfleura2
let ItM=ItMax-1
40 4 pfleura2
for i in `seq 0 $ItM`
41 4 pfleura2
  do
42 4 pfleura2
 xyz2scan ${Nom}${Ext}.${i} > /dev/null
43 4 pfleura2
 mv Scan.dat ${Nom}_${i}.dat
44 4 pfleura2
if [ "$Ext" = "" ]; then
45 4 pfleura2
# We are analysing a calculation done in cartesian.
46 4 pfleura2
# We have to  analyse the spline file and maybe also the tangent file.
47 4 pfleura2
 if [ -s ${Nom}_spline.${i} ]; then
48 4 pfleura2
   xyz2scan ${Nom}_spline.${i}  > /dev/null
49 4 pfleura2
   mv Scan.dat  ${Nom}_spline_${i}.dat
50 4 pfleura2
 fi
51 4 pfleura2
 if [  -s ${Nom}_dbgtgt.${i} ]; then
52 4 pfleura2
   xyz2scan ${Nom}_dbgtgt.${i}  > /dev/null
53 4 pfleura2
   mv Scan.dat  ${Nom}_dbgtgt_${i}.dat
54 4 pfleura2
 fi
55 4 pfleura2
fi
56 4 pfleura2
57 4 pfleura2
 cat <<EOF >>  $NomGplot
58 4 pfleura2
 clear
59 4 pfleura2
 set xrange [1.:2.5]
60 4 pfleura2
 set yrange [-10:190]
61 4 pfleura2
 plot "HCN_irc.dat" u 1:3 w l
62 4 pfleura2
EOF
63 4 pfleura2
 if [ "$PES" != "" ]; then
64 4 pfleura2
  echo "replot \"HCN_PES_2D.dat\" u 1:2 w l 2, \"HCN_PES_2D.dat\" u 1:(-\$2) w l 2,\"HCN_PES_2D.dat\" u 1:(360-\$2) w l 2" >> $NomGplot
65 4 pfleura2
 fi
66 4 pfleura2
 if [ "$Ext" = "_cart" ]; then
67 4 pfleura2
   if [ -s ${Nom}_spline.${i} ]; then
68 4 pfleura2
     echo "replot \"${Nom}_${i}.dat\" u 1:3 w p 5" >> $NomGplot
69 4 pfleura2
     echo "replot \"${Nom}_spline.${i}\" u 2:4 w l" >> $NomGplot
70 4 pfleura2
   elif [  -s ${Nom}_dbgtgt.${i} ]; then
71 4 pfleura2
     echo "replot \"${Nom}_${i}.dat\" u 1:3 w p 5" >> $NomGplot
72 4 pfleura2
     echo "replot \"${Nom}_dbgtgt.${i}\" u 2:(\$4*180./pi) w l" >> $NomGplot
73 4 pfleura2
   else
74 4 pfleura2
     echo "replot \"${Nom}_${i}.dat\" u 1:3 w lp 5" >> $NomGplot
75 4 pfleura2
   fi
76 4 pfleura2
 else
77 4 pfleura2
   if [ -s ${Nom}_spline_${i}.dat ]; then
78 4 pfleura2
     echo "replot \"${Nom}_${i}.dat\" u 1:3 w p 5" >> $NomGplot
79 4 pfleura2
     echo "replot \"${Nom}_spline_${i}.dat\" u 1:3 w lp" >> $NomGplot
80 4 pfleura2
   elif [  -s ${Nom}_dbgtgt_${i}.dat ]; then
81 4 pfleura2
     echo "replot \"${Nom}_${i}.dat\" u 1:3 w p 5" >> $NomGplot
82 4 pfleura2
     echo "replot \"${Nom}_dbgtgt_${i}.dat\" u 1:3 w l" >> $NomGplot
83 4 pfleura2
   else
84 4 pfleura2
     echo "replot \"${Nom}_${i}.dat\" u 1:3 w lp 5" >> $NomGplot
85 4 pfleura2
   fi
86 4 pfleura2
 fi
87 4 pfleura2
 if [ "$Tgt" != "" ]; then
88 4 pfleura2
  echo "replot \"${Nom}_tgt_${i}.dat\" u 1:3 w l" >> $NomGplot
89 4 pfleura2
 fi
90 4 pfleura2
 echo "pause -1" >> $NomGplot
91 4 pfleura2
 done
92 4 pfleura2
let i=ItMax
93 4 pfleura2
 xyz2scan ${Nom}${Ext}.${i} > /dev/null
94 4 pfleura2
 mv Scan.dat ${Nom}_${i}.dat
95 4 pfleura2
 cat <<EOF >>  $NomGplot
96 4 pfleura2
 clear
97 4 pfleura2
 set xrange [1.:2.5]
98 4 pfleura2
 set yrange [-10:190]
99 4 pfleura2
 plot "HCN_irc.dat" u 1:3 w l
100 4 pfleura2
EOF
101 4 pfleura2
 if [ "$PES" != "" ]; then
102 4 pfleura2
  echo "replot \"HCN_PES_2D.dat\" u 1:2 w l 2, \"HCN_PES_2D.dat\" u 1:(-\$2) w l 2,\"HCN_PES_2D.dat\" u 1:(360-\$2) w l 2" >> $NomGplot
103 4 pfleura2
 fi
104 4 pfleura2
 if [ -s ${Nom}_spline.${i} ]; then
105 4 pfleura2
 echo "replot \"${Nom}_${i}.dat\" u 1:3 w p 5" >> $NomGplot
106 4 pfleura2
 echo "replot \"${Nom}_spline.${i}\" u 2:4 w l" >> $NomGplot
107 4 pfleura2
 elif [  -s ${Nom}_dbgtgt_${i}.dat ]; then
108 4 pfleura2
 echo "replot \"${Nom}_${i}.dat\" u 1:3 w p 5" >> $NomGplot
109 4 pfleura2
 echo "replot \"${Nom}_dbgtgt_${i}.dat\" u 2:(\$4*180./pi) w l" >> $NomGplot
110 4 pfleura2
 else
111 4 pfleura2
 echo "replot \"${Nom}_${i}.dat\" u 1:3 w lp 5" >> $NomGplot
112 4 pfleura2
fi
113 4 pfleura2
 echo "pause -1" >> $NomGplot
114 4 pfleura2
chmod u+x $NomGplot
115 4 pfleura2
116 4 pfleura2
echo "./$NomGplot      to see the path"