Loop.s: Difference between revisions

From Wiki
Jump to navigation Jump to search
New page: This is an example loop for finding the lattice constant of an FCC metal (e.g. copper). The loop creates a series of <TT>POSCAR</TT> files with primitive cell size length specified in the ...
 
Dkarhanek (talk | contribs)
mNo edit summary
Line 3: Line 3:
This cell size parameter, cell volume from <TT>OUTCAR</TT> and energy form <TT>OSZICAR</TT> are extracted into the output files.
This cell size parameter, cell volume from <TT>OUTCAR</TT> and energy form <TT>OSZICAR</TT> are extracted into the output files.


Evaluation using a proper EOS method (preferentially ''Birch-Murnaghan equation'') should follow. (Do not use quadratic regression! - it's not an equation of state (EOS)!!)
Evaluation using a proper EOS method (preferentially ''Birch-Murnaghan equation'') should follow.
(Do not use quadratic regression! - it's not an equation of state (EOS)!!)


  #!/bin/bash
  #!/bin/bash
Line 31: Line 32:
     0.000000000000000  0.000000000000000  0.000000000000000  T  T  T
     0.000000000000000  0.000000000000000  0.000000000000000  T  T  T
  !
  !
 
  echo "a= $L"
  echo "a= $L"
  mpirun -np $NSLOTS vasp
  mpirun -np $NSLOTS vasp

Revision as of 13:15, 21 September 2010

This is an example loop for finding the lattice constant of an FCC metal (e.g. copper). The loop creates a series of POSCAR files with primitive cell size length specified in the seq command (3.1 to 4.0 Å with steps of 0.1 Å, i.e. 10 runs).

This cell size parameter, cell volume from OUTCAR and energy form OSZICAR are extracted into the output files.

Evaluation using a proper EOS method (preferentially Birch-Murnaghan equation) should follow. (Do not use quadratic regression! - it's not an equation of state (EOS)!!)

#!/bin/bash
#$ -N Cu-lattice
#$ -pe c8m24_ompi 8
#$ -cwd
#$ -o vasp-ompi.out
#$ -e vasp-ompi.err
#$ -S /bin/bash
 
. /etc/profile.d/modules.sh

module load vasp/5.2
export OMP_NUM_THREADS=1

for L in `seq -f %3.1f 3.2 0.1 4.0`
do
cat >POSCAR <<!
Copper bulk - Cu1
  $L
    0.500000000000000   0.500000000000000   0.000000000000000
    0.000000000000000   0.500000000000000   0.500000000000000
    0.500000000000000   0.000000000000000   0.500000000000000
  1 
Selective dynamics
Direct
    0.000000000000000   0.000000000000000   0.000000000000000   T   T   T
!
echo "a= $L"
mpirun -np $NSLOTS vasp

V=`grep "volume " OUTCAR | tail -1 | awk '{print $5}'`
E=`tail -1 OSZICAR | awk '{print $5}'`

printf "%3.1f %6.2f %13.7f\n" $L $V $E >> SUMMARY-LVE.log
printf "%3.1f %13.7f\n" $L $E >> SUMMARY-LE.log
printf "%6.2f %13.7f\n" $V $E >> SUMMARY-VE.log
cp OSZICAR OSZICAR-$L
cp  OUTCAR  OUTCAR-$L
done

cat SUMMARY.log 
rm -f CHG* WAVE*

Note In the INCAR file, please take care that you set up a rigid calculation - NSW=1 - and that the electronic density is properly converged - NELMIN=10. The KPOINTS should define a very dense k-point grid (such as 10x10x10 or more).