# This is the script to connect ABCluster with xTB.
#
# What you can change: arguments of xtb like --chrg, --gfn, --uhf, etc.
#

cp $1 $3.xyz 
xtb -o --chrg 0 --gfn 2 $3.xyz > $3.out 2>/dev/null

# Do NOT change things below!
energy=`awk 'NR==2{print $2}' xtbopt.xyz` ; sed  "2s/^.*/${energy}/g" xtbopt.xyz > $2
rm -rf $3.xyz $3.out charges wbo xtbopt.log xtbopt.xyz xtbrestart xtbtopo.mol .xtboptok