-
Notifications
You must be signed in to change notification settings - Fork 0
/
W2RC_ref
executable file
·72 lines (58 loc) · 1.45 KB
/
W2RC_ref
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
# Copyright (C) 2013 Thomas Carette
if [ ! -e $1 ]
then
echo "$1 do not exists"
exit
fi
nl='
'
if [ "$4" == 'Ne' ]
then
actc="2${nl}2${nl}6${nl}"
orb="3s 3p 3d 4s 4p 4d 4f 5s 5p 5d 5f 5g 6s 6p 6d 6f 6g 6h 7s 7p 7d 7f 7g 7h 7i 8s 8p 8d 8f 8g 8h 8i 8k 9s 9p 9d 9f 9g 9h 9i 9k 9l :s :p :d :f :g :h :i :k :l :m ;s ;p ;d ;f ;g ;h ;i ;k ;l ;m ;n <s <p <d <f <g <h <i <k <l <m <n =s =p =d =f =g =h =i =k =l =m =n ?s ?p ?d ?f ?g ?h ?i ?k ?l ?m ?n >s >p >d >f >g >h >i >k >l >m >n"
else
actc=''
orb="1s 2s 2p 3s 3p 3d 4s 4p 4d 4f 5s 5p 5d 5f 5g 6s 6p 6d 6f 6g 6h 7s 7p 7d 7f 7g 7h 7i 8s 8p 8d 8f 8g 8h 8i 8k 9s 9p 9d 9f 9g 9h 9i 9k 9l :s :p :d :f :g :h :i :k :l :m ;s ;p ;d ;f ;g ;h ;i ;k ;l ;m ;n <s <p <d <f <g <h <i <k <l <m <n =s =p =d =f =g =h =i =k =l =m =n ?s ?p ?d ?f ?g ?h ?i ?k ?l ?m ?n >s >p >d >f >g >h >i >k >l >m >n"
fi
order=""
if [ -e clist.ref ]
then
echo "WARNING: clist.ref exists. Assuming customized subshell ordering"
order="u"
fi
for i in $( seq 1 $2 )
do
act=''
line=$( head -$i $1 | tail -1 )
echo $line
for o in $orb
do
str=$(echo $line | grep -o "${o}(.." )
if [ ! "$str" == '' ]
then
occ=${str:4:5}
else
occ=0
fi
act=${act}${occ}${nl}
done
a='a'
if [ $i == 1 ]
then
a=''
fi
act="${act} $3 $4 ${nl} 0${nl}"
jjgen > .bid 2>/dev/null <<!
${a}
${u}
15
n
15
${actc}${act}
!
grep "configuration state" .bid
rm .bid
mv clist.out clist.inp
done
mv clist.inp MR$2_RCI.c