-
Notifications
You must be signed in to change notification settings - Fork 0
/
runstruct_vib
61 lines (52 loc) · 1.98 KB
/
runstruct_vib
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
#!/bin/csh
set wrap="lammps.wrap"
set strfile="str_hint.out"
if ( ! -e $strfile ) then
set strfile="str.out"
endif
echo 'start calc '`pwd | awk -F '/' '{print $9,"/",$10}'`' '`date +'%Y%m%d %T %z'`'' >> record.atat
#Transform POSCAR to LAMMPS in-file
python3 ../atat_wrap/POSCAR_lmp.py
#if ( ! -e ener.dat ) then
# echo 'end badstr '`pwd | awk -F '/' '{print $9,"/",$10}'`' '`date +'%Y%m%d %T %z'`'' >> record.atat
# echo 'bad structure' >! error
# exit 1
#endif
#Echo Atom masses to LAMMPS in-file
echo 'Masses' >> ener.dat
echo ' ' >> ener.dat
echo '1 14' >> ener.dat
#Structure optimization
lmp_mpi -in ../atat_wrap/in.lammps_minimize
#Check optimizaton result
set finE=`grep "Energy initial" log.lammps -A1 | tail -n 1 | awk '{print $3}'`
echo 'final_energy '$finE'' >! finalEner.out
if ((`grep -o 'e+' finalEner.out | wc -l` >= 1)) then
echo 'end lammps '`pwd | awk -F '/' '{print $9,"/",$10}'`' '`date +'%Y%m%d %T %z'`'' >> record.atat
echo 'minimize failed' >! error
exit 1
else if ((`echo ''$finE' > 2000' | bc` == 1) || (`echo ''$finE' < (-2000)' | bc` == 1)) then
echo 'end lammps '`pwd | awk -F '/' '{print $9,"/",$10}'`' '`date +'%Y%m%d %T %z'`'' >> record.atat
echo 'minimize failed' >! error
exit 1
endif
#Calculate vibrational free energy at T
phonolammps ../atat_wrap/in.lammps_data --dim 1 1 1
phonopy -c POSCAR ../atat_wrap/mesh.conf
set T=$argv
set f=`python ../atat_wrap/read_thermal_properties.py $T`
set eEeV=`cat DFTener | awk '{print $1}'`
###Set eEeV=`cat finalEner.out | awk '{print $2}'`
set eE=`echo ''$eEeV' * 96.48534' | bc`
#Calculate total free energy in kJ/mol
set totE=`echo ''$f' + '$eE'' | bc`
echo $totE >! enertot
#Check and write energy file
set l=`wc -c enertot | awk '{print $1}'`
if ( $l != '1' ) then
echo 'end normal '`pwd | awk -F '/' '{print $9,"/",$10}'`' '`date +'%Y%m%d %T %z'`'' >> record.atat
mv enertot energy
else
echo 'end unknwn '`pwd | awk -F '/' '{print $9,"/",$10}'`' '`date +'%Y%m%d %T %z'`'' >> record.atat
mv enertot error
endif