##################generat POTCAR for DFT############################
rm POTCAR
cat>INPUT!
vaspkit < INPUT
rm INPUT ################################DFT STATE##############################
mkdir ${filename_dft}
cd ${filename_dft}
cp ../INCAR ../POSCAR ../POTCAR ../KPOINTS ./ ##run##
bash ../run.wsy
cd .. ######################################################################### #calculation DFT #calculate U_{eff}
mkdir "2-NCSF+SCF"
cd "2-NCSF+SCF"
for i in $(seq ${MIN} ${STEP} ${MAX})
do
mkdir -- "$i"
cd -- $i
mkdir ${filename_NCSF_SCF_1} ${filename_NCSF_SCF_2} ### 2-/
cp ../../INCAR ../../POSCAR ../../POTCAR ../../KPOINTS ${filename_NCSF_SCF_1}
cp ../../INCAR ../../POSCAR ../../POTCAR ../../KPOINTS ${filename_NCSF_SCF_2} ####
cd ${filename_NCSF_SCF_1}
echo "ICHARG=11">>INCAR
cd ../${filename_NCSF_SCF_2}
echo "ICHARG=1">>INCAR
cd ../../
done
echo -e "$finish"
fi ######################################## ########################################
if (( ${arg}==2 ));then
arg2=$(echo $(head -1 input.wsy|awk '{print $1}'))
arg3=$( echo $(head -2 input.wsy|tail -1|awk '{print $1}')) ######################################################################
cd ${filename_NCSF_SCF} #1
for file in $(seq ${MIN} ${STEP} ${MAX})
do
cd -- ${file} #2
for items in 1 2
do
if (( $items==1 ));then
cd ${filename_NCSF_SCF_1} #copy CHGCAR AND WAVECAR TO 2 3
cp ../../../${filename_dft}/CHGCAR ./
cp ../../../${filename_dft}/WAVECAR ./
else
cd ${filename_NCSF_SCF_2} #copy CHGCAR AND WAVECAR TO 2 3
cp ../../../${filename_dft}/CHGCAR ./
cp ../../../${filename_dft}/WAVECAR ./
fi #Calculate the number of element types