~jose-soler/siesta/newdynamics-format0.92

« back to all changes in this revision

Viewing changes to Src/SiestaXC/Testers/test2.F90

  • Committer: Alberto Garcia
  • Date: 2014-05-29 10:35:23 UTC
  • mfrom: (459.1.4 xc_update3)
  • Revision ID: albertog@icmab.es-20140529103523-agpio81nosvrf5jm
New GGA and VDW functionals (M.Fritz & J.M.Soler)

* Added 4 GGA functionals by Capelle et al
  Refs: L.S.Pedroza et al, PRB 79, 201106 (2009) and
        M.M.Odashima et al, J. Chem. Theory Comp. 5, 798 (2009)

* Added 2 VDW-DF functionals of 
        V.R.Cooper, PRB 81, 161104(R) (2010)
        K. Berland and P. Hyldgaard, PRB 89, 035412 (2014)

* Fixed PW91 and BLYP GGA functionals 

* Corrected a minor bug in vdwxc.F90 (parameter nq->mq)

* Updated and extended XC testers

* Added some test outputs in SiestaXC/Testers/Reference

* m_timer.F90 added to SIESTA_SRCS in SiestaXC/makefile

(+ fix syntax error in Pseudo/atom/pxf.F90)
(+ increase patch level in Pseudo/atom/version.h)

added:
  Docs/gga.CHANGES
  Src/SiestaXC/Testers/Reference/
  Src/SiestaXC/Testers/Reference/test1.out
  Src/SiestaXC/Testers/Reference/test2.out
  Src/SiestaXC/Testers/Reference/test3.out
  Src/SiestaXC/Testers/Reference/test4.out
  Src/SiestaXC/Testers/test6.f90
  Src/SiestaXC/Testers/test6.m
renamed:
  Src/SiestaXC/Testers/test2.f90 => Src/SiestaXC/Testers/test2.F90
modified:
  Docs/siesta.tex
  Pseudo/atom/Docs/atom.tex
  Pseudo/atom/pseudoXML.f
  Pseudo/atom/pxf.F90
  Pseudo/atom/velect.f
  Pseudo/atom/version.h
  Src/SiestaXC/Testers/makefile
  Src/SiestaXC/Testers/test1.f90
  Src/SiestaXC/Testers/test3.F90
  Src/SiestaXC/Testers/test4.F90
  Src/SiestaXC/Testers/test5.f90
  Src/SiestaXC/atomxc.F90
  Src/SiestaXC/cellxc.F90
  Src/SiestaXC/ggaxc.f
  Src/SiestaXC/ldaxc.f
  Src/SiestaXC/makefile
  Src/SiestaXC/siestaxc.F90
  Src/SiestaXC/vdwxc.F90
  Src/SiestaXC/vv_vdwxc.F90
  Src/SiestaXC/xcmod.f90
  Src/atom.F
  Src/xc.f
  Src/SiestaXC/Testers/test2.F90

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
  USE siestaXC, only: dp
12
12
  USE siestaXC, only: gp => grid_p
13
13
 
 
14
! Used MPI procedures and types
 
15
#ifdef MPI
 
16
  USE mpi_siesta, only: MPI_AllReduce
 
17
  USE mpi_siesta, only: MPI_Comm_World
 
18
  USE mpi_siesta, only: MPI_Double_Precision
 
19
  USE mpi_siesta, only: MPI_Sum
 
20
#endif
 
21
 
14
22
  implicit none
15
23
 
16
24
  ! Tester parameters
17
25
  integer, parameter:: irel  =  0 ! Relativistic? 0=>no, 1=>yes
18
26
  integer, parameter:: nSpin =  2 ! Number of spin components
19
 
  integer, parameter:: nfTot = 11 ! Number of functionals
 
27
  integer, parameter:: nfTot = 19 ! Number of functionals
20
28
  integer, parameter:: nr    = 101 ! Number of radial points
21
29
  integer, parameter:: n1cut =  8 ! Cutoff parameter
22
30
  integer, parameter:: n2cut =  2 ! Cutoff parameter:
28
36
  real(dp),parameter:: deltaDens = 1.e-8_dp  ! Finite diff. change
29
37
  real(dp),parameter:: densMin  = 1.e-9_dp  ! Min. density to proceed
30
38
 
31
 
  ! List of functionals to be tested (avoid those not passing test1)
