23INTEGER (KIND=c_int) FUNCTION sphericals (MAXL, SPC, GEO, IDC, COOSPH)
31 INTEGER (KIND=c_int),
INTENT(IN) :: maxl, spc, geo, idc
32 INTEGER (KIND=c_int),
DIMENSION(NSP),
INTENT(IN) :: coosph
34 INTEGER,
DIMENSION(:),
ALLOCATABLE :: neigh
36 DOUBLE PRECISION :: xc, yc, zc
37 DOUBLE PRECISION :: sr, st, sp
38 DOUBLE PRECISION,
DIMENSION(0:MAXL,-MAXL:MAXL) :: hsp
40 DOUBLE PRECISION,
DIMENSION(:,:),
ALLOCATABLE :: athsp
41 DOUBLE PRECISION,
DIMENSION(:,:),
ALLOCATABLE :: sptshp
42 DOUBLE PRECISION,
DIMENSION(0:MAXL) :: spha
48 DOUBLE PRECISION FUNCTION plegendre (l, m, x)
49 INTEGER,
INTENT(IN) ::
l,
m
50 DOUBLE PRECISION,
INTENT(IN) ::
x
52 DOUBLE PRECISION FUNCTION calcdij (R12, AT1, AT2, STEP_1, STEP_2, SID)
53 DOUBLE PRECISION,
DIMENSION(3),
INTENT(INOUT) :: r12
54 INTEGER,
INTENT(IN) :: at1, at2, step_1, step_2, sid
58 if (
allocated(neigh))
deallocate(neigh)
59 allocate(neigh(
nsp), stat=
err)
61 call show_error (
"Impossible to allocate memory"//char(0), &
62 "Function: sphericals"//char(0),
"Table: NEIGH"//char(0))
75 if (
allocated(athsp))
deallocate(athsp)
76 allocate(athsp(0:maxl,-maxl:maxl), stat=
err)
78 call show_error (
"Impossible to allocate memory"//char(0), &
79 "Function: sphericals"//char(0),
"Table: ATHSP"//char(0))
83 if (
allocated(sptshp))
deallocate(sptshp)
84 allocate(sptshp(0:maxl,-maxl:maxl), stat=
err)
86 call show_error (
"Impossible to allocate memory"//char(0), &
87 "Function: sphericals"//char(0),
"Table: SPTSHP"//char(0))
97 numth = omp_get_max_threads()
100 if (numth .ge. 2*(
ns-1))
then
107 if (all_atoms) doatoms=.true.
110 if (
na.lt.numth) numth=
na
112 write (6, *)
"OpenMP on atoms, NUMTH= ",numth
123 if (
lot(
j) .eq. spc+1)
then
133 if (neigh(
k) .ne. coosph(
k))
then
159 if (
m .ne. 0) hsp(
l,-
m) = (-1)**
m*hsp(
l,
m)
164 sptshp(
l,
m)=sptshp(
l,
m)+hsp(
l,
m)
167 athsp(
l,
m)=athsp(
l,
m)+hsp(
l,
m)
180 write (6, *)
"OpenMP on MD steps, NUMTH= ",numth
191 if (
lot(
j) .eq. spc+1)
then
202 if (neigh(
k) .ne. coosph(
k))
then
230 if (
m .ne. 0) hsp(
l,-
m) = (-1)**
m*hsp(
l,
m)
237 sptshp(
l,
m)=sptshp(
l,
m)+hsp(
l,
m)
242 athsp(
l,
m)=athsp(
l,
m)+hsp(
l,
m)
258 if (nspsh .gt. 0)
then
261 spha(
l)=spha(
l)+(sptshp(
l,
m)/nspsh)**2
263 spha(
l)=sqrt(4*
pi*spha(
l)/(2*
l+1))
266 call save_curve (maxl+1, spha, idc-1,
idsp)
274 spha(
l)=sqrt(4*
pi*spha(
l)/(2*
l+1))
277 call save_curve (maxl+1, spha, idc,
idsp)
284 if (
allocated(athsp))
deallocate(athsp)
285 if (
allocated(sptshp))
deallocate(sptshp)
286 if (
allocated(neigh))
deallocate(neigh)
292DOUBLE PRECISION,
INTENT(IN) :: XC, YC, ZC
293DOUBLE PRECISION,
INTENT(OUT) :: RS, TS, PS
299rs= sqrt(xc**2 + yc**2 + zc**2)
309 DOUBLE PRECISION,
PARAMETER :: pi=acos(-1.0)
310 INTEGER,
INTENT(IN) :: l, m
311 DOUBLE PRECISION,
INTENT(IN) :: x
312 DOUBLE PRECISION :: y
314 DOUBLE PRECISION :: fact, oldfact, pll, pmm, pmmp1, omx2
323 pmm = pmm * (omx2*fact/(fact+1.0))
328 pmm=sqrt((2*m+1)*pmm/(4.0*pi))
329 if (mod(m,2) .eq. 1) pmm=-pmm
334 pmmp1=y*sqrt(2.0*m+3.0)*pmm
335 if (l .eq. (m+1))
then
338 oldfact=sqrt(2.0*m+3.0)
341 fact=sqrt((4.0*ll*ll-1.0)/(ll*ll-m*m))
342 pll=(y*pmmp1-pmm/oldfact)*fact
356 DOUBLE PRECISION,
PARAMETER :: pi=acos(-1.0)
358 INTEGER,
INTENT(IN) :: l, m
359 DOUBLE PRECISION,
INTENT(IN) :: x
360 DOUBLE PRECISION :: prod
363 DOUBLE PRECISION FUNCTION plegendre(l, m, x)
364 INTEGER,
INTENT(IN) :: l, m
365 DOUBLE PRECISION,
INTENT(IN) :: x
void show_error(char *error, int val, GtkWidget *win)
show error message
integer, dimension(:,:), allocatable contj
double precision, dimension(3) rij
integer, dimension(:,:,:), allocatable voisj
integer, dimension(:), allocatable lot
double precision, parameter pi
double precision function plgndr(l, m, x)
subroutine cart2spher(xc, yc, zc, rs, ts, ps)
integer(kind=c_int) function sphericals(maxl, spc, geo, idc, coosph)
double precision function plegendre(l, m, x)
double precision function calcdij(r12, at1, at2, step_1, step_2, sid)