86 topology, qmmm_env, particle_set, input_file, subsys_section, gci)
95 CHARACTER(len=*),
PARAMETER :: routinen =
'topology_constraint_pack'
97 CHARACTER(LEN=2) :: element_symbol
98 CHARACTER(LEN=default_string_length) :: molname, name
99 CHARACTER(LEN=default_string_length), &
100 DIMENSION(:),
POINTER :: atom_typeh, cnds
101 INTEGER :: cind, first, first_atom, gind, handle, handle2, i, ii, itype, iw, j, k, k1loc, &
102 k2loc, kk, last, last_atom, m, n_start_colv, natom, nbond, ncolv_glob, ncolv_mol, &
103 nfixd_list_gci, nfixd_restart, nfixd_restraint, nfixed_atoms, ng3x3, ng3x3_restraint, &
104 ng4x6, ng4x6_restraint, nhdist, nmolecule, nrep, nvsite, nvsite_restraint, offset
105 INTEGER,
DIMENSION(:),
POINTER :: constr_x_glob, inds, molecule_list
106 LOGICAL :: exclude_mm, exclude_qm, fix_atom_mm, fix_atom_molname, fix_atom_qm, &
107 fix_atom_qmmm, fix_fixed_atom, found_molname, is_qm, ishbond, ldummy, &
108 restart_restraint_clv, restart_restraint_pos, use_clv_info
109 LOGICAL,
ALLOCATABLE,
DIMENSION(:) :: missed_molname
110 REAL(kind=
dp) :: rmod, rvec(3)
111 REAL(kind=
dp),
DIMENSION(:),
POINTER :: hdist, r
112 TYPE(
atom_type),
DIMENSION(:),
POINTER :: atom_list
114 TYPE(
bond_type),
DIMENSION(:),
POINTER :: bond_list
134 fixd_restr_rest, hbonds_section
137 NULLIFY (logger, constr_x_mol, constr_x_glob)
140 extension=
".subsysLog")
141 CALL timeset(routinen, handle)
142 CALL timeset(routinen//
"_1", handle2)
146 "MOTION%CONSTRAINT%HBONDS")
148 "MOTION%CONSTRAINT%FIX_ATOM_RESTART")
151 "MOTION%CONSTRAINT%COLVAR_RESTART")
154 "COLVAR%COLVAR_FUNC_INFO")
161 molecule => molecule_set(i)
175 NULLIFY (gci%lcolv, &
187 gci%ng3x3_restraint = 0
188 gci%ng4x6_restraint = 0
189 gci%nvsite_restraint = 0
191 gci%nrestraint = gci%ng3x3_restraint + &
192 gci%ng4x6_restraint + &
193 gci%nvsite_restraint + &
195 CALL timestop(handle2)
196 CALL timeset(routinen//
"_2", handle2)
203 NULLIFY (atom_typeh, hdist)
204 ALLOCATE (constr_x_mol(
SIZE(molecule_kind_set)))
205 DO i = 1,
SIZE(molecule_kind_set)
206 ALLOCATE (constr_x_mol(i)%constr(1))
207 constr_x_mol(i)%constr(1) = 1
212 DO i = 1,
SIZE(molecule_kind_set)
213 constr_x_mol(i)%constr(1) = 0
217 constr_x_mol(inds(i))%constr(1) = 1
223 DO i = 1,
SIZE(molecule_kind_set)
224 constr_x_mol(i)%constr(1) = 0
228 found_molname = .false.
229 DO k = 1,
SIZE(molecule_kind_set)
230 molecule_kind => molecule_kind_set(k)
231 name = molecule_kind%name
233 IF (cnds(i) == name)
THEN
234 constr_x_mol(k)%constr(1) = 1
235 found_molname = .true.
238 CALL print_warning_molname(found_molname, cnds(i))
248 IF (
ASSOCIATED(hdist))
THEN
249 cpassert(
SIZE(hdist) ==
SIZE(atom_typeh))
254 DO i = 1,
SIZE(molecule_kind_set)
255 molecule_kind => molecule_kind_set(i)
256 IF (constr_x_mol(i)%constr(1) == 0) cycle
258 bond_list=bond_list, nbond=nbond, atom_list=atom_list, &
259 molecule_list=molecule_list)
262 molecule => molecule_set(molecule_list(1))
263 CALL get_molecule(molecule, first_atom=first_atom, last_atom=last_atom)
264 natom = last_atom - first_atom + 1
268 IF (j < 1 .OR. j > natom) cycle
269 atomic_kind => atom_list(j)%atomic_kind
272 IF ((name(1:1) ==
"H") .OR.
is_hydrogen(atomic_kind)) ishbond = .true.
273 IF (is_qm .AND. exclude_qm) ishbond = .false.
274 IF (.NOT. (is_qm) .AND. exclude_mm) ishbond = .false.
275 IF (.NOT. ishbond)
THEN
277 IF (j < 1 .OR. j > natom) cycle
278 atomic_kind => atom_list(j)%atomic_kind
281 IF ((name(1:1) ==
"H") .OR.
is_hydrogen(atomic_kind)) ishbond = .true.
282 IF (is_qm .AND. exclude_qm) ishbond = .false.
283 IF (.NOT. (is_qm) .AND. exclude_mm) ishbond = .false.
290 n_start_colv = cons_info%nconst_colv
291 cons_info%nconst_colv = nhdist + n_start_colv
292 CALL reallocate(cons_info%const_colv_mol, 1, cons_info%nconst_colv)
293 CALL reallocate(cons_info%const_colv_molname, 1, cons_info%nconst_colv)
294 CALL reallocate(cons_info%const_colv_target, 1, cons_info%nconst_colv)
295 CALL reallocate(cons_info%const_colv_target_growth, 1, cons_info%nconst_colv)
298 CALL reallocate(cons_info%colv_intermolecular, 1, cons_info%nconst_colv)
299 CALL reallocate(cons_info%colv_restraint, 1, cons_info%nconst_colv)
300 CALL reallocate(cons_info%colv_k0, 1, cons_info%nconst_colv)
301 CALL reallocate(cons_info%colv_exclude_qm, 1, cons_info%nconst_colv)
302 CALL reallocate(cons_info%colv_exclude_mm, 1, cons_info%nconst_colv)
304 cons_info%colv_intermolecular(n_start_colv + 1:cons_info%nconst_colv) = .false.
305 cons_info%colv_exclude_qm(n_start_colv + 1:cons_info%nconst_colv) = .false.
306 cons_info%colv_exclude_mm(n_start_colv + 1:cons_info%nconst_colv) = .false.
307 cons_info%colv_restraint(n_start_colv + 1:cons_info%nconst_colv) = cons_info%hbonds_restraint
308 cons_info%colv_k0(n_start_colv + 1:cons_info%nconst_colv) = cons_info%hbonds_k0
311 DO i = 1,
SIZE(molecule_kind_set)
312 IF (constr_x_mol(i)%constr(1) == 0) cycle
313 molecule_kind => molecule_kind_set(i)
315 bond_list=bond_list, nbond=nbond, atom_list=atom_list, &
316 molecule_list=molecule_list)
317 molecule => molecule_set(molecule_list(1))
318 CALL get_molecule(molecule, first_atom=first_atom, last_atom=last_atom)
319 natom = last_atom - first_atom + 1
320 offset = first_atom - 1
324 IF (j < 1 .OR. j > natom) cycle
325 atomic_kind => atom_list(j)%atomic_kind
328 IF ((name(1:1) ==
"H") .OR.
is_hydrogen(atomic_kind)) ishbond = .true.
329 IF (is_qm .AND. exclude_qm) ishbond = .false.
330 IF (.NOT. (is_qm) .AND. exclude_mm) ishbond = .false.
331 IF (.NOT. ishbond)
THEN
333 IF (j < 1 .OR. j > natom) cycle
334 atomic_kind => atom_list(j)%atomic_kind
337 IF ((name(1:1) ==
"H") .OR.
is_hydrogen(atomic_kind)) ishbond = .true.
338 IF (is_qm .AND. exclude_qm) ishbond = .false.
339 IF (.NOT. (is_qm) .AND. exclude_mm) ishbond = .false.
343 rvec = particle_set(offset + bond_list(k)%a)%r - particle_set(offset + bond_list(k)%b)%r
344 rmod = sqrt(dot_product(rvec, rvec))
345 IF (
ASSOCIATED(hdist))
THEN
346 IF (
SIZE(hdist) > 0)
THEN
347 IF (bond_list(k)%a == j) atomic_kind => atom_list(bond_list(k)%b)%atomic_kind
348 IF (bond_list(k)%b == j) atomic_kind => atom_list(bond_list(k)%a)%atomic_kind
350 name=name, element_symbol=element_symbol)
352 DO m = 1,
SIZE(hdist)
353 IF (trim(name) == trim(atom_typeh(m)))
EXIT
354 IF (trim(element_symbol) == trim(atom_typeh(m)))
EXIT
356 IF (m <=
SIZE(hdist))
THEN
361 cons_info%const_colv_mol(nhdist + n_start_colv) = i
362 cons_info%const_colv_molname(nhdist + n_start_colv) =
"UNDEF"
363 cons_info%const_colv_target(nhdist + n_start_colv) = rmod
364 cons_info%const_colv_target_growth(nhdist + n_start_colv) = 0.0_dp
365 CALL colvar_create(cons_info%colvar_set(nhdist + n_start_colv)%colvar, &
367 cons_info%colvar_set(nhdist + n_start_colv)%colvar%dist_param%i_at = bond_list(k)%a
368 cons_info%colvar_set(nhdist + n_start_colv)%colvar%dist_param%j_at = bond_list(k)%b
369 CALL colvar_setup(cons_info%colvar_set(nhdist + n_start_colv)%colvar)
373 DO j = 1,
SIZE(constr_x_mol)
374 DEALLOCATE (constr_x_mol(j)%constr)
376 DEALLOCATE (constr_x_mol)
379 CALL timestop(handle2)
380 CALL timeset(routinen//
"_3", handle2)
387 DO ii = 1,
SIZE(cons_info%colvar_set)
391 CALL give_constraint_array(cons_info%const_colv_mol, &
392 cons_info%const_colv_molname, &
393 cons_info%colv_intermolecular, &
397 cons_info%colv_exclude_qm, &
398 cons_info%colv_exclude_mm)
402 DO ii = 1,
SIZE(molecule_kind_set)
403 molecule_kind => molecule_kind_set(ii)
405 nmolecule=nmolecule, molecule_list=molecule_list)
406 ncolv_mol =
SIZE(constr_x_mol(ii)%constr)
407 ALLOCATE (colv_list(ncolv_mol))
412 molecule => molecule_set(molecule_list(1))
414 CALL setup_colv_list(colv_list, constr_x_mol(ii)%constr, gind, &
415 cons_info,
topology, particle_set, restart_restraint_clv, &
416 colvar_rest, first_atom)
420 molecule => molecule_set(molecule_list(j))
421 CALL get_molecule(molecule, first_atom=first_atom, last_atom=last_atom)
422 ALLOCATE (lcolv(ncolv_mol))
423 CALL setup_lcolv(lcolv, constr_x_mol(ii)%constr, first_atom, last_atom, &
424 cons_info, particle_set, colvar_func_info, use_clv_info, cind)
428 DO j = 1,
SIZE(constr_x_mol)
429 DEALLOCATE (constr_x_mol(j)%constr)
431 DEALLOCATE (constr_x_mol)
434 IF (
ASSOCIATED(constr_x_glob))
THEN
435 ncolv_glob =
SIZE(constr_x_glob)
436 ALLOCATE (colv_list(ncolv_glob))
437 CALL setup_colv_list(colv_list, constr_x_glob, gind, cons_info, &
438 topology, particle_set, restart_restraint_clv, colvar_rest, &
441 ALLOCATE (lcolv(ncolv_glob))
442 CALL setup_lcolv(lcolv, constr_x_glob, 1,
SIZE(particle_set), cons_info, &
443 particle_set, colvar_func_info, use_clv_info, cind)
444 gci%colv_list => colv_list
448 gci%ntot = gci%ncolv%ntot + gci%ntot
449 DEALLOCATE (constr_x_glob)
453 CALL timestop(handle2)
454 CALL timeset(routinen//
"_4", handle2)
460 CALL give_constraint_array(cons_info%const_g33_mol, &
461 cons_info%const_g33_molname, &
462 cons_info%g33_intermolecular, &
466 cons_info%g33_exclude_qm, &
467 cons_info%g33_exclude_mm)
469 DO ii = 1,
SIZE(molecule_kind_set)
470 molecule_kind => molecule_kind_set(ii)
472 nmolecule=nmolecule, &
473 molecule_list=molecule_list)
474 ng3x3 =
SIZE(constr_x_mol(ii)%constr)
475 ALLOCATE (g3x3_list(ng3x3))
476 CALL setup_g3x3_list(g3x3_list, constr_x_mol(ii)%constr, cons_info, ng3x3_restraint)
477 CALL set_molecule_kind(molecule_kind, ng3x3=ng3x3, ng3x3_restraint=ng3x3_restraint, g3x3_list=g3x3_list)
479 molecule => molecule_set(molecule_list(j))
480 CALL get_molecule(molecule, first_atom=first_atom, last_atom=last_atom)
481 ALLOCATE (lg3x3(ng3x3))
482 CALL setup_lg3x3(lg3x3, g3x3_list, first_atom, last_atom)
486 DO j = 1,
SIZE(constr_x_mol)
487 DEALLOCATE (constr_x_mol(j)%constr)
489 DEALLOCATE (constr_x_mol)
491 IF (
ASSOCIATED(constr_x_glob))
THEN
492 ng3x3 =
SIZE(constr_x_glob)
493 ALLOCATE (g3x3_list(ng3x3))
494 CALL setup_g3x3_list(g3x3_list, constr_x_glob, cons_info, ng3x3_restraint)
495 ALLOCATE (lg3x3(ng3x3))
496 CALL setup_lg3x3(lg3x3, g3x3_list, first_atom, last_atom)
497 gci%g3x3_list => g3x3_list
500 gci%ng3x3_restraint = ng3x3_restraint
502 gci%ntot = 3*gci%ng3x3 + gci%ntot
503 DEALLOCATE (constr_x_glob)
507 CALL timestop(handle2)
508 CALL timeset(routinen//
"_5", handle2)
514 CALL give_constraint_array(cons_info%const_g46_mol, &
515 cons_info%const_g46_molname, &
516 cons_info%g46_intermolecular, &
520 cons_info%g46_exclude_qm, &
521 cons_info%g46_exclude_mm)
523 DO ii = 1,
SIZE(molecule_kind_set)
524 molecule_kind => molecule_kind_set(ii)
526 nmolecule=nmolecule, molecule_list=molecule_list)
527 ng4x6 =
SIZE(constr_x_mol(ii)%constr)
528 ALLOCATE (g4x6_list(ng4x6))
529 CALL setup_g4x6_list(g4x6_list, constr_x_mol(ii)%constr, cons_info, ng4x6_restraint)
530 CALL set_molecule_kind(molecule_kind, ng4x6=ng4x6, ng4x6_restraint=ng4x6_restraint, g4x6_list=g4x6_list)
532 molecule => molecule_set(molecule_list(j))
533 CALL get_molecule(molecule, first_atom=first_atom, last_atom=last_atom)
534 ALLOCATE (lg4x6(ng4x6))
535 CALL setup_lg4x6(lg4x6, g4x6_list, first_atom, last_atom)
539 DO j = 1,
SIZE(constr_x_mol)
540 DEALLOCATE (constr_x_mol(j)%constr)
542 DEALLOCATE (constr_x_mol)
544 IF (
ASSOCIATED(constr_x_glob))
THEN
545 ng4x6 =
SIZE(constr_x_glob)
546 ALLOCATE (g4x6_list(ng4x6))
547 CALL setup_g4x6_list(g4x6_list, constr_x_glob, cons_info, ng4x6_restraint)
548 ALLOCATE (lg4x6(ng4x6))
549 CALL setup_lg4x6(lg4x6, g4x6_list, first_atom, last_atom)
550 gci%g4x6_list => g4x6_list
553 gci%ng4x6_restraint = ng4x6_restraint
555 gci%ntot = 6*gci%ng4x6 + gci%ntot
556 DEALLOCATE (constr_x_glob)
560 CALL timestop(handle2)
561 CALL timeset(routinen//
"_6", handle2)
567 CALL give_constraint_array(cons_info%const_vsite_mol, &
568 cons_info%const_vsite_molname, &
569 cons_info%vsite_intermolecular, &
573 cons_info%vsite_exclude_qm, &
574 cons_info%vsite_exclude_mm)
576 DO ii = 1,
SIZE(molecule_kind_set)
577 molecule_kind => molecule_kind_set(ii)
579 nmolecule=nmolecule, molecule_list=molecule_list)
580 nvsite =
SIZE(constr_x_mol(ii)%constr)
581 ALLOCATE (vsite_list(nvsite))
582 CALL setup_vsite_list(vsite_list, constr_x_mol(ii)%constr, cons_info, nvsite_restraint)
583 CALL set_molecule_kind(molecule_kind, nvsite=nvsite, nvsite_restraint=nvsite_restraint, &
584 vsite_list=vsite_list)
586 DO j = 1,
SIZE(constr_x_mol)
587 DEALLOCATE (constr_x_mol(j)%constr)
589 DEALLOCATE (constr_x_mol)
591 IF (
ASSOCIATED(constr_x_glob))
THEN
592 nvsite =
SIZE(constr_x_glob)
593 ALLOCATE (vsite_list(nvsite))
594 CALL setup_vsite_list(vsite_list, constr_x_glob, cons_info, nvsite_restraint)
595 gci%vsite_list => vsite_list
597 gci%nvsite_restraint = nvsite_restraint
599 gci%ntot = gci%nvsite + gci%ntot
600 DEALLOCATE (constr_x_glob)
603 CALL timestop(handle2)
604 CALL timeset(routinen//
"_7", handle2)
610 ALLOCATE (fixd_list_gci(
SIZE(particle_set)))
612 ALLOCATE (missed_molname(
SIZE(cons_info%fixed_molnames, 1)))
613 missed_molname = .true.
615 DO i = 1,
SIZE(molecule_kind_set)
616 molecule_kind => molecule_kind_set(i)
618 nmolecule=nmolecule, molecule_list=molecule_list, name=molname)
620 WHERE (molname .EQ. cons_info%fixed_molnames)
621 missed_molname = .false.
626 molecule => molecule_set(molecule_list(j))
627 CALL get_molecule(molecule, first_atom=first, last_atom=last)
628 fix_atom_molname = .false.
629 IF (
ASSOCIATED(cons_info%fixed_molnames))
THEN
630 DO k = 1,
SIZE(cons_info%fixed_molnames)
631 IF (cons_info%fixed_molnames(k) .EQ. molname)
THEN
632 fix_atom_molname = .true.
633 IF (is_qm .AND. cons_info%fixed_exclude_qm(k)) fix_atom_molname = .false.
634 IF ((.NOT. is_qm) .AND. cons_info%fixed_exclude_mm(k)) fix_atom_molname = .false.
639 fix_atom_qmmm = .false.
640 IF (
PRESENT(qmmm_env))
THEN
641 SELECT CASE (cons_info%freeze_qm)
643 IF (any(qmmm_env%qm_atom_index == k)) fix_atom_qmmm = .true.
645 IF (any(qmmm_env%qm_molecule_index == molecule_list(j))) fix_atom_qmmm = .true.
647 SELECT CASE (cons_info%freeze_mm)
649 IF (all(qmmm_env%qm_atom_index /= k)) fix_atom_qmmm = .true.
651 IF (all(qmmm_env%qm_molecule_index /= molecule_list(j))) fix_atom_qmmm = .true.
654 IF (any(cons_info%fixed_atoms == k) .OR. fix_atom_qmmm .OR. fix_atom_molname)
THEN
655 nfixed_atoms = nfixed_atoms + 1
659 ALLOCATE (fixd_list(nfixed_atoms))
662 IF (nfixed_atoms /= 0)
THEN
664 molecule => molecule_set(molecule_list(j))
665 CALL get_molecule(molecule, first_atom=first, last_atom=last)
666 fix_atom_molname = .false.
667 IF (
ASSOCIATED(cons_info%fixed_molnames))
THEN
668 DO k1loc = 1,
SIZE(cons_info%fixed_molnames)
669 IF (cons_info%fixed_molnames(k1loc) .EQ. molname)
THEN
670 fix_atom_molname = .true.
671 itype = cons_info%fixed_mol_type(k1loc)
678 fix_fixed_atom = .false.
679 DO k2loc = 1,
SIZE(cons_info%fixed_atoms)
680 IF (cons_info%fixed_atoms(k2loc) == k)
THEN
681 fix_fixed_atom = .true.
682 itype = cons_info%fixed_type(k2loc)
687 fix_atom_qmmm = .false.
688 fix_atom_mm = .false.
689 fix_atom_qm = .false.
690 IF (
PRESENT(qmmm_env))
THEN
691 SELECT CASE (cons_info%freeze_qm)
693 IF (any(qmmm_env%qm_atom_index == k))
THEN
694 fix_atom_qmmm = .true.
696 itype = cons_info%freeze_qm_type
699 IF (any(qmmm_env%qm_molecule_index == molecule_list(j)))
THEN
700 fix_atom_qmmm = .true.
702 itype = cons_info%freeze_qm_type
705 SELECT CASE (cons_info%freeze_mm)
707 IF (all(qmmm_env%qm_atom_index /= k))
THEN
708 fix_atom_qmmm = .true.
710 itype = cons_info%freeze_mm_type
713 IF (all(qmmm_env%qm_molecule_index /= molecule_list(j)))
THEN
714 fix_atom_qmmm = .true.
716 itype = cons_info%freeze_mm_type
720 IF (fix_atom_qm .AND. fix_atom_mm)
THEN
721 CALL cp_abort(__location__, &
723 " has been defined both QM and MM. General Error!")
727 IF ((fix_fixed_atom .AND. fix_atom_qmmm) .OR. (fix_fixed_atom .AND. fix_atom_molname) &
728 .OR. (fix_atom_qmmm .AND. fix_atom_molname))
THEN
729 CALL cp_abort(__location__, &
731 " has been constrained/restrained to be fixed in more than one"// &
732 " input section. Check and correct your input file!")
735 IF (fix_fixed_atom .OR. fix_atom_qmmm .OR. fix_atom_molname)
THEN
737 fixd_list(kk)%fixd = k
738 fixd_list(kk)%coord = particle_set(k)%r
739 fixd_list(kk)%itype = itype
741 IF (fix_fixed_atom)
THEN
742 fixd_list(kk)%restraint%active = cons_info%fixed_restraint(k2loc)
743 fixd_list(kk)%restraint%k0 = cons_info%fixed_k0(k2loc)
744 ELSEIF (fix_atom_qm)
THEN
745 fixd_list(kk)%restraint%active = cons_info%fixed_qm_restraint
746 fixd_list(kk)%restraint%k0 = cons_info%fixed_qm_k0
747 ELSEIF (fix_atom_mm)
THEN
748 fixd_list(kk)%restraint%active = cons_info%fixed_mm_restraint
749 fixd_list(kk)%restraint%k0 = cons_info%fixed_mm_k0
750 ELSEIF (fix_atom_molname)
THEN
751 fixd_list(kk)%restraint%active = cons_info%fixed_mol_restraint(k1loc)
752 fixd_list(kk)%restraint%k0 = cons_info%fixed_mol_k0(k1loc)
757 IF (fixd_list(kk)%restraint%active)
THEN
758 nfixd_restraint = nfixd_restraint + 1
759 nfixd_restart = nfixd_restart + 1
763 fixd_list(kk)%coord(2) = huge(0.0_dp)
764 fixd_list(kk)%coord(3) = huge(0.0_dp)
766 fixd_list(kk)%coord(1) = huge(0.0_dp)
767 fixd_list(kk)%coord(3) = huge(0.0_dp)
769 fixd_list(kk)%coord(1) = huge(0.0_dp)
770 fixd_list(kk)%coord(2) = huge(0.0_dp)
772 fixd_list(kk)%coord(3) = huge(0.0_dp)
774 fixd_list(kk)%coord(2) = huge(0.0_dp)
776 fixd_list(kk)%coord(1) = huge(0.0_dp)
778 IF (restart_restraint_pos)
THEN
781 i_rep_val=nfixd_restart, r_vals=r)
784 cpassert(
SIZE(r) == 1)
785 fixd_list(kk)%coord(1) = r(1)
787 cpassert(
SIZE(r) == 1)
788 fixd_list(kk)%coord(2) = r(1)
790 cpassert(
SIZE(r) == 1)
791 fixd_list(kk)%coord(3) = r(1)
793 cpassert(
SIZE(r) == 2)
794 fixd_list(kk)%coord(1) = r(1)
795 fixd_list(kk)%coord(2) = r(2)
797 cpassert(
SIZE(r) == 2)
798 fixd_list(kk)%coord(1) = r(1)
799 fixd_list(kk)%coord(3) = r(2)
801 cpassert(
SIZE(r) == 2)
802 fixd_list(kk)%coord(2) = r(1)
803 fixd_list(kk)%coord(3) = r(2)
805 cpassert(
SIZE(r) == 3)
806 fixd_list(kk)%coord(1:3) = r(1:3)
813 r(1) = fixd_list(kk)%coord(1)
816 r(1) = fixd_list(kk)%coord(2)
819 r(1) = fixd_list(kk)%coord(3)
822 r(1) = fixd_list(kk)%coord(1)
823 r(2) = fixd_list(kk)%coord(2)
826 r(1) = fixd_list(kk)%coord(1)
827 r(2) = fixd_list(kk)%coord(3)
830 r(1) = fixd_list(kk)%coord(1)
831 r(2) = fixd_list(kk)%coord(3)
834 r(1:3) = fixd_list(kk)%coord(1:3)
837 i_rep_val=nfixd_restart, r_vals_ptr=r)
845 WRITE (iw, *)
"MOLECULE KIND:", i,
" NR. FIXED ATOMS:",
SIZE(fixd_list(:)%fixd),
" LIST::", fixd_list(:)%fixd
847 CALL set_molecule_kind(molecule_kind, nfixd=nfixed_atoms, nfixd_restraint=nfixd_restraint, &
849 fixd_list_gci(nfixd_list_gci + 1:nfixd_list_gci + nfixed_atoms) = fixd_list
850 nfixd_list_gci = nfixd_list_gci + nfixed_atoms
853 WRITE (iw, *)
"TOTAL NUMBER OF FIXED ATOMS:", nfixd_list_gci
855 cpassert(count(missed_molname) == 0)
856 DEALLOCATE (missed_molname)
858 IF (gci%ntot /= 0)
THEN
859 ALLOCATE (fixd_list(nfixd_list_gci))
860 fixd_list(1:nfixd_list_gci) = fixd_list_gci(1:nfixd_list_gci)
861 gci%fixd_list => fixd_list
863 DEALLOCATE (fixd_list_gci)
866 gci%nrestraint = gci%ng3x3_restraint + &
867 gci%ng4x6_restraint + &
868 gci%nvsite_restraint + &
871 "PRINT%TOPOLOGY_INFO/UTIL_INFO")
872 CALL timestop(handle2)
873 CALL timestop(handle)