-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathget_esa.sh
executable file
·35 lines (23 loc) · 999 Bytes
/
get_esa.sh
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
#!/bin/bash
states=1
einit=0
if test -f $1 && [[ $(grep "Have a nice day." $1) ]] && [[ $(grep "sts_mom" $1) ]] ; then
outfile=$(echo $1)
if [ $(grep -c "Welcome to Q-Chem" $outfile) -gt 1 ] ; then
echo "More than one job, taking the latter one..."
if [ $(grep -c "Have a nice day." $outfile) -le 1 ] ; then echo "Second calc. not yet finished... exiting" ; exit ; fi
grep "User input: [2-9] of [2-9]" $outfile -A 1000000 > __temp.out
outfile="__temp.out"
fi
states=$(grep cis_n_roots $outfile | awk '{print $2}')
einit=$(grep "Excited state 1:" $outfile | awk '{print $8}')
for i in $(seq 2 $states) ; do
efinal=$(grep "Excited state * $i:" $outfile | awk '{print $8}')
ee=$(echo "$efinal - $einit" | bc)
fosc=$(grep "Transition Moments Between" -A200 $outfile | grep " 1 *$i " | awk '{print $6}')
echo "$ee $fosc"
done
test -f __temp.out && rm __temp.out
else
echo "File $1 does not exist, calc. not converged, or no state-to-state properties calculated"
fi