21INTEGER (KIND=c_int) FUNCTION s_of_k (NQ, XA) bind (C,NAME='s_of_k_')
33INTEGER (KIND=c_int),
INTENT(IN) :: nq, xa
34DOUBLE PRECISION :: factor, xfactor
37 DOUBLE PRECISION FUNCTION fqx(TA, Q)
38 INTEGER,
INTENT(IN) :: ta
39 DOUBLE PRECISION,
INTENT(IN) :: q
43if(
allocated(
sij))
deallocate(
sij)
46 call show_error (
"Impossible to allocate memory"//char(0), &
47 "Function: s_of_k"//char(0),
"Table: Sij"//char(0))
53if(
allocated(
cij))
deallocate(
cij)
56 call show_error (
"Impossible to allocate memory"//char(0), &
57 "Function: s_of_k"//char(0),
"Table: cij"//char(0))
61if(
allocated(
sik))
deallocate(
sik)
64 call show_error (
"Impossible to allocate memory"//char(0), &
65 "Function: s_of_k"//char(0),
"Table: sik"//char(0))
72 call fourier_trans_qvect ()
76 call fourier_trans_steps ()
79if (
allocated(
cij))
deallocate(
cij)
80if (
allocated(
sik))
deallocate(
sik)
86if(
allocated(
s))
deallocate(
s)
87allocate(
s(nq), stat=
err)
89 call show_error (
"Impossible to allocate memory"//char(0), &
90 "Function: s_of_k"//char(0),
"Table: S"//char(0))
94if(
allocated(
xs))
deallocate(
xs)
95allocate(
xs(nq), stat=
err)
97 call show_error (
"Impossible to allocate memory"//char(0), &
98 "Function: s_of_k"//char(0),
"Table: XS"//char(0))
156if (
allocated(
sij))
deallocate(
sij)
157if (
allocated(
s))
deallocate(
s)
158if (
allocated(
xs))
deallocate(
xs)
167SUBROUTINE fourier_trans_steps ()
172 DOUBLE PRECISION :: qx, qy, qz, qtr, sini, cosi
219SUBROUTINE fourier_trans_qvect ()
227 DOUBLE PRECISION :: qx, qy, qz, qtr, sini, cosi
229 numth = omp_get_max_threads()
281INTEGER FUNCTION sk_save()
286DOUBLE PRECISION,
DIMENSION (:),
ALLOCATABLE :: sqtab
289 LOGICAL FUNCTION fzbt (NDQ, SQIJ)
291 INTEGER,
INTENT(IN) :: ndq
292 DOUBLE PRECISION,
DIMENSION(NDQ,NSP,NSP),
INTENT(IN) :: sqij
298 if (degeneracy(j) .gt. 0) i=i+1
304 if (
allocated(sqtab))
deallocate(sqtab)
305 allocate(sqtab(nsq), stat=err)
307 call show_error (
"Impossible to allocate memory"//char(0), &
308 "Function: SK_SAVE"//char(0),
"Table: SQTAB"//char(0))
315 if (degeneracy(k).gt.0)
then
320 call save_xsk (nsq, sqtab)
324 if (degeneracy(k).gt.0)
then
329 call save_curve (nsq, sqtab, 0, idsk)
333 if (degeneracy(k).gt.0)
then
335 sqtab(i)= (s(k)-1.0)*k_point(k)
338 call save_curve (nsq, sqtab, 2, idsk)
342 if (degeneracy(k).gt.0)
then
347 call save_curve (nsq, sqtab, 4, idsk)
351 if (degeneracy(k).gt.0)
then
353 sqtab(i)= (xs(k)-1.0)*k_point(k)
356 call save_curve (nsq, sqtab, 6, idsk)
363 if (degeneracy(k).gt.0)
then
368 call save_curve (nsq, sqtab, l, idsk)
374 if (.not.
fzbt(nq, sij))
then
383 if (degeneracy(k).gt.0)
then
385 sqtab(m)= fzsij(k,i,j)
388 call save_curve (nsq, sqtab, l, idsk)
396 if (degeneracy(j).gt.0)
then
401 call save_curve (nsq, sqtab, l, idsk)
412if (
allocated(fzsij))
deallocate(fzsij)
413if (nsp.eq.2 .and.
allocated(btij))
deallocate(btij)
414if (
allocated(sqtab))
deallocate(sqtab)
420INTEGER (KIND=c_int) FUNCTION smooth_and_save (DPOINT, CTS, SFC, IDC, NQPTS, DATS) bind (C,NAME='smooth_and_save_')
426INTEGER (KIND=c_int),
INTENT(IN) :: idc, nqpts, dats
427real(kind=c_double),
DIMENSION(NQPTS),
INTENT(IN) :: dpoint, cts
428real(kind=c_double),
INTENT(IN) :: sfc
429DOUBLE PRECISION,
DIMENSION (:),
ALLOCATABLE :: sqtab
432 LOGICAL FUNCTION smooth (TABTOLISS, GTOLISS, DIMTOLISS, SIGMALISS)
433 INTEGER,
INTENT(IN) :: dimtoliss
434 DOUBLE PRECISION,
INTENT(IN) :: sigmaliss
435 DOUBLE PRECISION,
INTENT(IN),
DIMENSION(DIMTOLISS) :: gtoliss
436 DOUBLE PRECISION,
INTENT(INOUT),
DIMENSION(DIMTOLISS) :: tabtoliss
440if (
allocated(sqtab))
deallocate(sqtab)
442allocate(sqtab(nqpts), stat=
err)
444 call show_error (
"Impossible to allocate memory"//char(0), &
445 "Function: smooth_and_save"//char(0),
"Table: SQTAB"//char(0))
454if (.not.
smooth(sqtab, dpoint, nqpts, sfc))
then
459call save_curve (nqpts, sqtab, idc, dats)
465if (
allocated(sqtab))
deallocate(sqtab)
469DOUBLE PRECISION FUNCTION fqx(TA, Q)
473INTEGER,
INTENT(IN) :: ta
474DOUBLE PRECISION,
INTENT(IN) :: q
475DOUBLE PRECISION :: sinla
476DOUBLE PRECISION,
PARAMETER :: pi=acos(-1.0)
487fqx =
a1(ta)*exp(-
b1(ta)*sinla) &
488 +
a2(ta)*exp(-
b2(ta)*sinla) &
489 +
a3(ta)*exp(-
b3(ta)*sinla) &
490 +
a4(ta)*exp(-
b4(ta)*sinla) +
c(ta)
logical function fzbt(ndq, sqij)
void show_error(char *error, int val, GtkWidget *win)
show error message
double precision, dimension(98), parameter a3
double precision, dimension(98), parameter c
double precision, dimension(98), parameter a2
double precision, dimension(98), parameter b1
double precision, dimension(98), parameter b3
double precision, dimension(98), parameter a1
double precision, dimension(98), parameter b4
double precision, dimension(98), parameter b2
double precision, dimension(98), parameter a4
double precision, dimension(:,:,:), allocatable fullpos
double precision, dimension(:), allocatable qvectx
double precision, dimension(:), allocatable nscattl
double precision, dimension(:), allocatable qvecty
double precision, dimension(:), allocatable cij
double precision, dimension(:), allocatable k_point
integer, dimension(:), allocatable nbspbs
double precision, dimension(:), allocatable s
integer, dimension(:), allocatable degeneracy
double precision, dimension(:), allocatable xs
double precision, dimension(:), allocatable modq
double precision, dimension(:), allocatable xscattl
double precision, dimension(:), allocatable qvectz
integer, dimension(:), allocatable lot
double precision, dimension(:,:,:), allocatable sij
double precision, dimension(:), allocatable sik
double precision function fqx(ta, q)
integer(kind=c_int) function s_of_k(nq, xa)
integer(kind=c_int) function smooth_and_save(dpoint, cts, sfc, idc, nqpts, dats)
logical function smooth(tabtoliss, gtoliss, dimtoliss, sigmaliss)