[Wien] GLLB-SC potential
tran at theochem.tuwien.ac.at
tran at theochem.tuwien.ac.at
Sun Nov 25 18:12:26 CET 2018
Dear WIEN2k users,
For those who are interested in the GLLB-SC potential for
the calculation of the band gap, I attached a modified
version of the script run_deltagllb_lapw (used for the
calculation of the discontinuity). It is necessary to use
this new version of the script if the band structure or DOS
is calculated just after run_deltagllb_lapw was executed,
otherwise the results (for the BS or DOS) will be wrong.
For more details about the GLLB-SC potential, see the
user's guide or our recent paper:
https://journals.aps.org/prmaterials/abstract/10.1103/PhysRevMaterials.2.023802
F. Tran
-------------- next part --------------
#!/bin/csh -f
unalias mv
set name = $0
set name = $name:t
set file=`pwd`
set file=$file:t
set in1new1
set in1new2
set in1orig
set it
set para
set scratch
set scratchdir
set cmplx
set so
set sp
alias sb 'shift; breaksw'
while ($#argv)
switch ($1)
case -[H|h]:
set help; sb
case -in1new:
shift; set in1new1 = '-in1new'; set in1new2 = $1; sb
case -in1orig:
set in1orig = -in1orig; sb
case -it:
set it = -it; sb
case -it1:
set it = -it1; sb
case -it2:
set it = -it2; sb
case -noHinv:
set it = -noHinv; sb
case -p:
set para = '-p'; sb
case -scratch:
shift; set scratch = '-scratch'; set scratchdir = $1; sb
case -so:
set cmplx = -c
set so = -so; sb
case -sp:
set sp = sp; sb
default:
echo "ERROR: option $1 does not exist \!"; sb
endsw
end
if ($?help) goto help
run${sp}_lapw -deltagllb ${so} ${in1new1} ${in1new2} ${in1orig} ${it} ${para} ${scratch} ${scratchdir} -i 1 -NI
set stat = $status
if ($stat) then
echo "ERROR status"
exit 1
endif
set DE = 0.0001
set DEok = 0
if ("${sp}" == "") then
set FERMI = `grep :FER ${file}.scf2 | cut -c39-`
set GAP = `grep ":GAP (global)" ${file}.scf2 | cut -c18-27`
set E1 = `echo "${FERMI} + ${GAP} - 0.00001" | bc -l`
set E2 = `echo "${FERMI} + ${GAP} + 0.0001" | bc -l`
while (${DEok} == 0)
x lapw2 -all ${E1} ${E2} ${para} ${in1orig} ${cmplx} ${so} ${scratch} ${scratchdir}
set NORMUP = `grep ":CHA " ${file}.scf2 | cut -c48-`
set NORMDN = 0.0
set NORMUPcut=`echo ${NORMUP} | cut -c1-8`
if ("${NORMUPcut}" == "0.000000") then
set E2 = `echo "${E2} + ${DE}" | bc -l`
else
mv ${file}.clmval ${file}.r2v_nonloc
set DEok = 1
endif
end
else
set FERMI = `grep :FER ${file}.scf2up | cut -c39-`
set GAP = `grep ":GAP (global)" ${file}.scf2up | cut -c18-27`
set E1 = `echo "${FERMI} + ${GAP} - 0.00001" | bc -l`
set E2 = `echo "${FERMI} + ${GAP} + 0.0001" | bc -l`
while (${DEok} == 0)
x lapw2 -up -all ${E1} ${E2} ${para} ${in1orig} ${cmplx} ${so} ${scratch} ${scratchdir}
x lapw2 -dn -all ${E1} ${E2} ${para} ${in1orig} ${cmplx} ${so} ${scratch} ${scratchdir}
set NORMUP = `grep ":CHA " ${file}.scf2up | cut -c48-`
set NORMDN = `grep ":CHA " ${file}.scf2dn | cut -c48-`
set NORMUPcut=`echo ${NORMUP} | cut -c1-8`
set NORMDNcut=`echo ${NORMDN} | cut -c1-8`
if (("${NORMUPcut}" == "0.000000") && ("${NORMDNcut}" == "0.000000")) then
set E2 = `echo "${E2} + ${DE}" | bc -l`
else
mv ${file}.clmvalup ${file}.r2v_nonloc
mv ${file}.clmvaldn ${file}.r2v_nonlocdn
set DEok = 1
endif
end
endif
if ("${sp}" == "") then
mv ${file}.vsp ${file}.vsp_save
mv ${file}.vns ${file}.vns_save
else
mv ${file}.vspup ${file}.vspup_save
mv ${file}.vspdn ${file}.vspdn_save
mv ${file}.vnsup ${file}.vnsup_save
mv ${file}.vnsdn ${file}.vnsdn_save
endif
cp ${file}.in0 ${file}.in0_orig
sed "s/.*GLLB.*/KXC EX_DELTAGLLB EC_NONE VX_LDA VC_NONE ${NORMUP} ${NORMDN} (XC_LDA,XC_PBESOL,XC_WC,XC_MBJ,XC_REVTPSS)/g" ${file}.in0_orig > ${file}.in0
x lapw0 ${para}
mv ${file}.in0_orig ${file}.in0
if ("${sp}" == "") then
mv ${file}.vsp_save ${file}.vsp
mv ${file}.vns_save ${file}.vns
else
mv ${file}.vspup_save ${file}.vspup
mv ${file}.vspdn_save ${file}.vspdn
mv ${file}.vnsup_save ${file}.vnsup
mv ${file}.vnsdn_save ${file}.vnsdn
endif
exit 0
help:
cat << theend
PROGRAM: $0
PURPOSE: to run one iteration in order to calculate the derivative
discontinuity of the GLLB-SC potential
USAGE: $name [OPTIONS] [FLAGS]
OPTIONS:
-in1new N -> create "new" in1 file after N iter (write_in1 using scf2 info)
-scratch dir -> set scratch directory (for vector files)
FLAGS:
-h/-H -> help
-sp -> for spin-polarized calculation
-p -> run k-points in parallel (needs .machine file [speed:name])
-it -> use iterative diagonalization
-it1 -> use iterative diag. with recreating H_inv (after basis change)
-it2 -> use iterative diag. with reinitialization (after basis change)
-noHinv -> use iterative diag. without H_inv
-so -> run SCF including spin-orbit coupling
-in1orig-> if present, use case.in1_orig file; do not modify case.in1
theend
exit 1
More information about the Wien
mailing list