(git:916bf6e)
Loading...
Searching...
No Matches
molecule_kind_types.F
Go to the documentation of this file.
1!--------------------------------------------------------------------------------------------------!
2! CP2K: A general program to perform molecular dynamics simulations !
3! Copyright 2000-2025 CP2K developers group <https://cp2k.org> !
4! !
5! SPDX-License-Identifier: GPL-2.0-or-later !
6!--------------------------------------------------------------------------------------------------!
7
8! **************************************************************************************************
9!> \brief Define the molecule kind structure types and the corresponding
10!> functionality
11!> \par History
12!> Teodoro Laino [tlaino] 12.2008 - Preparing for VIRTUAL SITE constraints
13!> (patch by Marcel Baer)
14!> \author Matthias Krack (22.08.2003)
15! **************************************************************************************************
19 USE cell_types, ONLY: use_perd_x,&
26 USE colvar_types, ONLY: &
37 USE force_field_kind_types, ONLY: &
42 USE kinds, ONLY: default_string_length,&
43 dp
45#include "../base/base_uses.f90"
46
47 IMPLICIT NONE
48
49 PRIVATE
50
51 CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'molecule_kind_types'
52
53 ! Define the derived structure types
54
56 TYPE(atomic_kind_type), POINTER :: atomic_kind => null()
57 INTEGER :: id_name = 0
58 END TYPE atom_type
59
61 INTEGER :: a = 0
62 CHARACTER(LEN=default_string_length) :: name = ""
63 TYPE(shell_kind_type), POINTER :: shell_kind => null()
64 END TYPE shell_type
65
67 INTEGER :: a = 0, b = 0
68 INTEGER :: id_type = do_ff_undef, itype = 0
69 TYPE(bond_kind_type), POINTER :: bond_kind => null()
70 END TYPE bond_type
71
73 INTEGER :: a = 0, b = 0, c = 0
74 INTEGER :: id_type = do_ff_undef, itype = 0
75 TYPE(bend_kind_type), POINTER :: bend_kind => null()
76 END TYPE bend_type
77
79 INTEGER :: a = 0, b = 0, c = 0
80 INTEGER :: id_type = do_ff_undef, itype = 0
81 TYPE(ub_kind_type), POINTER :: ub_kind => null()
82 END TYPE ub_type
83
85 INTEGER :: a = 0, b = 0, c = 0, d = 0
86 INTEGER :: id_type = do_ff_undef, itype = 0
87 TYPE(torsion_kind_type), POINTER :: torsion_kind => null()
88 END TYPE torsion_type
89
91 INTEGER :: a = 0, b = 0, c = 0, d = 0
92 INTEGER :: id_type = do_ff_undef, itype = 0
93 TYPE(impr_kind_type), POINTER :: impr_kind => null()
94 END TYPE impr_type
95
97 INTEGER :: a = 0, b = 0, c = 0, d = 0
98 INTEGER :: id_type = do_ff_undef, itype = 0
99 TYPE(opbend_kind_type), POINTER :: opbend_kind => null()
100 END TYPE opbend_type
101
102 TYPE restraint_type
103 LOGICAL :: active = .false.
104 REAL(kind=dp) :: k0 = 0.0_dp
105 END TYPE restraint_type
106
107 ! Constraint types
109 INTEGER :: type_id = no_colvar_id
110 INTEGER :: inp_seq_num = 0
111 LOGICAL :: use_points = .false.
112 REAL(kind=dp) :: expected_value = 0.0_dp
113 REAL(kind=dp) :: expected_value_growth_speed = 0.0_dp
114 INTEGER, POINTER, DIMENSION(:) :: i_atoms => null()
115 TYPE(restraint_type) :: restraint = restraint_type()
117
119 INTEGER :: a = 0, b = 0, c = 0
120 REAL(kind=dp) :: dab = 0.0_dp, dac = 0.0_dp, dbc = 0.0_dp
121 TYPE(restraint_type) :: restraint = restraint_type()
122 END TYPE g3x3_constraint_type
123
125 INTEGER :: a = 0, b = 0, c = 0, d = 0
126 REAL(kind=dp) :: dab = 0.0_dp, dac = 0.0_dp, dbc = 0.0_dp, &
127 dad = 0.0_dp, dbd = 0.0_dp, dcd = 0.0_dp
128 TYPE(restraint_type) :: restraint = restraint_type()
129 END TYPE g4x6_constraint_type
130
132 INTEGER :: a = 0, b = 0, c = 0, d = 0
133 REAL(kind=dp) :: wbc = 0.0_dp, wdc = 0.0_dp
134 TYPE(restraint_type) :: restraint = restraint_type()
135 END TYPE vsite_constraint_type
136
138 TYPE(restraint_type) :: restraint = restraint_type()
139 INTEGER :: fixd = 0, itype = 0
140 REAL(kind=dp), DIMENSION(3) :: coord = 0.0_dp
141 END TYPE fixd_constraint_type
142
144 INTEGER :: ifixd_index = 0, ikind = 0
146
147 ! Molecule kind type
149 TYPE(atom_type), DIMENSION(:), POINTER :: atom_list => null()
150 TYPE(bond_kind_type), DIMENSION(:), POINTER :: bond_kind_set => null()
151 TYPE(bond_type), DIMENSION(:), POINTER :: bond_list => null()
152 TYPE(bend_kind_type), DIMENSION(:), POINTER :: bend_kind_set => null()
153 TYPE(bend_type), DIMENSION(:), POINTER :: bend_list => null()
154 TYPE(ub_kind_type), DIMENSION(:), POINTER :: ub_kind_set => null()
155 TYPE(ub_type), DIMENSION(:), POINTER :: ub_list => null()
156 TYPE(torsion_kind_type), DIMENSION(:), POINTER :: torsion_kind_set => null()
157 TYPE(torsion_type), DIMENSION(:), POINTER :: torsion_list => null()
158 TYPE(impr_kind_type), DIMENSION(:), POINTER :: impr_kind_set => null()
159 TYPE(impr_type), DIMENSION(:), POINTER :: impr_list => null()
160 TYPE(opbend_kind_type), DIMENSION(:), POINTER :: opbend_kind_set => null()
161 TYPE(opbend_type), DIMENSION(:), POINTER :: opbend_list => null()
162 TYPE(colvar_constraint_type), DIMENSION(:), &
163 POINTER :: colv_list => null()
164 TYPE(g3x3_constraint_type), DIMENSION(:), POINTER :: g3x3_list => null()
165 TYPE(g4x6_constraint_type), DIMENSION(:), POINTER :: g4x6_list => null()
166 TYPE(vsite_constraint_type), DIMENSION(:), POINTER :: vsite_list => null()
167 TYPE(fixd_constraint_type), DIMENSION(:), POINTER :: fixd_list => null()
168 TYPE(shell_type), DIMENSION(:), POINTER :: shell_list => null()
169 CHARACTER(LEN=default_string_length) :: name = ""
170 REAL(kind=dp) :: charge = 0.0_dp, &
171 mass = 0.0_dp
172 INTEGER :: kind_number = 0, &
173 natom = 0, &
174 nbond = 0, &
175 nbend = 0, &
176 nimpr = 0, &
177 nopbend = 0, &
178 ntorsion = 0, &
179 nub = 0, &
180 ng3x3 = 0, &
181 ng3x3_restraint = 0, &
182 ng4x6 = 0, &
183 ng4x6_restraint = 0, &
184 nvsite = 0, &
185 nvsite_restraint = 0, &
186 nfixd = 0, &
187 nfixd_restraint = 0, &
188 nmolecule = 0, &
189 nshell = 0
191 INTEGER :: nsgf = 0, &
192 nelectron = 0, &
193 nelectron_alpha = 0, &
194 nelectron_beta = 0
195 INTEGER, DIMENSION(:), POINTER :: molecule_list => null()
196 LOGICAL :: molname_generated = .false.
197 END TYPE molecule_kind_type
198
199 ! Public subroutines
200 PUBLIC :: allocate_molecule_kind_set, &
207
208 ! Public data types
209 PUBLIC :: atom_type, &
210 bend_type, &
211 bond_type, &
212 ub_type, &
213 torsion_type, &
214 impr_type, &
215 opbend_type, &
224
225CONTAINS
226
227! **************************************************************************************************
228!> \brief ...
229!> \param colv_list ...
230!> \param ncolv ...
231! **************************************************************************************************
232 SUBROUTINE setup_colvar_counters(colv_list, ncolv)
233 TYPE(colvar_constraint_type), DIMENSION(:), &
234 POINTER :: colv_list
235 TYPE(colvar_counters), INTENT(OUT) :: ncolv
236
237 INTEGER :: k
238
239 IF (ASSOCIATED(colv_list)) THEN
240 DO k = 1, SIZE(colv_list)
241 IF (colv_list(k)%restraint%active) ncolv%nrestraint = ncolv%nrestraint + 1
242 SELECT CASE (colv_list(k)%type_id)
243 CASE (angle_colvar_id)
244 ncolv%nangle = ncolv%nangle + 1
245 CASE (coord_colvar_id)
246 ncolv%ncoord = ncolv%ncoord + 1
248 ncolv%npopulation = ncolv%npopulation + 1
249 CASE (gyration_colvar_id)
250 ncolv%ngyration = ncolv%ngyration + 1
251 CASE (rotation_colvar_id)
252 ncolv%nrot = ncolv%nrot + 1
253 CASE (dist_colvar_id)
254 ncolv%ndist = ncolv%ndist + 1
255 CASE (dfunct_colvar_id)
256 ncolv%ndfunct = ncolv%ndfunct + 1
258 ncolv%nplane_dist = ncolv%nplane_dist + 1
260 ncolv%nplane_angle = ncolv%nplane_angle + 1
261 CASE (torsion_colvar_id)
262 ncolv%ntorsion = ncolv%ntorsion + 1
263 CASE (qparm_colvar_id)
264 ncolv%nqparm = ncolv%nqparm + 1
265 CASE (xyz_diag_colvar_id)
266 ncolv%nxyz_diag = ncolv%nxyz_diag + 1
268 ncolv%nxyz_outerdiag = ncolv%nxyz_outerdiag + 1
270 ncolv%nhydronium_shell = ncolv%nhydronium_shell + 1
272 ncolv%nhydronium_dist = ncolv%nhydronium_dist + 1
274 ncolv%nacid_hyd_dist = ncolv%nacid_hyd_dist + 1
276 ncolv%nacid_hyd_shell = ncolv%nacid_hyd_shell + 1
278 ncolv%nreactionpath = ncolv%nreactionpath + 1
279 CASE (combine_colvar_id)
280 ncolv%ncombinecvs = ncolv%ncombinecvs + 1
281 CASE DEFAULT
282 cpabort("")
283 END SELECT
284 END DO
285 END IF
286 ncolv%ntot = ncolv%ndist + &
287 ncolv%nangle + &
288 ncolv%ntorsion + &
289 ncolv%ncoord + &
290 ncolv%nplane_dist + &
291 ncolv%nplane_angle + &
292 ncolv%ndfunct + &
293 ncolv%nrot + &
294 ncolv%nqparm + &
295 ncolv%nxyz_diag + &
296 ncolv%nxyz_outerdiag + &
297 ncolv%nhydronium_shell + &
298 ncolv%nhydronium_dist + &
299 ncolv%nacid_hyd_dist + &
300 ncolv%nacid_hyd_shell + &
301 ncolv%nreactionpath + &
302 ncolv%ncombinecvs + &
303 ncolv%npopulation + &
304 ncolv%ngyration
305
306 END SUBROUTINE setup_colvar_counters
307
308! **************************************************************************************************
309!> \brief Allocate and initialize a molecule kind set.
310!> \param molecule_kind_set ...
311!> \param nmolecule_kind ...
312!> \date 22.08.2003
313!> \author Matthias Krack
314!> \version 1.0
315! **************************************************************************************************
316 SUBROUTINE allocate_molecule_kind_set(molecule_kind_set, nmolecule_kind)
317 TYPE(molecule_kind_type), DIMENSION(:), POINTER :: molecule_kind_set
318 INTEGER, INTENT(IN) :: nmolecule_kind
319
320 INTEGER :: imolecule_kind
321
322 IF (ASSOCIATED(molecule_kind_set)) THEN
323 CALL deallocate_molecule_kind_set(molecule_kind_set)
324 END IF
325
326 ALLOCATE (molecule_kind_set(nmolecule_kind))
327
328 DO imolecule_kind = 1, nmolecule_kind
329 molecule_kind_set(imolecule_kind)%kind_number = imolecule_kind
330 CALL setup_colvar_counters(molecule_kind_set(imolecule_kind)%colv_list, &
331 molecule_kind_set(imolecule_kind)%ncolv)
332 END DO
333
334 END SUBROUTINE allocate_molecule_kind_set
335
336! **************************************************************************************************
337!> \brief Deallocate a molecule kind set.
338!> \param molecule_kind_set ...
339!> \date 22.08.2003
340!> \author Matthias Krack
341!> \version 1.0
342! **************************************************************************************************
343 SUBROUTINE deallocate_molecule_kind_set(molecule_kind_set)
344
345 TYPE(molecule_kind_type), DIMENSION(:), POINTER :: molecule_kind_set
346
347 INTEGER :: i, imolecule_kind, j, nmolecule_kind
348
349 IF (ASSOCIATED(molecule_kind_set)) THEN
350
351 nmolecule_kind = SIZE(molecule_kind_set)
352
353 DO imolecule_kind = 1, nmolecule_kind
354
355 IF (ASSOCIATED(molecule_kind_set(imolecule_kind)%atom_list)) THEN
356 DEALLOCATE (molecule_kind_set(imolecule_kind)%atom_list)
357 END IF
358 IF (ASSOCIATED(molecule_kind_set(imolecule_kind)%bend_kind_set)) THEN
359 DO i = 1, SIZE(molecule_kind_set(imolecule_kind)%bend_kind_set)
360 IF (ASSOCIATED(molecule_kind_set(imolecule_kind)%bend_kind_set(i)%legendre%coeffs)) &
361 DEALLOCATE (molecule_kind_set(imolecule_kind)%bend_kind_set(i)%legendre%coeffs)
362 END DO
363 DEALLOCATE (molecule_kind_set(imolecule_kind)%bend_kind_set)
364 END IF
365 IF (ASSOCIATED(molecule_kind_set(imolecule_kind)%bend_list)) THEN
366 DEALLOCATE (molecule_kind_set(imolecule_kind)%bend_list)
367 END IF
368 IF (ASSOCIATED(molecule_kind_set(imolecule_kind)%ub_list)) THEN
369 DEALLOCATE (molecule_kind_set(imolecule_kind)%ub_list)
370 END IF
371 IF (ASSOCIATED(molecule_kind_set(imolecule_kind)%ub_kind_set)) THEN
372 CALL ub_kind_dealloc_ref(molecule_kind_set(imolecule_kind)%ub_kind_set)
373 END IF
374 IF (ASSOCIATED(molecule_kind_set(imolecule_kind)%impr_list)) THEN
375 DEALLOCATE (molecule_kind_set(imolecule_kind)%impr_list)
376 END IF
377 IF (ASSOCIATED(molecule_kind_set(imolecule_kind)%impr_kind_set)) THEN
378 DO i = 1, SIZE(molecule_kind_set(imolecule_kind)%impr_kind_set)
379 CALL impr_kind_dealloc_ref() !This Subroutine doesn't deallocate anything, maybe needs to be implemented
380 END DO
381 DEALLOCATE (molecule_kind_set(imolecule_kind)%impr_kind_set)
382 END IF
383 IF (ASSOCIATED(molecule_kind_set(imolecule_kind)%opbend_list)) THEN
384 DEALLOCATE (molecule_kind_set(imolecule_kind)%opbend_list)
385 END IF
386 IF (ASSOCIATED(molecule_kind_set(imolecule_kind)%opbend_kind_set)) THEN
387 DEALLOCATE (molecule_kind_set(imolecule_kind)%opbend_kind_set)
388 END IF
389 IF (ASSOCIATED(molecule_kind_set(imolecule_kind)%bond_kind_set)) THEN
390 DEALLOCATE (molecule_kind_set(imolecule_kind)%bond_kind_set)
391 END IF
392 IF (ASSOCIATED(molecule_kind_set(imolecule_kind)%bond_list)) THEN
393 DEALLOCATE (molecule_kind_set(imolecule_kind)%bond_list)
394 END IF
395 IF (ASSOCIATED(molecule_kind_set(imolecule_kind)%colv_list)) THEN
396 DO j = 1, SIZE(molecule_kind_set(imolecule_kind)%colv_list)
397 DEALLOCATE (molecule_kind_set(imolecule_kind)%colv_list(j)%i_atoms)
398 END DO
399 DEALLOCATE (molecule_kind_set(imolecule_kind)%colv_list)
400 END IF
401 IF (ASSOCIATED(molecule_kind_set(imolecule_kind)%g3x3_list)) THEN
402 DEALLOCATE (molecule_kind_set(imolecule_kind)%g3x3_list)
403 END IF
404 IF (ASSOCIATED(molecule_kind_set(imolecule_kind)%g4x6_list)) THEN
405 DEALLOCATE (molecule_kind_set(imolecule_kind)%g4x6_list)
406 END IF
407 IF (ASSOCIATED(molecule_kind_set(imolecule_kind)%vsite_list)) THEN
408 DEALLOCATE (molecule_kind_set(imolecule_kind)%vsite_list)
409 END IF
410 IF (ASSOCIATED(molecule_kind_set(imolecule_kind)%fixd_list)) THEN
411 DEALLOCATE (molecule_kind_set(imolecule_kind)%fixd_list)
412 END IF
413 IF (ASSOCIATED(molecule_kind_set(imolecule_kind)%torsion_kind_set)) THEN
414 DO i = 1, SIZE(molecule_kind_set(imolecule_kind)%torsion_kind_set)
415 CALL torsion_kind_dealloc_ref(molecule_kind_set(imolecule_kind)%torsion_kind_set(i))
416 END DO
417 DEALLOCATE (molecule_kind_set(imolecule_kind)%torsion_kind_set)
418 END IF
419 IF (ASSOCIATED(molecule_kind_set(imolecule_kind)%shell_list)) THEN
420 DEALLOCATE (molecule_kind_set(imolecule_kind)%shell_list)
421 END IF
422 IF (ASSOCIATED(molecule_kind_set(imolecule_kind)%torsion_list)) THEN
423 DEALLOCATE (molecule_kind_set(imolecule_kind)%torsion_list)
424 END IF
425 IF (ASSOCIATED(molecule_kind_set(imolecule_kind)%molecule_list)) THEN
426 DEALLOCATE (molecule_kind_set(imolecule_kind)%molecule_list)
427 END IF
428 END DO
429
430 DEALLOCATE (molecule_kind_set)
431 END IF
432 NULLIFY (molecule_kind_set)
433
434 END SUBROUTINE deallocate_molecule_kind_set
435
436! **************************************************************************************************
437!> \brief Get informations about a molecule kind.
438!> \param molecule_kind ...
439!> \param atom_list ...
440!> \param bond_list ...
441!> \param bend_list ...
442!> \param ub_list ...
443!> \param impr_list ...
444!> \param opbend_list ...
445!> \param colv_list ...
446!> \param fixd_list ...
447!> \param g3x3_list ...
448!> \param g4x6_list ...
449!> \param vsite_list ...
450!> \param torsion_list ...
451!> \param shell_list ...
452!> \param name ...
453!> \param mass ...
454!> \param charge ...
455!> \param kind_number ...
456!> \param natom ...
457!> \param nbend ...
458!> \param nbond ...
459!> \param nub ...
460!> \param nimpr ...
461!> \param nopbend ...
462!> \param nconstraint ...
463!> \param nconstraint_fixd ...
464!> \param nfixd ...
465!> \param ncolv ...
466!> \param ng3x3 ...
467!> \param ng4x6 ...
468!> \param nvsite ...
469!> \param nfixd_restraint ...
470!> \param ng3x3_restraint ...
471!> \param ng4x6_restraint ...
472!> \param nvsite_restraint ...
473!> \param nrestraints ...
474!> \param nmolecule ...
475!> \param nsgf ...
476!> \param nshell ...
477!> \param ntorsion ...
478!> \param molecule_list ...
479!> \param nelectron ...
480!> \param nelectron_alpha ...
481!> \param nelectron_beta ...
482!> \param bond_kind_set ...
483!> \param bend_kind_set ...
484!> \param ub_kind_set ...
485!> \param impr_kind_set ...
486!> \param opbend_kind_set ...
487!> \param torsion_kind_set ...
488!> \param molname_generated ...
489!> \date 27.08.2003
490!> \author Matthias Krack
491!> \version 1.0
492! **************************************************************************************************
493 SUBROUTINE get_molecule_kind(molecule_kind, atom_list, bond_list, bend_list, &
494 ub_list, impr_list, opbend_list, colv_list, fixd_list, &
495 g3x3_list, g4x6_list, vsite_list, torsion_list, shell_list, &
496 name, mass, charge, kind_number, natom, nbend, nbond, nub, &
497 nimpr, nopbend, nconstraint, nconstraint_fixd, nfixd, ncolv, ng3x3, ng4x6, &
498 nvsite, nfixd_restraint, ng3x3_restraint, ng4x6_restraint, &
499 nvsite_restraint, nrestraints, nmolecule, nsgf, nshell, ntorsion, &
500 molecule_list, nelectron, nelectron_alpha, nelectron_beta, &
501 bond_kind_set, bend_kind_set, &
502 ub_kind_set, impr_kind_set, opbend_kind_set, torsion_kind_set, &
503 molname_generated)
504
505 TYPE(molecule_kind_type), INTENT(IN) :: molecule_kind
506 TYPE(atom_type), DIMENSION(:), OPTIONAL, POINTER :: atom_list
507 TYPE(bond_type), DIMENSION(:), OPTIONAL, POINTER :: bond_list
508 TYPE(bend_type), DIMENSION(:), OPTIONAL, POINTER :: bend_list
509 TYPE(ub_type), DIMENSION(:), OPTIONAL, POINTER :: ub_list
510 TYPE(impr_type), DIMENSION(:), OPTIONAL, POINTER :: impr_list
511 TYPE(opbend_type), DIMENSION(:), OPTIONAL, POINTER :: opbend_list
512 TYPE(colvar_constraint_type), DIMENSION(:), &
513 OPTIONAL, POINTER :: colv_list
514 TYPE(fixd_constraint_type), DIMENSION(:), &
515 OPTIONAL, POINTER :: fixd_list
516 TYPE(g3x3_constraint_type), DIMENSION(:), &
517 OPTIONAL, POINTER :: g3x3_list
518 TYPE(g4x6_constraint_type), DIMENSION(:), &
519 OPTIONAL, POINTER :: g4x6_list
520 TYPE(vsite_constraint_type), DIMENSION(:), &
521 OPTIONAL, POINTER :: vsite_list
522 TYPE(torsion_type), DIMENSION(:), OPTIONAL, &
523 POINTER :: torsion_list
524 TYPE(shell_type), DIMENSION(:), OPTIONAL, POINTER :: shell_list
525 CHARACTER(LEN=default_string_length), &
526 INTENT(OUT), OPTIONAL :: name
527 REAL(kind=dp), OPTIONAL :: mass, charge
528 INTEGER, INTENT(OUT), OPTIONAL :: kind_number, natom, nbend, nbond, nub, &
529 nimpr, nopbend, nconstraint, &
530 nconstraint_fixd, nfixd
531 TYPE(colvar_counters), INTENT(out), OPTIONAL :: ncolv
532 INTEGER, INTENT(OUT), OPTIONAL :: ng3x3, ng4x6, nvsite, nfixd_restraint, ng3x3_restraint, &
533 ng4x6_restraint, nvsite_restraint, nrestraints, nmolecule, nsgf, nshell, ntorsion
534 INTEGER, DIMENSION(:), OPTIONAL, POINTER :: molecule_list
535 INTEGER, INTENT(OUT), OPTIONAL :: nelectron, nelectron_alpha, &
536 nelectron_beta
537 TYPE(bond_kind_type), DIMENSION(:), OPTIONAL, &
538 POINTER :: bond_kind_set
539 TYPE(bend_kind_type), DIMENSION(:), OPTIONAL, &
540 POINTER :: bend_kind_set
541 TYPE(ub_kind_type), DIMENSION(:), OPTIONAL, &
542 POINTER :: ub_kind_set
543 TYPE(impr_kind_type), DIMENSION(:), OPTIONAL, &
544 POINTER :: impr_kind_set
545 TYPE(opbend_kind_type), DIMENSION(:), OPTIONAL, &
546 POINTER :: opbend_kind_set
547 TYPE(torsion_kind_type), DIMENSION(:), OPTIONAL, &
548 POINTER :: torsion_kind_set
549 LOGICAL, INTENT(OUT), OPTIONAL :: molname_generated
550
551 INTEGER :: i
552
553 IF (PRESENT(atom_list)) atom_list => molecule_kind%atom_list
554 IF (PRESENT(bend_list)) bend_list => molecule_kind%bend_list
555 IF (PRESENT(bond_list)) bond_list => molecule_kind%bond_list
556 IF (PRESENT(impr_list)) impr_list => molecule_kind%impr_list
557 IF (PRESENT(opbend_list)) opbend_list => molecule_kind%opbend_list
558 IF (PRESENT(ub_list)) ub_list => molecule_kind%ub_list
559 IF (PRESENT(bond_kind_set)) bond_kind_set => molecule_kind%bond_kind_set
560 IF (PRESENT(bend_kind_set)) bend_kind_set => molecule_kind%bend_kind_set
561 IF (PRESENT(ub_kind_set)) ub_kind_set => molecule_kind%ub_kind_set
562 IF (PRESENT(impr_kind_set)) impr_kind_set => molecule_kind%impr_kind_set
563 IF (PRESENT(opbend_kind_set)) opbend_kind_set => molecule_kind%opbend_kind_set
564 IF (PRESENT(torsion_kind_set)) torsion_kind_set => molecule_kind%torsion_kind_set
565 IF (PRESENT(colv_list)) colv_list => molecule_kind%colv_list
566 IF (PRESENT(g3x3_list)) g3x3_list => molecule_kind%g3x3_list
567 IF (PRESENT(g4x6_list)) g4x6_list => molecule_kind%g4x6_list
568 IF (PRESENT(vsite_list)) vsite_list => molecule_kind%vsite_list
569 IF (PRESENT(fixd_list)) fixd_list => molecule_kind%fixd_list
570 IF (PRESENT(torsion_list)) torsion_list => molecule_kind%torsion_list
571 IF (PRESENT(shell_list)) shell_list => molecule_kind%shell_list
572 IF (PRESENT(name)) name = molecule_kind%name
573 IF (PRESENT(molname_generated)) molname_generated = molecule_kind%molname_generated
574 IF (PRESENT(mass)) mass = molecule_kind%mass
575 IF (PRESENT(charge)) charge = molecule_kind%charge
576 IF (PRESENT(kind_number)) kind_number = molecule_kind%kind_number
577 IF (PRESENT(natom)) natom = molecule_kind%natom
578 IF (PRESENT(nbend)) nbend = molecule_kind%nbend
579 IF (PRESENT(nbond)) nbond = molecule_kind%nbond
580 IF (PRESENT(nub)) nub = molecule_kind%nub
581 IF (PRESENT(nimpr)) nimpr = molecule_kind%nimpr
582 IF (PRESENT(nopbend)) nopbend = molecule_kind%nopbend
583 IF (PRESENT(nconstraint)) nconstraint = (molecule_kind%ncolv%ntot - molecule_kind%ncolv%nrestraint) + &
584 3*(molecule_kind%ng3x3 - molecule_kind%ng3x3_restraint) + &
585 6*(molecule_kind%ng4x6 - molecule_kind%ng4x6_restraint) + &
586 3*(molecule_kind%nvsite - molecule_kind%nvsite_restraint)
587 IF (PRESENT(ncolv)) ncolv = molecule_kind%ncolv
588 IF (PRESENT(ng3x3)) ng3x3 = molecule_kind%ng3x3
589 IF (PRESENT(ng4x6)) ng4x6 = molecule_kind%ng4x6
590 IF (PRESENT(nvsite)) nvsite = molecule_kind%nvsite
591 ! Number of atoms that have one or more components fixed
592 IF (PRESENT(nfixd)) nfixd = molecule_kind%nfixd
593 ! Number of degrees of freedom fixed
594 IF (PRESENT(nconstraint_fixd)) THEN
595 nconstraint_fixd = 0
596 IF (molecule_kind%nfixd /= 0) THEN
597 DO i = 1, SIZE(molecule_kind%fixd_list)
598 IF (molecule_kind%fixd_list(i)%restraint%active) cycle
599 SELECT CASE (molecule_kind%fixd_list(i)%itype)
601 nconstraint_fixd = nconstraint_fixd + 1
603 nconstraint_fixd = nconstraint_fixd + 2
604 CASE (use_perd_xyz)
605 nconstraint_fixd = nconstraint_fixd + 3
606 END SELECT
607 END DO
608 END IF
609 END IF
610 IF (PRESENT(ng3x3_restraint)) ng3x3_restraint = molecule_kind%ng3x3_restraint
611 IF (PRESENT(ng4x6_restraint)) ng4x6_restraint = molecule_kind%ng4x6_restraint
612 IF (PRESENT(nvsite_restraint)) nvsite_restraint = molecule_kind%nvsite_restraint
613 IF (PRESENT(nfixd_restraint)) nfixd_restraint = molecule_kind%nfixd_restraint
614 IF (PRESENT(nrestraints)) nrestraints = molecule_kind%ncolv%nrestraint + &
615 molecule_kind%ng3x3_restraint + &
616 molecule_kind%ng4x6_restraint + &
617 molecule_kind%nvsite_restraint
618 IF (PRESENT(nmolecule)) nmolecule = molecule_kind%nmolecule
619 IF (PRESENT(nshell)) nshell = molecule_kind%nshell
620 IF (PRESENT(ntorsion)) ntorsion = molecule_kind%ntorsion
621 IF (PRESENT(nsgf)) nsgf = molecule_kind%nsgf
622 IF (PRESENT(nelectron)) nelectron = molecule_kind%nelectron
623 IF (PRESENT(nelectron_alpha)) nelectron_alpha = molecule_kind%nelectron_beta
624 IF (PRESENT(nelectron_beta)) nelectron_beta = molecule_kind%nelectron_alpha
625 IF (PRESENT(molecule_list)) molecule_list => molecule_kind%molecule_list
626
627 END SUBROUTINE get_molecule_kind
628
629! **************************************************************************************************
630!> \brief Get informations about a molecule kind set.
631!> \param molecule_kind_set ...
632!> \param maxatom ...
633!> \param natom ...
634!> \param nbond ...
635!> \param nbend ...
636!> \param nub ...
637!> \param ntorsion ...
638!> \param nimpr ...
639!> \param nopbend ...
640!> \param nconstraint ...
641!> \param nconstraint_fixd ...
642!> \param nmolecule ...
643!> \param nrestraints ...
644!> \date 27.08.2003
645!> \author Matthias Krack
646!> \version 1.0
647! **************************************************************************************************
648 SUBROUTINE get_molecule_kind_set(molecule_kind_set, maxatom, natom, &
649 nbond, nbend, nub, ntorsion, nimpr, nopbend, &
650 nconstraint, nconstraint_fixd, nmolecule, &
651 nrestraints)
652
653 TYPE(molecule_kind_type), DIMENSION(:), INTENT(IN) :: molecule_kind_set
654 INTEGER, INTENT(OUT), OPTIONAL :: maxatom, natom, nbond, nbend, nub, &
655 ntorsion, nimpr, nopbend, nconstraint, &
656 nconstraint_fixd, nmolecule, &
657 nrestraints
658
659 INTEGER :: ibend, ibond, iimpr, imolecule_kind, iopbend, itorsion, iub, na, nc, nc_fixd, &
660 nfixd_restraint, nm, nmolecule_kind, nrestraints_tot
661
662 IF (PRESENT(maxatom)) maxatom = 0
663 IF (PRESENT(natom)) natom = 0
664 IF (PRESENT(nbond)) nbond = 0
665 IF (PRESENT(nbend)) nbend = 0
666 IF (PRESENT(nub)) nub = 0
667 IF (PRESENT(ntorsion)) ntorsion = 0
668 IF (PRESENT(nimpr)) nimpr = 0
669 IF (PRESENT(nopbend)) nopbend = 0
670 IF (PRESENT(nconstraint)) nconstraint = 0
671 IF (PRESENT(nconstraint_fixd)) nconstraint_fixd = 0
672 IF (PRESENT(nrestraints)) nrestraints = 0
673 IF (PRESENT(nmolecule)) nmolecule = 0
674
675 nmolecule_kind = SIZE(molecule_kind_set)
676
677 DO imolecule_kind = 1, nmolecule_kind
678 associate(molecule_kind => molecule_kind_set(imolecule_kind))
679
680 CALL get_molecule_kind(molecule_kind=molecule_kind, &
681 natom=na, &
682 nbond=ibond, &
683 nbend=ibend, &
684 nub=iub, &
685 ntorsion=itorsion, &
686 nimpr=iimpr, &
687 nopbend=iopbend, &
688 nconstraint=nc, &
689 nconstraint_fixd=nc_fixd, &
690 nfixd_restraint=nfixd_restraint, &
691 nrestraints=nrestraints_tot, &
692 nmolecule=nm)
693 IF (PRESENT(maxatom)) maxatom = max(maxatom, na)
694 IF (PRESENT(natom)) natom = natom + na*nm
695 IF (PRESENT(nbond)) nbond = nbond + ibond*nm
696 IF (PRESENT(nbend)) nbend = nbend + ibend*nm
697 IF (PRESENT(nub)) nub = nub + iub*nm
698 IF (PRESENT(ntorsion)) ntorsion = ntorsion + itorsion*nm
699 IF (PRESENT(nimpr)) nimpr = nimpr + iimpr*nm
700 IF (PRESENT(nopbend)) nopbend = nopbend + iopbend*nm
701 IF (PRESENT(nconstraint)) nconstraint = nconstraint + nc*nm + nc_fixd
702 IF (PRESENT(nconstraint_fixd)) nconstraint_fixd = nconstraint_fixd + nc_fixd
703 IF (PRESENT(nmolecule)) nmolecule = nmolecule + nm
704 IF (PRESENT(nrestraints)) nrestraints = nrestraints + nm*nrestraints_tot + nfixd_restraint
705
706 END associate
707 END DO
708
709 END SUBROUTINE get_molecule_kind_set
710
711! **************************************************************************************************
712!> \brief Set the components of a molecule kind.
713!> \param molecule_kind ...
714!> \param name ...
715!> \param mass ...
716!> \param charge ...
717!> \param kind_number ...
718!> \param molecule_list ...
719!> \param atom_list ...
720!> \param nbond ...
721!> \param bond_list ...
722!> \param nbend ...
723!> \param bend_list ...
724!> \param nub ...
725!> \param ub_list ...
726!> \param nimpr ...
727!> \param impr_list ...
728!> \param nopbend ...
729!> \param opbend_list ...
730!> \param ntorsion ...
731!> \param torsion_list ...
732!> \param fixd_list ...
733!> \param ncolv ...
734!> \param colv_list ...
735!> \param ng3x3 ...
736!> \param g3x3_list ...
737!> \param ng4x6 ...
738!> \param nfixd ...
739!> \param g4x6_list ...
740!> \param nvsite ...
741!> \param vsite_list ...
742!> \param ng3x3_restraint ...
743!> \param ng4x6_restraint ...
744!> \param nfixd_restraint ...
745!> \param nshell ...
746!> \param shell_list ...
747!> \param nvsite_restraint ...
748!> \param bond_kind_set ...
749!> \param bend_kind_set ...
750!> \param ub_kind_set ...
751!> \param torsion_kind_set ...
752!> \param impr_kind_set ...
753!> \param opbend_kind_set ...
754!> \param nelectron ...
755!> \param nsgf ...
756!> \param molname_generated ...
757!> \date 27.08.2003
758!> \author Matthias Krack
759!> \version 1.0
760! **************************************************************************************************
761 SUBROUTINE set_molecule_kind(molecule_kind, name, mass, charge, kind_number, &
762 molecule_list, atom_list, nbond, bond_list, &
763 nbend, bend_list, nub, ub_list, nimpr, impr_list, &
764 nopbend, opbend_list, ntorsion, &
765 torsion_list, fixd_list, ncolv, colv_list, ng3x3, &
766 g3x3_list, ng4x6, nfixd, g4x6_list, nvsite, &
767 vsite_list, ng3x3_restraint, ng4x6_restraint, &
768 nfixd_restraint, nshell, shell_list, &
769 nvsite_restraint, bond_kind_set, bend_kind_set, &
770 ub_kind_set, torsion_kind_set, impr_kind_set, &
771 opbend_kind_set, nelectron, nsgf, &
772 molname_generated)
773
774 TYPE(molecule_kind_type), INTENT(INOUT) :: molecule_kind
775 CHARACTER(LEN=*), INTENT(IN), OPTIONAL :: name
776 REAL(kind=dp), OPTIONAL :: mass, charge
777 INTEGER, INTENT(IN), OPTIONAL :: kind_number
778 INTEGER, DIMENSION(:), OPTIONAL, POINTER :: molecule_list
779 TYPE(atom_type), DIMENSION(:), OPTIONAL, POINTER :: atom_list
780 INTEGER, INTENT(IN), OPTIONAL :: nbond
781 TYPE(bond_type), DIMENSION(:), OPTIONAL, POINTER :: bond_list
782 INTEGER, INTENT(IN), OPTIONAL :: nbend
783 TYPE(bend_type), DIMENSION(:), OPTIONAL, POINTER :: bend_list
784 INTEGER, INTENT(IN), OPTIONAL :: nub
785 TYPE(ub_type), DIMENSION(:), OPTIONAL, POINTER :: ub_list
786 INTEGER, INTENT(IN), OPTIONAL :: nimpr
787 TYPE(impr_type), DIMENSION(:), OPTIONAL, POINTER :: impr_list
788 INTEGER, INTENT(IN), OPTIONAL :: nopbend
789 TYPE(opbend_type), DIMENSION(:), OPTIONAL, POINTER :: opbend_list
790 INTEGER, INTENT(IN), OPTIONAL :: ntorsion
791 TYPE(torsion_type), DIMENSION(:), OPTIONAL, &
792 POINTER :: torsion_list
793 TYPE(fixd_constraint_type), DIMENSION(:), &
794 OPTIONAL, POINTER :: fixd_list
795 TYPE(colvar_counters), INTENT(IN), OPTIONAL :: ncolv
796 TYPE(colvar_constraint_type), DIMENSION(:), &
797 OPTIONAL, POINTER :: colv_list
798 INTEGER, INTENT(IN), OPTIONAL :: ng3x3
799 TYPE(g3x3_constraint_type), DIMENSION(:), &
800 OPTIONAL, POINTER :: g3x3_list
801 INTEGER, INTENT(IN), OPTIONAL :: ng4x6, nfixd
802 TYPE(g4x6_constraint_type), DIMENSION(:), &
803 OPTIONAL, POINTER :: g4x6_list
804 INTEGER, INTENT(IN), OPTIONAL :: nvsite
805 TYPE(vsite_constraint_type), DIMENSION(:), &
806 OPTIONAL, POINTER :: vsite_list
807 INTEGER, INTENT(IN), OPTIONAL :: ng3x3_restraint, ng4x6_restraint, &
808 nfixd_restraint, nshell
809 TYPE(shell_type), DIMENSION(:), OPTIONAL, POINTER :: shell_list
810 INTEGER, INTENT(IN), OPTIONAL :: nvsite_restraint
811 TYPE(bond_kind_type), DIMENSION(:), OPTIONAL, &
812 POINTER :: bond_kind_set
813 TYPE(bend_kind_type), DIMENSION(:), OPTIONAL, &
814 POINTER :: bend_kind_set
815 TYPE(ub_kind_type), DIMENSION(:), OPTIONAL, &
816 POINTER :: ub_kind_set
817 TYPE(torsion_kind_type), DIMENSION(:), OPTIONAL, &
818 POINTER :: torsion_kind_set
819 TYPE(impr_kind_type), DIMENSION(:), OPTIONAL, &
820 POINTER :: impr_kind_set
821 TYPE(opbend_kind_type), DIMENSION(:), OPTIONAL, &
822 POINTER :: opbend_kind_set
823 INTEGER, INTENT(IN), OPTIONAL :: nelectron, nsgf
824 LOGICAL, INTENT(IN), OPTIONAL :: molname_generated
825
826 INTEGER :: n
827
828 IF (PRESENT(atom_list)) THEN
829 n = SIZE(atom_list)
830 molecule_kind%natom = n
831 molecule_kind%atom_list => atom_list
832 END IF
833 IF (PRESENT(molname_generated)) molecule_kind%molname_generated = molname_generated
834 IF (PRESENT(name)) molecule_kind%name = name
835 IF (PRESENT(mass)) molecule_kind%mass = mass
836 IF (PRESENT(charge)) molecule_kind%charge = charge
837 IF (PRESENT(kind_number)) molecule_kind%kind_number = kind_number
838 IF (PRESENT(nbond)) molecule_kind%nbond = nbond
839 IF (PRESENT(bond_list)) molecule_kind%bond_list => bond_list
840 IF (PRESENT(nbend)) molecule_kind%nbend = nbend
841 IF (PRESENT(nelectron)) molecule_kind%nelectron = nelectron
842 IF (PRESENT(nsgf)) molecule_kind%nsgf = nsgf
843 IF (PRESENT(bend_list)) molecule_kind%bend_list => bend_list
844 IF (PRESENT(nub)) molecule_kind%nub = nub
845 IF (PRESENT(ub_list)) molecule_kind%ub_list => ub_list
846 IF (PRESENT(ntorsion)) molecule_kind%ntorsion = ntorsion
847 IF (PRESENT(torsion_list)) molecule_kind%torsion_list => torsion_list
848 IF (PRESENT(nimpr)) molecule_kind%nimpr = nimpr
849 IF (PRESENT(impr_list)) molecule_kind%impr_list => impr_list
850 IF (PRESENT(nopbend)) molecule_kind%nopbend = nopbend
851 IF (PRESENT(opbend_list)) molecule_kind%opbend_list => opbend_list
852 IF (PRESENT(ncolv)) molecule_kind%ncolv = ncolv
853 IF (PRESENT(colv_list)) molecule_kind%colv_list => colv_list
854 IF (PRESENT(ng3x3)) molecule_kind%ng3x3 = ng3x3
855 IF (PRESENT(g3x3_list)) molecule_kind%g3x3_list => g3x3_list
856 IF (PRESENT(ng4x6)) molecule_kind%ng4x6 = ng4x6
857 IF (PRESENT(nvsite)) molecule_kind%nvsite = nvsite
858 IF (PRESENT(nfixd)) molecule_kind%nfixd = nfixd
859 IF (PRESENT(nfixd_restraint)) molecule_kind%nfixd_restraint = nfixd_restraint
860 IF (PRESENT(ng3x3_restraint)) molecule_kind%ng3x3_restraint = ng3x3_restraint
861 IF (PRESENT(ng4x6_restraint)) molecule_kind%ng4x6_restraint = ng4x6_restraint
862 IF (PRESENT(nvsite_restraint)) molecule_kind%nvsite_restraint = nvsite_restraint
863 IF (PRESENT(g4x6_list)) molecule_kind%g4x6_list => g4x6_list
864 IF (PRESENT(vsite_list)) molecule_kind%vsite_list => vsite_list
865 IF (PRESENT(fixd_list)) molecule_kind%fixd_list => fixd_list
866 IF (PRESENT(bond_kind_set)) molecule_kind%bond_kind_set => bond_kind_set
867 IF (PRESENT(bend_kind_set)) molecule_kind%bend_kind_set => bend_kind_set
868 IF (PRESENT(ub_kind_set)) molecule_kind%ub_kind_set => ub_kind_set
869 IF (PRESENT(torsion_kind_set)) molecule_kind%torsion_kind_set => torsion_kind_set
870 IF (PRESENT(impr_kind_set)) molecule_kind%impr_kind_set => impr_kind_set
871 IF (PRESENT(opbend_kind_set)) molecule_kind%opbend_kind_set => opbend_kind_set
872 IF (PRESENT(nshell)) molecule_kind%nshell = nshell
873 IF (PRESENT(shell_list)) molecule_kind%shell_list => shell_list
874 IF (PRESENT(molecule_list)) THEN
875 n = SIZE(molecule_list)
876 molecule_kind%nmolecule = n
877 molecule_kind%molecule_list => molecule_list
878 END IF
879 END SUBROUTINE set_molecule_kind
880
881! **************************************************************************************************
882!> \brief Write a molecule kind data set to the output unit.
883!> \param molecule_kind ...
884!> \param output_unit ...
885!> \date 24.09.2003
886!> \author Matthias Krack
887!> \version 1.0
888! **************************************************************************************************
889 SUBROUTINE write_molecule_kind(molecule_kind, output_unit)
890 TYPE(molecule_kind_type), INTENT(IN) :: molecule_kind
891 INTEGER, INTENT(in) :: output_unit
892
893 CHARACTER(LEN=default_string_length) :: name
894 INTEGER :: iatom, imolecule, natom, nmolecule
895 TYPE(atomic_kind_type), POINTER :: atomic_kind
896
897 IF (output_unit > 0) THEN
898 natom = SIZE(molecule_kind%atom_list)
899 nmolecule = SIZE(molecule_kind%molecule_list)
900
901 IF (natom == 1) THEN
902 atomic_kind => molecule_kind%atom_list(1)%atomic_kind
903 CALL get_atomic_kind(atomic_kind=atomic_kind, name=name)
904 WRITE (unit=output_unit, fmt="(/,T2,I5,A,T36,A,A,T64,A)") &
905 molecule_kind%kind_number, &
906 ". Molecule kind: "//trim(molecule_kind%name), &
907 "Atomic kind name: ", trim(name)
908 WRITE (unit=output_unit, fmt="(T9,A,L1,T55,A,T75,I6)") &
909 "Automatic name: ", molecule_kind%molname_generated, &
910 "Number of molecules:", nmolecule
911 ELSE
912 WRITE (unit=output_unit, fmt="(/,T2,I5,A,T50,A,T75,I6,/,T22,A)") &
913 molecule_kind%kind_number, &
914 ". Molecule kind: "//trim(molecule_kind%name), &
915 "Number of atoms: ", natom, &
916 "Atom Atomic kind name"
917 DO iatom = 1, natom
918 atomic_kind => molecule_kind%atom_list(iatom)%atomic_kind
919 CALL get_atomic_kind(atomic_kind=atomic_kind, name=name)
920 WRITE (unit=output_unit, fmt="(T20,I6,(7X,A18))") &
921 iatom, trim(name)
922 END DO
923 WRITE (unit=output_unit, fmt="(/,T9,A,L1)") &
924 "The name was automatically generated: ", &
925 molecule_kind%molname_generated
926 WRITE (unit=output_unit, fmt="(T9,A,I6,/,T9,A,(T30,5I10))") &
927 "Number of molecules: ", nmolecule, "Molecule list:", &
928 (molecule_kind%molecule_list(imolecule), imolecule=1, nmolecule)
929 IF (molecule_kind%nbond > 0) &
930 WRITE (unit=output_unit, fmt="(1X,A30,I6)") &
931 "Number of bonds: ", molecule_kind%nbond
932 IF (molecule_kind%nbend > 0) &
933 WRITE (unit=output_unit, fmt="(1X,A30,I6)") &
934 "Number of bends: ", molecule_kind%nbend
935 IF (molecule_kind%nub > 0) &
936 WRITE (unit=output_unit, fmt="(1X,A30,I6)") &
937 "Number of Urey-Bradley:", molecule_kind%nub
938 IF (molecule_kind%ntorsion > 0) &
939 WRITE (unit=output_unit, fmt="(1X,A30,I6)") &
940 "Number of torsions: ", molecule_kind%ntorsion
941 IF (molecule_kind%nimpr > 0) &
942 WRITE (unit=output_unit, fmt="(1X,A30,I6)") &
943 "Number of improper: ", molecule_kind%nimpr
944 IF (molecule_kind%nopbend > 0) &
945 WRITE (unit=output_unit, fmt="(1X,A30,I6)") &
946 "Number of out opbends: ", molecule_kind%nopbend
947 END IF
948 END IF
949 END SUBROUTINE write_molecule_kind
950
951! **************************************************************************************************
952!> \brief Write a moleculeatomic kind set data set to the output unit.
953!> \param molecule_kind_set ...
954!> \param subsys_section ...
955!> \date 24.09.2003
956!> \author Matthias Krack
957!> \version 1.0
958! **************************************************************************************************
959 SUBROUTINE write_molecule_kind_set(molecule_kind_set, subsys_section)
960 TYPE(molecule_kind_type), DIMENSION(:), INTENT(IN) :: molecule_kind_set
961 TYPE(section_vals_type), INTENT(IN) :: subsys_section
962
963 CHARACTER(len=*), PARAMETER :: routinen = 'write_molecule_kind_set'
964
965 INTEGER :: handle, imolecule_kind, natom, nbend, &
966 nbond, nimpr, nmolecule, &
967 nmolecule_kind, nopbend, ntors, &
968 ntotal, nub, output_unit
969 LOGICAL :: all_single_atoms
970 TYPE(cp_logger_type), POINTER :: logger
971
972 CALL timeset(routinen, handle)
973
974 NULLIFY (logger)
975 logger => cp_get_default_logger()
976 output_unit = cp_print_key_unit_nr(logger, subsys_section, &
977 "PRINT%MOLECULES", extension=".Log")
978 IF (output_unit > 0) THEN
979 WRITE (unit=output_unit, fmt="(/,/,T2,A)") "MOLECULE KIND INFORMATION"
980
981 nmolecule_kind = SIZE(molecule_kind_set)
982
983 all_single_atoms = .true.
984 DO imolecule_kind = 1, nmolecule_kind
985 natom = SIZE(molecule_kind_set(imolecule_kind)%atom_list)
986 nmolecule = SIZE(molecule_kind_set(imolecule_kind)%molecule_list)
987 IF (natom*nmolecule > 1) all_single_atoms = .false.
988 END DO
989
990 IF (all_single_atoms) THEN
991 WRITE (unit=output_unit, fmt="(/,/,T2,A)") &
992 "All atoms are their own molecule, skipping detailed information"
993 ELSE
994 DO imolecule_kind = 1, nmolecule_kind
995 CALL write_molecule_kind(molecule_kind_set(imolecule_kind), output_unit)
996 END DO
997 END IF
998
999 CALL get_molecule_kind_set(molecule_kind_set=molecule_kind_set, &
1000 nbond=nbond, &
1001 nbend=nbend, &
1002 nub=nub, &
1003 ntorsion=ntors, &
1004 nimpr=nimpr, &
1005 nopbend=nopbend)
1006 ntotal = nbond + nbend + nub + ntors + nimpr + nopbend
1007 IF (ntotal > 0) THEN
1008 WRITE (unit=output_unit, fmt="(/,/,T2,A,T45,A30,I6)") &
1009 "MOLECULE KIND SET INFORMATION", &
1010 "Total Number of bonds: ", nbond
1011 WRITE (unit=output_unit, fmt="(T45,A30,I6)") &
1012 "Total Number of bends: ", nbend
1013 WRITE (unit=output_unit, fmt="(T45,A30,I6)") &
1014 "Total Number of Urey-Bradley:", nub
1015 WRITE (unit=output_unit, fmt="(T45,A30,I6)") &
1016 "Total Number of torsions: ", ntors
1017 WRITE (unit=output_unit, fmt="(T45,A30,I6)") &
1018 "Total Number of improper: ", nimpr
1019 WRITE (unit=output_unit, fmt="(T45,A30,I6)") &
1020 "Total Number of opbends: ", nopbend
1021 END IF
1022 END IF
1023 CALL cp_print_key_finished_output(output_unit, logger, subsys_section, &
1024 "PRINT%MOLECULES")
1025
1026 CALL timestop(handle)
1027
1028 END SUBROUTINE write_molecule_kind_set
1029
1030END MODULE molecule_kind_types
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.
Definition cell_types.F:15
integer, parameter, public use_perd_xyz
Definition cell_types.F:42
integer, parameter, public use_perd_y
Definition cell_types.F:42
integer, parameter, public use_perd_xz
Definition cell_types.F:42
integer, parameter, public use_perd_x
Definition cell_types.F:42
integer, parameter, public use_perd_z
Definition cell_types.F:42
integer, parameter, public use_perd_yz
Definition cell_types.F:42
integer, parameter, public use_perd_xy
Definition cell_types.F:42
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.
objects that represent the structure of input sections and the data contained in an input section
Defines the basic variable types.
Definition kinds.F:23
integer, parameter, public dp
Definition kinds.F:34
integer, parameter, public default_string_length
Definition kinds.F:57
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.
Handles all possible kinds of restraints in CP2K.
Definition restraint.F:14
Provides all information about an atomic kind.
type of a logger, at the moment it contains just a print level starting at which level it should be l...