21INTEGER (KIND=c_int) FUNCTION s_of_q (QMAX, QMIN, NQ) bind (C,NAME='s_of_q_')
65INTEGER (KIND=c_int),
INTENT(IN) :: nq
66real(kind=c_double),
INTENT(IN) :: qmax , qmin
68DOUBLE PRECISION,
DIMENSION (:),
ALLOCATABLE :: sqtab
71 INTEGER FUNCTION recup_data (i, j)
72 INTEGER,
INTENT(IN) ::
i,
j
74 LOGICAL FUNCTION fzbt (NDQ, SQIJ)
76 INTEGER,
INTENT(IN) :: ndq
77 DOUBLE PRECISION,
DIMENSION(NDQ,NSP,NSP),
INTENT(IN) :: sqij
82total_density = dble(na)/meanvol
84if (
allocated(q_point))
deallocate(q_point)
85allocate(q_point(nq), stat=err)
87 call show_error (
"Impossible to allocate memory"//char(0), &
88 "Function: s_of_q"//char(0),
"Table: Q_POINT"//char(0))
92if (
allocated(s))
deallocate(s)
93allocate(s(nq), stat=err)
95 call show_error (
"Impossible to allocate memory"//char(0), &
96 "Function: s_of_q"//char(0),
"Table: S"//char(0))
100if (
allocated(xs))
deallocate(xs)
101allocate(xs(nq), stat=err)
103 call show_error (
"Impossible to allocate memory"//char(0), &
104 "Function: s_of_q"//char(0),
"Table: XS"//char(0))
108if (
allocated(sij))
deallocate(sij)
109allocate(sij(nq,nsp,nsp), stat=err)
111 call show_error (
"Impossible to allocate memory"//char(0), &
112 "Function: s_of_q"//char(0),
"Table: Sij"//char(0))
119dq=((qmax-qmin)/dble(nq))
125 q_point(i)= dble(i-1)*dq+qmin
131if (recup_data(j, idgr) .ne. 1)
then
137if (recup_data(j, idgr) .ne. 1)
then
145 if (recup_data(j, idgr) .ne. 1)
then
153if (.not.
fzbt(nq, sij))
then
158if (
allocated(sqtab))
deallocate(sqtab)
159allocate(sqtab(nq), stat=err)
161 call show_error (
"Impossible to allocate memory"//char(0), &
162 "Function: s_of_q"//char(0),
"Table: SQTAB"//char(0))
171call save_curve (nq, sqtab, l, idsq)
175 sqtab(k)= (s(k)-1.0)*q_point(k)
177call save_curve (nq, sqtab, l, idsq)
183call save_curve (nq, sqtab, l, idsq)
187 sqtab(k)= (xs(k)-1.0)*q_point(k)
189call save_curve (nq, sqtab, l, idsq)
197 call save_curve (nq, sqtab, l, idsq)
204 sqtab(k)= fzsij(k,i,j)
206 call save_curve (nq, sqtab, l, idsq)
215 call save_curve (nq, sqtab, l, idsq)
224if (
allocated(sqtab))
deallocate(sqtab)
225if (
allocated(q_point))
deallocate(q_point)
226if (
allocated(sij))
deallocate(sij)
227if (
allocated(s))
deallocate(s)
228if (
allocated(xs))
deallocate(xs)
229if (
allocated(fzsij))
deallocate(fzsij)
230if (
allocated(btij))
deallocate(btij)