-
Notifications
You must be signed in to change notification settings - Fork 0
/
W2BPC_SDred
executable file
·137 lines (114 loc) · 2.27 KB
/
W2BPC_SDred
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#!/bin/bash
# Copyright (C) 2013 Thomas Carette
if [ ! -e $1 ]
then
echo "$1 do not exists"
exit
fi
nl='
'
s[4]=4
s[5]=5
s[6]=6
s[7]=7
s[8]=8
s[9]=9
s[10]=':'
s[11]=';'
s[12]='<'
s[13]='='
s[14]='?'
s[15]='>'
if [ $6 -gt 10 ]
then
nlm=10
else
nlm=$6
fi
lm='spdfghiklmn'
for i in $( seq 1 15 )
do
im=$(( i - 1 ))
if [ $im -gt $nlm ]
then
lmax[$i]=${lm:$nlm:1}
else
lmax[$i]=${lm:$im:1}
fi
done
j=$5
echo "------------------"
echo ${j}_$2
echo "------------------"
if [ -e ${j}_$2.c ]
then
continue
fi
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"
orb=$( echo ${orb%${s[$j]}*} | sed 's/.[h,i,k,l,m,n]//g' )
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"
orb=$( echo ${orb%${s[$j]}*} | sed 's/.[h,i,k,l,m,n]//g' )
fi
if [ ! -e MR$2.c ]
then
echo "Missing" MR$2.c
exit
fi
cp MR$2.c mrlist
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} $4 ${nl} $3 ${nl} 9 ${nl} 1 ${nl}${nl}${nl}2${nl}"
lsgen <<! # > .bid 2>/dev/null <<!
${a}
B
${u}
$j
${lmax[$j]}
$j
${actc}${act}
!
grep "configuration state" .bid
rm .bid
echo "reducing..."
mv clist.out cfg.inp
lsreduce # >.bid
grep "configuration state" .bid
rm .bid
mv clist.out clist.inp
echo "restoring order..."
lsgen <<! # &>/dev/null<<!
r
!
mv clist.out clist.inp
done
mv clist.inp ${j}_$2.c