Example: Applying a Magnetic Field (S . B)
******************************************

"Download BFieldB.run"

   #!/bin/bash

   myreport () {
     mX=`$AMSBIN/amsreport $AMS_JOBNAME.results -k "Properties%Value(2)#6.3f" | awk '{print $1}'`
     mY=`$AMSBIN/amsreport $AMS_JOBNAME.results -k "Properties%Value(2)#6.3f" | awk '{print $2}'`
     mZ=`$AMSBIN/amsreport $AMS_JOBNAME.results -k "Properties%Value(2)#6.3f" | awk '{print $3}'`
     energy=`$AMSBIN/amsreport $AMS_JOBNAME.results -k "AMSResults%Energy#10.6f"`
     nCycles=`$AMSBIN/amsreport $AMS_JOBNAME.results -k "SCCLogger%nEntries"`
     printf "%20s %10s %10.3f %10.3f %10.3f %10s\n"  $BFieldComp $nCycles $mX $mY $mZ $energy
   }

   LC_NUMERIC=en_US.UTF-8

   export NSCM=1

   BField=1.0e-1

   BFieldComp=bY

   report=report.txt

   echo "" > $report

   echo "We run a H atom with three different directions of a finite B field" >> $report
   echo "with the NonCollinear model." >> $report
   echo "This way the magnetization vector m should align with the B field vector." >> $report

   printf "\n%20s %10s %10s %10s %10s %10s\n" "BField" "nCycles" "mX" "mY" "mZ" "energy" >> $report

   for BFieldComp in bX bY bZ
   do

   export AMS_JOBNAME=H.$BFieldComp

   $AMSBIN/ams --delete-old-results <<eor

   Task SinglePoint

   System
     Atoms
       H 0 0 0
     End
   End

   Engine Band

     Relativity
       Level Spin-Orbit
     End

     xc
       SpinOrbitMagnetization NonCollinear
     End

     BField
       Unit a.u.
       $BFieldComp $BField
     End

     Print AtomicChargesDetails
   EndEngine
   eor

   myreport >> $report

   done

   echo "begin report"
   cat $report
   echo "end report"
