-
Notifications
You must be signed in to change notification settings - Fork 6
/
global_mod.f90
76 lines (55 loc) · 1.62 KB
/
global_mod.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
module global_mod
implicit none
logical :: wf_table,v_table
real (kind=8) :: pi
real (kind=8) :: rbin,dr
real (kind=8) :: rcut,rcut2
real (kind=8) :: CWorm
integer (kind=4) :: dim,Np,Nbin,Nb,Nmax,Npw
real (kind=8),dimension (:),allocatable :: Lbox,LboxHalf,qbin
!real (kind=8),dimension (:),allocatable :: a_ho
contains
!-----------------------------------------------------------------------
function GreenFunction(opt,ib,dt,Pot,F2)
implicit none
real (kind=8) :: GreenFunction
real (kind=8) :: dt,Pot,F2
real (kind=8) :: Ve,dVe
real (kind=8) :: Vc,dVc
integer (kind=4) :: ib,opt
GreenFunction = 0.d0
if (opt==0) then
Ve = Pot
Vc = Pot+dt**2*F2/6.d0
if (ib==0) then
GreenFunction = dt*Ve/3.d0
else if (ib==2*Nb) then
GreenFunction = dt*Ve/3.d0
else
if (mod(ib,2)==0) then
GreenFunction = 2.d0*dt*Ve/3.d0
else
GreenFunction = 4.d0*dt*Vc/3.d0
end if
end if
!GreenFunction = dt*Pot
else if (opt==1) then
dVe = Pot
dVc = Pot+dt**2*F2/2.d0
if (ib==0) then
GreenFunction = dVe/3.d0
else if (ib==2*Nb) then
GreenFunction = dVe/3.d0
else
if (mod(ib,2)==0) then
GreenFunction = 2.d0*dVe/3.d0
else
GreenFunction = 4.d0*dVc/3.d0
end if
end if
!GreenFunction = Pot
end if
return
end function GreenFunction
!-----------------------------------------------------------------------
end module global_mod