#!/bin/sh #################################################################### # # set the needed environment variables # PW_ROOT=/home/sprokuda/PWscf PSEUDO_DIR=/home/sprokuda/PWscf/pseudo TMP_DIR=/scratch PARA_PREFIX= PARA_POSTFIX= # # # check whether echo needs the -e option if [ "`echo -e`" = "-e" ]; then echo='echo' else echo='echo -e' fi # $echo ' ' $echo ' running '$0':' $echo ' This example shows how to use pw.x and ph.x to calculate phonon ' $echo ' frequencies at Gamma and X for Ge in diamond structure. ' $echo ' ' # # check that needed directories and files exist # $echo ' PW_ROOT is defined as '$PW_ROOT' ' $echo ' PSEUDO_DIR is defined as '$PSEUDO_DIR' ' $echo ' TMP_DIR is defined as '$TMP_DIR' ' $echo ' ' $echo ' checking that needed directories and files exist; \c' if [ ! -d $PW_ROOT ]; then $echo;$echo ' STOPPING: directory '$PW_ROOT' does not exist'; exit else if [ ! -f $PW_ROOT/bin/pw.x ]; then echo;echo ' STOPPING: executable '$PW_ROOT/bin/pw.x' does not exist'; exit fi if [ ! -f $PW_ROOT/bin/ph.x ]; then $echo;$echo ' STOPPING: executable '$PW_ROOT/bin/ph.x' does not exist'; exit fi fi if [ ! -d $PSEUDO_DIR ]; then $echo;$echo ' STOPPING: directory '$PSEUDO_DIR' does not exist'; exit else if [ ! -f $PSEUDO_DIR/Ge.pz-bhs.UPF ]; then $echo;$echo ' STOPPING: pseudop file '$PSEUDO_DIR/Ge.pz-bhs.UPF' does not exist'; exit fi fi if [ ! -d $TMP_DIR ]; then $echo;$echo ' STOPPING: directory '$TMP_DIR' does not exist'; exit fi $echo ' done' # # clean TMP_DIR # $echo ' cleaning '$TMP_DIR' ; \c' rm -f $TMP_DIR/* $echo ' done' # # output in results/ # if [ ! -d results ]; then mkdir results fi cd results # # self-consistent calculation # cat > ge.scf.in << EOF Ge Germanium &control calculation='scf', restart_mode='from_scratch', prefix='ge' pseudo_dir = '$PSEUDO_DIR/', outdir='$TMP_DIR/' / &system ibrav = 2, celldm(1) =10.6260, nat= 2, ntyp= 1, ecutwfc = 18.0 / &electrons mixing_beta = 0.7 conv_thr = 1.0d-8 / ATOMIC_SPECIES Ge 72.61 Ge.pz-bhs.UPF ATOMIC_POSITIONS Ge 0.00 0.00 0.00 Ge 0.25 0.25 0.25 K_POINTS 10 0.1250000 0.1250000 0.1250000 1.00 0.1250000 0.1250000 0.3750000 3.00 0.1250000 0.1250000 0.6250000 3.00 0.1250000 0.1250000 0.8750000 3.00 0.1250000 0.3750000 0.3750000 3.00 0.1250000 0.3750000 0.6250000 6.00 0.1250000 0.3750000 0.8750000 6.00 0.1250000 0.6250000 0.6250000 3.00 0.3750000 0.3750000 0.3750000 1.00 0.3750000 0.3750000 0.6250000 3.00 EOF $echo ' running the scf calculation; \c' $PARA_PREFIX $PW_ROOT/bin/pw.x $PARA_POSTFIX < ge.scf.in > ge.scf.out $echo ' done' #--------------------------------------------------------------------------------------------------------------- #----------------------- 0.1 calculation ------------------------------------------- #--------------------------------------------------------------------------------------------------------------- # # non self-consistent calculation at 0.1 # cat > ge.nscf_011.in << EOF Ge Germanium &control calculation='phonon' prefix = 'ge' pseudo_dir = '$PSEUDO_DIR/', outdir='$TMP_DIR/' / &system ibrav= 2, celldm(1) =10.6260, nat= 2, ntyp= 1, ecutwfc =18.0, / &electrons conv_thr = 1.0d-8 / &phonon xqq(1)=0.0, xqq(2)=0.1, xqq(3)=0.1 / ATOMIC_SPECIES Ge 72.61 Ge.pz-bhs.UPF ATOMIC_POSITIONS Ge 0.00 0.00 0.00 Ge 0.25 0.25 0.25 K_POINTS 10 0.1250000 0.1250000 0.1250000 1.00 0.1250000 0.1250000 0.3750000 3.00 0.1250000 0.1250000 0.6250000 3.00 0.1250000 0.1250000 0.8750000 3.00 0.1250000 0.3750000 0.3750000 3.00 0.1250000 0.3750000 0.6250000 6.00 0.1250000 0.3750000 0.8750000 6.00 0.1250000 0.6250000 0.6250000 3.00 0.3750000 0.3750000 0.3750000 1.00 0.3750000 0.3750000 0.6250000 3.00 EOF $echo ' running the nscf calculation at 011; \c' $PARA_PREFIX $PW_ROOT/bin/pw.x $PARA_POSTFIX < ge.nscf_011.in > ge.nscf_011.out $echo ' done' # # phonon calculation at 05 # cat > ge.ph_011.in << EOF &inputph tr2_ph=1.0d-14, prefix='ge', amass(1)=72.61, tmp_dir='$TMP_DIR/', fildyn='ge.dyn_011.out', / 0.0 0.1 0.1 EOF $echo ' running the phonon calculation at 011; \c' $PARA_PREFIX $PW_ROOT/bin/ph.x $PARA_POSTFIX < ge.ph_011.in > ge.ph_011.out $echo ' done'