87 topology, qmmm_env, particle_set, input_file, subsys_section, gci)
96 CHARACTER(len=*),
PARAMETER :: routinen =
'topology_constraint_pack'
98 CHARACTER(LEN=2) :: element_symbol
99 CHARACTER(LEN=default_string_length) :: molname, name
100 CHARACTER(LEN=default_string_length), &
101 DIMENSION(:),
POINTER :: atom_typeh, cnds
102 INTEGER :: cind, first, first_atom, gind, handle, handle2, i, ii, itype, iw, j, k, k1loc, &
103 k2loc, kk, last, last_atom, m, n_start_colv, natom, nbond, ncolv_glob, ncolv_mol, &
104 nfixd_list_gci, nfixd_restart, nfixd_restraint, nfixed_atoms, ng3x3, ng3x3_restraint, &
105 ng4x6, ng4x6_restraint, nhdist, nmolecule, nrep, nvsite, nvsite_restraint, offset
106 INTEGER,
DIMENSION(:),
POINTER :: constr_x_glob, inds, molecule_list
107 LOGICAL :: exclude_mm, exclude_qm, fix_atom_mm, fix_atom_molname, fix_atom_qm, &
108 fix_atom_qmmm, fix_fixed_atom, found_molname, is_qm, ishbond, ldummy, &
109 restart_restraint_clv, restart_restraint_pos, use_clv_info
110 LOGICAL,
ALLOCATABLE,
DIMENSION(:) :: missed_molname
111 REAL(kind=
dp) :: rmod, rvec(3)
112 REAL(kind=
dp),
DIMENSION(:),
POINTER :: hdist, r
113 TYPE(
atom_type),
DIMENSION(:),
POINTER :: atom_list
115 TYPE(
bond_type),
DIMENSION(:),
POINTER :: bond_list
135 fixd_restr_rest, hbonds_section
138 NULLIFY (logger, constr_x_mol, constr_x_glob)
141 extension=
".subsysLog")
142 CALL timeset(routinen, handle)
143 CALL timeset(routinen//
"_1", handle2)
147 "MOTION%CONSTRAINT%HBONDS")
149 "MOTION%CONSTRAINT%FIX_ATOM_RESTART")
152 "MOTION%CONSTRAINT%COLVAR_RESTART")
155 "COLVAR%COLVAR_FUNC_INFO")
162 molecule => molecule_set(i)
176 NULLIFY (gci%lcolv, &
188 gci%ng3x3_restraint = 0
189 gci%ng4x6_restraint = 0
190 gci%nvsite_restraint = 0
192 gci%nrestraint = gci%ng3x3_restraint + &
193 gci%ng4x6_restraint + &
194 gci%nvsite_restraint + &
196 CALL timestop(handle2)
197 CALL timeset(routinen//
"_2", handle2)
204 NULLIFY (atom_typeh, hdist)
205 ALLOCATE (constr_x_mol(
SIZE(molecule_kind_set)))
206 DO i = 1,
SIZE(molecule_kind_set)
207 ALLOCATE (constr_x_mol(i)%constr(1))
208 constr_x_mol(i)%constr(1) = 1
213 DO i = 1,
SIZE(molecule_kind_set)
214 constr_x_mol(i)%constr(1) = 0
218 constr_x_mol(inds(i))%constr(1) = 1
224 DO i = 1,
SIZE(molecule_kind_set)
225 constr_x_mol(i)%constr(1) = 0
229 found_molname = .false.
230 DO k = 1,
SIZE(molecule_kind_set)
231 molecule_kind => molecule_kind_set(k)
232 name = molecule_kind%name
234 IF (cnds(i) == name)
THEN
235 constr_x_mol(k)%constr(1) = 1
236 found_molname = .true.
239 CALL print_warning_molname(found_molname, cnds(i))
249 IF (
ASSOCIATED(hdist))
THEN
250 cpassert(
SIZE(hdist) ==
SIZE(atom_typeh))
255 DO i = 1,
SIZE(molecule_kind_set)
256 molecule_kind => molecule_kind_set(i)
257 IF (constr_x_mol(i)%constr(1) == 0) cycle
259 bond_list=bond_list, nbond=nbond, atom_list=atom_list, &
260 molecule_list=molecule_list)
263 molecule => molecule_set(molecule_list(1))
264 CALL get_molecule(molecule, first_atom=first_atom, last_atom=last_atom)
265 natom = last_atom - first_atom + 1
269 IF (j < 1 .OR. j > natom) cycle
270 atomic_kind => atom_list(j)%atomic_kind
273 IF ((name(1:1) ==
"H") .OR.
is_hydrogen(atomic_kind)) ishbond = .true.
274 IF (is_qm .AND. exclude_qm) ishbond = .false.
275 IF (.NOT. (is_qm) .AND. exclude_mm) ishbond = .false.
276 IF (.NOT. ishbond)
THEN
278 IF (j < 1 .OR. j > natom) cycle
279 atomic_kind => atom_list(j)%atomic_kind
282 IF ((name(1:1) ==
"H") .OR.
is_hydrogen(atomic_kind)) ishbond = .true.
283 IF (is_qm .AND. exclude_qm) ishbond = .false.
284 IF (.NOT. (is_qm) .AND. exclude_mm) ishbond = .false.
291 n_start_colv = cons_info%nconst_colv
292 cons_info%nconst_colv = nhdist + n_start_colv
293 CALL reallocate(cons_info%const_colv_mol, 1, cons_info%nconst_colv)
294 CALL reallocate(cons_info%const_colv_molname, 1, cons_info%nconst_colv)
295 CALL reallocate(cons_info%const_colv_target, 1, cons_info%nconst_colv)
296 CALL reallocate(cons_info%const_colv_target_growth, 1, cons_info%nconst_colv)
299 CALL reallocate(cons_info%colv_intermolecular, 1, cons_info%nconst_colv)
300 CALL reallocate(cons_info%colv_restraint, 1, cons_info%nconst_colv)
301 CALL reallocate(cons_info%colv_k0, 1, cons_info%nconst_colv)
302 CALL reallocate(cons_info%colv_exclude_qm, 1, cons_info%nconst_colv)
303 CALL reallocate(cons_info%colv_exclude_mm, 1, cons_info%nconst_colv)
305 cons_info%colv_intermolecular(n_start_colv + 1:cons_info%nconst_colv) = .false.
306 cons_info%colv_exclude_qm(n_start_colv + 1:cons_info%nconst_colv) = .false.
307 cons_info%colv_exclude_mm(n_start_colv + 1:cons_info%nconst_colv) = .false.
308 cons_info%colv_restraint(n_start_colv + 1:cons_info%nconst_colv) = cons_info%hbonds_restraint
309 cons_info%colv_k0(n_start_colv + 1:cons_info%nconst_colv) = cons_info%hbonds_k0
312 DO i = 1,
SIZE(molecule_kind_set)
313 IF (constr_x_mol(i)%constr(1) == 0) cycle
314 molecule_kind => molecule_kind_set(i)
316 bond_list=bond_list, nbond=nbond, atom_list=atom_list, &
317 molecule_list=molecule_list)
318 molecule => molecule_set(molecule_list(1))
319 CALL get_molecule(molecule, first_atom=first_atom, last_atom=last_atom)
320 natom = last_atom - first_atom + 1
321 offset = first_atom - 1
325 IF (j < 1 .OR. j > natom) cycle
326 atomic_kind => atom_list(j)%atomic_kind
329 IF ((name(1:1) ==
"H") .OR.
is_hydrogen(atomic_kind)) ishbond = .true.
330 IF (is_qm .AND. exclude_qm) ishbond = .false.
331 IF (.NOT. (is_qm) .AND. exclude_mm) ishbond = .false.
332 IF (.NOT. ishbond)
THEN
334 IF (j < 1 .OR. j > natom) cycle
335 atomic_kind => atom_list(j)%atomic_kind
338 IF ((name(1:1) ==
"H") .OR.
is_hydrogen(atomic_kind)) ishbond = .true.
339 IF (is_qm .AND. exclude_qm) ishbond = .false.
340 IF (.NOT. (is_qm) .AND. exclude_mm) ishbond = .false.
344 rvec = particle_set(offset + bond_list(k)%a)%r - particle_set(offset + bond_list(k)%b)%r
345 rmod = sqrt(dot_product(rvec, rvec))
346 IF (
ASSOCIATED(hdist))
THEN
347 IF (
SIZE(hdist) > 0)
THEN
348 IF (bond_list(k)%a == j) atomic_kind => atom_list(bond_list(k)%b)%atomic_kind
349 IF (bond_list(k)%b == j) atomic_kind => atom_list(bond_list(k)%a)%atomic_kind
351 name=name, element_symbol=element_symbol)
353 DO m = 1,
SIZE(hdist)
354 IF (trim(name) == trim(atom_typeh(m)))
EXIT
355 IF (trim(element_symbol) == trim(atom_typeh(m)))
EXIT
357 IF (m <=
SIZE(hdist))
THEN
362 cons_info%const_colv_mol(nhdist + n_start_colv) = i
363 cons_info%const_colv_molname(nhdist + n_start_colv) =
"UNDEF"
364 cons_info%const_colv_target(nhdist + n_start_colv) = rmod
365 cons_info%const_colv_target_growth(nhdist + n_start_colv) = 0.0_dp
366 CALL colvar_create(cons_info%colvar_set(nhdist + n_start_colv)%colvar, &
368 cons_info%colvar_set(nhdist + n_start_colv)%colvar%dist_param%i_at = bond_list(k)%a
369 cons_info%colvar_set(nhdist + n_start_colv)%colvar%dist_param%j_at = bond_list(k)%b
370 CALL colvar_setup(cons_info%colvar_set(nhdist + n_start_colv)%colvar)
374 DO j = 1,
SIZE(constr_x_mol)
375 DEALLOCATE (constr_x_mol(j)%constr)
377 DEALLOCATE (constr_x_mol)
380 CALL timestop(handle2)
381 CALL timeset(routinen//
"_3", handle2)
388 DO ii = 1,
SIZE(cons_info%colvar_set)
392 CALL give_constraint_array(cons_info%const_colv_mol, &
393 cons_info%const_colv_molname, &
394 cons_info%colv_intermolecular, &
398 cons_info%colv_exclude_qm, &
399 cons_info%colv_exclude_mm)
403 DO ii = 1,
SIZE(molecule_kind_set)
404 molecule_kind => molecule_kind_set(ii)
406 nmolecule=nmolecule, molecule_list=molecule_list)
407 ncolv_mol =
SIZE(constr_x_mol(ii)%constr)
408 ALLOCATE (colv_list(ncolv_mol))
413 molecule => molecule_set(molecule_list(1))
415 CALL setup_colv_list(colv_list, constr_x_mol(ii)%constr, gind, &
416 cons_info,
topology, particle_set, restart_restraint_clv, &
417 colvar_rest, first_atom)
421 molecule => molecule_set(molecule_list(j))
422 CALL get_molecule(molecule, first_atom=first_atom, last_atom=last_atom)
423 ALLOCATE (lcolv(ncolv_mol))
424 CALL setup_lcolv(lcolv, constr_x_mol(ii)%constr, first_atom, last_atom, &
425 cons_info, particle_set, colvar_func_info, use_clv_info, cind)
429 DO j = 1,
SIZE(constr_x_mol)
430 DEALLOCATE (constr_x_mol(j)%constr)
432 DEALLOCATE (constr_x_mol)
435 IF (
ASSOCIATED(constr_x_glob))
THEN
436 ncolv_glob =
SIZE(constr_x_glob)
437 ALLOCATE (colv_list(ncolv_glob))
438 CALL setup_colv_list(colv_list, constr_x_glob, gind, cons_info, &
439 topology, particle_set, restart_restraint_clv, colvar_rest, &
442 ALLOCATE (lcolv(ncolv_glob))
443 CALL setup_lcolv(lcolv, constr_x_glob, 1,
SIZE(particle_set), cons_info, &
444 particle_set, colvar_func_info, use_clv_info, cind)
445 gci%colv_list => colv_list
449 gci%ntot = gci%ncolv%ntot + gci%ntot
450 DEALLOCATE (constr_x_glob)
454 CALL timestop(handle2)
455 CALL timeset(routinen//
"_4", handle2)
461 CALL give_constraint_array(cons_info%const_g33_mol, &
462 cons_info%const_g33_molname, &
463 cons_info%g33_intermolecular, &
467 cons_info%g33_exclude_qm, &
468 cons_info%g33_exclude_mm)
470 DO ii = 1,
SIZE(molecule_kind_set)
471 molecule_kind => molecule_kind_set(ii)
473 nmolecule=nmolecule, &
474 molecule_list=molecule_list)
475 ng3x3 =
SIZE(constr_x_mol(ii)%constr)
476 ALLOCATE (g3x3_list(ng3x3))
477 CALL setup_g3x3_list(g3x3_list, constr_x_mol(ii)%constr, cons_info, ng3x3_restraint)
478 CALL set_molecule_kind(molecule_kind, ng3x3=ng3x3, ng3x3_restraint=ng3x3_restraint, g3x3_list=g3x3_list)
480 molecule => molecule_set(molecule_list(j))
481 CALL get_molecule(molecule, first_atom=first_atom, last_atom=last_atom)
482 ALLOCATE (lg3x3(ng3x3))
483 CALL setup_lg3x3(lg3x3, g3x3_list, first_atom, last_atom)
487 DO j = 1,
SIZE(constr_x_mol)
488 DEALLOCATE (constr_x_mol(j)%constr)
490 DEALLOCATE (constr_x_mol)
492 IF (
ASSOCIATED(constr_x_glob))
THEN
493 ng3x3 =
SIZE(constr_x_glob)
494 ALLOCATE (g3x3_list(ng3x3))
495 CALL setup_g3x3_list(g3x3_list, constr_x_glob, cons_info, ng3x3_restraint)
496 ALLOCATE (lg3x3(ng3x3))
497 CALL setup_lg3x3(lg3x3, g3x3_list, first_atom, last_atom)
498 gci%g3x3_list => g3x3_list
501 gci%ng3x3_restraint = ng3x3_restraint
503 gci%ntot = 3*gci%ng3x3 + gci%ntot
504 DEALLOCATE (constr_x_glob)
508 CALL timestop(handle2)
509 CALL timeset(routinen//
"_5", handle2)
515 CALL give_constraint_array(cons_info%const_g46_mol, &
516 cons_info%const_g46_molname, &
517 cons_info%g46_intermolecular, &
521 cons_info%g46_exclude_qm, &
522 cons_info%g46_exclude_mm)
524 DO ii = 1,
SIZE(molecule_kind_set)
525 molecule_kind => molecule_kind_set(ii)
527 nmolecule=nmolecule, molecule_list=molecule_list)
528 ng4x6 =
SIZE(constr_x_mol(ii)%constr)
529 ALLOCATE (g4x6_list(ng4x6))
530 CALL setup_g4x6_list(g4x6_list, constr_x_mol(ii)%constr, cons_info, ng4x6_restraint)
531 CALL set_molecule_kind(molecule_kind, ng4x6=ng4x6, ng4x6_restraint=ng4x6_restraint, g4x6_list=g4x6_list)
533 molecule => molecule_set(molecule_list(j))
534 CALL get_molecule(molecule, first_atom=first_atom, last_atom=last_atom)
535 ALLOCATE (lg4x6(ng4x6))
536 CALL setup_lg4x6(lg4x6, g4x6_list, first_atom, last_atom)
540 DO j = 1,
SIZE(constr_x_mol)
541 DEALLOCATE (constr_x_mol(j)%constr)
543 DEALLOCATE (constr_x_mol)
545 IF (
ASSOCIATED(constr_x_glob))
THEN
546 ng4x6 =
SIZE(constr_x_glob)
547 ALLOCATE (g4x6_list(ng4x6))
548 CALL setup_g4x6_list(g4x6_list, constr_x_glob, cons_info, ng4x6_restraint)
549 ALLOCATE (lg4x6(ng4x6))
550 CALL setup_lg4x6(lg4x6, g4x6_list, first_atom, last_atom)
551 gci%g4x6_list => g4x6_list
554 gci%ng4x6_restraint = ng4x6_restraint
556 gci%ntot = 6*gci%ng4x6 + gci%ntot
557 DEALLOCATE (constr_x_glob)
561 CALL timestop(handle2)
562 CALL timeset(routinen//
"_6", handle2)
568 CALL give_constraint_array(cons_info%const_vsite_mol, &
569 cons_info%const_vsite_molname, &
570 cons_info%vsite_intermolecular, &
574 cons_info%vsite_exclude_qm, &
575 cons_info%vsite_exclude_mm)
577 DO ii = 1,
SIZE(molecule_kind_set)
578 molecule_kind => molecule_kind_set(ii)
580 nmolecule=nmolecule, molecule_list=molecule_list)
581 nvsite =
SIZE(constr_x_mol(ii)%constr)
582 ALLOCATE (vsite_list(nvsite))
583 CALL setup_vsite_list(vsite_list, constr_x_mol(ii)%constr, cons_info, nvsite_restraint)
584 CALL set_molecule_kind(molecule_kind, nvsite=nvsite, nvsite_restraint=nvsite_restraint, &
585 vsite_list=vsite_list)
587 DO j = 1,
SIZE(constr_x_mol)
588 DEALLOCATE (constr_x_mol(j)%constr)
590 DEALLOCATE (constr_x_mol)
592 IF (
ASSOCIATED(constr_x_glob))
THEN
593 nvsite =
SIZE(constr_x_glob)
594 ALLOCATE (vsite_list(nvsite))
595 CALL setup_vsite_list(vsite_list, constr_x_glob, cons_info, nvsite_restraint)
596 gci%vsite_list => vsite_list
598 gci%nvsite_restraint = nvsite_restraint
600 gci%ntot = gci%nvsite + gci%ntot
601 DEALLOCATE (constr_x_glob)
604 CALL timestop(handle2)
605 CALL timeset(routinen//
"_7", handle2)
611 ALLOCATE (fixd_list_gci(
SIZE(particle_set)))
613 ALLOCATE (missed_molname(
SIZE(cons_info%fixed_molnames, 1)))
614 missed_molname = .true.
616 DO i = 1,
SIZE(molecule_kind_set)
617 molecule_kind => molecule_kind_set(i)
619 nmolecule=nmolecule, molecule_list=molecule_list, name=molname)
621 WHERE (molname == cons_info%fixed_molnames)
622 missed_molname = .false.
627 molecule => molecule_set(molecule_list(j))
628 CALL get_molecule(molecule, first_atom=first, last_atom=last)
629 fix_atom_molname = .false.
630 IF (
ASSOCIATED(cons_info%fixed_molnames))
THEN
631 DO k = 1,
SIZE(cons_info%fixed_molnames)
632 IF (cons_info%fixed_molnames(k) == molname)
THEN
633 fix_atom_molname = .true.
634 IF (is_qm .AND. cons_info%fixed_exclude_qm(k)) fix_atom_molname = .false.
635 IF ((.NOT. is_qm) .AND. cons_info%fixed_exclude_mm(k)) fix_atom_molname = .false.
640 fix_atom_qmmm = .false.
641 IF (
PRESENT(qmmm_env))
THEN
642 SELECT CASE (cons_info%freeze_qm)
644 IF (any(qmmm_env%qm_atom_index == k)) fix_atom_qmmm = .true.
646 IF (any(qmmm_env%qm_molecule_index == molecule_list(j))) fix_atom_qmmm = .true.
648 SELECT CASE (cons_info%freeze_mm)
650 IF (all(qmmm_env%qm_atom_index /= k)) fix_atom_qmmm = .true.
652 IF (all(qmmm_env%qm_molecule_index /= molecule_list(j))) fix_atom_qmmm = .true.
655 IF (any(cons_info%fixed_atoms == k) .OR. fix_atom_qmmm .OR. fix_atom_molname)
THEN
656 nfixed_atoms = nfixed_atoms + 1
660 ALLOCATE (fixd_list(nfixed_atoms))
663 IF (nfixed_atoms /= 0)
THEN
665 molecule => molecule_set(molecule_list(j))
666 CALL get_molecule(molecule, first_atom=first, last_atom=last)
667 fix_atom_molname = .false.
668 IF (
ASSOCIATED(cons_info%fixed_molnames))
THEN
669 DO k1loc = 1,
SIZE(cons_info%fixed_molnames)
670 IF (cons_info%fixed_molnames(k1loc) == molname)
THEN
671 fix_atom_molname = .true.
672 itype = cons_info%fixed_mol_type(k1loc)
679 fix_fixed_atom = .false.
680 DO k2loc = 1,
SIZE(cons_info%fixed_atoms)
681 IF (cons_info%fixed_atoms(k2loc) == k)
THEN
682 fix_fixed_atom = .true.
683 itype = cons_info%fixed_type(k2loc)
688 fix_atom_qmmm = .false.
689 fix_atom_mm = .false.
690 fix_atom_qm = .false.
691 IF (
PRESENT(qmmm_env))
THEN
692 SELECT CASE (cons_info%freeze_qm)
694 IF (any(qmmm_env%qm_atom_index == k))
THEN
695 fix_atom_qmmm = .true.
697 itype = cons_info%freeze_qm_type
700 IF (any(qmmm_env%qm_molecule_index == molecule_list(j)))
THEN
701 fix_atom_qmmm = .true.
703 itype = cons_info%freeze_qm_type
706 SELECT CASE (cons_info%freeze_mm)
708 IF (all(qmmm_env%qm_atom_index /= k))
THEN
709 fix_atom_qmmm = .true.
711 itype = cons_info%freeze_mm_type
714 IF (all(qmmm_env%qm_molecule_index /= molecule_list(j)))
THEN
715 fix_atom_qmmm = .true.
717 itype = cons_info%freeze_mm_type
721 IF (fix_atom_qm .AND. fix_atom_mm)
THEN
722 CALL cp_abort(__location__, &
724 " has been defined both QM and MM. General Error!")
728 IF ((fix_fixed_atom .AND. fix_atom_qmmm) .OR. (fix_fixed_atom .AND. fix_atom_molname) &
729 .OR. (fix_atom_qmmm .AND. fix_atom_molname))
THEN
730 CALL cp_abort(__location__, &
732 " has been constrained/restrained to be fixed in more than one"// &
733 " input section. Check and correct your input file!")
736 IF (fix_fixed_atom .OR. fix_atom_qmmm .OR. fix_atom_molname)
THEN
737 IF (
ASSOCIATED(
topology%cell_muc))
THEN
739 CALL cp_abort(__location__, &
740 "Partial FIXED_ATOMS components cannot be transformed "// &
741 "after CELL%CANONICALIZE. Use COMPONENTS_TO_FIX XYZ or "// &
742 "disable CELL%CANONICALIZE for this input.")
746 fixd_list(kk)%fixd = k
747 fixd_list(kk)%coord = particle_set(k)%r
748 fixd_list(kk)%itype = itype
750 IF (fix_fixed_atom)
THEN
751 fixd_list(kk)%restraint%active = cons_info%fixed_restraint(k2loc)
752 fixd_list(kk)%restraint%k0 = cons_info%fixed_k0(k2loc)
753 ELSEIF (fix_atom_qm)
THEN
754 fixd_list(kk)%restraint%active = cons_info%fixed_qm_restraint
755 fixd_list(kk)%restraint%k0 = cons_info%fixed_qm_k0
756 ELSEIF (fix_atom_mm)
THEN
757 fixd_list(kk)%restraint%active = cons_info%fixed_mm_restraint
758 fixd_list(kk)%restraint%k0 = cons_info%fixed_mm_k0
759 ELSEIF (fix_atom_molname)
THEN
760 fixd_list(kk)%restraint%active = cons_info%fixed_mol_restraint(k1loc)
761 fixd_list(kk)%restraint%k0 = cons_info%fixed_mol_k0(k1loc)
766 IF (fixd_list(kk)%restraint%active)
THEN
767 nfixd_restraint = nfixd_restraint + 1
768 nfixd_restart = nfixd_restart + 1
772 fixd_list(kk)%coord(2) = huge(0.0_dp)
773 fixd_list(kk)%coord(3) = huge(0.0_dp)
775 fixd_list(kk)%coord(1) = huge(0.0_dp)
776 fixd_list(kk)%coord(3) = huge(0.0_dp)
778 fixd_list(kk)%coord(1) = huge(0.0_dp)
779 fixd_list(kk)%coord(2) = huge(0.0_dp)
781 fixd_list(kk)%coord(3) = huge(0.0_dp)
783 fixd_list(kk)%coord(2) = huge(0.0_dp)
785 fixd_list(kk)%coord(1) = huge(0.0_dp)
787 IF (restart_restraint_pos)
THEN
790 i_rep_val=nfixd_restart, r_vals=r)
793 cpassert(
SIZE(r) == 1)
794 fixd_list(kk)%coord(1) = r(1)
796 cpassert(
SIZE(r) == 1)
797 fixd_list(kk)%coord(2) = r(1)
799 cpassert(
SIZE(r) == 1)
800 fixd_list(kk)%coord(3) = r(1)
802 cpassert(
SIZE(r) == 2)
803 fixd_list(kk)%coord(1) = r(1)
804 fixd_list(kk)%coord(2) = r(2)
806 cpassert(
SIZE(r) == 2)
807 fixd_list(kk)%coord(1) = r(1)
808 fixd_list(kk)%coord(3) = r(2)
810 cpassert(
SIZE(r) == 2)
811 fixd_list(kk)%coord(2) = r(1)
812 fixd_list(kk)%coord(3) = r(2)
814 cpassert(
SIZE(r) == 3)
815 fixd_list(kk)%coord(1:3) = r(1:3)
816 IF (
ASSOCIATED(
topology%cell_muc)) &
824 r(1) = fixd_list(kk)%coord(1)
827 r(1) = fixd_list(kk)%coord(2)
830 r(1) = fixd_list(kk)%coord(3)
833 r(1) = fixd_list(kk)%coord(1)
834 r(2) = fixd_list(kk)%coord(2)
837 r(1) = fixd_list(kk)%coord(1)
838 r(2) = fixd_list(kk)%coord(3)
841 r(1) = fixd_list(kk)%coord(1)
842 r(2) = fixd_list(kk)%coord(3)
845 r(1:3) = fixd_list(kk)%coord(1:3)
848 i_rep_val=nfixd_restart, r_vals_ptr=r)
856 WRITE (iw, *)
"MOLECULE KIND:", i,
" NR. FIXED ATOMS:",
SIZE(fixd_list(:)%fixd),
" LIST::", fixd_list(:)%fixd
858 CALL set_molecule_kind(molecule_kind, nfixd=nfixed_atoms, nfixd_restraint=nfixd_restraint, &
860 fixd_list_gci(nfixd_list_gci + 1:nfixd_list_gci + nfixed_atoms) = fixd_list
861 nfixd_list_gci = nfixd_list_gci + nfixed_atoms
864 WRITE (iw, *)
"TOTAL NUMBER OF FIXED ATOMS:", nfixd_list_gci
866 cpassert(count(missed_molname) == 0)
867 DEALLOCATE (missed_molname)
869 IF (gci%ntot /= 0)
THEN
870 ALLOCATE (fixd_list(nfixd_list_gci))
871 fixd_list(1:nfixd_list_gci) = fixd_list_gci(1:nfixd_list_gci)
872 gci%fixd_list => fixd_list
874 DEALLOCATE (fixd_list_gci)
877 gci%nrestraint = gci%ng3x3_restraint + &
878 gci%ng4x6_restraint + &
879 gci%nvsite_restraint + &
882 "PRINT%TOPOLOGY_INFO/UTIL_INFO")
883 CALL timestop(handle2)
884 CALL timestop(handle)