43 #include "./base/base_uses.f90"
47 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'topology_connectivity_util'
64 topology, subsys_section)
65 TYPE(molecule_kind_type),
DIMENSION(:),
POINTER :: molecule_kind_set
66 TYPE(molecule_type),
DIMENSION(:),
POINTER :: molecule_set
68 TYPE(section_vals_type),
POINTER :: subsys_section
70 CHARACTER(len=*),
PARAMETER :: routinen =
'topology_connectivity_pack'
72 CHARACTER(LEN=default_string_length) :: name
73 INTEGER :: counter, first, handle, handle2, i, ibend, ibond, idim, iimpr, ikind, imol, &
74 inter_bends, inter_bonds, inter_imprs, inter_torsions, inter_ubs, intra_bends, &
75 intra_bonds, intra_imprs, intra_torsions, intra_ubs, inum, ires, istart_mol, istart_typ, &
76 itorsion, ityp, iub, iw, j, j1, j2, j3, j4, jind, last, min_index, natom, nelectron, &
77 nsgf, nval_tot1, nval_tot2, nvar1, nvar2, output_unit, stat
78 INTEGER,
DIMENSION(:),
POINTER :: c_var_a, c_var_b, c_var_c, c_var_d, c_var_type, &
79 first_list, last_list, map_atom_mol, map_atom_type, map_cvar_mol, map_cvars, map_var_mol, &
80 map_vars, molecule_list
81 INTEGER,
DIMENSION(:, :),
POINTER :: bnd_ctype, bnd_type
82 LOGICAL :: found, found_last
84 TYPE(atom_type),
DIMENSION(:),
POINTER :: atom_list
85 TYPE(bend_type),
DIMENSION(:),
POINTER :: bend_list
86 TYPE(bond_type),
DIMENSION(:),
POINTER :: bond_list
88 TYPE(cp_logger_type),
POINTER :: logger
89 TYPE(impr_type),
DIMENSION(:),
POINTER :: impr_list
90 TYPE(local_states_type),
DIMENSION(:),
POINTER :: lmi
91 TYPE(molecule_kind_type),
POINTER :: molecule_kind
92 TYPE(molecule_type),
POINTER :: molecule
93 TYPE(opbend_type),
DIMENSION(:),
POINTER :: opbend_list
94 TYPE(torsion_type),
DIMENSION(:),
POINTER :: torsion_list
95 TYPE(ub_type),
DIMENSION(:),
POINTER :: ub_list
101 extension=
".subsysLog")
102 CALL timeset(routinen, handle)
106 ALLOCATE (map_atom_mol(
topology%natoms))
107 ALLOCATE (map_atom_type(
topology%natoms))
112 CALL timeset(routinen//
"_1", handle2)
122 IF ((atom_info%map_mol_typ(i + 1) /= atom_info%map_mol_typ(i)) .OR. &
123 ((atom_info%map_mol_res(i + 1) /= atom_info%map_mol_res(i)) .AND. &
127 map_atom_type(i + 1) =
topology%nmol_type
128 IF ((atom_info%map_mol_typ(i + 1) /= atom_info%map_mol_typ(i)) .OR. &
129 (atom_info%map_mol_num(i + 1) /= atom_info%map_mol_num(i)) .OR. &
130 (atom_info%map_mol_res(i + 1) /= atom_info%map_mol_res(i)))
THEN
134 IF ((atom_info%map_mol_typ(i + 1) == atom_info%map_mol_typ(i)) .AND. &
135 (atom_info%map_mol_num(i + 1) == atom_info%map_mol_num(i)) .AND. &
136 (atom_info%map_mol_res(i + 1) /= atom_info%map_mol_res(i)))
THEN
140 IF (iw > 0)
WRITE (iw, *)
"topology%nmol ::",
topology%nmol
141 IF (iw > 0)
WRITE (iw, *)
"topology%nmol_type ::",
topology%nmol_type
142 IF (iw > 0)
WRITE (iw, *)
"topology%nmol_conn ::",
topology%nmol_conn
143 CALL timestop(handle2)
149 CALL timeset(routinen//
"_1.1", handle2)
150 istart_mol = map_atom_mol(1)
151 istart_typ = map_atom_type(1)
153 IF ((map_atom_mol(i) /= istart_mol) .AND. (map_atom_type(i) == istart_typ))
THEN
154 map_atom_mol(i) = -map_atom_mol(i)
155 ELSE IF (map_atom_type(i) /= istart_typ)
THEN
156 istart_mol = map_atom_mol(i)
157 istart_typ = map_atom_type(i)
160 CALL timestop(handle2)
165 CALL timeset(routinen//
"_2", handle2)
167 cpabort(
"No molecule kind defined")
169 NULLIFY (molecule_kind_set)
172 IF (iw > 0)
WRITE (iw, *)
" Allocated molecule_kind_set, Dimenstion of ", &
173 SIZE(molecule_kind_set)
175 CALL timestop(handle2)
180 CALL timeset(routinen//
"_3", handle2)
182 cpabort(
"No molecule defined")
184 NULLIFY (molecule_set)
187 IF (iw > 0)
WRITE (iw, *)
" Allocated molecule_set, dimension of ", &
190 CALL timestop(handle2)
195 CALL timeset(routinen//
"_4", handle2)
199 IF (ikind /= map_atom_type(i))
THEN
200 ikind = map_atom_type(i)
201 molecule_kind => molecule_kind_set(ikind)
204 name = trim(
id2str(atom_info%id_molname(i)))
207 molname_generated=
topology%molname_generated, &
213 CALL timestop(handle2)
218 CALL timeset(routinen//
"_5", handle2)
220 ikind = map_atom_type(1)
221 imol = abs(map_atom_mol(1))
224 IF (ikind /= map_atom_type(i + 1))
THEN
227 imol = abs(map_atom_mol(i))
228 ELSEIF (ikind ==
topology%nmol_type)
THEN
231 imol = abs(map_atom_mol(natom))
238 ALLOCATE (molecule_list(imol - counter))
239 DO j = 1,
SIZE(molecule_list)
240 molecule_list(j) = j + counter
242 molecule_kind => molecule_kind_set(ikind)
244 molecule_list=molecule_list)
245 IF (iw > 0)
WRITE (iw, *)
" molecule_list", ikind, molecule_list(:)
248 ikind = map_atom_type(i + 1)
253 imol = abs(map_atom_mol(natom))
255 ALLOCATE (molecule_list(imol - counter))
256 DO j = 1,
SIZE(molecule_list)
257 molecule_list(j) = j + counter
259 molecule_kind => molecule_kind_set(ikind)
261 molecule_list=molecule_list)
262 IF (iw > 0)
WRITE (iw, *)
" molecule_list", ikind, molecule_list(:)
264 CALL timestop(handle2)
269 CALL timeset(routinen//
"_6", handle2)
270 DO ikind = 1,
SIZE(molecule_kind_set)
271 molecule_kind => molecule_kind_set(ikind)
273 molecule_list=molecule_list)
274 DO i = 1,
SIZE(molecule_list)
275 molecule => molecule_set(molecule_list(i))
276 CALL set_molecule(molecule, molecule_kind=molecule_kind)
279 CALL timestop(handle2)
284 ALLOCATE (first_list(
SIZE(molecule_set)))
285 ALLOCATE (last_list(
SIZE(molecule_set)))
286 CALL timeset(routinen//
"_7", handle2)
289 ityp = atom_info%map_mol_typ(1)
290 inum = atom_info%map_mol_num(1)
291 ires = atom_info%map_mol_res(1)
295 IF ((atom_info%map_mol_typ(j) /= ityp) .OR. &
296 (atom_info%map_mol_num(j) /= inum) .OR. &
297 (atom_info%map_mol_res(j) /= ires))
THEN
298 ityp = atom_info%map_mol_typ(j)
299 inum = atom_info%map_mol_num(j)
300 ires = atom_info%map_mol_res(j)
307 last_list(ikind) = first_list(ikind + 1) - 1
311 CALL timestop(handle2)
316 CALL timeset(routinen//
"_8", handle2)
317 DO imol = 1,
SIZE(molecule_set)
318 molecule => molecule_set(imol)
322 CALL timestop(handle2)
327 CALL timeset(routinen//
"_9", handle2)
329 DO imol = 1,
SIZE(molecule_set)
330 molecule => molecule_set(imol)
331 molecule_kind => molecule_set(imol)%molecule_kind
334 IF (counter /= i)
THEN
337 first_atom=first, last_atom=last)
339 IF (first /= 0 .AND. last /= 0) natom = last - first + 1
340 ALLOCATE (atom_list(natom))
343 NULLIFY (atom_list(i)%atomic_kind)
344 atom_list(i)%id_name = atom_info%id_atmname(i + first - 1)
345 IF (iw > 0)
WRITE (iw,
'(5X,A,3I5,1X,A5)')
"atom_list ", &
346 imol, counter, i, trim(
id2str(atom_list(i)%id_name))
351 CALL timestop(handle2)
356 CALL timeset(routinen//
"_10", handle2)
360 NULLIFY (map_vars, map_cvars, bnd_type, bnd_ctype)
361 IF (
ASSOCIATED(conn_info%bond_a)) nvar1 =
SIZE(conn_info%bond_a)
362 IF (
ASSOCIATED(conn_info%c_bond_a)) nvar2 =
SIZE(conn_info%c_bond_a)
365 ALLOCATE (map_var_mol(nvar1))
366 ALLOCATE (map_cvar_mol(nvar2))
370 j1 = map_atom_mol(conn_info%bond_a(i))
371 j2 = map_atom_mol(conn_info%bond_b(i))
373 IF (j1 > 0) map_var_mol(i) = map_atom_type(conn_info%bond_a(i))
377 min_index = min(conn_info%c_bond_a(i), conn_info%c_bond_b(i))
378 j1 = map_atom_mol(min_index)
379 IF (j1 > 0) map_cvar_mol(i) = map_atom_type(min_index)
381 CALL find_bnd_typ(
topology%nmol_type, map_vars, map_var_mol, bnd_type, nvar1)
382 CALL find_bnd_typ(
topology%nmol_type, map_cvars, map_cvar_mol, bnd_ctype, nvar2)
386 IF (all(bnd_type(:, i) > 0))
THEN
387 intra_bonds = bnd_type(2, i) - bnd_type(1, i) + 1
389 IF (all(bnd_ctype(:, i) > 0))
THEN
390 inter_bonds = bnd_ctype(2, i) - bnd_ctype(1, i) + 1
392 ibond = intra_bonds + inter_bonds
394 WRITE (iw, *)
" Total number bonds for molecule type ", i,
" :", ibond
395 WRITE (iw, *)
" intra (bonds inside molecules) :: ", intra_bonds
396 WRITE (iw, *)
" inter (bonds between molecules) :: ", inter_bonds
398 molecule_kind => molecule_kind_set(i)
399 nval_tot2 = nval_tot2 + ibond*
SIZE(molecule_kind%molecule_list)
401 ALLOCATE (bond_list(ibond))
403 DO j = bnd_type(1, i), bnd_type(2, i)
407 first = first_list(map_atom_mol(conn_info%bond_a(jind)))
408 bond_list(ibond)%a = conn_info%bond_a(jind) - first + 1
409 bond_list(ibond)%b = conn_info%bond_b(jind) - first + 1
413 bond_list(ibond)%itype = conn_info%bond_type(jind)
416 NULLIFY (bond_list(ibond)%bond_kind)
418 WRITE (iw,
'(7X,A,I3,1X,A,I5,I5,1X,A,I5,I5)')
"molecule_kind", &
420 conn_info%bond_a(jind), &
421 conn_info%bond_b(jind), &
422 "offset number at", &
423 conn_info%bond_a(jind) - first + 1, &
424 conn_info%bond_b(jind) - first + 1
427 DO j = bnd_ctype(1, i), bnd_ctype(2, i)
431 min_index = min(conn_info%c_bond_a(jind), conn_info%c_bond_b(jind))
432 first = first_list(map_atom_mol(min_index))
433 bond_list(ibond)%a = conn_info%c_bond_a(jind) - first + 1
434 bond_list(ibond)%b = conn_info%c_bond_b(jind) - first + 1
438 bond_list(ibond)%itype = conn_info%c_bond_type(jind)
441 NULLIFY (bond_list(ibond)%bond_kind)
443 WRITE (iw,
'(7X,A,I3,1X,A,I5,I5,1X,A,I5,I5)')
"molecule_kind", &
445 conn_info%c_bond_a(jind), &
446 conn_info%c_bond_b(jind), &
447 "offset number at", &
448 conn_info%c_bond_a(jind) - first + 1, &
449 conn_info%c_bond_b(jind) - first + 1
453 nbond=
SIZE(bond_list), bond_list=bond_list)
455 IF ((nval_tot1 /= nval_tot2) .AND. (output_unit > 0))
THEN
456 WRITE (output_unit,
'(/)')
457 WRITE (output_unit,
'(T5,A)')
"ERROR| Mismatching found between the total number of atoms"
458 WRITE (output_unit,
'(T5,A)')
"ERROR| and the number of atoms computed multiplying the Nr."
459 WRITE (output_unit,
'(T5,A)')
"ERROR| of molecules by the number of atoms building that"
460 WRITE (output_unit,
'(T5,A)')
"ERROR| kind of molecule."
461 WRITE (output_unit,
'(T5,A)')
"ERROR| This happens when the connectivity is wrongly built"
462 WRITE (output_unit,
'(T5,A)')
"ERROR| One example could be two same kind of molecules have"
463 WRITE (output_unit,
'(T5,A)')
"ERROR| a different number of atoms. Check the connectivity!"
465 cpassert(nval_tot1 == nval_tot2)
466 DEALLOCATE (map_var_mol)
467 DEALLOCATE (map_cvar_mol)
468 DEALLOCATE (map_vars)
469 DEALLOCATE (map_cvars)
470 DEALLOCATE (bnd_type)
471 DEALLOCATE (bnd_ctype)
472 CALL timestop(handle2)
478 CALL timeset(routinen//
"_11_pre", handle2)
480 ALLOCATE (c_var_a(idim))
481 ALLOCATE (c_var_b(idim))
482 ALLOCATE (c_var_c(idim))
483 found =
ASSOCIATED(conn_info%theta_type)
485 ALLOCATE (c_var_type(idim))
487 IF (
ASSOCIATED(conn_info%c_bond_a) .AND.
ASSOCIATED(conn_info%theta_a))
THEN
488 DO j = 1,
SIZE(conn_info%theta_a)
489 j1 = map_atom_mol(conn_info%theta_a(j))
490 j2 = map_atom_mol(conn_info%theta_b(j))
491 j3 = map_atom_mol(conn_info%theta_c(j))
492 IF (j1 /= j2 .OR. j2 /= j3)
THEN
496 CALL reallocate(c_var_a, 1, idim)
497 CALL reallocate(c_var_b, 1, idim)
498 CALL reallocate(c_var_c, 1, idim)
500 CALL reallocate(c_var_type, 1, idim)
503 DO j = 1,
SIZE(conn_info%theta_a)
504 j1 = map_atom_mol(conn_info%theta_a(j))
505 j2 = map_atom_mol(conn_info%theta_b(j))
506 j3 = map_atom_mol(conn_info%theta_c(j))
507 IF (j1 /= j2 .OR. j2 /= j3)
THEN
509 c_var_a(idim) = conn_info%theta_a(j)
510 c_var_b(idim) = conn_info%theta_b(j)
511 c_var_c(idim) = conn_info%theta_c(j)
513 c_var_type(idim) = conn_info%theta_type(j)
518 CALL timestop(handle2)
519 CALL timeset(routinen//
"_11", handle2)
523 NULLIFY (map_vars, map_cvars, bnd_type, bnd_ctype)
524 IF (
ASSOCIATED(conn_info%theta_a)) nvar1 =
SIZE(conn_info%theta_a)
525 IF (
ASSOCIATED(c_var_a)) nvar2 =
SIZE(c_var_a)
528 ALLOCATE (map_var_mol(nvar1))
529 ALLOCATE (map_cvar_mol(nvar2))
533 j1 = map_atom_mol(conn_info%theta_a(i))
534 j2 = map_atom_mol(conn_info%theta_b(i))
535 j3 = map_atom_mol(conn_info%theta_c(i))
536 IF (j1 == j2 .AND. j2 == j3)
THEN
537 IF (j1 > 0) map_var_mol(i) = map_atom_type(conn_info%theta_a(i))
541 min_index = min(c_var_a(i), c_var_b(i), c_var_c(i))
542 j1 = map_atom_mol(min_index)
543 IF (j1 > 0) map_cvar_mol(i) = map_atom_type(min_index)
545 CALL find_bnd_typ(
topology%nmol_type, map_vars, map_var_mol, bnd_type, nvar1)
546 CALL find_bnd_typ(
topology%nmol_type, map_cvars, map_cvar_mol, bnd_ctype, nvar2)
550 IF (all(bnd_type(:, i) > 0))
THEN
551 intra_bends = bnd_type(2, i) - bnd_type(1, i) + 1
553 IF (all(bnd_ctype(:, i) > 0))
THEN
554 inter_bends = bnd_ctype(2, i) - bnd_ctype(1, i) + 1
556 ibend = intra_bends + inter_bends
558 WRITE (iw, *)
" Total number of angles for molecule type ", i,
" :", ibend
559 WRITE (iw, *)
" intra (angles inside molecules) :: ", intra_bends
560 WRITE (iw, *)
" inter (angles between molecules) :: ", inter_bends
562 molecule_kind => molecule_kind_set(i)
563 nval_tot2 = nval_tot2 + ibend*
SIZE(molecule_kind%molecule_list)
564 ALLOCATE (bend_list(ibend))
566 DO j = bnd_type(1, i), bnd_type(2, i)
570 first = first_list(map_atom_mol(conn_info%theta_a(jind)))
571 bend_list(ibend)%a = conn_info%theta_a(jind) - first + 1
572 bend_list(ibend)%b = conn_info%theta_b(jind) - first + 1
573 bend_list(ibend)%c = conn_info%theta_c(jind) - first + 1
577 bend_list(ibend)%itype = conn_info%theta_type(jind)
580 NULLIFY (bend_list(ibend)%bend_kind)
582 WRITE (iw,
'(7X,A,I3,1X,A,I5,I5,I5,1X,A,I5,I5,I5)') &
583 "molecule_kind", ikind,
"intra bend", &
584 conn_info%theta_a(jind), &
585 conn_info%theta_b(jind), &
586 conn_info%theta_c(jind), &
587 "offset number at", &
588 conn_info%theta_a(jind) - first + 1, &
589 conn_info%theta_b(jind) - first + 1, &
590 conn_info%theta_c(jind) - first + 1
593 DO j = bnd_ctype(1, i), bnd_ctype(2, i)
597 min_index = min(c_var_a(jind), c_var_b(jind), c_var_c(jind))
598 first = first_list(map_atom_mol(min_index))
599 bend_list(ibend)%a = c_var_a(jind) - first + 1
600 bend_list(ibend)%b = c_var_b(jind) - first + 1
601 bend_list(ibend)%c = c_var_c(jind) - first + 1
605 bend_list(ibend)%itype = c_var_type(jind)
608 NULLIFY (bend_list(ibend)%bend_kind)
610 WRITE (iw,
'(7X,A,I3,1X,A,I5,I5,I5,1X,A,I5,I5,I5)') &
611 "molecule_kind", ikind,
"inter bend", &
615 "offset number at", &
616 c_var_a(jind) - first + 1, &
617 c_var_b(jind) - first + 1, &
618 c_var_c(jind) - first + 1
622 nbend=
SIZE(bend_list), bend_list=bend_list)
624 cpassert(nval_tot1 == nval_tot2)
625 DEALLOCATE (map_var_mol)
626 DEALLOCATE (map_cvar_mol)
627 DEALLOCATE (map_vars)
628 DEALLOCATE (map_cvars)
629 DEALLOCATE (bnd_type)
630 DEALLOCATE (bnd_ctype)
635 DEALLOCATE (c_var_type)
637 CALL timestop(handle2)
642 CALL timeset(routinen//
"_12_pre", handle2)
644 ALLOCATE (c_var_a(idim))
645 ALLOCATE (c_var_b(idim))
646 ALLOCATE (c_var_c(idim))
647 IF (
ASSOCIATED(conn_info%c_bond_a) .AND.
ASSOCIATED(conn_info%ub_a))
THEN
648 DO j = 1,
SIZE(conn_info%ub_a)
649 j1 = map_atom_mol(conn_info%ub_a(j))
650 j2 = map_atom_mol(conn_info%ub_b(j))
651 j3 = map_atom_mol(conn_info%ub_c(j))
652 IF (j1 /= j2 .OR. j2 /= j3)
THEN
656 CALL reallocate(c_var_a, 1, idim)
657 CALL reallocate(c_var_b, 1, idim)
658 CALL reallocate(c_var_c, 1, idim)
660 DO j = 1,
SIZE(conn_info%ub_a)
661 j1 = map_atom_mol(conn_info%ub_a(j))
662 j2 = map_atom_mol(conn_info%ub_b(j))
663 j3 = map_atom_mol(conn_info%ub_c(j))
664 IF (j1 /= j2 .OR. j2 /= j3)
THEN
666 c_var_a(idim) = conn_info%ub_a(j)
667 c_var_b(idim) = conn_info%ub_b(j)
668 c_var_c(idim) = conn_info%ub_c(j)
672 CALL timestop(handle2)
673 CALL timeset(routinen//
"_12", handle2)
677 NULLIFY (map_vars, map_cvars, bnd_type, bnd_ctype)
678 IF (
ASSOCIATED(conn_info%ub_a)) nvar1 =
SIZE(conn_info%ub_a)
679 IF (
ASSOCIATED(c_var_a)) nvar2 =
SIZE(c_var_a)
682 ALLOCATE (map_var_mol(nvar1))
683 ALLOCATE (map_cvar_mol(nvar2))
687 j1 = map_atom_mol(conn_info%ub_a(i))
688 j2 = map_atom_mol(conn_info%ub_b(i))
689 j3 = map_atom_mol(conn_info%ub_c(i))
690 IF (j1 == j2 .AND. j2 == j3)
THEN
691 IF (j1 > 0) map_var_mol(i) = map_atom_type(conn_info%ub_a(i))
695 min_index = min(c_var_a(i), c_var_b(i), c_var_c(i))
696 j1 = map_atom_mol(min_index)
697 IF (j1 > 0) map_cvar_mol(i) = map_atom_type(min_index)
699 CALL find_bnd_typ(
topology%nmol_type, map_vars, map_var_mol, bnd_type, nvar1)
700 CALL find_bnd_typ(
topology%nmol_type, map_cvars, map_cvar_mol, bnd_ctype, nvar2)
704 IF (all(bnd_type(:, i) > 0))
THEN
705 intra_ubs = bnd_type(2, i) - bnd_type(1, i) + 1
707 IF (all(bnd_ctype(:, i) > 0))
THEN
708 inter_ubs = bnd_ctype(2, i) - bnd_ctype(1, i) + 1
710 iub = intra_ubs + inter_ubs
712 WRITE (iw, *)
" Total number of Urey-Bradley for molecule type ", i,
" :", iub
713 WRITE (iw, *)
" intra (UB inside molecules) :: ", intra_ubs
714 WRITE (iw, *)
" inter (UB between molecules) :: ", inter_ubs
716 molecule_kind => molecule_kind_set(i)
717 nval_tot2 = nval_tot2 + iub*
SIZE(molecule_kind%molecule_list)
718 ALLOCATE (ub_list(iub))
720 DO j = bnd_type(1, i), bnd_type(2, i)
724 first = first_list(map_atom_mol(conn_info%ub_a(jind)))
725 ub_list(iub)%a = conn_info%ub_a(jind) - first + 1
726 ub_list(iub)%b = conn_info%ub_b(jind) - first + 1
727 ub_list(iub)%c = conn_info%ub_c(jind) - first + 1
730 NULLIFY (ub_list(iub)%ub_kind)
732 WRITE (iw,
'(7X,A,I3,1X,A,I5,I5,I5,1X,A,I5,I5,I5)') &
733 "molecule_kind", i,
"intra UB", &
734 conn_info%ub_a(jind), &
735 conn_info%ub_b(jind), &
736 conn_info%ub_c(jind), &
737 "offset number at", &
738 conn_info%ub_a(jind) - first + 1, &
739 conn_info%ub_b(jind) - first + 1, &
740 conn_info%ub_c(jind) - first + 1
743 DO j = bnd_ctype(1, i), bnd_ctype(2, i)
747 min_index = min(c_var_a(jind), c_var_b(jind), c_var_c(jind))
748 first = first_list(map_atom_mol(min_index))
749 ub_list(iub)%a = c_var_a(jind) - first + 1
750 ub_list(iub)%b = c_var_b(jind) - first + 1
751 ub_list(iub)%c = c_var_c(jind) - first + 1
754 NULLIFY (ub_list(iub)%ub_kind)
756 WRITE (iw,
'(7X,A,I3,1X,A,I5,I5,I5,1X,A,I5,I5,I5)') &
757 "molecule_kind", i,
"inter UB", &
761 "offset number at", &
762 c_var_a(jind) - first + 1, &
763 c_var_b(jind) - first + 1, &
764 c_var_c(jind) - first + 1
768 nub=
SIZE(ub_list), ub_list=ub_list)
770 cpassert(nval_tot1 == nval_tot2)
771 DEALLOCATE (map_var_mol)
772 DEALLOCATE (map_cvar_mol)
773 DEALLOCATE (map_vars)
774 DEALLOCATE (map_cvars)
775 DEALLOCATE (bnd_type)
776 DEALLOCATE (bnd_ctype)
780 CALL timestop(handle2)
786 CALL timeset(routinen//
"_13_pre", handle2)
788 ALLOCATE (c_var_a(idim))
789 ALLOCATE (c_var_b(idim))
790 ALLOCATE (c_var_c(idim))
791 ALLOCATE (c_var_d(idim))
792 found =
ASSOCIATED(conn_info%phi_type)
794 ALLOCATE (c_var_type(idim))
796 IF (
ASSOCIATED(conn_info%c_bond_a) .AND.
ASSOCIATED(conn_info%phi_a))
THEN
797 DO j = 1,
SIZE(conn_info%phi_a)
798 j1 = map_atom_mol(conn_info%phi_a(j))
799 j2 = map_atom_mol(conn_info%phi_b(j))
800 j3 = map_atom_mol(conn_info%phi_c(j))
801 j4 = map_atom_mol(conn_info%phi_d(j))
802 IF (j1 /= j2 .OR. j2 /= j3 .OR. j3 /= j4)
THEN
806 CALL reallocate(c_var_a, 1, idim)
807 CALL reallocate(c_var_b, 1, idim)
808 CALL reallocate(c_var_c, 1, idim)
809 CALL reallocate(c_var_d, 1, idim)
811 CALL reallocate(c_var_type, 1, idim)
814 DO j = 1,
SIZE(conn_info%phi_a)
815 j1 = map_atom_mol(conn_info%phi_a(j))
816 j2 = map_atom_mol(conn_info%phi_b(j))
817 j3 = map_atom_mol(conn_info%phi_c(j))
818 j4 = map_atom_mol(conn_info%phi_d(j))
819 IF (j1 /= j2 .OR. j2 /= j3 .OR. j3 /= j4)
THEN
821 c_var_a(idim) = conn_info%phi_a(j)
822 c_var_b(idim) = conn_info%phi_b(j)
823 c_var_c(idim) = conn_info%phi_c(j)
824 c_var_d(idim) = conn_info%phi_d(j)
826 c_var_type(idim) = conn_info%phi_type(j)
831 CALL timestop(handle2)
832 CALL timeset(routinen//
"_13", handle2)
836 NULLIFY (map_vars, map_cvars, bnd_type, bnd_ctype)
837 IF (
ASSOCIATED(conn_info%phi_a)) nvar1 =
SIZE(conn_info%phi_a)
838 IF (
ASSOCIATED(c_var_a)) nvar2 =
SIZE(c_var_a)
841 ALLOCATE (map_var_mol(nvar1))
842 ALLOCATE (map_cvar_mol(nvar2))
846 j1 = map_atom_mol(conn_info%phi_a(i))
847 j2 = map_atom_mol(conn_info%phi_b(i))
848 j3 = map_atom_mol(conn_info%phi_c(i))
849 j4 = map_atom_mol(conn_info%phi_d(i))
850 IF (j1 == j2 .AND. j2 == j3 .AND. j3 == j4)
THEN
851 IF (j1 > 0) map_var_mol(i) = map_atom_type(conn_info%phi_a(i))
855 min_index = min(c_var_a(i), c_var_b(i), c_var_c(i), c_var_d(i))
856 j1 = map_atom_mol(min_index)
857 IF (j1 > 0) map_cvar_mol(i) = map_atom_type(min_index)
859 CALL find_bnd_typ(
topology%nmol_type, map_vars, map_var_mol, bnd_type, nvar1)
860 CALL find_bnd_typ(
topology%nmol_type, map_cvars, map_cvar_mol, bnd_ctype, nvar2)
864 IF (all(bnd_type(:, i) > 0))
THEN
865 intra_torsions = bnd_type(2, i) - bnd_type(1, i) + 1
867 IF (all(bnd_ctype(:, i) > 0))
THEN
868 inter_torsions = bnd_ctype(2, i) - bnd_ctype(1, i) + 1
870 itorsion = intra_torsions + inter_torsions
872 WRITE (iw, *)
" Total number of torsions for molecule type ", i,
" :", itorsion
873 WRITE (iw, *)
" intra (torsions inside molecules) :: ", intra_torsions
874 WRITE (iw, *)
" inter (torsions between molecules) :: ", inter_torsions
876 molecule_kind => molecule_kind_set(i)
877 nval_tot2 = nval_tot2 + itorsion*
SIZE(molecule_kind%molecule_list)
878 ALLOCATE (torsion_list(itorsion))
880 DO j = bnd_type(1, i), bnd_type(2, i)
882 itorsion = itorsion + 1
884 first = first_list(map_atom_mol(conn_info%phi_a(jind)))
885 torsion_list(itorsion)%a = conn_info%phi_a(jind) - first + 1
886 torsion_list(itorsion)%b = conn_info%phi_b(jind) - first + 1
887 torsion_list(itorsion)%c = conn_info%phi_c(jind) - first + 1
888 torsion_list(itorsion)%d = conn_info%phi_d(jind) - first + 1
892 torsion_list(itorsion)%itype = conn_info%phi_type(jind)
895 NULLIFY (torsion_list(itorsion)%torsion_kind)
897 WRITE (iw,
'(7X,A,I3,1X,A,I4,I4,I4,I4,1X,A,I4,I4,I4,I4)') &
898 "molecule_kind", i,
"intra TOR", &
899 conn_info%phi_a(jind), &
900 conn_info%phi_b(jind), &
901 conn_info%phi_c(jind), &
902 conn_info%phi_d(jind), &
903 "offset number at", &
904 conn_info%phi_a(jind) - first + 1, &
905 conn_info%phi_b(jind) - first + 1, &
906 conn_info%phi_c(jind) - first + 1, &
907 conn_info%phi_d(jind) - first + 1
910 DO j = bnd_ctype(1, i), bnd_ctype(2, i)
912 itorsion = itorsion + 1
914 min_index = min(c_var_a(jind), c_var_b(jind), c_var_c(jind), c_var_d(jind))
915 first = first_list(map_atom_mol(min_index))
916 torsion_list(itorsion)%a = c_var_a(jind) - first + 1
917 torsion_list(itorsion)%b = c_var_b(jind) - first + 1
918 torsion_list(itorsion)%c = c_var_c(jind) - first + 1
919 torsion_list(itorsion)%d = c_var_d(jind) - first + 1
923 torsion_list(itorsion)%itype = c_var_type(jind)
926 NULLIFY (torsion_list(itorsion)%torsion_kind)
928 WRITE (iw,
'(7X,A,I3,1X,A,I4,I4,I4,I4,1X,A,I4,I4,I4,I4)') &
929 "molecule_kind", i,
"inter TOR", &
934 "offset number at", &
935 c_var_a(jind) - first + 1, &
936 c_var_b(jind) - first + 1, &
937 c_var_c(jind) - first + 1, &
938 c_var_d(jind) - first + 1
942 ntorsion=
SIZE(torsion_list), torsion_list=torsion_list)
944 cpassert(nval_tot1 == nval_tot2)
945 DEALLOCATE (map_var_mol)
946 DEALLOCATE (map_cvar_mol)
947 DEALLOCATE (map_vars)
948 DEALLOCATE (map_cvars)
949 DEALLOCATE (bnd_type)
950 DEALLOCATE (bnd_ctype)
956 DEALLOCATE (c_var_type)
958 CALL timestop(handle2)
965 CALL timeset(routinen//
"_14_pre", handle2)
967 ALLOCATE (c_var_a(idim))
968 ALLOCATE (c_var_b(idim))
969 ALLOCATE (c_var_c(idim))
970 ALLOCATE (c_var_d(idim))
971 found =
ASSOCIATED(conn_info%impr_type)
973 ALLOCATE (c_var_type(idim))
975 IF (
ASSOCIATED(conn_info%c_bond_a) .AND.
ASSOCIATED(conn_info%impr_a))
THEN
976 DO j = 1,
SIZE(conn_info%impr_a)
977 j1 = map_atom_mol(conn_info%impr_a(j))
978 j2 = map_atom_mol(conn_info%impr_b(j))
979 j3 = map_atom_mol(conn_info%impr_c(j))
980 j4 = map_atom_mol(conn_info%impr_d(j))
981 IF (j1 /= j2 .OR. j2 /= j3 .OR. j3 /= j4)
THEN
985 CALL reallocate(c_var_a, 1, idim)
986 CALL reallocate(c_var_b, 1, idim)
987 CALL reallocate(c_var_c, 1, idim)
988 CALL reallocate(c_var_d, 1, idim)
990 CALL reallocate(c_var_type, 1, idim)
993 DO j = 1,
SIZE(conn_info%impr_a)
994 j1 = map_atom_mol(conn_info%impr_a(j))
995 j2 = map_atom_mol(conn_info%impr_b(j))
996 j3 = map_atom_mol(conn_info%impr_c(j))
997 j4 = map_atom_mol(conn_info%impr_d(j))
998 IF (j1 /= j2 .OR. j2 /= j3 .OR. j3 /= j4)
THEN
1000 c_var_a(idim) = conn_info%impr_a(j)
1001 c_var_b(idim) = conn_info%impr_b(j)
1002 c_var_c(idim) = conn_info%impr_c(j)
1003 c_var_d(idim) = conn_info%impr_d(j)
1005 c_var_type(idim) = conn_info%impr_type(j)
1010 CALL timestop(handle2)
1011 CALL timeset(routinen//
"_14", handle2)
1015 NULLIFY (map_vars, map_cvars, bnd_type, bnd_ctype)
1016 IF (
ASSOCIATED(conn_info%impr_a)) nvar1 =
SIZE(conn_info%impr_a)
1017 IF (
ASSOCIATED(c_var_a)) nvar2 =
SIZE(c_var_a)
1020 ALLOCATE (map_var_mol(nvar1))
1021 ALLOCATE (map_cvar_mol(nvar2))
1025 j1 = map_atom_mol(conn_info%impr_a(i))
1026 j2 = map_atom_mol(conn_info%impr_b(i))
1027 j3 = map_atom_mol(conn_info%impr_c(i))
1028 j4 = map_atom_mol(conn_info%impr_d(i))
1029 IF (j1 == j2 .AND. j2 == j3 .AND. j3 == j4)
THEN
1030 IF (j1 > 0) map_var_mol(i) = map_atom_type(conn_info%impr_a(i))
1034 min_index = min(c_var_a(i), c_var_b(i), c_var_c(i), c_var_d(i))
1035 j1 = map_atom_mol(min_index)
1036 IF (j1 > 0) map_cvar_mol(i) = map_atom_type(min_index)
1038 CALL find_bnd_typ(
topology%nmol_type, map_vars, map_var_mol, bnd_type, nvar1)
1039 CALL find_bnd_typ(
topology%nmol_type, map_cvars, map_cvar_mol, bnd_ctype, nvar2)
1043 IF (all(bnd_type(:, i) > 0))
THEN
1044 intra_imprs = bnd_type(2, i) - bnd_type(1, i) + 1
1046 IF (all(bnd_ctype(:, i) > 0))
THEN
1047 inter_imprs = bnd_ctype(2, i) - bnd_ctype(1, i) + 1
1049 iimpr = intra_imprs + inter_imprs
1051 WRITE (iw, *)
" Total number of imprs for molecule type ", i,
" :", iimpr
1052 WRITE (iw, *)
" intra (imprs inside molecules) :: ", intra_imprs
1053 WRITE (iw, *)
" inter (imprs between molecules) :: ", inter_imprs
1054 WRITE (iw, *)
" Total number of opbends for molecule type ", i,
" :", iimpr
1055 WRITE (iw, *)
" intra (opbends inside molecules) :: ", intra_imprs
1056 WRITE (iw, *)
" inter (opbends between molecules) :: ", inter_imprs
1058 molecule_kind => molecule_kind_set(i)
1059 nval_tot2 = nval_tot2 + iimpr*
SIZE(molecule_kind%molecule_list)
1060 ALLOCATE (impr_list(iimpr), stat=stat)
1061 ALLOCATE (opbend_list(iimpr), stat=stat)
1064 DO j = bnd_type(1, i), bnd_type(2, i)
1068 first = first_list(map_atom_mol(conn_info%impr_a(jind)))
1069 impr_list(iimpr)%a = conn_info%impr_a(jind) - first + 1
1070 impr_list(iimpr)%b = conn_info%impr_b(jind) - first + 1
1071 impr_list(iimpr)%c = conn_info%impr_c(jind) - first + 1
1072 impr_list(iimpr)%d = conn_info%impr_d(jind) - first + 1
1077 opbend_list(iimpr)%a = conn_info%impr_b(jind) - first + 1
1078 opbend_list(iimpr)%b = conn_info%impr_d(jind) - first + 1
1079 opbend_list(iimpr)%c = conn_info%impr_c(jind) - first + 1
1080 opbend_list(iimpr)%d = conn_info%impr_a(jind) - first + 1
1086 impr_list(iimpr)%itype = conn_info%impr_type(jind)
1089 NULLIFY (impr_list(iimpr)%impr_kind)
1090 NULLIFY (opbend_list(iimpr)%opbend_kind)
1092 WRITE (iw,
'(7X,A,I3,1X,A,I4,I4,I4,I4,1X,A,I4,I4,I4,I4)') &
1093 "molecule_kind", i,
"intra IMPR", &
1094 conn_info%impr_a(jind), &
1095 conn_info%impr_b(jind), &
1096 conn_info%impr_c(jind), &
1097 conn_info%impr_d(jind), &
1098 "offset number at", &
1099 conn_info%impr_a(jind) - first + 1, &
1100 conn_info%impr_b(jind) - first + 1, &
1101 conn_info%impr_c(jind) - first + 1, &
1102 conn_info%impr_d(jind) - first + 1
1103 WRITE (iw,
'(7X,A,I3,1X,A,I4,I4,I4,I4,1X,A,I4,I4,I4,I4)') &
1104 "molecule_kind", i,
"intra OPBEND", &
1105 conn_info%impr_b(jind), &
1106 conn_info%impr_d(jind), &
1107 conn_info%impr_c(jind), &
1108 conn_info%impr_a(jind), &
1109 "offset number at", &
1110 conn_info%impr_b(jind) - first + 1, &
1111 conn_info%impr_d(jind) - first + 1, &
1112 conn_info%impr_c(jind) - first + 1, &
1113 conn_info%impr_a(jind) - first + 1
1116 DO j = bnd_ctype(1, i), bnd_ctype(2, i)
1120 min_index = min(c_var_a(jind), c_var_b(jind), c_var_c(jind), c_var_d(jind))
1121 first = first_list(map_atom_mol(min_index))
1122 impr_list(iimpr)%a = c_var_a(jind) - first + 1
1123 impr_list(iimpr)%b = c_var_b(jind) - first + 1
1124 impr_list(iimpr)%c = c_var_c(jind) - first + 1
1125 impr_list(iimpr)%d = c_var_d(jind) - first + 1
1126 opbend_list(iimpr)%a = c_var_b(jind) - first + 1
1127 opbend_list(iimpr)%b = c_var_d(jind) - first + 1
1128 opbend_list(iimpr)%c = c_var_c(jind) - first + 1
1129 opbend_list(iimpr)%d = c_var_a(jind) - first + 1
1135 impr_list(iimpr)%itype = c_var_type(jind)
1138 NULLIFY (impr_list(iimpr)%impr_kind)
1139 NULLIFY (opbend_list(iimpr)%opbend_kind)
1141 WRITE (iw,
'(7X,A,I3,1X,A,I4,I4,I4,I4,1X,A,I4,I4,I4,I4)') &
1142 "molecule_kind", i,
"inter IMPR", &
1147 "offset number at", &
1148 c_var_a(jind) - first + 1, &
1149 c_var_b(jind) - first + 1, &
1150 c_var_c(jind) - first + 1, &
1151 c_var_d(jind) - first + 1
1152 WRITE (iw,
'(7X,A,I3,1X,A,I4,I4,I4,I4,1X,A,I4,I4,I4,I4)') &
1153 "molecule_kind", i,
"inter OPBEND", &
1158 "offset number at", &
1159 c_var_b(jind) - first + 1, &
1160 c_var_d(jind) - first + 1, &
1161 c_var_c(jind) - first + 1, &
1162 c_var_a(jind) - first + 1
1166 nimpr=
SIZE(impr_list), impr_list=impr_list)
1168 nopbend=
SIZE(opbend_list), opbend_list=opbend_list)
1170 cpassert(nval_tot1 == nval_tot2)
1171 DEALLOCATE (map_var_mol)
1172 DEALLOCATE (map_cvar_mol)
1173 DEALLOCATE (map_vars)
1174 DEALLOCATE (map_cvars)
1175 DEALLOCATE (bnd_type)
1176 DEALLOCATE (bnd_ctype)
1177 DEALLOCATE (c_var_a)
1178 DEALLOCATE (c_var_b)
1179 DEALLOCATE (c_var_c)
1180 DEALLOCATE (c_var_d)
1182 DEALLOCATE (c_var_type)
1184 CALL timestop(handle2)
1189 DEALLOCATE (first_list)
1190 DEALLOCATE (last_list)
1191 DEALLOCATE (map_atom_mol)
1192 DEALLOCATE (map_atom_type)
1193 CALL timestop(handle)
1195 "PRINT%TOPOLOGY_INFO/UTIL_INFO")
1208 SUBROUTINE find_bnd_typ(nmol_type, map_vars, map_var_mol, bnd_type, nvar1)
1209 INTEGER,
INTENT(IN) :: nmol_type
1210 INTEGER,
DIMENSION(:),
POINTER :: map_vars, map_var_mol
1211 INTEGER,
DIMENSION(:, :),
POINTER :: bnd_type
1212 INTEGER,
INTENT(IN) :: nvar1
1214 INTEGER :: i, ibond, j
1216 ALLOCATE (map_vars(nvar1))
1217 CALL sort(map_var_mol, nvar1, map_vars)
1218 ALLOCATE (bnd_type(2, nmol_type))
1220 IF (nvar1 == 0)
RETURN
1222 IF (map_var_mol(j) /= -1)
EXIT
1224 IF (j == nvar1 + 1)
RETURN
1228 IF (map_var_mol(ibond) /= i)
THEN
1229 bnd_type(2, i) = ibond - 1
1230 i = map_var_mol(ibond)
1231 bnd_type(1, i) = ibond
1234 bnd_type(2, i) = nvar1
1236 END SUBROUTINE find_bnd_typ
1246 TYPE(section_vals_type),
POINTER :: subsys_section
1248 INTEGER :: a,
fac, i, ind, j, k, m, natoms_orig, &
1249 nbond, nbond_c, nimpr, nonfo, nphi, &
1251 INTEGER,
DIMENSION(:),
POINTER :: multiple_unit_cell
1254 NULLIFY (multiple_unit_cell)
1256 i_vals=multiple_unit_cell)
1257 IF (any(multiple_unit_cell /= 1))
THEN
1258 fac = product(multiple_unit_cell)
1262 IF (
ASSOCIATED(conn_info%bond_a))
THEN
1263 nbond =
SIZE(conn_info%bond_a)
1264 CALL reallocate(conn_info%bond_a, 1, nbond*
fac)
1265 CALL reallocate(conn_info%bond_b, 1, nbond*
fac)
1269 IF (
ASSOCIATED(conn_info%theta_a))
THEN
1270 ntheta =
SIZE(conn_info%theta_a)
1271 CALL reallocate(conn_info%theta_a, 1, ntheta*
fac)
1272 CALL reallocate(conn_info%theta_b, 1, ntheta*
fac)
1273 CALL reallocate(conn_info%theta_c, 1, ntheta*
fac)
1277 IF (
ASSOCIATED(conn_info%phi_a))
THEN
1278 nphi =
SIZE(conn_info%phi_a)
1279 CALL reallocate(conn_info%phi_a, 1, nphi*
fac)
1280 CALL reallocate(conn_info%phi_b, 1, nphi*
fac)
1281 CALL reallocate(conn_info%phi_c, 1, nphi*
fac)
1282 CALL reallocate(conn_info%phi_d, 1, nphi*
fac)
1286 IF (
ASSOCIATED(conn_info%impr_a))
THEN
1287 nimpr =
SIZE(conn_info%impr_a)
1288 CALL reallocate(conn_info%impr_a, 1, nimpr*
fac)
1289 CALL reallocate(conn_info%impr_b, 1, nimpr*
fac)
1290 CALL reallocate(conn_info%impr_c, 1, nimpr*
fac)
1291 CALL reallocate(conn_info%impr_d, 1, nimpr*
fac)
1295 IF (
ASSOCIATED(conn_info%c_bond_a))
THEN
1296 nbond_c =
SIZE(conn_info%c_bond_a)
1297 CALL reallocate(conn_info%c_bond_a, 1, nbond_c*
fac)
1298 CALL reallocate(conn_info%c_bond_b, 1, nbond_c*
fac)
1302 IF (
ASSOCIATED(conn_info%ub_a))
THEN
1303 nub =
SIZE(conn_info%ub_a)
1304 CALL reallocate(conn_info%ub_a, 1, nub*
fac)
1305 CALL reallocate(conn_info%ub_b, 1, nub*
fac)
1306 CALL reallocate(conn_info%ub_c, 1, nub*
fac)
1310 IF (
ASSOCIATED(conn_info%onfo_a))
THEN
1311 nonfo =
SIZE(conn_info%onfo_a)
1312 CALL reallocate(conn_info%onfo_a, 1, nonfo*
fac)
1313 CALL reallocate(conn_info%onfo_b, 1, nonfo*
fac)
1318 DO k = 1, multiple_unit_cell(3)
1319 DO j = 1, multiple_unit_cell(2)
1320 DO i = 1, multiple_unit_cell(1)
1323 a = (ind - 1)*natoms_orig
1328 conn_info%bond_a(m + 1:m + nbond) = conn_info%bond_a(1:nbond) + a
1329 conn_info%bond_b(m + 1:m + nbond) = conn_info%bond_b(1:nbond) + a
1332 IF (ntheta > 0)
THEN
1333 m = (ind - 1)*ntheta
1334 conn_info%theta_a(m + 1:m + ntheta) = conn_info%theta_a(1:ntheta) + a
1335 conn_info%theta_b(m + 1:m + ntheta) = conn_info%theta_b(1:ntheta) + a
1336 conn_info%theta_c(m + 1:m + ntheta) = conn_info%theta_c(1:ntheta) + a
1341 conn_info%phi_a(m + 1:m + nphi) = conn_info%phi_a(1:nphi) + a
1342 conn_info%phi_b(m + 1:m + nphi) = conn_info%phi_b(1:nphi) + a
1343 conn_info%phi_c(m + 1:m + nphi) = conn_info%phi_c(1:nphi) + a
1344 conn_info%phi_d(m + 1:m + nphi) = conn_info%phi_d(1:nphi) + a
1349 conn_info%impr_a(m + 1:m + nimpr) = conn_info%impr_a(1:nimpr) + a
1350 conn_info%impr_b(m + 1:m + nimpr) = conn_info%impr_b(1:nimpr) + a
1351 conn_info%impr_c(m + 1:m + nimpr) = conn_info%impr_c(1:nimpr) + a
1352 conn_info%impr_d(m + 1:m + nimpr) = conn_info%impr_d(1:nimpr) + a
1355 IF (nbond_c > 0)
THEN
1356 m = (ind - 1)*nbond_c
1357 conn_info%c_bond_a(m + 1:m + nbond_c) = conn_info%c_bond_a(1:nbond_c) + a
1358 conn_info%c_bond_b(m + 1:m + nbond_c) = conn_info%c_bond_b(1:nbond_c) + a
1363 conn_info%ub_a(m + 1:m + nub) = conn_info%ub_a(1:nub) + a
1364 conn_info%ub_b(m + 1:m + nub) = conn_info%ub_b(1:nub) + a
1365 conn_info%ub_c(m + 1:m + nub) = conn_info%ub_c(1:nub) + a
1370 conn_info%onfo_a(m + 1:m + nonfo) = conn_info%onfo_a(1:nonfo) + a
1371 conn_info%onfo_b(m + 1:m + nonfo) = conn_info%onfo_b(1:nonfo) + a
static GRID_HOST_DEVICE double fac(const int i)
Factorial function, e.g. fac(5) = 5! = 120.
various routines to log and control the output. The idea is that decisions about where to log should ...
integer function, public cp_logger_get_default_io_unit(logger)
returns the unit nr for the ionode (-1 on all other processors) skips as well checks if the procs cal...
type(cp_logger_type) function, pointer, public cp_get_default_logger()
returns the default logger
routines to handle the output, The idea is to remove the decision of wheter to output and what to out...
integer function, public cp_print_key_unit_nr(logger, basis_section, print_key_path, extension, middle_name, local, log_filename, ignore_should_output, file_form, file_position, file_action, file_status, do_backup, on_file, is_new_file, mpi_io, fout)
...
subroutine, public cp_print_key_finished_output(unit_nr, logger, basis_section, print_key_path, local, ignore_should_output, on_file, mpi_io)
should be called after you finish working with a unit obtained with cp_print_key_unit_nr,...
Define all structure types related to force field kinds.
integer, parameter, public do_ff_charmm
integer, parameter, public do_ff_harmonic
Defines the basic variable types.
integer, parameter, public default_string_length
Utility routines for the memory handling.
Define the molecule kind structure types and the corresponding functionality.
subroutine, public get_molecule_kind(molecule_kind, atom_list, bond_list, bend_list, ub_list, impr_list, opbend_list, colv_list, fixd_list, g3x3_list, g4x6_list, vsite_list, torsion_list, shell_list, name, mass, charge, kind_number, natom, nbend, nbond, nub, nimpr, nopbend, nconstraint, nconstraint_fixd, nfixd, ncolv, ng3x3, ng4x6, nvsite, nfixd_restraint, ng3x3_restraint, ng4x6_restraint, nvsite_restraint, nrestraints, nmolecule, nsgf, nshell, ntorsion, molecule_list, nelectron, nelectron_alpha, nelectron_beta, bond_kind_set, bend_kind_set, ub_kind_set, impr_kind_set, opbend_kind_set, torsion_kind_set, molname_generated)
Get informations about a molecule kind.
subroutine, public set_molecule_kind(molecule_kind, name, mass, charge, kind_number, molecule_list, atom_list, nbond, bond_list, nbend, bend_list, nub, ub_list, nimpr, impr_list, nopbend, opbend_list, ntorsion, torsion_list, fixd_list, ncolv, colv_list, ng3x3, g3x3_list, ng4x6, nfixd, g4x6_list, nvsite, vsite_list, ng3x3_restraint, ng4x6_restraint, nfixd_restraint, nshell, shell_list, nvsite_restraint, bond_kind_set, bend_kind_set, ub_kind_set, torsion_kind_set, impr_kind_set, opbend_kind_set, nelectron, nsgf, molname_generated)
Set the components of a molecule kind.
subroutine, public allocate_molecule_kind_set(molecule_kind_set, nmolecule_kind)
Allocate and initialize a molecule kind set.
Define the data structure for the molecule information.
subroutine, public get_molecule(molecule, molecule_kind, lmi, lci, lg3x3, lg4x6, lcolv, first_atom, last_atom, first_shell, last_shell)
Get components from a molecule data set.
subroutine, public allocate_molecule_set(molecule_set, nmolecule)
Allocate a molecule set.
subroutine, public set_molecule_set(molecule_set, first_atom, last_atom)
Set a molecule data set.
subroutine, public set_molecule(molecule, molecule_kind, lmi, lci, lcolv, lg3x3, lg4x6)
Set a molecule data set.
generates a unique id number for a string (str2id) that can be used two compare two strings....
character(len=default_string_length) function, public id2str(id)
returns the string associated with a given id
Collection of subroutine needed for topology related things.
subroutine, public topology_conn_multiple(topology, subsys_section)
Handles the multiple unit cell option for the connectivity.
subroutine, public topology_connectivity_pack(molecule_kind_set, molecule_set, topology, subsys_section)
topology connectivity pack
Control for reading in different topologies and coordinates.
All kind of helpful little routines.