-
Notifications
You must be signed in to change notification settings - Fork 0
/
getorbitals-list.sh
100 lines (89 loc) · 2 KB
/
getorbitals-list.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
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#! /bin/bash
#
# Originally by J. Song.
# Modified by R. Bjornsson and converted to bash
# Orbital list version
normal=`tput sgr0`
bold=`tput bold`
red=`tput setaf 1`
yellow=`tput setaf 3`
green=`tput setaf 2`
cyan=`tput setaf 6`
magenta=`tput setaf 5`
underline=`tput smul`
orcadir=/opt/orca_4.2.0
echo "${cyan}Using orca_plot present in $orcadir${normal}"
INPUT_FILE=$1
spin=$2
var="$@"
orbs=$(echo "${var#* }");orbs=$(echo "${orbs#* }")
echo "Orbitals : $orbs"
if [[ "$1" == "" ]]
then
echo " usage: getorbitals-list.sh gbwfile [alpha | beta | both] n1 n2 n3 ..."
echo
exit
fi
if [[ "$spin" == "alpha" ]]
then
echo "Doing: alpha orbitals..."
elif [[ "$spin" == "beta" ]]
then
echo "Doing: beta orbitals..."
elif [[ "$spin" == "both" ]]
then
echo "Doing: both alpha and beta orbitals..."
else
echo "${red}Second argument should be alpha, beta or both. Example: getorbitals-list.sh file.gbw alpha 5 9 ${normal}"
exit
fi
SPLOTFILE="SPLOT_FILE"
if [[ -e $SPLOTFILE ]]
then
rm $SPLOTFILE
fi
# grid
echo 4 >> $SPLOTFILE
echo 80 >> $SPLOTFILE
# Gaussian cube file print
echo 5 >> $SPLOTFILE
echo 7 >> $SPLOTFILE
#
for orb in $orbs
do
echo "Doing orbital: $orb"
if [[ $spin == alpha ]]
then
echo 3 >> $SPLOTFILE
echo 0 >> $SPLOTFILE
echo 2 >> $SPLOTFILE
echo $orb >> $SPLOTFILE
echo 10 >> $SPLOTFILE
fi
if [[ $spin == beta ]]
then
echo 3 >> $SPLOTFILE
echo 1 >> $SPLOTFILE
echo 2 >> $SPLOTFILE
echo $orb >> $SPLOTFILE
echo 10 >> $SPLOTFILE
fi
if [[ $spin == both ]]
then
echo 3 >> $SPLOTFILE
echo 0 >> $SPLOTFILE
echo 2 >> $SPLOTFILE
echo $orb >> $SPLOTFILE
echo 10 >> $SPLOTFILE
echo 3 >> $SPLOTFILE
echo 1 >> $SPLOTFILE
echo 2 >> $SPLOTFILE
echo $orb >> $SPLOTFILE
echo 10 >> $SPLOTFILE
fi
done
echo 11 >> $SPLOTFILE
$orcadir/orca_plot $INPUT_FILE -i < $SPLOTFILE > $SPLOTFILE.log
rm $SPLOTFILE
echo
echo "Finished plotting."