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