45 #include "../base/base_uses.f90"
51 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'molecule_kind_types'
57 TYPE(atomic_kind_type),
POINTER :: atomic_kind => null()
58 INTEGER :: id_name = 0
64 CHARACTER(LEN=default_string_length) :: name =
""
65 TYPE(shell_kind_type),
POINTER :: shell_kind => null()
70 INTEGER :: a = 0, b = 0
72 TYPE(bond_kind_type),
POINTER :: bond_kind => null()
77 INTEGER :: a = 0, b = 0, c = 0
79 TYPE(bend_kind_type),
POINTER :: bend_kind => null()
84 INTEGER :: a = 0, b = 0, c = 0
86 TYPE(ub_kind_type),
POINTER :: ub_kind => null()
91 INTEGER :: a = 0, b = 0, c = 0, d = 0
93 TYPE(torsion_kind_type),
POINTER :: torsion_kind => null()
98 INTEGER :: a = 0, b = 0, c = 0, d = 0
100 TYPE(impr_kind_type),
POINTER :: impr_kind => null()
105 INTEGER :: a = 0, b = 0, c = 0, d = 0
107 TYPE(opbend_kind_type),
POINTER :: opbend_kind => null()
112 LOGICAL :: active = .false.
113 REAL(KIND=
dp) :: k0 = 0.0_dp
114 END TYPE restraint_type
117 TYPE colvar_constraint_type
119 INTEGER :: inp_seq_num = 0
120 LOGICAL :: use_points = .false.
121 REAL(KIND=
dp) :: expected_value = 0.0_dp
122 REAL(KIND=
dp) :: expected_value_growth_speed = 0.0_dp
123 INTEGER,
POINTER,
DIMENSION(:) :: i_atoms => null()
124 TYPE(restraint_type) :: restraint = restraint_type()
125 END TYPE colvar_constraint_type
128 TYPE g3x3_constraint_type
129 INTEGER :: a = 0, b = 0, c = 0
130 REAL(KIND=
dp) :: dab = 0.0_dp, dac = 0.0_dp, dbc = 0.0_dp
131 TYPE(restraint_type) :: restraint = restraint_type()
132 END TYPE g3x3_constraint_type
135 TYPE g4x6_constraint_type
136 INTEGER :: a = 0, b = 0, c = 0, d = 0
137 REAL(KIND=
dp) :: dab = 0.0_dp, dac = 0.0_dp, dbc = 0.0_dp, dad = 0.0_dp, dbd = 0.0_dp, dcd = 0.0_dp
138 TYPE(restraint_type) :: restraint = restraint_type()
139 END TYPE g4x6_constraint_type
142 TYPE vsite_constraint_type
143 INTEGER :: a = 0, b = 0, c = 0, d = 0
144 REAL(KIND=
dp) :: wbc = 0.0_dp, wdc = 0.0_dp
145 TYPE(restraint_type) :: restraint = restraint_type()
146 END TYPE vsite_constraint_type
149 TYPE fixd_constraint_type
150 TYPE(restraint_type) :: restraint = restraint_type()
151 INTEGER :: fixd = 0, itype = 0
152 REAL(KIND=
dp),
DIMENSION(3) :: coord = 0.0_dp
153 END TYPE fixd_constraint_type
156 TYPE local_fixd_constraint_type
157 INTEGER :: ifixd_index = 0, ikind = 0
158 END TYPE local_fixd_constraint_type
161 TYPE molecule_kind_type
162 TYPE(atom_type),
DIMENSION(:),
POINTER :: atom_list => null()
163 TYPE(bond_kind_type),
DIMENSION(:),
POINTER :: bond_kind_set => null()
164 TYPE(bond_type),
DIMENSION(:),
POINTER :: bond_list => null()
165 TYPE(bend_kind_type),
DIMENSION(:),
POINTER :: bend_kind_set => null()
166 TYPE(bend_type),
DIMENSION(:),
POINTER :: bend_list => null()
167 TYPE(ub_kind_type),
DIMENSION(:),
POINTER :: ub_kind_set => null()
168 TYPE(ub_type),
DIMENSION(:),
POINTER :: ub_list => null()
169 TYPE(torsion_kind_type),
DIMENSION(:),
POINTER :: torsion_kind_set => null()
170 TYPE(torsion_type),
DIMENSION(:),
POINTER :: torsion_list => null()
171 TYPE(impr_kind_type),
DIMENSION(:),
POINTER :: impr_kind_set => null()
172 TYPE(impr_type),
DIMENSION(:),
POINTER :: impr_list => null()
173 TYPE(opbend_kind_type),
DIMENSION(:),
POINTER :: opbend_kind_set => null()
174 TYPE(opbend_type),
DIMENSION(:),
POINTER :: opbend_list => null()
175 TYPE(colvar_constraint_type),
DIMENSION(:),
POINTER :: colv_list => null()
176 TYPE(g3x3_constraint_type),
DIMENSION(:),
POINTER :: g3x3_list => null()
177 TYPE(g4x6_constraint_type),
DIMENSION(:),
POINTER :: g4x6_list => null()
178 TYPE(vsite_constraint_type),
DIMENSION(:),
POINTER :: vsite_list => null()
179 TYPE(fixd_constraint_type),
DIMENSION(:),
POINTER :: fixd_list => null()
180 TYPE(shell_type),
DIMENSION(:),
POINTER :: shell_list => null()
181 CHARACTER(LEN=default_string_length) :: name =
""
182 REAL(KIND=
dp) :: charge = 0.0_dp, &
184 INTEGER :: kind_number = 0, &
192 ng3x3 = 0, ng3x3_restraint = 0, &
193 ng4x6 = 0, ng4x6_restraint = 0, &
194 nvsite = 0, nvsite_restraint = 0, &
195 nfixd = 0, nfixd_restraint = 0, &
196 nmolecule = 0, nshell = 0
197 TYPE(colvar_counters) :: ncolv = colvar_counters()
198 INTEGER :: nsgf = 0, nelectron = 0, &
199 nelectron_alpha = 0, &
201 INTEGER,
DIMENSION(:),
POINTER :: molecule_list => null()
202 LOGICAL :: molname_generated = .false.
203 END TYPE molecule_kind_type
215 PUBLIC :: atom_type, &
222 colvar_constraint_type, &
223 g3x3_constraint_type, &
224 g4x6_constraint_type, &
225 vsite_constraint_type, &
226 fixd_constraint_type, &
227 local_fixd_constraint_type, &
228 molecule_kind_type, &
239 TYPE(colvar_constraint_type),
DIMENSION(:), &
241 TYPE(colvar_counters),
INTENT(OUT) :: ncolv
245 IF (
ASSOCIATED(colv_list))
THEN
246 DO k = 1,
SIZE(colv_list)
247 IF (colv_list(k)%restraint%active) ncolv%nrestraint = ncolv%nrestraint + 1
248 SELECT CASE (colv_list(k)%type_id)
250 ncolv%nangle = ncolv%nangle + 1
252 ncolv%ncoord = ncolv%ncoord + 1
254 ncolv%npopulation = ncolv%npopulation + 1
256 ncolv%ngyration = ncolv%ngyration + 1
258 ncolv%nrot = ncolv%nrot + 1
260 ncolv%ndist = ncolv%ndist + 1
262 ncolv%ndfunct = ncolv%ndfunct + 1
264 ncolv%nplane_dist = ncolv%nplane_dist + 1
266 ncolv%nplane_angle = ncolv%nplane_angle + 1
268 ncolv%ntorsion = ncolv%ntorsion + 1
270 ncolv%nqparm = ncolv%nqparm + 1
272 ncolv%nxyz_diag = ncolv%nxyz_diag + 1
274 ncolv%nxyz_outerdiag = ncolv%nxyz_outerdiag + 1
276 ncolv%nhydronium_shell = ncolv%nhydronium_shell + 1
278 ncolv%nhydronium_dist = ncolv%nhydronium_dist + 1
280 ncolv%nacid_hyd_dist = ncolv%nacid_hyd_dist + 1
282 ncolv%nacid_hyd_shell = ncolv%nacid_hyd_shell + 1
284 ncolv%nreactionpath = ncolv%nreactionpath + 1
286 ncolv%ncombinecvs = ncolv%ncombinecvs + 1
292 ncolv%ntot = ncolv%ndist + &
296 ncolv%nplane_dist + &
297 ncolv%nplane_angle + &
302 ncolv%nxyz_outerdiag + &
303 ncolv%nhydronium_shell + &
304 ncolv%nhydronium_dist + &
305 ncolv%nacid_hyd_dist + &
306 ncolv%nacid_hyd_shell + &
307 ncolv%nreactionpath + &
308 ncolv%ncombinecvs + &
309 ncolv%npopulation + &
323 TYPE(molecule_kind_type),
DIMENSION(:),
POINTER :: molecule_kind_set
324 INTEGER,
INTENT(IN) :: nmolecule_kind
326 INTEGER :: imolecule_kind
328 IF (
ASSOCIATED(molecule_kind_set))
THEN
332 ALLOCATE (molecule_kind_set(nmolecule_kind))
334 DO imolecule_kind = 1, nmolecule_kind
335 molecule_kind_set(imolecule_kind)%kind_number = imolecule_kind
337 molecule_kind_set(imolecule_kind)%ncolv)
351 TYPE(molecule_kind_type),
DIMENSION(:),
POINTER :: molecule_kind_set
353 INTEGER :: i, imolecule_kind, j, nmolecule_kind
355 IF (
ASSOCIATED(molecule_kind_set))
THEN
357 nmolecule_kind =
SIZE(molecule_kind_set)
359 DO imolecule_kind = 1, nmolecule_kind
361 IF (
ASSOCIATED(molecule_kind_set(imolecule_kind)%atom_list))
THEN
362 DEALLOCATE (molecule_kind_set(imolecule_kind)%atom_list)
364 IF (
ASSOCIATED(molecule_kind_set(imolecule_kind)%bend_kind_set))
THEN
365 DO i = 1,
SIZE(molecule_kind_set(imolecule_kind)%bend_kind_set)
366 IF (
ASSOCIATED(molecule_kind_set(imolecule_kind)%bend_kind_set(i)%legendre%coeffs)) &
367 DEALLOCATE (molecule_kind_set(imolecule_kind)%bend_kind_set(i)%legendre%coeffs)
369 DEALLOCATE (molecule_kind_set(imolecule_kind)%bend_kind_set)
371 IF (
ASSOCIATED(molecule_kind_set(imolecule_kind)%bend_list))
THEN
372 DEALLOCATE (molecule_kind_set(imolecule_kind)%bend_list)
374 IF (
ASSOCIATED(molecule_kind_set(imolecule_kind)%ub_list))
THEN
375 DEALLOCATE (molecule_kind_set(imolecule_kind)%ub_list)
377 IF (
ASSOCIATED(molecule_kind_set(imolecule_kind)%ub_kind_set))
THEN
380 IF (
ASSOCIATED(molecule_kind_set(imolecule_kind)%impr_list))
THEN
381 DEALLOCATE (molecule_kind_set(imolecule_kind)%impr_list)
383 IF (
ASSOCIATED(molecule_kind_set(imolecule_kind)%impr_kind_set))
THEN
384 DO i = 1,
SIZE(molecule_kind_set(imolecule_kind)%impr_kind_set)
387 DEALLOCATE (molecule_kind_set(imolecule_kind)%impr_kind_set)
389 IF (
ASSOCIATED(molecule_kind_set(imolecule_kind)%opbend_list))
THEN
390 DEALLOCATE (molecule_kind_set(imolecule_kind)%opbend_list)
392 IF (
ASSOCIATED(molecule_kind_set(imolecule_kind)%opbend_kind_set))
THEN
393 DEALLOCATE (molecule_kind_set(imolecule_kind)%opbend_kind_set)
395 IF (
ASSOCIATED(molecule_kind_set(imolecule_kind)%bond_kind_set))
THEN
396 DEALLOCATE (molecule_kind_set(imolecule_kind)%bond_kind_set)
398 IF (
ASSOCIATED(molecule_kind_set(imolecule_kind)%bond_list))
THEN
399 DEALLOCATE (molecule_kind_set(imolecule_kind)%bond_list)
401 IF (
ASSOCIATED(molecule_kind_set(imolecule_kind)%colv_list))
THEN
402 DO j = 1,
SIZE(molecule_kind_set(imolecule_kind)%colv_list)
403 DEALLOCATE (molecule_kind_set(imolecule_kind)%colv_list(j)%i_atoms)
405 DEALLOCATE (molecule_kind_set(imolecule_kind)%colv_list)
407 IF (
ASSOCIATED(molecule_kind_set(imolecule_kind)%g3x3_list))
THEN
408 DEALLOCATE (molecule_kind_set(imolecule_kind)%g3x3_list)
410 IF (
ASSOCIATED(molecule_kind_set(imolecule_kind)%g4x6_list))
THEN
411 DEALLOCATE (molecule_kind_set(imolecule_kind)%g4x6_list)
413 IF (
ASSOCIATED(molecule_kind_set(imolecule_kind)%vsite_list))
THEN
414 DEALLOCATE (molecule_kind_set(imolecule_kind)%vsite_list)
416 IF (
ASSOCIATED(molecule_kind_set(imolecule_kind)%fixd_list))
THEN
417 DEALLOCATE (molecule_kind_set(imolecule_kind)%fixd_list)
419 IF (
ASSOCIATED(molecule_kind_set(imolecule_kind)%torsion_kind_set))
THEN
420 DO i = 1,
SIZE(molecule_kind_set(imolecule_kind)%torsion_kind_set)
423 DEALLOCATE (molecule_kind_set(imolecule_kind)%torsion_kind_set)
425 IF (
ASSOCIATED(molecule_kind_set(imolecule_kind)%shell_list))
THEN
426 DEALLOCATE (molecule_kind_set(imolecule_kind)%shell_list)
428 IF (
ASSOCIATED(molecule_kind_set(imolecule_kind)%torsion_list))
THEN
429 DEALLOCATE (molecule_kind_set(imolecule_kind)%torsion_list)
431 IF (
ASSOCIATED(molecule_kind_set(imolecule_kind)%molecule_list))
THEN
432 DEALLOCATE (molecule_kind_set(imolecule_kind)%molecule_list)
436 DEALLOCATE (molecule_kind_set)
438 NULLIFY (molecule_kind_set)
500 ub_list, impr_list, opbend_list, colv_list, fixd_list, &
501 g3x3_list, g4x6_list, vsite_list, torsion_list, shell_list, &
502 name, mass, charge, kind_number, natom, nbend, nbond, nub, &
503 nimpr, nopbend, nconstraint, nconstraint_fixd, nfixd, ncolv, ng3x3, ng4x6, &
504 nvsite, nfixd_restraint, ng3x3_restraint, ng4x6_restraint, &
505 nvsite_restraint, nrestraints, nmolecule, nsgf, nshell, ntorsion, &
506 molecule_list, nelectron, nelectron_alpha, nelectron_beta, &
507 bond_kind_set, bend_kind_set, &
508 ub_kind_set, impr_kind_set, opbend_kind_set, torsion_kind_set, &
511 TYPE(molecule_kind_type),
INTENT(IN) :: molecule_kind
512 TYPE(atom_type),
DIMENSION(:),
OPTIONAL,
POINTER :: atom_list
513 TYPE(bond_type),
DIMENSION(:),
OPTIONAL,
POINTER :: bond_list
514 TYPE(bend_type),
DIMENSION(:),
OPTIONAL,
POINTER :: bend_list
515 TYPE(ub_type),
DIMENSION(:),
OPTIONAL,
POINTER :: ub_list
516 TYPE(impr_type),
DIMENSION(:),
OPTIONAL,
POINTER :: impr_list
517 TYPE(opbend_type),
DIMENSION(:),
OPTIONAL,
POINTER :: opbend_list
518 TYPE(colvar_constraint_type),
DIMENSION(:), &
519 OPTIONAL,
POINTER :: colv_list
520 TYPE(fixd_constraint_type),
DIMENSION(:), &
521 OPTIONAL,
POINTER :: fixd_list
522 TYPE(g3x3_constraint_type),
DIMENSION(:), &
523 OPTIONAL,
POINTER :: g3x3_list
524 TYPE(g4x6_constraint_type),
DIMENSION(:), &
525 OPTIONAL,
POINTER :: g4x6_list
526 TYPE(vsite_constraint_type),
DIMENSION(:), &
527 OPTIONAL,
POINTER :: vsite_list
528 TYPE(torsion_type),
DIMENSION(:),
OPTIONAL, &
529 POINTER :: torsion_list
530 TYPE(shell_type),
DIMENSION(:),
OPTIONAL,
POINTER :: shell_list
531 CHARACTER(LEN=default_string_length), &
532 INTENT(OUT),
OPTIONAL :: name
533 REAL(kind=
dp),
OPTIONAL :: mass, charge
534 INTEGER,
INTENT(OUT),
OPTIONAL :: kind_number, natom, nbend, nbond, nub, &
535 nimpr, nopbend, nconstraint, &
536 nconstraint_fixd, nfixd
537 TYPE(colvar_counters),
INTENT(out),
OPTIONAL :: ncolv
538 INTEGER,
INTENT(OUT),
OPTIONAL :: ng3x3, ng4x6, nvsite, nfixd_restraint, ng3x3_restraint, &
539 ng4x6_restraint, nvsite_restraint, nrestraints, nmolecule, nsgf, nshell, ntorsion
540 INTEGER,
DIMENSION(:),
OPTIONAL,
POINTER :: molecule_list
541 INTEGER,
INTENT(OUT),
OPTIONAL :: nelectron, nelectron_alpha, &
543 TYPE(bond_kind_type),
DIMENSION(:),
OPTIONAL, &
544 POINTER :: bond_kind_set
545 TYPE(bend_kind_type),
DIMENSION(:),
OPTIONAL, &
546 POINTER :: bend_kind_set
547 TYPE(ub_kind_type),
DIMENSION(:),
OPTIONAL, &
548 POINTER :: ub_kind_set
549 TYPE(impr_kind_type),
DIMENSION(:),
OPTIONAL, &
550 POINTER :: impr_kind_set
551 TYPE(opbend_kind_type),
DIMENSION(:),
OPTIONAL, &
552 POINTER :: opbend_kind_set
553 TYPE(torsion_kind_type),
DIMENSION(:),
OPTIONAL, &
554 POINTER :: torsion_kind_set
555 LOGICAL,
INTENT(OUT),
OPTIONAL :: molname_generated
559 IF (
PRESENT(atom_list)) atom_list => molecule_kind%atom_list
560 IF (
PRESENT(bend_list)) bend_list => molecule_kind%bend_list
561 IF (
PRESENT(bond_list)) bond_list => molecule_kind%bond_list
562 IF (
PRESENT(impr_list)) impr_list => molecule_kind%impr_list
563 IF (
PRESENT(opbend_list)) opbend_list => molecule_kind%opbend_list
564 IF (
PRESENT(ub_list)) ub_list => molecule_kind%ub_list
565 IF (
PRESENT(bond_kind_set)) bond_kind_set => molecule_kind%bond_kind_set
566 IF (
PRESENT(bend_kind_set)) bend_kind_set => molecule_kind%bend_kind_set
567 IF (
PRESENT(ub_kind_set)) ub_kind_set => molecule_kind%ub_kind_set
568 IF (
PRESENT(impr_kind_set)) impr_kind_set => molecule_kind%impr_kind_set
569 IF (
PRESENT(opbend_kind_set)) opbend_kind_set => molecule_kind%opbend_kind_set
570 IF (
PRESENT(torsion_kind_set)) torsion_kind_set => molecule_kind%torsion_kind_set
571 IF (
PRESENT(colv_list)) colv_list => molecule_kind%colv_list
572 IF (
PRESENT(g3x3_list)) g3x3_list => molecule_kind%g3x3_list
573 IF (
PRESENT(g4x6_list)) g4x6_list => molecule_kind%g4x6_list
574 IF (
PRESENT(vsite_list)) vsite_list => molecule_kind%vsite_list
575 IF (
PRESENT(fixd_list)) fixd_list => molecule_kind%fixd_list
576 IF (
PRESENT(torsion_list)) torsion_list => molecule_kind%torsion_list
577 IF (
PRESENT(shell_list)) shell_list => molecule_kind%shell_list
578 IF (
PRESENT(name)) name = molecule_kind%name
579 IF (
PRESENT(molname_generated)) molname_generated = molecule_kind%molname_generated
580 IF (
PRESENT(mass)) mass = molecule_kind%mass
581 IF (
PRESENT(charge)) charge = molecule_kind%charge
582 IF (
PRESENT(kind_number)) kind_number = molecule_kind%kind_number
583 IF (
PRESENT(natom)) natom = molecule_kind%natom
584 IF (
PRESENT(nbend)) nbend = molecule_kind%nbend
585 IF (
PRESENT(nbond)) nbond = molecule_kind%nbond
586 IF (
PRESENT(nub)) nub = molecule_kind%nub
587 IF (
PRESENT(nimpr)) nimpr = molecule_kind%nimpr
588 IF (
PRESENT(nopbend)) nopbend = molecule_kind%nopbend
589 IF (
PRESENT(nconstraint)) nconstraint = (molecule_kind%ncolv%ntot - molecule_kind%ncolv%nrestraint) + &
590 3*(molecule_kind%ng3x3 - molecule_kind%ng3x3_restraint) + &
591 6*(molecule_kind%ng4x6 - molecule_kind%ng4x6_restraint) + &
592 3*(molecule_kind%nvsite - molecule_kind%nvsite_restraint)
593 IF (
PRESENT(ncolv)) ncolv = molecule_kind%ncolv
594 IF (
PRESENT(ng3x3)) ng3x3 = molecule_kind%ng3x3
595 IF (
PRESENT(ng4x6)) ng4x6 = molecule_kind%ng4x6
596 IF (
PRESENT(nvsite)) nvsite = molecule_kind%nvsite
598 IF (
PRESENT(nfixd)) nfixd = molecule_kind%nfixd
600 IF (
PRESENT(nconstraint_fixd))
THEN
602 IF (molecule_kind%nfixd /= 0)
THEN
603 DO i = 1,
SIZE(molecule_kind%fixd_list)
604 IF (molecule_kind%fixd_list(i)%restraint%active) cycle
605 SELECT CASE (molecule_kind%fixd_list(i)%itype)
607 nconstraint_fixd = nconstraint_fixd + 1
609 nconstraint_fixd = nconstraint_fixd + 2
611 nconstraint_fixd = nconstraint_fixd + 3
616 IF (
PRESENT(ng3x3_restraint)) ng3x3_restraint = molecule_kind%ng3x3_restraint
617 IF (
PRESENT(ng4x6_restraint)) ng4x6_restraint = molecule_kind%ng4x6_restraint
618 IF (
PRESENT(nvsite_restraint)) nvsite_restraint = molecule_kind%nvsite_restraint
619 IF (
PRESENT(nfixd_restraint)) nfixd_restraint = molecule_kind%nfixd_restraint
620 IF (
PRESENT(nrestraints)) nrestraints = molecule_kind%ncolv%nrestraint + &
621 molecule_kind%ng3x3_restraint + &
622 molecule_kind%ng4x6_restraint + &
623 molecule_kind%nvsite_restraint
624 IF (
PRESENT(nmolecule)) nmolecule = molecule_kind%nmolecule
625 IF (
PRESENT(nshell)) nshell = molecule_kind%nshell
626 IF (
PRESENT(ntorsion)) ntorsion = molecule_kind%ntorsion
627 IF (
PRESENT(nsgf)) nsgf = molecule_kind%nsgf
628 IF (
PRESENT(nelectron)) nelectron = molecule_kind%nelectron
629 IF (
PRESENT(nelectron_alpha)) nelectron_alpha = molecule_kind%nelectron_beta
630 IF (
PRESENT(nelectron_beta)) nelectron_beta = molecule_kind%nelectron_alpha
631 IF (
PRESENT(molecule_list)) molecule_list => molecule_kind%molecule_list
655 nbond, nbend, nub, ntorsion, nimpr, nopbend, &
656 nconstraint, nconstraint_fixd, nmolecule, &
659 TYPE(molecule_kind_type),
DIMENSION(:),
INTENT(IN) :: molecule_kind_set
660 INTEGER,
INTENT(OUT),
OPTIONAL :: maxatom, natom, nbond, nbend, nub, &
661 ntorsion, nimpr, nopbend, nconstraint, &
662 nconstraint_fixd, nmolecule, &
665 INTEGER :: ibend, ibond, iimpr, imolecule_kind, iopbend, itorsion, iub, na, nc, nc_fixd, &
666 nfixd_restraint, nm, nmolecule_kind, nrestraints_tot
668 IF (
PRESENT(maxatom)) maxatom = 0
669 IF (
PRESENT(natom)) natom = 0
670 IF (
PRESENT(nbond)) nbond = 0
671 IF (
PRESENT(nbend)) nbend = 0
672 IF (
PRESENT(nub)) nub = 0
673 IF (
PRESENT(ntorsion)) ntorsion = 0
674 IF (
PRESENT(nimpr)) nimpr = 0
675 IF (
PRESENT(nopbend)) nopbend = 0
676 IF (
PRESENT(nconstraint)) nconstraint = 0
677 IF (
PRESENT(nconstraint_fixd)) nconstraint_fixd = 0
678 IF (
PRESENT(nrestraints)) nrestraints = 0
679 IF (
PRESENT(nmolecule)) nmolecule = 0
681 nmolecule_kind =
SIZE(molecule_kind_set)
683 DO imolecule_kind = 1, nmolecule_kind
684 associate(molecule_kind => molecule_kind_set(imolecule_kind))
695 nconstraint_fixd=nc_fixd, &
696 nfixd_restraint=nfixd_restraint, &
697 nrestraints=nrestraints_tot, &
699 IF (
PRESENT(maxatom)) maxatom = max(maxatom, na)
700 IF (
PRESENT(natom)) natom = natom + na*nm
701 IF (
PRESENT(nbond)) nbond = nbond + ibond*nm
702 IF (
PRESENT(nbend)) nbend = nbend + ibend*nm
703 IF (
PRESENT(nub)) nub = nub + iub*nm
704 IF (
PRESENT(ntorsion)) ntorsion = ntorsion + itorsion*nm
705 IF (
PRESENT(nimpr)) nimpr = nimpr + iimpr*nm
706 IF (
PRESENT(nopbend)) nopbend = nopbend + iopbend*nm
707 IF (
PRESENT(nconstraint)) nconstraint = nconstraint + nc*nm + nc_fixd
708 IF (
PRESENT(nconstraint_fixd)) nconstraint_fixd = nconstraint_fixd + nc_fixd
709 IF (
PRESENT(nmolecule)) nmolecule = nmolecule + nm
710 IF (
PRESENT(nrestraints)) nrestraints = nrestraints + nm*nrestraints_tot + nfixd_restraint
768 molecule_list, atom_list, nbond, bond_list, &
769 nbend, bend_list, nub, ub_list, nimpr, impr_list, &
770 nopbend, opbend_list, ntorsion, &
771 torsion_list, fixd_list, ncolv, colv_list, ng3x3, &
772 g3x3_list, ng4x6, nfixd, g4x6_list, nvsite, &
773 vsite_list, ng3x3_restraint, ng4x6_restraint, &
774 nfixd_restraint, nshell, shell_list, &
775 nvsite_restraint, bond_kind_set, bend_kind_set, &
776 ub_kind_set, torsion_kind_set, impr_kind_set, &
777 opbend_kind_set, nelectron, nsgf, &
780 TYPE(molecule_kind_type),
INTENT(INOUT) :: molecule_kind
781 CHARACTER(LEN=*),
INTENT(IN),
OPTIONAL :: name
782 REAL(kind=dp),
OPTIONAL :: mass, charge
783 INTEGER,
INTENT(IN),
OPTIONAL :: kind_number
784 INTEGER,
DIMENSION(:),
OPTIONAL,
POINTER :: molecule_list
785 TYPE(atom_type),
DIMENSION(:),
OPTIONAL,
POINTER :: atom_list
786 INTEGER,
INTENT(IN),
OPTIONAL :: nbond
787 TYPE(bond_type),
DIMENSION(:),
OPTIONAL,
POINTER :: bond_list
788 INTEGER,
INTENT(IN),
OPTIONAL :: nbend
789 TYPE(bend_type),
DIMENSION(:),
OPTIONAL,
POINTER :: bend_list
790 INTEGER,
INTENT(IN),
OPTIONAL :: nub
791 TYPE(ub_type),
DIMENSION(:),
OPTIONAL,
POINTER :: ub_list
792 INTEGER,
INTENT(IN),
OPTIONAL :: nimpr
793 TYPE(impr_type),
DIMENSION(:),
OPTIONAL,
POINTER :: impr_list
794 INTEGER,
INTENT(IN),
OPTIONAL :: nopbend
795 TYPE(opbend_type),
DIMENSION(:),
OPTIONAL,
POINTER :: opbend_list
796 INTEGER,
INTENT(IN),
OPTIONAL :: ntorsion
797 TYPE(torsion_type),
DIMENSION(:),
OPTIONAL, &
798 POINTER :: torsion_list
799 TYPE(fixd_constraint_type),
DIMENSION(:), &
800 OPTIONAL,
POINTER :: fixd_list
801 TYPE(colvar_counters),
INTENT(IN),
OPTIONAL :: ncolv
802 TYPE(colvar_constraint_type),
DIMENSION(:), &
803 OPTIONAL,
POINTER :: colv_list
804 INTEGER,
INTENT(IN),
OPTIONAL :: ng3x3
805 TYPE(g3x3_constraint_type),
DIMENSION(:), &
806 OPTIONAL,
POINTER :: g3x3_list
807 INTEGER,
INTENT(IN),
OPTIONAL :: ng4x6, nfixd
808 TYPE(g4x6_constraint_type),
DIMENSION(:), &
809 OPTIONAL,
POINTER :: g4x6_list
810 INTEGER,
INTENT(IN),
OPTIONAL :: nvsite
811 TYPE(vsite_constraint_type),
DIMENSION(:), &
812 OPTIONAL,
POINTER :: vsite_list
813 INTEGER,
INTENT(IN),
OPTIONAL :: ng3x3_restraint, ng4x6_restraint, &
814 nfixd_restraint, nshell
815 TYPE(shell_type),
DIMENSION(:),
OPTIONAL,
POINTER :: shell_list
816 INTEGER,
INTENT(IN),
OPTIONAL :: nvsite_restraint
817 TYPE(bond_kind_type),
DIMENSION(:),
OPTIONAL, &
818 POINTER :: bond_kind_set
819 TYPE(bend_kind_type),
DIMENSION(:),
OPTIONAL, &
820 POINTER :: bend_kind_set
821 TYPE(ub_kind_type),
DIMENSION(:),
OPTIONAL, &
822 POINTER :: ub_kind_set
823 TYPE(torsion_kind_type),
DIMENSION(:),
OPTIONAL, &
824 POINTER :: torsion_kind_set
825 TYPE(impr_kind_type),
DIMENSION(:),
OPTIONAL, &
826 POINTER :: impr_kind_set
827 TYPE(opbend_kind_type),
DIMENSION(:),
OPTIONAL, &
828 POINTER :: opbend_kind_set
829 INTEGER,
INTENT(IN),
OPTIONAL :: nelectron, nsgf
830 LOGICAL,
INTENT(IN),
OPTIONAL :: molname_generated
834 IF (
PRESENT(atom_list))
THEN
836 molecule_kind%natom = n
837 molecule_kind%atom_list => atom_list
839 IF (
PRESENT(molname_generated)) molecule_kind%molname_generated = molname_generated
840 IF (
PRESENT(name)) molecule_kind%name = name
841 IF (
PRESENT(mass)) molecule_kind%mass = mass
842 IF (
PRESENT(charge)) molecule_kind%charge = charge
843 IF (
PRESENT(kind_number)) molecule_kind%kind_number = kind_number
844 IF (
PRESENT(nbond)) molecule_kind%nbond = nbond
845 IF (
PRESENT(bond_list)) molecule_kind%bond_list => bond_list
846 IF (
PRESENT(nbend)) molecule_kind%nbend = nbend
847 IF (
PRESENT(nelectron)) molecule_kind%nelectron = nelectron
848 IF (
PRESENT(nsgf)) molecule_kind%nsgf = nsgf
849 IF (
PRESENT(bend_list)) molecule_kind%bend_list => bend_list
850 IF (
PRESENT(nub)) molecule_kind%nub = nub
851 IF (
PRESENT(ub_list)) molecule_kind%ub_list => ub_list
852 IF (
PRESENT(ntorsion)) molecule_kind%ntorsion = ntorsion
853 IF (
PRESENT(torsion_list)) molecule_kind%torsion_list => torsion_list
854 IF (
PRESENT(nimpr)) molecule_kind%nimpr = nimpr
855 IF (
PRESENT(impr_list)) molecule_kind%impr_list => impr_list
856 IF (
PRESENT(nopbend)) molecule_kind%nopbend = nopbend
857 IF (
PRESENT(opbend_list)) molecule_kind%opbend_list => opbend_list
858 IF (
PRESENT(ncolv)) molecule_kind%ncolv = ncolv
859 IF (
PRESENT(colv_list)) molecule_kind%colv_list => colv_list
860 IF (
PRESENT(ng3x3)) molecule_kind%ng3x3 = ng3x3
861 IF (
PRESENT(g3x3_list)) molecule_kind%g3x3_list => g3x3_list
862 IF (
PRESENT(ng4x6)) molecule_kind%ng4x6 = ng4x6
863 IF (
PRESENT(nvsite)) molecule_kind%nvsite = nvsite
864 IF (
PRESENT(nfixd)) molecule_kind%nfixd = nfixd
865 IF (
PRESENT(nfixd_restraint)) molecule_kind%nfixd_restraint = nfixd_restraint
866 IF (
PRESENT(ng3x3_restraint)) molecule_kind%ng3x3_restraint = ng3x3_restraint
867 IF (
PRESENT(ng4x6_restraint)) molecule_kind%ng4x6_restraint = ng4x6_restraint
868 IF (
PRESENT(nvsite_restraint)) molecule_kind%nvsite_restraint = nvsite_restraint
869 IF (
PRESENT(g4x6_list)) molecule_kind%g4x6_list => g4x6_list
870 IF (
PRESENT(vsite_list)) molecule_kind%vsite_list => vsite_list
871 IF (
PRESENT(fixd_list)) molecule_kind%fixd_list => fixd_list
872 IF (
PRESENT(bond_kind_set)) molecule_kind%bond_kind_set => bond_kind_set
873 IF (
PRESENT(bend_kind_set)) molecule_kind%bend_kind_set => bend_kind_set
874 IF (
PRESENT(ub_kind_set)) molecule_kind%ub_kind_set => ub_kind_set
875 IF (
PRESENT(torsion_kind_set)) molecule_kind%torsion_kind_set => torsion_kind_set
876 IF (
PRESENT(impr_kind_set)) molecule_kind%impr_kind_set => impr_kind_set
877 IF (
PRESENT(opbend_kind_set)) molecule_kind%opbend_kind_set => opbend_kind_set
878 IF (
PRESENT(nshell)) molecule_kind%nshell = nshell
879 IF (
PRESENT(shell_list)) molecule_kind%shell_list => shell_list
880 IF (
PRESENT(molecule_list))
THEN
881 n =
SIZE(molecule_list)
882 molecule_kind%nmolecule = n
883 molecule_kind%molecule_list => molecule_list
895 SUBROUTINE write_molecule_kind(molecule_kind, output_unit)
896 TYPE(molecule_kind_type),
INTENT(IN) :: molecule_kind
897 INTEGER,
INTENT(in) :: output_unit
899 CHARACTER(LEN=default_string_length) :: name
900 INTEGER :: iatom, imolecule, natom, nmolecule
901 TYPE(atomic_kind_type),
POINTER :: atomic_kind
903 IF (output_unit > 0)
THEN
904 natom =
SIZE(molecule_kind%atom_list)
905 nmolecule =
SIZE(molecule_kind%molecule_list)
908 atomic_kind => molecule_kind%atom_list(1)%atomic_kind
909 CALL get_atomic_kind(atomic_kind=atomic_kind, name=name)
910 WRITE (unit=output_unit, fmt=
"(/,T2,I5,A,T36,A,A,T64,A)") &
911 molecule_kind%kind_number, &
912 ". Molecule kind: "//trim(molecule_kind%name), &
913 "Atomic kind name: ", trim(name)
914 WRITE (unit=output_unit, fmt=
"(T9,A,L1,T55,A,T75,I6)") &
915 "Automatic name: ", molecule_kind%molname_generated, &
916 "Number of molecules:", nmolecule
918 WRITE (unit=output_unit, fmt=
"(/,T2,I5,A,T50,A,T75,I6,/,T22,A)") &
919 molecule_kind%kind_number, &
920 ". Molecule kind: "//trim(molecule_kind%name), &
921 "Number of atoms: ", natom, &
922 "Atom Atomic kind name"
924 atomic_kind => molecule_kind%atom_list(iatom)%atomic_kind
925 CALL get_atomic_kind(atomic_kind=atomic_kind, name=name)
926 WRITE (unit=output_unit, fmt=
"(T20,I6,(7X,A18))") &
929 WRITE (unit=output_unit, fmt=
"(/,T9,A,L1)") &
930 "The name was automatically generated: ", &
931 molecule_kind%molname_generated
932 WRITE (unit=output_unit, fmt=
"(T9,A,I6,/,T9,A,(T30,5I10))") &
933 "Number of molecules: ", nmolecule,
"Molecule list:", &
934 (molecule_kind%molecule_list(imolecule), imolecule=1, nmolecule)
935 IF (molecule_kind%nbond > 0) &
936 WRITE (unit=output_unit, fmt=
"(1X,A30,I6)") &
937 "Number of bonds: ", molecule_kind%nbond
938 IF (molecule_kind%nbend > 0) &
939 WRITE (unit=output_unit, fmt=
"(1X,A30,I6)") &
940 "Number of bends: ", molecule_kind%nbend
941 IF (molecule_kind%nub > 0) &
942 WRITE (unit=output_unit, fmt=
"(1X,A30,I6)") &
943 "Number of Urey-Bradley:", molecule_kind%nub
944 IF (molecule_kind%ntorsion > 0) &
945 WRITE (unit=output_unit, fmt=
"(1X,A30,I6)") &
946 "Number of torsions: ", molecule_kind%ntorsion
947 IF (molecule_kind%nimpr > 0) &
948 WRITE (unit=output_unit, fmt=
"(1X,A30,I6)") &
949 "Number of improper: ", molecule_kind%nimpr
950 IF (molecule_kind%nopbend > 0) &
951 WRITE (unit=output_unit, fmt=
"(1X,A30,I6)") &
952 "Number of out opbends: ", molecule_kind%nopbend
955 END SUBROUTINE write_molecule_kind
966 TYPE(molecule_kind_type),
DIMENSION(:),
INTENT(IN) :: molecule_kind_set
967 TYPE(section_vals_type),
INTENT(IN) :: subsys_section
969 CHARACTER(len=*),
PARAMETER :: routinen =
'write_molecule_kind_set'
971 INTEGER :: handle, imolecule_kind, natom, nbend, &
972 nbond, nimpr, nmolecule, &
973 nmolecule_kind, nopbend, ntors, &
974 ntotal, nub, output_unit
975 LOGICAL :: all_single_atoms
976 TYPE(cp_logger_type),
POINTER :: logger
978 CALL timeset(routinen, handle)
981 logger => cp_get_default_logger()
982 output_unit = cp_print_key_unit_nr(logger, subsys_section, &
983 "PRINT%MOLECULES", extension=
".Log")
984 IF (output_unit > 0)
THEN
985 WRITE (unit=output_unit, fmt=
"(/,/,T2,A)")
"MOLECULE KIND INFORMATION"
987 nmolecule_kind =
SIZE(molecule_kind_set)
989 all_single_atoms = .true.
990 DO imolecule_kind = 1, nmolecule_kind
991 natom =
SIZE(molecule_kind_set(imolecule_kind)%atom_list)
992 nmolecule =
SIZE(molecule_kind_set(imolecule_kind)%molecule_list)
993 IF (natom*nmolecule > 1) all_single_atoms = .false.
996 IF (all_single_atoms)
THEN
997 WRITE (unit=output_unit, fmt=
"(/,/,T2,A)") &
998 "All atoms are their own molecule, skipping detailed information"
1000 DO imolecule_kind = 1, nmolecule_kind
1001 CALL write_molecule_kind(molecule_kind_set(imolecule_kind), output_unit)
1012 ntotal = nbond + nbend + nub + ntors + nimpr + nopbend
1013 IF (ntotal > 0)
THEN
1014 WRITE (unit=output_unit, fmt=
"(/,/,T2,A,T45,A30,I6)") &
1015 "MOLECULE KIND SET INFORMATION", &
1016 "Total Number of bonds: ", nbond
1017 WRITE (unit=output_unit, fmt=
"(T45,A30,I6)") &
1018 "Total Number of bends: ", nbend
1019 WRITE (unit=output_unit, fmt=
"(T45,A30,I6)") &
1020 "Total Number of Urey-Bradley:", nub
1021 WRITE (unit=output_unit, fmt=
"(T45,A30,I6)") &
1022 "Total Number of torsions: ", ntors
1023 WRITE (unit=output_unit, fmt=
"(T45,A30,I6)") &
1024 "Total Number of improper: ", nimpr
1025 WRITE (unit=output_unit, fmt=
"(T45,A30,I6)") &
1026 "Total Number of opbends: ", nopbend
1029 CALL cp_print_key_finished_output(output_unit, logger, subsys_section, &
1032 CALL timestop(handle)
Define the atomic kind types and their sub types.
subroutine, public get_atomic_kind(atomic_kind, fist_potential, element_symbol, name, mass, kind_number, natom, atom_list, rcov, rvdw, z, qeff, apol, cpol, mm_radius, shell, shell_active, damping)
Get attributes of an atomic kind.
Handles all functions related to the CELL.
integer, parameter, public use_perd_xyz
integer, parameter, public use_perd_y
integer, parameter, public use_perd_xz
integer, parameter, public use_perd_x
integer, parameter, public use_perd_z
integer, parameter, public use_perd_yz
integer, parameter, public use_perd_xy
Initialize the collective variables types.
integer, parameter, public population_colvar_id
integer, parameter, public acid_hyd_dist_colvar_id
integer, parameter, public xyz_outerdiag_colvar_id
integer, parameter, public plane_plane_angle_colvar_id
integer, parameter, public plane_distance_colvar_id
integer, parameter, public combine_colvar_id
integer, parameter, public gyration_colvar_id
integer, parameter, public rotation_colvar_id
integer, parameter, public hydronium_dist_colvar_id
integer, parameter, public coord_colvar_id
integer, parameter, public dfunct_colvar_id
integer, parameter, public no_colvar_id
integer, parameter, public angle_colvar_id
integer, parameter, public qparm_colvar_id
integer, parameter, public dist_colvar_id
integer, parameter, public hydronium_shell_colvar_id
integer, parameter, public torsion_colvar_id
integer, parameter, public xyz_diag_colvar_id
integer, parameter, public reaction_path_colvar_id
integer, parameter, public acid_hyd_shell_colvar_id
various routines to log and control the output. The idea is that decisions about where to log should ...
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_undef
pure subroutine, public torsion_kind_dealloc_ref(torsion_kind)
Deallocate a torsion kind element.
pure subroutine, public ub_kind_dealloc_ref(ub_kind_set)
Deallocate a ub kind set.
pure subroutine, public impr_kind_dealloc_ref()
Deallocate a impr kind element.
Defines the basic variable types.
integer, parameter, public dp
integer, parameter, public default_string_length
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 setup_colvar_counters(colv_list, ncolv)
...
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 deallocate_molecule_kind_set(molecule_kind_set)
Deallocate a molecule kind set.
subroutine, public get_molecule_kind_set(molecule_kind_set, maxatom, natom, nbond, nbend, nub, ntorsion, nimpr, nopbend, nconstraint, nconstraint_fixd, nmolecule, nrestraints)
Get informations about a molecule kind set.
subroutine, public write_molecule_kind_set(molecule_kind_set, subsys_section)
Write a moleculeatomic kind set data set to the output unit.
subroutine, public allocate_molecule_kind_set(molecule_kind_set, nmolecule_kind)
Allocate and initialize a molecule kind set.