atomes 1.3.1
atomes: an atomic scale modeling tool box
Loading...
Searching...
No Matches
fzbt.F90
Go to the documentation of this file.
1! This file is part of the 'atomes' software.
2!
3! 'atomes' is free software: you can redistribute it and/or modify it under the terms
4! of the GNU Affero General Public License as published by the Free Software Foundation,
5! either version 3 of the License, or (at your option) any later version.
6!
7! 'atomes' is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
8! without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
9! See the GNU General Public License for more details.
10!
11! You should have received a copy of the GNU Affero General Public License along with 'atomes'.
12! If not, see <https://www.gnu.org/licenses/>
13!
14! Copyright (C) 2022-2026 by CNRS and University of Strasbourg
15!
16!>
17!! @file fzbt.F90
18!! @short Partial structure factors: Faber-Ziman and Bathia-Thornton analysis
19!! @author Sébastien Le Roux <sebastien.leroux@ipcms.unistra.fr>
20
21LOGICAL FUNCTION fzbt (NDQ, SQIJ)
22
23!
24! Compute Faber-Ziman and Bathia-Thornton S(q) from Ashcroft S(q)
25!
26
27USE parameters
28
29IMPLICIT NONE
30
31INTEGER, INTENT(IN) :: ndq
32DOUBLE PRECISION, DIMENSION(NDQ,NSP,NSP), INTENT(IN) :: sqij
33
34if (nsp .eq. 2) then
35 if (allocated(btij)) deallocate(btij)
36 allocate(btij(ndq,4), stat=err)
37 if (err .ne. 0) then
38 call show_error ("Impossible to allocate memory"//char(0), &
39 "Function: FZBT"//char(0), "Table: BTij"//char(0))
40 fzbt=.false.
41 goto 001
42 endif
43 btij(:,:)=0.0d0
44endif
45
46if (allocated(fzsij)) deallocate(fzsij)
47allocate(fzsij(ndq,nsp,nsp), stat=err)
48if (err .ne. 0) then
49 call show_error ("Impossible to allocate memory"//char(0), &
50 "Function: FZBT"//char(0), "Table: FZSij"//char(0))
51 fzbt=.false.
52 goto 001
53endif
54
55fzsij(:,:,:)=0.0d0
56
57do m=1, ndq
58 do n=1, nsp
59 do o=1, nsp
60 if (o .eq. n) then
61 fzsij(m,n,o) = 1.0d0 + (sqij(m,n,o)-1.0d0)/xi(n)
62 if (nsp .eq. 2) then
63 btij(m,1) = btij(m,1) + xi(o)*xi(o)*fzsij(m,n,o)
64 btij(m,3) = btij(m,3) + fzsij(m,n,o)
65 endif
66 else
67 fzsij(m,n,o) = 1.0d0 + sqij(m,n,o)/sqrt(xi(n)*xi(o))
68 if (nsp .eq. 2) then
69 btij(m,1) = btij(m,1) + xi(o)*xi(n)*fzsij(m,n,o)
70 btij(m,3) = btij(m,3) - fzsij(m,n,o)
71 endif
72 endif
73 enddo
74 enddo
75 if (nsp .eq. 2) then
76 if (nbspbs(1) .le. nbspbs(2)) then
77 o=1
78 n=2
79 else
80 o=2
81 n=1
82 endif
83 btij(m,2) = xi(o)*fzsij(m,o,o) - xi(n)*fzsij(m,n,n)
84 btij(m,2) = btij(m,2)+fzsij(m,o,n)*(xi(n)-xi(o))
85 btij(m,2) = btij(m,2)*xi(n)*xi(o)
86 btij(m,3) = (btij(m,3)*xi(1)*xi(2) +1)*xi(1)*xi(2)
87 btij(m,4) = btij(m,3)/(xi(1)*xi(2))
88 endif
89enddo
90
91fzbt=.true.
92
93001 continue
94
95END FUNCTION
96
97LOGICAL FUNCTION grbt(GrToBT, NDTR)
98
99!
100! Compute Bathia-Thornton g(r)
101!
102
103USE parameters
104
105INTEGER, INTENT(IN) :: ndtr
106DOUBLE PRECISION, DIMENSION(NDTR,NSP,NSP), INTENT(IN) :: grtobt
107
108if (allocated(btij)) deallocate(btij)
109allocate(btij(ndtr,3), stat=err)
110if (err .ne. 0) then
111 call show_error ("Impossible to allocate memory"//char(0), &
112 "Function: GRBT"//char(0), "Table: BTij"//char(0))
113 grbt=.false.
114 goto 001
115endif
116btij(:,:)=0.0d0
117
118do m=1, ndtr
119 do n=1, nsp
120 do o=1, nsp
121 if (o .eq. n) then
122 btij(m,1) = btij(m,1) + xi(o)*xi(o)*grtobt(m,n,o)
123 btij(m,3) = btij(m,3) + grtobt(m,n,o)
124 else
125 btij(m,1) = btij(m,1) + xi(o)*xi(n)*grtobt(m,n,o)
126 btij(m,3) = btij(m,3) - grtobt(m,n,o)
127 endif
128 enddo
129 enddo
130 if (nbspbs(1) .le. nbspbs(2)) then
131 o=1
132 n=2
133 else
134 o=2
135 n=1
136 endif
137 btij(m,2) = xi(o)*grtobt(m,o,o) - xi(n)*grtobt(m,n,n)
138 btij(m,2) = btij(m,2)+grtobt(m,o,n)*(xi(n)-xi(o))
139 btij(m,3) = btij(m,3)*xi(1)*xi(2)
140! BTij(m,4) = BTij(m,3)/(Xi(1)*Xi(2))
141! BTij(m,5) = BTij(m,2)/(Xi(n)/ )
142enddo
143
144grbt=.true.
145
146001 continue
147
148END FUNCTION
logical function fzbt(ndq, sqij)
Definition fzbt.F90:22
logical function grbt(grtobt, ndtr)
Definition fzbt.F90:98
void show_error(char *error, int val, GtkWidget *win)
show error message
Definition interface.c:299
double precision, dimension(:,:,:), allocatable fzsij
double precision, dimension(:), allocatable xi
integer, dimension(:), allocatable nbspbs
double precision, dimension(:,:), allocatable btij
integer err
integer nsp