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