Commit ecc0bb76 authored by giannozz's avatar giannozz

Old and non-functional (since a long time) directory "vdW" deleted


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@12446 c92efa57-630b-4861-b058-cf58834340f0
parent 10f6ab35
# Makefile for VdW
sinclude ../make.sys
default: all
all:
@echo "VdW no longer maintained"
# ( cd src ; $(MAKE) all || exit 1 )
clean :
( cd src ; $(MAKE) clean ; )
distclean: clean
This example illustrates how to use vdw.x to calculate
dynamic polarizability of methane molecules (experiment stage).
The van der Waals coefficient C6 can be obtained by simply
integrating the dynamic polarizability(not done here).
The Thomas-Fermi and von Weizsacker approximation is used
to simplify the full calculation done in ph.x. It is expected
that this simplified calculation gives results deviating
about 20% comparing to that of the full one(checked for
methane and benzene).
The calculation proceeds as follows
1) make a self-consistent calculation (input=ch4.scf.in,
output=ch4.scf.out)
2) make a frequency dependent polarizability calculation
(input=ch4.vdw.in, output=ch4.vdw.out).
&control
calculation='relax'
prefix='ch4',
restart_mode='from_scratch',
pseudo_dir = '/home/giannozz/espresso/pseudo/',
outdir='/home/giannozz/tmp/'
/
&system
ibrav= 1, celldm(1) = 10.39349, nat= 5, ntyp= 2,
ecutwfc = 40
/
&electrons
/
&ions
/
ATOMIC_SPECIES
C 12.0107 C.pz-vbc.UPF
H 1.00794 H.vbc.UPF
ATOMIC_POSITIONS
C 0.00 0.00 0.00
H .11547 .11547 .11547
H .11547 -.11547 -.11547
H -.11547 -.11547 .11547
H -.11547 .11547 -.11547
K_POINTS
1
0.00 0.00 0.00 1.0
This diff is collapsed.
&inputvdw
tr2_vdw=1.0d-14,
prefix='ch4',
outdir='/home/giannozz/tmp/',
thresh_veff = 9.6d-3
/
FREQUENCIES
2
0.0d0
1.5d0
Program VdW v.4.0 starts ...
Today is 28Apr2008 at 16:41:49
Effective Potential Calculation
Charge difference due to FFT 0.01788486
Charge difference due to V_eff (initial) 0.01198253
iter # 1 charge diff. 0.01266868 thresh_veff 0.00960000
iter # 2 charge diff. 0.00944867 thresh_veff 0.00960000
End of Effective Potential Calculation
Frequency Dependent Polarizability Calculation
iter # 1 total cpu time : 1.1 secs av.it.: 6.0
thresh= 0.100E-01 al_mix_vdw = 0.100 |ddv_scf|^2 = 0.439E-07
iter # 2 total cpu time : 2.8 secs av.it.: 12.0
thresh= 0.210E-04 al_mix_vdw = 0.100 |ddv_scf|^2 = 0.286E-07
iter # 3 total cpu time : 4.4 secs av.it.: 13.0
thresh= 0.169E-04 al_mix_vdw = 0.100 |ddv_scf|^2 = 0.129E-08
iter # 4 total cpu time : 6.1 secs av.it.: 14.0
thresh= 0.359E-05 al_mix_vdw = 0.100 |ddv_scf|^2 = 0.964E-09
iter # 5 total cpu time : 7.5 secs av.it.: 12.0
thresh= 0.310E-05 al_mix_vdw = 0.100 |ddv_scf|^2 = 0.145E-10
iter # 6 total cpu time : 8.8 secs av.it.: 10.0
thresh= 0.381E-06 al_mix_vdw = 0.100 |ddv_scf|^2 = 0.888E-11
iter # 7 total cpu time : 10.0 secs av.it.: 10.0
thresh= 0.298E-06 al_mix_vdw = 0.100 |ddv_scf|^2 = 0.266E-12
iter # 8 total cpu time : 11.3 secs av.it.: 11.0
thresh= 0.516E-07 al_mix_vdw = 0.100 |ddv_scf|^2 = 0.219E-13
iter # 9 total cpu time : 12.7 secs av.it.: 11.0
thresh= 0.148E-07 al_mix_vdw = 0.100 |ddv_scf|^2 = 0.281E-14
Polarizability in cartesian axis at frequency 1.50
( 6.193787429 0.000000000 0.000000000 )
( 0.000000000 6.193787429 0.000000000 )
( 0.000000000 0.000000000 6.193787429 )
iter # 1 total cpu time : 13.6 secs av.it.: 7.0
thresh= 0.100E-01 al_mix_vdw = 0.100 |ddv_scf|^2 = 0.255E-05
iter # 2 total cpu time : 15.1 secs av.it.: 13.0
thresh= 0.160E-03 al_mix_vdw = 0.100 |ddv_scf|^2 = 0.526E-07
iter # 3 total cpu time : 16.5 secs av.it.: 12.0
thresh= 0.229E-04 al_mix_vdw = 0.100 |ddv_scf|^2 = 0.121E-07
iter # 4 total cpu time : 17.9 secs av.it.: 12.0
thresh= 0.110E-04 al_mix_vdw = 0.100 |ddv_scf|^2 = 0.557E-09
iter # 5 total cpu time : 19.4 secs av.it.: 12.0
thresh= 0.236E-05 al_mix_vdw = 0.100 |ddv_scf|^2 = 0.342E-09
iter # 6 total cpu time : 20.7 secs av.it.: 11.0
thresh= 0.185E-05 al_mix_vdw = 0.100 |ddv_scf|^2 = 0.283E-10
iter # 7 total cpu time : 22.0 secs av.it.: 11.0
thresh= 0.532E-06 al_mix_vdw = 0.100 |ddv_scf|^2 = 0.328E-11
iter # 8 total cpu time : 23.5 secs av.it.: 10.0
thresh= 0.181E-06 al_mix_vdw = 0.100 |ddv_scf|^2 = 0.143E-11
iter # 9 total cpu time : 25.1 secs av.it.: 12.0
thresh= 0.120E-06 al_mix_vdw = 0.100 |ddv_scf|^2 = 0.629E-13
iter # 10 total cpu time : 26.4 secs av.it.: 10.0
thresh= 0.251E-07 al_mix_vdw = 0.100 |ddv_scf|^2 = 0.417E-13
iter # 11 total cpu time : 27.8 secs av.it.: 12.0
thresh= 0.204E-07 al_mix_vdw = 0.100 |ddv_scf|^2 = 0.264E-14
Polarizability in cartesian axis at frequency 0.00
( 14.093867807 0.000000000 0.000000000 )
( 0.000000000 14.093867807 0.000000000 )
( 0.000000000 0.000000000 14.093867807 )
End of Frequency Dependent Polarizability Calculation
End of vdW calculation
#!/bin/sh
# run from directory where this script is
cd `echo $0 | sed 's/\(.*\)\/.*/\1/'` # extract pathname
EXAMPLE_DIR=`pwd`
# check whether ECHO has the -e option
if test "`echo -e`" = "-e" ; then ECHO=echo ; else ECHO="echo -e" ; fi
$ECHO
$ECHO "$EXAMPLE_DIR : starting"
$ECHO
$ECHO "This example shows how to use vdw.x to calculate dynamic"
$ECHO "polarizability of methane molecule in simplified version
of the one in ph.x (see example33) by using Thomas-Fermi
and von Weizsaecker approximation"
# set the needed environment variables
. ../../../environment_variables
# required executables and pseudopotentials
BIN_LIST="pw.x vdw.x"
PSEUDO_LIST="C.pz-vbc.UPF H.pz-vbc.UPF"
$ECHO
$ECHO " executables directory: $BIN_DIR"
$ECHO " pseudo directory: $PSEUDO_DIR"
$ECHO " temporary directory: $TMP_DIR"
$ECHO
$ECHO " checking that needed directories and files exist...\c"
# check for directories
for DIR in "$BIN_DIR" "$PSEUDO_DIR" ; do
if test ! -d $DIR ; then
$ECHO
$ECHO "ERROR: $DIR not existent or not a directory"
$ECHO "Aborting"
exit 1
fi
done
for DIR in "$TMP_DIR" "$EXAMPLE_DIR/results" ; do
if test ! -d $DIR ; then
mkdir $DIR
fi
done
cd $EXAMPLE_DIR/results
# check for executables
for FILE in $BIN_LIST ; do
if test ! -x $BIN_DIR/$FILE ; then
$ECHO
$ECHO "ERROR: $BIN_DIR/$FILE not existent or not executable"
$ECHO "Aborting"
exit 1
fi
done
# check for pseudopotentials
for FILE in $PSEUDO_LIST ; do
if test ! -r $PSEUDO_DIR/$FILE ; then
$ECHO
$ECHO "Downloading $FILE to $PSEUDO_DIR...\c"
$WGET $PSEUDO_DIR/$FILE \
http://www.quantum-espresso.org/pseudo/1.3/UPF/$FILE 2> /dev/null
fi
if test $? != 0; then
$ECHO
$ECHO "ERROR: $PSEUDO_DIR/$FILE not existent or not readable"
$ECHO "Aborting"
exit 1
fi
done
$ECHO " done"
# how to run executables
PW_COMMAND="$PARA_PREFIX $BIN_DIR/pw.x $PARA_POSTFIX"
PH_COMMAND="$PARA_PREFIX $BIN_DIR/vdw.x $PARA_POSTFIX"
$ECHO
$ECHO " running pw.x as: $PW_COMMAND"
$ECHO " running vdw.x as: $PH_COMMAND"
$ECHO
# clean TMP_DIR
$ECHO " cleaning $TMP_DIR...\c"
rm -rf $TMP_DIR/*
$ECHO " done"
# self-consistent calculation
chbl=1.10 #C-H bond length in CH4
bohr=0.529177
n=5
lc=$(echo "scale=5; $n * $chbl / $bohr" | bc) # latt. const. in a.u.
pos=$(echo "scale=5; 1.0/$n/sqrt(3)" | bc )
ecut=40
#
cat > ch4.scf.in << EOF
&control
calculation='relax'
prefix='ch4',
restart_mode='from_scratch',
pseudo_dir = '$PSEUDO_DIR/',
outdir='$TMP_DIR/'
/
&system
ibrav= 1, celldm(1) = $lc, nat= 5, ntyp= 2,
ecutwfc = $ecut
/
&electrons
/
&ions
/
ATOMIC_SPECIES
C 12.0107 C.pz-vbc.UPF
H 1.00794 H.pz-vbc.UPF
ATOMIC_POSITIONS
C 0.00 0.00 0.00
H $pos $pos $pos
H $pos -$pos -$pos
H -$pos -$pos $pos
H -$pos $pos -$pos
K_POINTS
1
0.00 0.00 0.00 1.0
EOF
#
$ECHO " running the scf calculation...\c"
$PW_COMMAND < ch4.scf.in > ch4.scf.out
check_failure $?
$ECHO " done"
#
# dynamic polarizability calculation
#
cat > ch4.vdw.in << EOF
&inputvdw
tr2_vdw=1.0d-14,
prefix='ch4',
outdir='$TMP_DIR/',
thresh_veff = 9.6d-3
/
FREQUENCIES
2
0.0d0
1.5d0
EOF
#
$ECHO " running the dynamic polarizability calculation ...\c"
$PH_COMMAND < ch4.vdw.in > ch4.vdw.out
check_failure $?
$ECHO " done"
$ECHO
$ECHO "$EXAMPLE_DIR : done"
#!/bin/sh
# run from directory where this script is
cd `echo $0 | sed 's/\(.*\)\/.*/\1/'` # extract pathname
EXAMPLE_DIR=`pwd`
# check whether ECHO has the -e option
if test "`echo -e`" = "-e" ; then ECHO=echo ; else ECHO="echo -e" ; fi
$ECHO
$ECHO "$EXAMPLE_DIR : starting"
$ECHO
$ECHO "This example shows how to use vdw.x to calculate dynamic"
$ECHO "polarizability of methane molecule in simplified version
of the one in ph.x (see example33) by using Thomas-Fermi
and von Weizsaecker approximation"
# set the needed environment variables
. ../../../environment_variables
# required executables and pseudopotentials
BIN_LIST="pw.x vdw.x"
PSEUDO_LIST="C.pz-vbc.UPF H.pz-vbc.UPF"
$ECHO
$ECHO " executables directory: $BIN_DIR"
$ECHO " pseudo directory: $PSEUDO_DIR"
$ECHO " temporary directory: $TMP_DIR"
$ECHO
$ECHO " checking that needed directories and files exist...\c"
# check for directories
for DIR in "$BIN_DIR" "$PSEUDO_DIR" ; do
if test ! -d $DIR ; then
$ECHO
$ECHO "ERROR: $DIR not existent or not a directory"
$ECHO "Aborting"
exit 1
fi
done
for DIR in "$TMP_DIR" "$EXAMPLE_DIR/results" ; do
if test ! -d $DIR ; then
mkdir $DIR
fi
done
cd $EXAMPLE_DIR/results
# check for executables
for FILE in $BIN_LIST ; do
if test ! -x $BIN_DIR/$FILE ; then
$ECHO
$ECHO "ERROR: $BIN_DIR/$FILE not existent or not executable"
$ECHO "Aborting"
exit 1
fi
done
# check for pseudopotentials
for FILE in $PSEUDO_LIST ; do
if test ! -r $PSEUDO_DIR/$FILE ; then
$ECHO
$ECHO "Downloading $FILE to $PSEUDO_DIR...\c"
$WGET $PSEUDO_DIR/$FILE \
http://www.quantum-espresso.org/pseudo/1.3/UPF/$FILE 2> /dev/null
fi
if test $? != 0; then
$ECHO
$ECHO "ERROR: $PSEUDO_DIR/$FILE not existent or not readable"
$ECHO "Aborting"
exit 1
fi
done
$ECHO " done"
# how to run executables
PW_COMMAND="$PARA_PREFIX $BIN_DIR/pw.x $PARA_POSTFIX"
PH_COMMAND="$PARA_PREFIX $BIN_DIR/vdw.x $PARA_POSTFIX"
$ECHO
$ECHO " running pw.x as: $PW_COMMAND"
$ECHO " running vdw.x as: $PH_COMMAND"
$ECHO
# clean TMP_DIR
$ECHO " cleaning $TMP_DIR...\c"
rm -rf $TMP_DIR/*
$ECHO " done"
# self-consistent calculation
chbl=1.10 #C-H bond length in CH4
bohr=0.529177
n=5
lc=$(echo "scale=5; $n * $chbl / $bohr" | bc) # latt. const. in a.u.
pos=$(echo "scale=5; 1.0/$n/sqrt(3)" | bc )
ecut=40.0
#
cat > ch4.scf.xml << EOF
<?xml version="1.0" encoding="UTF-8"?>
<input calculation="relax" prefix="ch4">
<cell type="qecell">
<qecell ibrav="1" alat="$lc">
<real rank="1" n1="5">
0.0 0.0 0.0 0.0 0.0
</real>
</qecell>
</cell>
<atomic_species ntyp="2">
<specie name="C">
<property name="mass">
<real>12.0107</real>
</property>
<property name="pseudofile">
<string>C.pz-vbc.UPF</string>
</property>
</specie>
<specie name="H">
<property name="mass">
<real>1.00794</real>
</property>
<property name="pseudofile">
<string>H.pz-vbc.UPF</string>
</property>
</specie>
</atomic_species>
<atomic_list units="alat" nat="5" >
<atom name="C">
<position>
<real rank="1" n1="3">
0.00 0.00 0.00
</real>
</position>
</atom>
<atom name="H">
<position>
<real rank="1" n1="3">
$pos $pos $pos
</real>
</position>
</atom>
<atom name="H">
<position>
<real rank="1" n1="3">
$pos -$pos -$pos
</real>
</position>
</atom>
<atom name="H">
<position>
<real rank="1" n1="3">
-$pos -$pos $pos
</real>
</position>
</atom>
<atom name="H">
<position>
<real rank="1" n1="3">
-$pos $pos -$pos
</real>
</position>
</atom>
</atomic_list>
<field name="InputOutput">
<parameter name="restart_mode">
<string>
from_scratch
</string>
</parameter>
<parameter name="pseudo_dir">
<string>
$PSEUDO_DIR/
</string>
</parameter>
<parameter name="outdir">
<string>
$TMP_DIR/
</string>
</parameter>
</field>
<field name="Numerics">
<parameter name="ecutwfc">
<real>
$ecut
</real>
</parameter>
</field>
<k_points type="tpiba">
<mesh npoints="1">
<real rank="2" n1="4" n2="1">
0.00 0.00 0.00 1.0
</real>
</mesh>
</k_points>
</input>
EOF
#
$ECHO " running the scf calculation...\c"
$PW_COMMAND < ch4.scf.xml > ch4.scf.out
check_failure $?
$ECHO " done"
#
# dynamic polarizability calculation
#
cat > ch4.vdw.in << EOF
&inputvdw
tr2_vdw=1.0d-14,
prefix='ch4',
outdir='$TMP_DIR/',
thresh_veff = 9.6d-3
/
FREQUENCIES
2
0.0d0
1.5d0
EOF
#
$ECHO " running the dynamic polarizability calculation ...\c"
$PH_COMMAND < ch4.vdw.in > ch4.vdw.out
check_failure $?
$ECHO " done"
$ECHO
$ECHO "$EXAMPLE_DIR : done"
# Makefile for TF-VdW calculation.
include ../../make.sys
# location of needed modules
MODFLAGS= $(MOD_FLAG)../../iotk/src $(MOD_FLAG)../../Modules $(MOD_FLAG)../../FFTXlib \
$(MOD_FLAG)../../PW/src $(MOD_FLAG)../../PHonon/PH $(MOD_FLAG).
VdWOBJS = \
allocate_vdw.o \
cegterg.o \
check_v_eff.o \
ch_psi_all.o \
dv_of_drho.o \
dvpsi_e.o \
eff_pot.o \
h_psiq.o \
incdrhoscf.o \
pbcg_psi.o \
polariz.o \
print_clock_vdw.o \
solve_e.o \
stop_vdw.o \
vdwcom.o
PPOBJS = \
../../PP/src/openfil_pp.o
QEMODS = ../../Modules/libqemod.a ../../FFTXlib/libqefft.a
PWOBJS = ../../PW/src/libpw.a
PHOBJS = ../../PHonon/PH/libph.a
LIBOBJS = ../../flib/ptools.a ../../flib/flib.a ../../clib/clib.a ../../iotk/src/libiotk.a
TLDEPS= bindir mods libs pw ph pp
all : tldeps vdw.x
vdw.x : vdw.o $(VdWOBJS) $(PPOBJS) $(PWOBJS) $(PHOBJS) $(QEMODS) $(LIBOBJS)
$(LD) $(LDFLAGS) -o $@ vdw.o \
$(VdWOBJS) $(PPOBJS) $(PHOBJS) $(PWOBJS) $(QEMODS) \
$(LIBOBJS) $(LIBS)
- ( cd ../../bin ; ln -fs ../VdW/src/$@ . )
tldeps :
if test -n "$(TLDEPS)" ; then \
( cd ../.. ; $(MAKE) $(TLDEPS) || exit 1 ) ; fi
clean :
- /bin/rm -f *.x *.o *~ *.F90 *.d *.mod *.i *.L
include make.depend
! Copyright (C) 2001 PWSCF group
! This file is distributed under the terms of the
! GNU General Public License. See the file `License'
! in the root directory of the present distribution,
! or http://www.gnu.org/copyleft/gpl.txt .
!
!
!-----------------------------------------------------------------------
SUBROUTINE allocate_vdw
!-----------------------------------------------------------------------
!
! dynamical allocation of arrays:
! local potential for each kind of atom, structure factor
!
USE lsda_mod, ONLY : nspin
USE fft_base, ONLY : dfftp
USE wvfct, ONLY : npwx, nbnd
USE qpoint, ONLY : nksq
USE eff_v
!
IMPLICIT NONE
!
ALLOCATE (rho_fft (dfftp%nnr, nspin))
ALLOCATE (rho_veff(dfftp%nnr, nspin))
ALLOCATE (veff (dfftp%nnr, nspin))
!
ALLOCATE (evc_veff(npwx, nbnd ))
ALLOCATE (et_c(nbnd, nksq ))
ALLOCATE (dvext(npwx, 3, nbnd))
ALLOCATE (dpsi_eff(npwx, 3, nbnd))
!
RETURN
END SUBROUTINE allocate_vdw
This diff is collapsed.
!
! Copyright (C) 2001 PWSCF group
! This file is distributed under the terms of the
! GNU General Public License. See the file `License'
! in the root directory of the present distribution,
! or http://www.gnu.org/copyleft/gpl.txt .
!
!-----------------------------------------------------------------------
SUBROUTINE ch_psi_all_vdw (n, h, ah, e, ik, m)
!-----------------------------------------------------------------------
!
! This routine applies the operator ( H - \epsilon S + alpha_pv P_v)
! to a vector h. The result is given in Ah.
!
USE pwcom
USE becmod
USE kinds, ONLY : DP
USE phcom
USE mp_global, ONLY : intra_pool_comm
USE mp, ONLY : mp_sum
USE wvfct, ONLY : igk
IMPLICIT NONE
INTEGER :: n, m, ik
! input: the dimension of h
! input: the number of bands
! input: the k point
COMPLEX(DP) :: e (m)
! input: the eigenvalue plus imaginary freq.
COMPLEX(DP) :: h (npwx, m), ah (npwx, m)
! input: the vector
! output: the operator applied to the vector
!
! local variables
!
INTEGER :: ibnd, ikq, ig
! counter on bands
! the point k+q
! counter on G vetors
COMPLEX(DP), ALLOCATABLE :: ps (:,:), hpsi (:,:), spsi (:,:)
! scalar products
! the product of the Hamiltonian and h
! the product of the S matrix and h
CALL start_clock ('ch_psi')
ALLOCATE (ps ( nbnd , m))
ALLOCATE (hpsi( npwx , m))
ALLOCATE (spsi( npwx , m))
hpsi (:,:) = (0.d0, 0.d0)
spsi (:,:) = (0.d0, 0.d0)
!
! compute the product of the hamiltonian with the h vector
!
CALL h_psiq_vdw (npwx, n, m, h, hpsi, spsi, igk)
!
CALL start_clock ('last')
!
! then we compute the operator H-epsilon S
!
DO ibnd = 1, m
DO ig = 1, n
ah (ig, ibnd) = hpsi (ig, ibnd) - e (ibnd) * spsi (ig, ibnd)
ENDDO
ENDDO
!
DEALLOCATE (spsi)
DEALLOCATE (hpsi)
DEALLOCATE