-
Notifications
You must be signed in to change notification settings - Fork 1
/
run-bi2te3
152 lines (129 loc) · 3.88 KB
/
run-bi2te3
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
#!/bin/sh
# problem specific parameters
prefix='bi2te3'
pseudo_bi='Bi.rel-pbe-dn-kjpaw_psl.1.0.0.UPF'
pseudo_te='Te.rel-pbe-dn-kjpaw_psl.0.2.2.UPF'
ecutwfc=56.0
ecutrho=457.0
num_kx=8
num_ky=8
num_kz=8
num_band=90
THIS_DIR=`pwd`
# check whether echo has the -e option
if test "`echo -e`" = "-e" ; then ECHO=echo ; else ECHO="echo -e" ; fi
$ECHO
$ECHO "Starting ab initio calculations for $prefix..."
$ECHO
# set quantum espresso and wannier90 paths
. set-path
# set environment variables path
ENV_PATH=$QE_PATH/environment_variables
# set the needed environment variables
. $ENV_PATH
# override pseudopotential path
PSEUDO_DIR=$THIS_DIR/pseudo
# required executables, pseudopotentials, and directories
QE_BIN_LIST="pw.x bands.x pw2wannier90.x"
WANNIER_BIN_LIST="wannier90.x postw90.x"
PSEUDO_LIST="$pseudo_bi, $pseudo_te"
TMP_ROOT_DIR="$THIS_DIR/temp"
TMP_DIR="$THIS_DIR/temp/$prefix"
IN_DIR="$THIS_DIR/in/$prefix"
OUT_DIR="$THIS_DIR/out/$prefix"
$ECHO
$ECHO " Quantum ESSPRESSO executables directory: $BIN_DIR"
$ECHO " Wannier90 executables directory: $WANNIER_PATH"
$ECHO " Pseudopotentials directory: $PSEUDO_DIR"
$ECHO " Temporary directory: $TMP_DIR"
$ECHO "\n checking that needed directories and files exist...\c"
# check for directories
for DIR in "$BIN_DIR" "$WANNIER_PATH" "$PSEUDO_DIR" ; do
if test ! -d $DIR ; then
$ECHO
$ECHO "ERROR: $DIR not existent or not a directory"
$ECHO "Aborting"
exit 1
fi
done
for DIR in "$TMP_ROOT_DIR" "$TMP_DIR" "$OUT_DIR" ; do
if test ! -d $DIR ; then
mkdir $DIR
fi
done
cd $OUT_DIR
# check for qe executables
for FILE in $QE_BIN_LIST ; do
if test ! -x $BIN_DIR/$FILE ; then
$ECHO
$ECHO "ERROR: $BIN_DIR/$FILE not existent or not executable"
$ECHO "Aborting"
exit 1
fi
done
# check for wannier executables
for FILE in $WANNIER_BIN_LIST ; do
if test ! -x $WANNIER_PATH/$FILE ; then
$ECHO
$ECHO "ERROR: $WANNIER_PATH/$FILE not existent or not executable"
$ECHO "Aborting"
exit 1
fi
done
# check for pseudopotentials
for FILE in $PSEUDO_LIST ; do
if test $? != 0; then
$ECHO
$ECHO "ERROR: $PSEUDO_DIR/$FILE not existent or not readable"
$ECHO "Aborting"
exit 1
fi
done
$ECHO " done"
PARA_PREFIX="mpirun -np 12"
# how to run executables
PW_COMMAND="$PARA_PREFIX $BIN_DIR/pw.x $PARA_POSTFIX"
BANDS_COMMAND="$PARA_PREFIX $BIN_DIR/bands.x $PARA_POSTFIX"
PW2WANNIER90_COMMAND="$PARA_PREFIX $BIN_DIR/pw2wannier90.x $PARA_POSTFIX"
WANNIER90_COMMAND="$PARA_PREFIX $WANNIER_PATH/wannier90.x $PARA_POSTFIX"
POSTW90_COMMAND="$PARA_PREFIX $WANNIER_PATH/postw90.x $PARA_POSTFIX"
$ECHO
$ECHO " running pw.x as: $PW_COMMAND"
$ECHO " running bands.x as: $BANDS_COMMAND"
$ECHO " running pw2wannier90.x $PW2WANNIER90_COMMAND"
$ECHO " running wannier90.x $WANNIER90_COMMAND"
$ECHO " running postw90.x $POSTW90_COMMAND"
$ECHO
# $ECHO " running the structural relaxation...\c"
# . $IN_DIR/$prefix.rlx
# check_failure $?
# $ECHO " done"
# $ECHO " running the scf calculation...\c"
# . $IN_DIR/$prefix.scf
# check_failure $?
# $ECHO " done"
# $ECHO " running the nscf calculation...\c"
# . $IN_DIR/$prefix.nscf
# check_failure $?
# $ECHO " done"
# cp $IN_DIR/$prefix.win $prefix.win
# $ECHO " generating the list of required overlaps...\c"
# $WANNIER_PATH/wannier90.x -pp $prefix
# check_failure $?
# $ECHO " done"
# $ECHO " computing overlaps...\c"
# . $IN_DIR/$prefix.pw2wan
# check_failure $?
# $ECHO " done"
# cp $IN_DIR/$prefix.win $prefix.win
# $ECHO " computing maximally localized Wannier functions...\c"
# $WANNIER_PATH/wannier90.x $prefix
# check_failure $?
# $ECHO " done"
cp $IN_DIR/$prefix.win $prefix.win
$ECHO " computing spin Hall conductivity...\c"
mpirun -np 12 $WANNIER_PATH/postw90.x $prefix
check_failure $?
$ECHO " done"
# cd $THIS_DIR
# end of file