#!/bin/ksh #Run the LMTO code (initialization and all) for a series of #lattice constants #JMS NRL 2/28/02 # Group of lattice constants to run lats="8.55 8.60 8.62 8.64 8.66 8.70 8.75" #lats="8.45 8.51 8.52 8.53 8.54" #lats="8.55" #lats="8.56 8.57 8.58 8.59" #lats="8.61 8.63" # Configuration of atoms for the calculations Ti_conf="CONF=4 4 3 4 IDXDN=1 2 1" O_conf="CONF=2 2 3 4 IDXDN=1 1 2" E_conf="CONF=1 2 3 4 IDXDN=1 1 2" E1_conf="CONF=1 2 3 4 IDXDN=1 1" atoms="Ti O E E1" # Structure information spgr_num=136 # space group number # Prefix (just for output of the data to distinct directories) case=tio2_rutile # C/A ratio c_a=0.644064772 # Loop over the lattice constants for a in $lats; do mkdir $case.$a cd $case.$a c=$(echo $a $c_a | awk '{printf "%12.8f \n", $1*$2}') # Should be customized for each type of case considered cat >| init.in << EOF $spgr_num # space group number 1 # origin choice / # atomic units $a # A $c # C Ti # Atom 1 0.0 0.0 0.0 # Position(1) O # Atom 2 0.3053 0.3053 0.0 # Position(2) q # Out of atoms EOF # LMTO initialization lminit < init.in lmhart lmes sed 's/VERBOS=30/VERBOS=50/' CTRL >| CTRL.2 mv -f CTRL.2 CTRL lmctl sed 's/NIT=30/NIT=80/g' CTRL >| CTRL.2 mv -f CTRL.2 CTRL # Now put in the atomic descriptions by hand for a in $atoms; do line=$(grep "ATOM="$a" Z=" CTRL ) nline=$(grep -n "ATOM="$a" Z=" CTRL | sed 's/:/\ /g' | awk '{print $1}') nline=$((nline+1)) if [ $nline -eq 1 ]; then echo "Correcting for Short Atom Name" line=$(grep "ATOM="$a" Z=" CTRL ) nline=$(grep -n "ATOM="$a" Z=" CTRL | sed 's/:/\ /g' | awk '{print $1}') else nline=$((nline-1)) fi csplit CTRL $nline mv xx00 CTRL mv xx01 tmp csplit tmp 2 if [ $a = 'Ti' ]; then echo $a echo "Ti configuration" conf=$Ti_conf elif [ $a = 'O' ]; then echo $a echo "O configuration" conf=$O_conf elif [ $a = 'E' ]; then echo $a echo "E configuration" conf=$E_conf else echo $a echo "E1 configuration" conf=$E1_conf fi echo $conf l1=$(awk '{print $1, $2, $3, $4, $5}' xx00 ) l2=$(awk '{print $1}' xx00) if [ $l2 = "CLASS" ]; then echo $l1 $conf >> CTRL else echo " " $l1 $conf >> CTRL fi cat xx01 >> CTRL done lmctl lmstr # LMTO self-consistency lm cd .. done exit 0