21INTEGER (KIND=c_int) FUNCTION cqvf (QMAX, QMIN, NQ, PROBA, LIMQ) bind (C,NAME='cqvf_')
32 INTEGER (KIND=c_int),
INTENT(IN) :: nq
33 REAL (kind=c_double),
INTENT(IN) :: proba, limq
34 REAL (kind=c_double),
INTENT(IN) :: qmax, qmin
36 LOGICAL :: kpts, keepkpts
37 INTEGER :: hkl, q_index, seed
39 INTEGER,
DIMENSION(3) :: nkpts
40 DOUBLE PRECISION,
DIMENSION(3) :: qmrecip
41 DOUBLE PRECISION :: qmax2, qmin2, limq2
42 DOUBLE PRECISION :: kpx, kpy, kpz, keep
45 DOUBLE PRECISION FUNCTION ran3 (idnum)
46 INTEGER,
INTENT(IN) :: idnum
56 qmrecip(:) = qmrecip(:)/
ncells
58 nkpts(
i) = anint(qmax/qmrecip(
i))+1
86 call show_error (
"Impossible to allocate memory"//char(0), &
87 "Function: COMP_Q_VAL_FULL"//char(0),
"Table: qvectx"//char(0))
94 call show_error (
"Impossible to allocate memory"//char(0), &
95 "Function: COMP_Q_VAL_FULL"//char(0),
"Table: qvecty"//char(0))
102 call show_error (
"Impossible to allocate memory"//char(0), &
103 "Function: COMP_Q_VAL_FULL"//char(0),
"Table: qvectz"//char(0))
107 if (
allocated(
modq))
deallocate(
modq)
110 call show_error (
"Impossible to allocate memory"//char(0), &
111 "Function: COMP_Q_VAL_FULL"//char(0),
"Table: modq"//char(0))
129 if (
k.eq.0 .and.
h.eq.0)
then
146 qvmod= kpx**2 + kpy**2 + kpz**2
157 if (
qvmod .le. qmax2 .and.
qvmod .ge. qmin2)
then
162 if (
i .eq. 1 .and. kpts)
then
164 elseif (
i .eq. 2 .and. kpts)
then
165 if (
qvmod .le. limq2)
then
169 keep =
ran3(seed+
h**3+
k**2+
l**5)
170 if (keep .le. proba)
then
184 if (
h.ne.0 .or.
k.ne.0 .or.
l.ne.0)
then
212 call show_error (
"Impossible to allocate memory"//char(0), &
213 "Function: COMP_Q_VAL_FULL"//char(0),
"Table: degeneracy"//char(0))
235 call show_error (
"Impossible to allocate memory"//char(0), &
236 "Function: COMP_Q_VAL_FULL"//char(0),
"Table: K_POINT"//char(0))
integer(kind=c_int) function cqvf(qmax, qmin, nq, proba, limq)
void show_error(char *error, int val, GtkWidget *win)
show error message
double precision, dimension(:), allocatable qvectx
double precision, dimension(:), allocatable qvecty
double precision, dimension(:), allocatable k_point
integer, dimension(:), allocatable degeneracy
double precision, dimension(:), allocatable modq
type(lattice), dimension(:), allocatable, target the_box
double precision, dimension(:), allocatable qvectz
double precision, parameter pi
double precision function ran3(idnum)