11
11
USE siestaXC, only: dp
12
12
USE siestaXC, only: gp => grid_p
14
! Used MPI procedures and types
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
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
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)
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
39
48
! All functionals available
43
54
character(len=3):: &
44
func(nfTot) = (/'LDA', 'LDA', 'GGA', 'GGA', 'GGA', &
45
'GGA', 'GGA', 'GGA', 'GGA', 'GGA', &
48
auth(nfTot) = (/'PZ ','PW92 ','PW91 ','PBE ','RPBE ', &
49
'revPBE','LYP ','WC ','PBESOL','AM05 ', &
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' /)
61
auth(nfTot)=(/'PZ ','PW92 ','PW91 ','PBE ', &
62
'RPBE ','revPBE ','LYP ','WC ', &
63
'PBEJsJrLO ','PBEJsJrHEG','PBEGcGxLO ','PBEGcGxHEG', &
64
'PBESOL ','AM05 ','DRSLL ','LMKLL ', &
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)
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 )
62
83
! Initialize hybrid XC functional with all tested functionals