32
 
  integer, parameter:: nf = 9         ! Number of tested functionals
33
 
  integer:: indexf(nf) = (/1,2,  4,5,6,  8,9,10,11/)  ! Indexes from list below
 
39
  ! List of functionals to be tested
 
40
!  integer, parameter:: nf = nfTot-4   ! Number of tested functionals
 
41
!  integer:: indexf(nf) = (/1,2,3,4,5,6,7,8,9,10,11,12,13,14,  18/) 
 
42
!                         ! Indexes from list below (only one VDW allowed)
34
43
 
35
44
  ! Same to test a single functional
36
 
!  integer, parameter:: nf = 1        ! Number of tested functionals
37
 
!  integer:: indexf(nf) = (/11/)      ! Indexes from list below
 
45
  integer, parameter:: nf = 1        ! Number of tested functionals
 
46
  integer:: indexf(nf) = (/18/)      ! Indexes from list below
38
47
 
39
48
  ! All functionals available
40
 
  !                  1,       2,       3,       4,       5,   
41
 
  !                  6,       7,       8,       9,      10,
42
 
  !                 11   
 
49
  !                  1,           2,          3,           4,   
 
50
  !                  5,           6,          7,           8, 
 
51
  !                  9,          10,         11,          12,
 
52
  !                 13,          14,         15,          16,
 
53
  !                 17,          18,         19
43
54
  character(len=3):: &
44
 
    func(nfTot) = (/'LDA',   'LDA',   'GGA',   'GGA',   'GGA',    &
45
 
                    'GGA',   'GGA',   'GGA',   'GGA',   'GGA',    &
46
 
                    'VDW'  /)
47
 
  character(len=6):: &
48
 
    auth(nfTot) = (/'PZ    ','PW92  ','PW91  ','PBE   ','RPBE  ', &
49
 
                    'revPBE','LYP   ','WC    ','PBESOL','AM05  ', &
50
 
!                    'DRSLL ' /) 
51
 
!                    'LMKLL ' /) 
52
 
                    'VV    ' /) 
 
55
    func(nfTot)=(/'LDA',       'LDA',       'GGA',       'GGA', &
 
56
                  'GGA',       'GGA',       'GGA',       'GGA', &
 
57
                  'GGA',       'GGA',       'GGA',       'GGA', &
 
58
                  'GGA',       'GGA',       'VDW',       'VDW', &
 
59
                  'VDW',       'VDW',       'VDW'       /)
 
60
  character(len=10):: &
 
61
    auth(nfTot)=(/'PZ        ','PW92      ','PW91      ','PBE       ', &
 
62
                  'RPBE      ','revPBE    ','LYP       ','WC        ', &
 
63
                  'PBEJsJrLO ','PBEJsJrHEG','PBEGcGxLO ','PBEGcGxHEG', &
 
64
                  'PBESOL    ','AM05      ','DRSLL     ','LMKLL     ', &
 
65
                  'C09       ','BH        ','VV        '/) 
53
66
 
54
67
  ! Tester variables and arrays
55
68
  integer :: iDelta, ir, irmax, ismax, iSpin, one, two
59
72
             kf, kg, maxDiffVxc, pi, r, rMesh(nr), &
60
73
             Vxc(nr,nSpin), Vxc0(nr,nSpin), wc(nfTot), wr, wx(nfTot)
61
74
 
 
75
#ifdef MPI
 
76
  ! Initialize MPI, even though this test is intended to be run serially
 
77
  integer:: MPIerror, myNode, nNodes
 
78
  call MPI_Init( MPIerror )
 
79
  call MPI_Comm_Rank( MPI_Comm_World, myNode, MPIerror )
 
80
  call MPI_Comm_Size( MPI_Comm_World, nNodes, MPIerror )
 
81
#endif
 
82
 
62
83
  ! Initialize hybrid XC functional with all tested functionals
63
84
  wx = 1._dp / nf
64
85
  wc = 1._dp / nf
138
159
!  print'(a,2i6)', 'irMax, iSpinMax = ', irmax, ismax
139
160
  close( unit=44 )
140
161
 
 
162
! Finalize MPI
 
163
#ifdef MPI
 
164
  call MPI_Finalize( MPIerror )
 
165
#endif
 
166
 
141
167
CONTAINS
142
168
 
143
169
FUNCTION DensOfR( d0, r )