quantum-espresso/NEB/examples/ESM_example/run_example_ESM

244 lines
6.3 KiB
Bash
Executable File

#!/bin/sh
###############################################################################
##
## ESM EXAMPLE
##
###############################################################################
EXAMPLE_DIR=`pwd`
# check whether echo has the -e option
if test "`echo -e`" = "-e" ; then ECHO=echo ; else ECHO="echo -e" ; fi
$ECHO
$ECHO "run_example_ESM : starting"
$ECHO
$ECHO "This example shows how to use neb.x to calculate the"
$ECHO "minimum energy path (MEP) of the H atom on Al(001) surface"
$ECHO "with ESM method."
$ECHO
# set the needed environment variables
. ../../../environment_variables
# required executables and pseudopotentials
BIN_LIST="neb.x"
PSEUDO_LIST="Al.pbe-n-van.UPF H.pbe-van_ak.UPF"
$ECHO
$ECHO " executables directory: $BIN_DIR"
$ECHO " pseudo directory: $PSEUDO_DIR"
$ECHO " temporary directory: $TMP_DIR"
$ECHO " checking that needed directories and files exist...\c"
# check for directories
for DIR in "$BIN_DIR" "$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_DIR" "$EXAMPLE_DIR/results" ; do
if test ! -d $DIR ; then
mkdir $DIR
fi
done
cd $EXAMPLE_DIR/results
# check for executables
for FILE in $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 pseudopotentials
for FILE in $PSEUDO_LIST ; do
if test ! -r $PSEUDO_DIR/$FILE ; then
$ECHO
$ECHO "Downloading $FILE to $PSEUDO_DIR...\c"
echo $WGET $PSEUDO_DIR/$FILE $NETWORK_PSEUDO/$FILE
$WGET $PSEUDO_DIR/$FILE $NETWORK_PSEUDO/$FILE 2> /dev/null
fi
if test $? != 0; then
$ECHO
$ECHO "ERROR: $PSEUDO_DIR/$FILE not existent or not readable"
$ECHO "Aborting"
exit 1
fi
done
$ECHO " done"
# how to run executables
PW_COMMAND="$PARA_PREFIX $BIN_DIR/pw.x $PARA_POSTFIX"
NEB_COMMAND="$PARA_PREFIX $BIN_DIR/neb.x $PARA_POSTFIX"
$ECHO
$ECHO " running Born-Oppenheimer NEB as: $NEB_COMMAND"
$ECHO
# NEB calculation for Al001+H with bc3 (vacuum-slab-metal),
cat > Al001+H_bc3.in << EOF
BEGIN
BEGIN_PATH_INPUT
&PATH
restart_mode = 'from_scratch',
string_method = 'neb',
nstep_path = 50,
opt_scheme = 'broyden',
num_of_images = 5,
/
END_PATH_INPUT
BEGIN_ENGINE_INPUT
&CONTROL
prefix = 'Al001+H_bc3'
outdir = '$TMP_DIR/',
pseudo_dir = '$PSEUDO_DIR/',
/
&SYSTEM
ibrav = 0,
nat = 5,
ntyp = 2,
ecutwfc = 20.0,
occupations = 'smearing',
nosym = .TRUE.
smearing = 'mv',
degauss = 0.02,
assume_isolated='esm',
esm_bc='bc3',
/
&ELECTRONS
mixing_beta = 0.3,
/
ATOMIC_SPECIES
Al 26.981538 Al.pbe-n-van.UPF
H 1.00794 H.pbe-van_ak.UPF
BEGIN_POSITIONS
FIRST_IMAGE
ATOMIC_POSITIONS bohr
Al 0.00000000 0.00000000 0.00000000 0 0 0
Al 5.41113843 0.00000000 0.00000000 0 0 0
Al 0.00000000 5.41113843 0.00000000 0 0 0
Al 5.41113843 5.41113843 0.00000000 0 0 0
H 0.00000000 0.00000000 3.11055367 0 0 1
LAST_IMAGE
ATOMIC_POSITIONS bohr
Al 0.00000000 0.00000000 0.00000000 0 0 0
Al 5.41113843 0.00000000 0.00000000 0 0 0
Al 0.00000000 5.41113843 0.00000000 0 0 0
Al 5.41113843 5.41113843 0.00000000 0 0 0
H 5.41113843 5.41113843 3.11055367 0 0 1
END_POSITIONS
K_POINTS automatic
6 6 1 1 1 0
CELL_PARAMETERS bohr
10.82227686 0.00000000 0.00000000
0.00000000 10.82227686 0.00000000
0.00000000 0.00000000 22.67672253
END_ENGINE_INPUT
END
EOF
$ECHO " running NEB calculation for Al001+H with ESM (constant-N)"
$NEB_COMMAND -inp Al001+H_bc3.in > Al001+H_bc3.out
check_failure $?
$ECHO " done"
# clean current dir & $TMP_DIR
$ECHO " cleaning ./ & $TMP_DIR...\c"
rm -rf neb.dat pw_1.in pw_2.in out.1_0 out.2_0
rm -rf $TMP_DIR/Al001+H_bc3.*
rm -rf $TMP_DIR/Al001+H_bc3_*/Al001+H_bc3.save
rm -rf $TMP_DIR/Al001+H_bc3_*/Al001+H_bc3.update
rm -rf $TMP_DIR/Al001+H_bc3_*/Al001+H_bc3.wfc*
rm -rf $TMP_DIR/Al001+H_bc3_*/PW.out
mv $TMP_DIR/Al001+H_bc3_* .
# NEB calculation for Al001+H with bc3 (vacuum-slab-metal).
# Constant-N calculation with tot_charge = 0.0215
cat > Al001+H_bc3_n215.in << EOF
BEGIN
BEGIN_PATH_INPUT
&PATH
restart_mode = 'from_scratch',
string_method = 'neb',
nstep_path = 50,
opt_scheme = 'broyden',
num_of_images = 5,
/
END_PATH_INPUT
BEGIN_ENGINE_INPUT
&CONTROL
prefix = 'Al001+H_bc3_n215'
outdir = '$TMP_DIR/',
pseudo_dir = '$PSEUDO_DIR/',
/
&SYSTEM
ibrav = 0,
nat = 5,
ntyp = 2,
ecutwfc = 20.0,
occupations = 'smearing',
nosym = .TRUE.
smearing = 'mv',
degauss = 0.02,
assume_isolated='esm',
esm_bc='bc3',
tot_charge = 0.0215,
/
&ELECTRONS
mixing_beta = 0.3,
/
ATOMIC_SPECIES
Al 26.981538 Al.pbe-n-van.UPF
H 1.00794 H.pbe-van_ak.UPF
BEGIN_POSITIONS
FIRST_IMAGE
ATOMIC_POSITIONS bohr
Al 0.00000000 0.00000000 0.00000000 0 0 0
Al 5.41113843 0.00000000 0.00000000 0 0 0
Al 0.00000000 5.41113843 0.00000000 0 0 0
Al 5.41113843 5.41113843 0.00000000 0 0 0
H 0.00000000 0.00000000 3.11055367 0 0 1
LAST_IMAGE
ATOMIC_POSITIONS bohr
Al 0.00000000 0.00000000 0.00000000 0 0 0
Al 5.41113843 0.00000000 0.00000000 0 0 0
Al 0.00000000 5.41113843 0.00000000 0 0 0
Al 5.41113843 5.41113843 0.00000000 0 0 0
H 5.41113843 5.41113843 3.11055367 0 0 1
END_POSITIONS
K_POINTS automatic
6 6 1 1 1 0
CELL_PARAMETERS bohr
10.82227686 0.00000000 0.00000000
0.00000000 10.82227686 0.00000000
0.00000000 0.00000000 22.67672253
END_ENGINE_INPUT
END
EOF
$ECHO " running NEB calculation for Al001+H with ESM (constant-N)"
$NEB_COMMAND -inp Al001+H_bc3_n215.in > Al001+H_bc3_n215.out
check_failure $?
$ECHO " done"
# clean current dir & $TMP_DIR
$ECHO " cleaning ./ & $TMP_DIR...\c"
rm -rf neb.dat pw_1.in pw_2.in out.1_0 out.2_0
rm -rf $TMP_DIR/Al001+H_bc3_n215.*
rm -rf $TMP_DIR/Al001+H_bc3_n215_*/Al001+H_bc3_n215.save
rm -rf $TMP_DIR/Al001+H_bc3_n215_*/Al001+H_bc3_n215.update
rm -rf $TMP_DIR/Al001+H_bc3_n215_*/Al001+H_bc3_n215.wfc*
rm -rf $TMP_DIR/Al001+H_bc3_n215_*/PW.out
mv $TMP_DIR/Al001+H_bc3_n215_* .
# clean TMP_DIR
$ECHO " cleaning $TMP_DIR...\c"
rm -rf $TMP_DIR/
$ECHO " done"
$ECHO
$ECHO "run_example_ESM: done"