21INTEGER (KIND=c_int) FUNCTION bonding (scf, sbf, adv, bdist, bmin, delt_ij, sfil) bind (C,NAME='bonding_')
30INTEGER (KIND=c_int),
INTENT(IN) :: scf, sbf, adv, bdist
31real(kind=c_double),
INTENT(IN) :: bmin, delt_ij
32CHARACTER (KIND=c_char),
DIMENSION(*),
INTENT(IN) :: sfil
33INTEGER,
DIMENSION(:),
ALLOCATABLE :: gesp
34CHARACTER (LEN=scf) :: sfile
35DOUBLE PRECISION :: dbd
36DOUBLE PRECISION,
DIMENSION(3) :: rbd
45 INTEGER,
DIMENSION(:),
ALLOCATABLE :: geo
46 TYPE (geometry),
POINTER :: first
47 TYPE (geometry),
POINTER :: last
48 TYPE (geometry),
POINTER :: next
49 TYPE (geometry),
POINTER :: prev
52TYPE(geometry),
DIMENSION(:),
POINTER :: geot, geop
53TYPE(geometry),
POINTER :: ga
58 LOGICAL,
INTENT(IN) :: alloc
61 LOGICAL,
INTENT(IN) :: alloc
63 DOUBLE PRECISION FUNCTION calcdij(R12, AT1, AT2, STEP_1, STEP_2, SID)
64 DOUBLE PRECISION,
DIMENSION(3),
INTENT(INOUT) :: r12
65 INTEGER,
INTENT(IN) :: at1, at2, step_1, step_2, sid
67 LOGICAL FUNCTION eescs ()
77 call show_error (
"Impossible to allocate memory"//char(0), &
78 "Function: bonding"//char(0),
"Table: STATBD"//char(0))
90if (
allocated(gesp))
deallocate(gesp)
91allocate(gesp(
nsp), stat=
err)
93 call show_error (
"Impossible to allocate memory"//char(0), &
94 "Function: bonding"//char(0),
"Table: GESP"//char(0))
101 call show_error (
"Impossible to allocate memory"//char(0), &
102 "Function: bonding"//char(0),
"Table: LT_GEOM"//char(0))
107allocate(geot(
nsp), stat=
err)
109 call show_error (
"Impossible to allocate memory"//char(0), &
110 "Function: bonding"//char(0),
"Pointer: GEOT"//char(0))
114allocate(geop(
nsp), stat=
err)
116 call show_error (
"Impossible to allocate memory"//char(0), &
117 "Function: bonding"//char(0),
"Pointer: GEOP"//char(0))
121allocate(ga, stat=
err)
123 call show_error (
"Impossible to allocate memory"//char(0), &
124 "Function: bonding"//char(0),
"Pointer: GA"//char(0))
130 nullify(geot(
i)%NEXT)
131 nullify(geot(
i)%PREV)
132 nullify(geot(
i)%FIRST)
133 nullify(geot(
i)%LAST)
135 nullify(geop(
i)%NEXT)
136 nullify(geop(
i)%PREV)
137 nullify(geop(
i)%FIRST)
138 nullify(geop(
i)%LAST)
144numth = omp_get_max_threads()
147 if (numth .ge. 2*(
ns-1))
then
154if (all_atoms) doatoms=.true.
158 if (
na.lt.numth) numth=
na
179 p =int((dbd-bmin)/delt_ij)
210 p =int((dbd-bmin)/delt_ij)
223if (sbf .eq. 1 .and. scf.gt.0)
then
227 open(unit=100, file=sfile,
action=
"write", status=
'unknown')
229 write (100, °
'("Configuration N",i6)')
i
232 write (100,
'(A2,i6)')
tl(
lot(
j)),
j
233 write (100,
'(4x,"Nc[tot]= ",i2)')
contj(
j,
i)
243 write (100, Å
'(10x,A2,1x,i6,1x,"at",1x,f7.5,1x,"")')
tl(
k),
voisj(
l,
j,
i), sqrt(dbd)
264 m = newcoord(1,
l, ga,
nsp, gesp)
266 n = newcoord(0,
l, ga,
nsp, gesp)
267 if (
m > 0 .and.
n > 0)
then
282 j = geop(
i)%LAST%INDICE
287 if (
k <
j) ga => ga%NEXT
291call send_coord_opengl (1,
ns*
na, 0, 0,
n,
togl)
292if (
allocated(
togl))
deallocate(
togl)
298 j = geot(
i)%LAST%INDICE
304 if (
k <
j) ga => ga%NEXT
311 j = geot(
i)%LAST%INDICE
312 if (
allocated(
lgsa))
deallocate(
lgsa)
315 call show_error (
"Impossible to allocate memory"//char(0), &
316 "Function: bonding"//char(0),
"Table: LGSA"//char(0))
323 if (
k <
j) ga => ga%NEXT
325 call init_menu_coordinations (0,
i-1,
j,
lgsa)
328if (
allocated(
lgsa))
deallocate(
lgsa)
329if (
allocated(
tigl))
deallocate(
tigl)
345 j = geop(
i)%LAST%INDICE
346 if (
allocated(
ngsa))
deallocate(
ngsa)
349 call show_error (
"Impossible to allocate memory"//char(0), &
350 "Function: bonding"//char(0),
"Table: NGSA"//char(0))
354 if (
allocated(
lgsa))
deallocate(
lgsa)
357 call show_error (
"Impossible to allocate memory"//char(0), &
358 "Function: bonding"//char(0),
"Table: LGSA"//char(0))
363 call allocate_partial_geo (
i-1,
j)
370 call partial_geo_out (
i-1,
k-1,
nsp, gesp)
371 if (
k .lt.
j) ga => ga%NEXT
373 call envout (
i-1,
j,
ngsa)
374 call init_menu_coordinations (1,
i-1,
j,
lgsa)
375 if (
allocated(
ngsa))
deallocate(
ngsa)
376 if (
allocated(
lgsa))
deallocate(
lgsa)
379if (
allocated(gesp))
deallocate(gesp)
382 if (.not.
eescs())
then
407 if (
allocated(
eabl))
deallocate(
eabl)
408 allocate(
eabl(0:bdist), stat=
err)
410 call show_error (
"Impossible to allocate memory"//char(0), &
411 "Function: bonding"//char(0),
"Table: EABL"//char(0))
450INTEGER FUNCTION newcoord (ID, GEO, GP, NP, GSP)
452INTEGER,
INTENT(IN) ::
id, geo, np
453INTEGER,
DIMENSION(NP),
INTENT(IN) :: gsp
454TYPE(geometry),
INTENT(INOUT),
POINTER :: gp
456LOGICAL :: newgeo=.false.
457TYPE(geometry),
POINTER :: gm
459if (gp%INDICE .eq. 0)
then
479 if (gp%COORD .eq. geo)
then
484 if (
ab .lt. ac) gp => gp%NEXT
488 if (gp%COORD .eq. geo)
then
491 if (gp%GEO(ad) .ne. gsp(ad))
then
496 if (.not.newgeo)
exit
498 if (
ab .lt. ac) gp => gp%NEXT
502 allocate(gm, stat=
err)
504 call show_error (
"Impossible to allocate memory"//char(0), &
505 "Function: NEWCOORD"//char(0),
"Pointer: GM"//char(0))
519 gm%INDICE = gp%INDICE+1
532 gp%NCOORD = gp%NCOORD+1
541SUBROUTINE clean_geom ()
569SUBROUTINE sendcuts (cspa, cspb, cutab) bind (C,NAME='sendcuts_')
575INTEGER (KIND=c_int),
INTENT(IN) :: cspa, cspb
576real(kind=c_double),
INTENT(IN) :: cutab
578if (cspa .eq.
nsp)
then
581 gr_cut(cspa+1,cspb+1) = cutab**2
586REAL (KIND=c_double) FUNCTION fdmax(use_pbc) bind (C,NAME='fdmax_')
592INTEGER (KIND=c_int),
INTENT(IN) :: use_pbc
594if (use_pbc .eq. 0)
then
637REAL (KIND=c_double) FUNCTION fkmin(use_pbc) bind (C,NAME='fkmin_')
643INTEGER (KIND=c_int),
INTENT(IN) :: use_pbc
645if (use_pbc .eq. 0)
then
657REAL (KIND=c_double) FUNCTION oglmax() bind (C,NAME='oglmax_')
663DOUBLE PRECISION :: dmax
logical function allocedco(alloc)
logical function allocbonds(alloc)
integer(kind=c_int) function bonding(scf, sbf, adv, bdist, bmin, delt_ij, sfil)
subroutine sendcuts(cspa, cspb, cutab)
real(kind=c_double) function oglmax()
real(kind=c_double) function fdmax(use_pbc)
real(kind=c_double) function fkmin(use_pbc)
void show_error(char *error, int val, GtkWidget *win)
show error message
integer(kind=c_int) function molecules(frag_and_mol, allbonds)
double precision, dimension(:,:,:), allocatable fullpos
integer, dimension(:,:,:), allocatable statbd
double precision, dimension(:,:,:), allocatable nfullpos
double precision, dimension(:), allocatable tdtabl
integer, dimension(:), allocatable lgsa
integer, dimension(:,:), allocatable contj
double precision, dimension(:,:), allocatable ctypea
character(len=2), dimension(:), allocatable tl
double precision, dimension(:,:), allocatable ma_count
double precision, dimension(:), allocatable ctabl
double precision, dimension(3) pmax
integer, dimension(:), allocatable nbspbs
double precision, dimension(:,:), allocatable etypea
double precision, dimension(:), allocatable eabl
double precision gr_cutoff
integer, dimension(:,:), allocatable corta
integer, dimension(:,:,:), allocatable la_count
type(lattice), dimension(:), allocatable, target the_box
double precision, dimension(:), allocatable mac
integer, dimension(:), allocatable ngsa
double precision, dimension(:), allocatable cabl
double precision, dimension(3) pmin
integer, dimension(:,:), allocatable edgeta
integer, dimension(:,:,:), allocatable voisj
integer, dimension(:,:), allocatable tda
double precision, dimension(:,:), allocatable etda
integer, dimension(:,:), allocatable defta
double precision, dimension(:), allocatable ectabl
double precision, dimension(:,:), allocatable gr_cut
double precision, dimension(:), allocatable etabl
double precision, dimension(:), allocatable dabl
double precision, dimension(:), allocatable sa_count
double precision, dimension(:), allocatable dtabl
integer, dimension(:), allocatable lot
double precision, dimension(:,:), allocatable detypea
integer, dimension(:,:), allocatable lt_geom
integer, dimension(:), allocatable tigl
integer, dimension(:), allocatable togl
double precision function calcdij(r12, at1, at2, step_1, step_2, sid)
subroutine calcrij(at1, at2, step_1, step_2, sid)