-
Notifications
You must be signed in to change notification settings - Fork 0
/
optical.sh
35 lines (24 loc) · 954 Bytes
/
optical.sh
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
#!/bin/bash
### IMPORTANT ###
# Edit as required
### INSTRUCTIONS ###
# This script makes new directory "optical" and runs optical calculation
# Run this script using: bash optical.sh
echo "-----------------------------------------------------------------------------------------------"
cd ..
mkdir optical
cd optical
cp -r ../dos/* ./
cp INCAR INCAR.st
mm=$(grep "MAGMOM" INCAR.r | awk -F "=" '{print $2}')
nb=$((3*$(grep "number of bands NBANDS" OUTCAR | awk -F "=" '{print $4}')))
mm_string="MAGMOM = $mm"
nb_string="NBANDS = $nb"
echo -e "101\nOP\n" | vaspkit > vaspkit.txt
sed -i '/NBANDS/d' INCAR #Delete pre-existing NBANDS tag in INCAR
sed -i "2 i $nb_string" INCAR #Insert NBANDS into INCAR
sed -i "2 i $mm_string" INCAR #Insert MAGMOM into INCAR
sed -i "2 i ISPIN = 2" INCAR #Insert ISPIN into INCAR
### Runing VASP ####
nohup mpirun -np $(grep -c ^processor /proc/cpuinfo) vasp
echo -e "711\n1\n" | vaspkit > vaspkit.txt