-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathalign
executable file
·72 lines (46 loc) · 1.01 KB
/
align
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
# splits an stringfile.xyz into its xyz parts
# still need to make sure there are no realignments in molden
# first arg
file=$1
# second arg
#nnodes=$2
numlines=`cat $file | wc -l`
echo " lines: $numlines"
#echo "working on $file"
# csplit operates on file, splits into 2 files (xx00 and xx01) at line 2
csplit $file 2
# cats the first line, and stores the number of atoms
natoms=`cat xx00`
#echo " natoms: $natoms"
# natomsp2 is the length of geometry
let natomsp2=natoms+2
echo " natomsp2: $natomsp2"
let nnodes=numlines/natomsp2-2
echo " nnodes: $nnodes"
#echo " natomsp2: $natomsp2"
i=0
let a=natomsp2+1
while [ $i -le $nnodes ]
do
echo "list:$list"
list="$list $a"
let a=a+natomsp2
let i=i+1
done
#exit
echo "list: $list"
csplit $file $list
i=0
let nnodes_p1=nnodes+1
while [ $i -le $nnodes_p1 ]
do
ID=`printf "%0*d\n" 2 ${i}`
echo " working on xx$ID"
python ~/bin/removeH.py xx$ID
python ~/bin/distance.py xx$ID
let i=i+1
done
cat xx*.flat > $file.a
#rm xx*
rm noH.*