#!/bin/bash # some env. variables to control settings unr=no k_quality=Normal DOSLINE="DOS CalcPDos=true Energies=300 AbsoluteMaxMin=yes Min=-0.3 Max=0.2" BANDSTTRUCTURELINE="BandStructure Enabled=true DeltaK=0.03" cat << eor > convergence.inc SCF Method=DIIS Convergence Criterion=1e-8 eor report=report.txt echo "" > $report base=test.unr=$unr.k_quality=$k_quality export AMS_JOBNAME=$base # First calculation, where we "forget" to request the PDOS and BandStructure, or did not satisfactory settings for those. $AMSBIN/ams --delete-old-results << eor Task SinglePoint System Atoms Cu -1.014698231 -0.585836297 0.414248818 Ni 1.014698231 0.585836297 -0.414248818 End Lattice 4.058792924 0.000000000 0.000000000 2.029396462 3.515017781 0.000000000 End End Engine Band Unrestricted $unr KSpace Quality=$k_quality @include convergence.inc $DOSLINE $BANDSTTRUCTURELINE EndEngine eor export AMS_JOBNAME=$base.betterk # We could have done the calculation with a better k-grid $AMSBIN/ams --delete-old-results << eor Task SinglePoint System Atoms Cu -1.014698231 -0.585836297 0.414248818 Ni 1.014698231 0.585836297 -0.414248818 End Lattice 4.058792924 0.000000000 0.000000000 2.029396462 3.515017781 0.000000000 End End Engine Band Unrestricted $unr KSpace Quality $k_quality Regular DoubleCount=1 # use a twice as dense k-grid. You could also use a better KSpace%Quality, or set a more dense grid otherwise. End @include convergence.inc $DOSLINE $BANDSTTRUCTURELINE EndEngine eor $AMSBIN/amspython $AMSHOME/scripting/tools/comparekf.py --dot-product $base.results/band.rkf $base.betterk.results/band.rkf "DOS%Total DOS" >> $report # We can request the dos and band structure simply restarting the SCF. export AMS_JOBNAME=$base.restartscf $AMSBIN/ams --delete-old-results << eor Task SinglePoint LoadSystem File $base.results/ams.rkf End Engine Band Unrestricted $unr KSpace Quality=$k_quality Restart File $base.results/band.rkf SCF true End @include convergence.inc $DOSLINE $BANDSTTRUCTURELINE EndEngine eor # We can also request both the DOS and BandStructure in a restart, avoiding restarting the SCF export AMS_JOBNAME=$base.restartdos $AMSBIN/ams --delete-old-results << eor Task SinglePoint LoadSystem File $base.results/ams.rkf End Engine Band Unrestricted $unr KSpace Quality=$k_quality Restart File $base.restartscf.results/band.rkf # can as well be restarted from $base.results/band.rkf. this restart used for the most precise comparison Dos true BandStructure true End @include convergence.inc $DOSLINE $BANDSTTRUCTURELINE EndEngine eor $AMSBIN/amspython $AMSHOME/scripting/tools/comparekf.py --dot-product $base.results/band.rkf $base.restartscf.results/band.rkf "DOS%Total DOS" >> $report $AMSBIN/amspython $AMSHOME/scripting/tools/comparekf.py --dot-product $base.results/band.rkf $base.restartdos.results/band.rkf "DOS%Total DOS" >> $report $AMSBIN/amspython $AMSHOME/scripting/tools/comparekf.py --dot-product $base.restartscf.results/band.rkf $base.restartdos.results/band.rkf "DOS%Total DOS" >> $report # We can even use a better k-space sampling which improves the DOS. BandStructure not affected. export AMS_JOBNAME=$base.restartdosbetterk $AMSBIN/ams --delete-old-results << eor Task SinglePoint LoadSystem File $base.results/ams.rkf End Engine Band Unrestricted $unr KSpace Quality $k_quality Regular DoubleCount=1 # use a twice as dense k-grid. You could also use a better KSpace%Quality, or set a more dense grid otherwise. End Restart File $base.results/band.rkf Dos true BandStructure true End @include convergence.inc $DOSLINE $BANDSTTRUCTURELINE EndEngine eor $AMSBIN/amspython $AMSHOME/scripting/tools/comparekf.py --dot-product $base.betterk.results/band.rkf $base.restartdosbetterk.results/band.rkf "DOS%Total DOS" >> $report echo "begin report" cat $report echo "end report"