-
Notifications
You must be signed in to change notification settings - Fork 0
/
getIRCPEC
executable file
·72 lines (62 loc) · 2.54 KB
/
getIRCPEC
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# !/bin/bash
#################################################################
# Program: #
# #
# pre-requist script: #
# 1. getIRCstruc #
# 2. rev1Dstruc #
# 3. rot.py #
# #
# Input: #
# $1 = *_F.log; IRC output file #
# $2 = *_R.log; IRC output file #
# #
# History: #
# 2019/07/05, Grace #
#################################################################
function main(){
# $1 = TS*_F.log
# $2 = TS*_R.log
name_F=$(echo $1 | sed 's/.log//g')
name_R=$(echo $2 | sed 's/.log//g')
name=$(echo $name_F | sed 's/_F//g')
changeName $name_F # output: $name.xyz
# changeName $name_R
# rev1Dstruc $name_R.xyz rev.$name_R.xyz
# echo $NAtoms > new.xyz
# echo $E runpoint 1 >> new.xyz
# head -n $jobLine $name.xyz >> new.xyz
# cat rev.$name_R.xyz > $name\_IRC.xyz
# NAtoms=$(head -n 1 rev.$name_R.xyz)
# totLine=$(wc -l $name_F.xyz | awk '{print $2}')
# tail -n $(($totLine - $NAtoms -2 )) $name_F.xyz >> $name\_IRC.xyz
# rm -f rev.$name_R.xyz
}
function changeName(){
# $1 = TS*.log
name=$1
nPt=$(grep 'Total number of gradient calculations:' $name.log \
| awk '{print $6}' )
getIRCstruc $name.log $name.xyz >/dev/null 2>&1
grep -A $(( $nPt + 2 )) 'Summary of reaction path following' $name.log \
| tail -n $nPt | awk '{print $2}' > relE.dat
E_TS=$(grep 'Energies reported relative to the TS energy of' $name.log \
| awk '{print $9}' )
NAtoms=$(head -n 1 $name.xyz)
echo $NAtoms
# relE=$(head -n 1 relE.dat)
# E=$(echo $E_TS + $relE | bc)
jobLine=$(( $NAtoms + 2 ))
rm -f new.xyz
for ((i=1;i<=$nPt;i++))
do
relE=$(sed -n "$i,$i p" relE.dat)
E=$(echo $E_TS + $relE | bc)
echo $NAtoms >> new.xyz
echo $E >> new.xyz
head -n $(( $i * $jobLine )) $name.xyz | tail -n $NAtoms >> new.xyz
done
# mv new.xyz $name.xyz
# rm -f E.dat
}
main $1 $2