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))
251 IF (
ASSOCIATED(hdist))
THEN
252 cpassert(
SIZE(hdist) ==
SIZE(atom_typeh))
257 DO i = 1,
SIZE(molecule_kind_set)
258 molecule_kind => molecule_kind_set(i)
259 IF (constr_x_mol(i)%constr(1) == 0) cycle
261 bond_list=bond_list, nbond=nbond, atom_list=atom_list, &
262 molecule_list=molecule_list)
265 molecule => molecule_set(molecule_list(1))
266 CALL get_molecule(molecule, first_atom=first_atom, last_atom=last_atom)
267 natom = last_atom - first_atom + 1
271 IF (j < 1 .OR. j > natom) cycle
272 atomic_kind => atom_list(j)%atomic_kind
275 IF ((name(1:1) ==
"H") .OR.
is_hydrogen(atomic_kind)) ishbond = .true.
276 IF (is_qm .AND. exclude_qm) ishbond = .false.
277 IF (.NOT. (is_qm) .AND. exclude_mm) ishbond = .false.
278 IF (.NOT. ishbond)
THEN
280 IF (j < 1 .OR. j > natom) cycle
281 atomic_kind => atom_list(j)%atomic_kind
284 IF ((name(1:1) ==
"H") .OR.
is_hydrogen(atomic_kind)) ishbond = .true.
285 IF (is_qm .AND. exclude_qm) ishbond = .false.
286 IF (.NOT. (is_qm) .AND. exclude_mm) ishbond = .false.
293 n_start_colv = cons_info%nconst_colv
294 cons_info%nconst_colv = nhdist + n_start_colv
295 CALL reallocate(cons_info%const_colv_mol, 1, cons_info%nconst_colv)
296 CALL reallocate(cons_info%const_colv_molname, 1, cons_info%nconst_colv)
297 CALL reallocate(cons_info%const_colv_target, 1, cons_info%nconst_colv)
298 CALL reallocate(cons_info%const_colv_target_growth, 1, cons_info%nconst_colv)
301 CALL reallocate(cons_info%colv_intermolecular, 1, cons_info%nconst_colv)
302 CALL reallocate(cons_info%colv_restraint, 1, cons_info%nconst_colv)
303 CALL reallocate(cons_info%colv_k0, 1, cons_info%nconst_colv)
304 CALL reallocate(cons_info%colv_exclude_qm, 1, cons_info%nconst_colv)
305 CALL reallocate(cons_info%colv_exclude_mm, 1, cons_info%nconst_colv)
307 cons_info%colv_intermolecular(n_start_colv + 1:cons_info%nconst_colv) = .false.
308 cons_info%colv_exclude_qm(n_start_colv + 1:cons_info%nconst_colv) = .false.
309 cons_info%colv_exclude_mm(n_start_colv + 1:cons_info%nconst_colv) = .false.
310 cons_info%colv_restraint(n_start_colv + 1:cons_info%nconst_colv) = cons_info%hbonds_restraint
311 cons_info%colv_k0(n_start_colv + 1:cons_info%nconst_colv) = cons_info%hbonds_k0
314 DO i = 1,
SIZE(molecule_kind_set)
315 IF (constr_x_mol(i)%constr(1) == 0) cycle
316 molecule_kind => molecule_kind_set(i)
318 bond_list=bond_list, nbond=nbond, atom_list=atom_list, &
319 molecule_list=molecule_list)
320 molecule => molecule_set(molecule_list(1))
321 CALL get_molecule(molecule, first_atom=first_atom, last_atom=last_atom)
322 natom = last_atom - first_atom + 1
323 offset = first_atom - 1
327 IF (j < 1 .OR. j > natom) cycle
328 atomic_kind => atom_list(j)%atomic_kind
331 IF ((name(1:1) ==
"H") .OR.
is_hydrogen(atomic_kind)) ishbond = .true.
332 IF (is_qm .AND. exclude_qm) ishbond = .false.
333 IF (.NOT. (is_qm) .AND. exclude_mm) ishbond = .false.
334 IF (.NOT. ishbond)
THEN
336 IF (j < 1 .OR. j > natom) cycle
337 atomic_kind => atom_list(j)%atomic_kind
340 IF ((name(1:1) ==
"H") .OR.
is_hydrogen(atomic_kind)) ishbond = .true.
341 IF (is_qm .AND. exclude_qm) ishbond = .false.
342 IF (.NOT. (is_qm) .AND. exclude_mm) ishbond = .false.
346 rvec = particle_set(offset + bond_list(k)%a)%r - particle_set(offset + bond_list(k)%b)%r
348 IF (
ASSOCIATED(hdist))
THEN
349 IF (
SIZE(hdist) > 0)
THEN
350 IF (bond_list(k)%a == j) atomic_kind => atom_list(bond_list(k)%b)%atomic_kind
351 IF (bond_list(k)%b == j) atomic_kind => atom_list(bond_list(k)%a)%atomic_kind
353 name=name, element_symbol=element_symbol)
355 DO m = 1,
SIZE(hdist)
356 IF (trim(name) == trim(atom_typeh(m)))
EXIT
357 IF (trim(element_symbol) == trim(atom_typeh(m)))
EXIT
359 IF (m <=
SIZE(hdist))
THEN
364 cons_info%const_colv_mol(nhdist + n_start_colv) = i
365 cons_info%const_colv_molname(nhdist + n_start_colv) =
"UNDEF"
366 cons_info%const_colv_target(nhdist + n_start_colv) = rmod
367 cons_info%const_colv_target_growth(nhdist + n_start_colv) = 0.0_dp
368 CALL colvar_create(cons_info%colvar_set(nhdist + n_start_colv)%colvar, &
370 cons_info%colvar_set(nhdist + n_start_colv)%colvar%dist_param%i_at = bond_list(k)%a
371 cons_info%colvar_set(nhdist + n_start_colv)%colvar%dist_param%j_at = bond_list(k)%b
372 CALL colvar_setup(cons_info%colvar_set(nhdist + n_start_colv)%colvar)
376 DO j = 1,
SIZE(constr_x_mol)
377 DEALLOCATE (constr_x_mol(j)%constr)
379 DEALLOCATE (constr_x_mol)
382 CALL timestop(handle2)
383 CALL timeset(routinen//
"_3", handle2)
390 DO ii = 1,
SIZE(cons_info%colvar_set)
394 CALL give_constraint_array(cons_info%const_colv_mol, &
395 cons_info%const_colv_molname, &
396 cons_info%colv_intermolecular, &
400 cons_info%colv_exclude_qm, &
401 cons_info%colv_exclude_mm)
405 DO ii = 1,
SIZE(molecule_kind_set)
406 molecule_kind => molecule_kind_set(ii)
408 nmolecule=nmolecule, molecule_list=molecule_list)
409 ncolv_mol =
SIZE(constr_x_mol(ii)%constr)
410 ALLOCATE (colv_list(ncolv_mol))
415 molecule => molecule_set(molecule_list(1))
417 CALL setup_colv_list(colv_list, constr_x_mol(ii)%constr, gind, &
418 cons_info,
topology, particle_set, restart_restraint_clv, &
419 colvar_rest, first_atom)
423 molecule => molecule_set(molecule_list(j))
424 CALL get_molecule(molecule, first_atom=first_atom, last_atom=last_atom)
425 ALLOCATE (lcolv(ncolv_mol))
426 CALL setup_lcolv(lcolv, constr_x_mol(ii)%constr, first_atom, last_atom, &
427 cons_info, particle_set, colvar_func_info, use_clv_info, cind)
431 DO j = 1,
SIZE(constr_x_mol)
432 DEALLOCATE (constr_x_mol(j)%constr)
434 DEALLOCATE (constr_x_mol)
437 IF (
ASSOCIATED(constr_x_glob))
THEN
438 ncolv_glob =
SIZE(constr_x_glob)
439 ALLOCATE (colv_list(ncolv_glob))
440 CALL setup_colv_list(colv_list, constr_x_glob, gind, cons_info, &
441 topology, particle_set, restart_restraint_clv, colvar_rest, &
444 ALLOCATE (lcolv(ncolv_glob))
445 CALL setup_lcolv(lcolv, constr_x_glob, 1,
SIZE(particle_set), cons_info, &
446 particle_set, colvar_func_info, use_clv_info, cind)
447 gci%colv_list => colv_list
451 gci%ntot = gci%ncolv%ntot + gci%ntot
452 DEALLOCATE (constr_x_glob)
456 CALL timestop(handle2)
457 CALL timeset(routinen//
"_4", handle2)
463 CALL give_constraint_array(cons_info%const_g33_mol, &
464 cons_info%const_g33_molname, &
465 cons_info%g33_intermolecular, &
469 cons_info%g33_exclude_qm, &
470 cons_info%g33_exclude_mm)
472 DO ii = 1,
SIZE(molecule_kind_set)
473 molecule_kind => molecule_kind_set(ii)
475 nmolecule=nmolecule, &
476 molecule_list=molecule_list)
477 ng3x3 =
SIZE(constr_x_mol(ii)%constr)
478 ALLOCATE (g3x3_list(ng3x3))
479 CALL setup_g3x3_list(g3x3_list, constr_x_mol(ii)%constr, cons_info, ng3x3_restraint)
480 CALL set_molecule_kind(molecule_kind, ng3x3=ng3x3, ng3x3_restraint=ng3x3_restraint, g3x3_list=g3x3_list)
482 molecule => molecule_set(molecule_list(j))
483 CALL get_molecule(molecule, first_atom=first_atom, last_atom=last_atom)
484 ALLOCATE (lg3x3(ng3x3))
485 CALL setup_lg3x3(lg3x3, g3x3_list, first_atom, last_atom)
489 DO j = 1,
SIZE(constr_x_mol)
490 DEALLOCATE (constr_x_mol(j)%constr)
492 DEALLOCATE (constr_x_mol)
494 IF (
ASSOCIATED(constr_x_glob))
THEN
495 ng3x3 =
SIZE(constr_x_glob)
496 ALLOCATE (g3x3_list(ng3x3))
497 CALL setup_g3x3_list(g3x3_list, constr_x_glob, cons_info, ng3x3_restraint)
498 ALLOCATE (lg3x3(ng3x3))
499 CALL setup_lg3x3(lg3x3, g3x3_list, first_atom, last_atom)
500 gci%g3x3_list => g3x3_list
503 gci%ng3x3_restraint = ng3x3_restraint
505 gci%ntot = 3*gci%ng3x3 + gci%ntot
506 DEALLOCATE (constr_x_glob)
510 CALL timestop(handle2)
511 CALL timeset(routinen//
"_5", handle2)
517 CALL give_constraint_array(cons_info%const_g46_mol, &
518 cons_info%const_g46_molname, &
519 cons_info%g46_intermolecular, &
523 cons_info%g46_exclude_qm, &
524 cons_info%g46_exclude_mm)
526 DO ii = 1,
SIZE(molecule_kind_set)
527 molecule_kind => molecule_kind_set(ii)
529 nmolecule=nmolecule, molecule_list=molecule_list)
530 ng4x6 =
SIZE(constr_x_mol(ii)%constr)
531 ALLOCATE (g4x6_list(ng4x6))
532 CALL setup_g4x6_list(g4x6_list, constr_x_mol(ii)%constr, cons_info, ng4x6_restraint)
533 CALL set_molecule_kind(molecule_kind, ng4x6=ng4x6, ng4x6_restraint=ng4x6_restraint, g4x6_list=g4x6_list)
535 molecule => molecule_set(molecule_list(j))
536 CALL get_molecule(molecule, first_atom=first_atom, last_atom=last_atom)
537 ALLOCATE (lg4x6(ng4x6))
538 CALL setup_lg4x6(lg4x6, g4x6_list, first_atom, last_atom)
542 DO j = 1,
SIZE(constr_x_mol)
543 DEALLOCATE (constr_x_mol(j)%constr)
545 DEALLOCATE (constr_x_mol)
547 IF (
ASSOCIATED(constr_x_glob))
THEN
548 ng4x6 =
SIZE(constr_x_glob)
549 ALLOCATE (g4x6_list(ng4x6))
550 CALL setup_g4x6_list(g4x6_list, constr_x_glob, cons_info, ng4x6_restraint)
551 ALLOCATE (lg4x6(ng4x6))
552 CALL setup_lg4x6(lg4x6, g4x6_list, first_atom, last_atom)
553 gci%g4x6_list => g4x6_list
556 gci%ng4x6_restraint = ng4x6_restraint
558 gci%ntot = 6*gci%ng4x6 + gci%ntot
559 DEALLOCATE (constr_x_glob)
563 CALL timestop(handle2)
564 CALL timeset(routinen//
"_6", handle2)
570 CALL give_constraint_array(cons_info%const_vsite_mol, &
571 cons_info%const_vsite_molname, &
572 cons_info%vsite_intermolecular, &
576 cons_info%vsite_exclude_qm, &
577 cons_info%vsite_exclude_mm)
579 DO ii = 1,
SIZE(molecule_kind_set)
580 molecule_kind => molecule_kind_set(ii)
582 nmolecule=nmolecule, molecule_list=molecule_list)
583 nvsite =
SIZE(constr_x_mol(ii)%constr)
584 ALLOCATE (vsite_list(nvsite))
585 CALL setup_vsite_list(vsite_list, constr_x_mol(ii)%constr, cons_info, nvsite_restraint)
586 CALL set_molecule_kind(molecule_kind, nvsite=nvsite, nvsite_restraint=nvsite_restraint, &
587 vsite_list=vsite_list)
589 DO j = 1,
SIZE(constr_x_mol)
590 DEALLOCATE (constr_x_mol(j)%constr)
592 DEALLOCATE (constr_x_mol)
594 IF (
ASSOCIATED(constr_x_glob))
THEN
595 nvsite =
SIZE(constr_x_glob)
596 ALLOCATE (vsite_list(nvsite))
597 CALL setup_vsite_list(vsite_list, constr_x_glob, cons_info, nvsite_restraint)
598 gci%vsite_list => vsite_list
600 gci%nvsite_restraint = nvsite_restraint
602 gci%ntot = gci%nvsite + gci%ntot
603 DEALLOCATE (constr_x_glob)
606 CALL timestop(handle2)
607 CALL timeset(routinen//
"_7", handle2)
613 ALLOCATE (fixd_list_gci(
SIZE(particle_set)))
615 ALLOCATE (missed_molname(
SIZE(cons_info%fixed_molnames, 1)))
616 missed_molname = .true.
618 DO i = 1,
SIZE(molecule_kind_set)
619 molecule_kind => molecule_kind_set(i)
621 nmolecule=nmolecule, molecule_list=molecule_list, name=molname)
623 WHERE (molname == cons_info%fixed_molnames)
624 missed_molname = .false.
629 molecule => molecule_set(molecule_list(j))
630 CALL get_molecule(molecule, first_atom=first, last_atom=last)
631 fix_atom_molname = .false.
632 IF (
ASSOCIATED(cons_info%fixed_molnames))
THEN
633 DO k = 1,
SIZE(cons_info%fixed_molnames)
634 IF (cons_info%fixed_molnames(k) == molname)
THEN
635 fix_atom_molname = .true.
636 IF (is_qm .AND. cons_info%fixed_exclude_qm(k)) fix_atom_molname = .false.
637 IF ((.NOT. is_qm) .AND. cons_info%fixed_exclude_mm(k)) fix_atom_molname = .false.
642 fix_atom_qmmm = .false.
643 IF (
PRESENT(qmmm_env))
THEN
644 SELECT CASE (cons_info%freeze_qm)
646 IF (any(qmmm_env%qm_atom_index == k)) fix_atom_qmmm = .true.
648 IF (any(qmmm_env%qm_molecule_index == molecule_list(j))) fix_atom_qmmm = .true.
650 SELECT CASE (cons_info%freeze_mm)
652 IF (all(qmmm_env%qm_atom_index /= k)) fix_atom_qmmm = .true.
654 IF (all(qmmm_env%qm_molecule_index /= molecule_list(j))) fix_atom_qmmm = .true.
657 IF (any(cons_info%fixed_atoms == k) .OR. fix_atom_qmmm .OR. fix_atom_molname)
THEN
658 nfixed_atoms = nfixed_atoms + 1
662 ALLOCATE (fixd_list(nfixed_atoms))
665 IF (nfixed_atoms /= 0)
THEN
667 molecule => molecule_set(molecule_list(j))
668 CALL get_molecule(molecule, first_atom=first, last_atom=last)
669 fix_atom_molname = .false.
670 IF (
ASSOCIATED(cons_info%fixed_molnames))
THEN
671 DO k1loc = 1,
SIZE(cons_info%fixed_molnames)
672 IF (cons_info%fixed_molnames(k1loc) == molname)
THEN
673 fix_atom_molname = .true.
674 itype = cons_info%fixed_mol_type(k1loc)
681 fix_fixed_atom = .false.
682 DO k2loc = 1,
SIZE(cons_info%fixed_atoms)
683 IF (cons_info%fixed_atoms(k2loc) == k)
THEN
684 fix_fixed_atom = .true.
685 itype = cons_info%fixed_type(k2loc)
690 fix_atom_qmmm = .false.
691 fix_atom_mm = .false.
692 fix_atom_qm = .false.
693 IF (
PRESENT(qmmm_env))
THEN
694 SELECT CASE (cons_info%freeze_qm)
696 IF (any(qmmm_env%qm_atom_index == k))
THEN
697 fix_atom_qmmm = .true.
699 itype = cons_info%freeze_qm_type
702 IF (any(qmmm_env%qm_molecule_index == molecule_list(j)))
THEN
703 fix_atom_qmmm = .true.
705 itype = cons_info%freeze_qm_type
708 SELECT CASE (cons_info%freeze_mm)
710 IF (all(qmmm_env%qm_atom_index /= k))
THEN
711 fix_atom_qmmm = .true.
713 itype = cons_info%freeze_mm_type
716 IF (all(qmmm_env%qm_molecule_index /= molecule_list(j)))
THEN
717 fix_atom_qmmm = .true.
719 itype = cons_info%freeze_mm_type
723 IF (fix_atom_qm .AND. fix_atom_mm)
THEN
724 CALL cp_abort(__location__, &
726 " has been defined both QM and MM. General Error!")
730 IF ((fix_fixed_atom .AND. fix_atom_qmmm) .OR. (fix_fixed_atom .AND. fix_atom_molname) &
731 .OR. (fix_atom_qmmm .AND. fix_atom_molname))
THEN
732 CALL cp_abort(__location__, &
734 " has been constrained/restrained to be fixed in more than one"// &
735 " input section. Check and correct your input file!")
738 IF (fix_fixed_atom .OR. fix_atom_qmmm .OR. fix_atom_molname)
THEN
739 IF (
ASSOCIATED(
topology%cell_muc))
THEN
741 CALL cp_abort(__location__, &
742 "Partial FIXED_ATOMS components cannot be transformed "// &
743 "after CELL%CANONICALIZE. Use COMPONENTS_TO_FIX XYZ or "// &
744 "disable CELL%CANONICALIZE for this input.")
748 fixd_list(kk)%fixd = k
749 fixd_list(kk)%coord = particle_set(k)%r
750 fixd_list(kk)%itype = itype
752 IF (fix_fixed_atom)
THEN
753 fixd_list(kk)%restraint%active = cons_info%fixed_restraint(k2loc)
754 fixd_list(kk)%restraint%k0 = cons_info%fixed_k0(k2loc)
755 ELSE IF (fix_atom_qm)
THEN
756 fixd_list(kk)%restraint%active = cons_info%fixed_qm_restraint
757 fixd_list(kk)%restraint%k0 = cons_info%fixed_qm_k0
758 ELSE IF (fix_atom_mm)
THEN
759 fixd_list(kk)%restraint%active = cons_info%fixed_mm_restraint
760 fixd_list(kk)%restraint%k0 = cons_info%fixed_mm_k0
761 ELSE IF (fix_atom_molname)
THEN
762 fixd_list(kk)%restraint%active = cons_info%fixed_mol_restraint(k1loc)
763 fixd_list(kk)%restraint%k0 = cons_info%fixed_mol_k0(k1loc)
766 cpabort(
"Unknown fix atom specification")
768 IF (fixd_list(kk)%restraint%active)
THEN
769 nfixd_restraint = nfixd_restraint + 1
770 nfixd_restart = nfixd_restart + 1
774 fixd_list(kk)%coord(2) = huge(0.0_dp)
775 fixd_list(kk)%coord(3) = huge(0.0_dp)
777 fixd_list(kk)%coord(1) = huge(0.0_dp)
778 fixd_list(kk)%coord(3) = huge(0.0_dp)
780 fixd_list(kk)%coord(1) = huge(0.0_dp)
781 fixd_list(kk)%coord(2) = huge(0.0_dp)
783 fixd_list(kk)%coord(3) = huge(0.0_dp)
785 fixd_list(kk)%coord(2) = huge(0.0_dp)
787 fixd_list(kk)%coord(1) = huge(0.0_dp)
789 IF (restart_restraint_pos)
THEN
792 i_rep_val=nfixd_restart, r_vals=r)
795 cpassert(
SIZE(r) == 1)
796 fixd_list(kk)%coord(1) = r(1)
798 cpassert(
SIZE(r) == 1)
799 fixd_list(kk)%coord(2) = r(1)
801 cpassert(
SIZE(r) == 1)
802 fixd_list(kk)%coord(3) = r(1)
804 cpassert(
SIZE(r) == 2)
805 fixd_list(kk)%coord(1) = r(1)
806 fixd_list(kk)%coord(2) = r(2)
808 cpassert(
SIZE(r) == 2)
809 fixd_list(kk)%coord(1) = r(1)
810 fixd_list(kk)%coord(3) = r(2)
812 cpassert(
SIZE(r) == 2)
813 fixd_list(kk)%coord(2) = r(1)
814 fixd_list(kk)%coord(3) = r(2)
816 cpassert(
SIZE(r) == 3)
817 fixd_list(kk)%coord(1:3) = r(1:3)
818 IF (
ASSOCIATED(
topology%cell_muc))
THEN
827 r(1) = fixd_list(kk)%coord(1)
830 r(1) = fixd_list(kk)%coord(2)
833 r(1) = fixd_list(kk)%coord(3)
836 r(1) = fixd_list(kk)%coord(1)
837 r(2) = fixd_list(kk)%coord(2)
840 r(1) = fixd_list(kk)%coord(1)
841 r(2) = fixd_list(kk)%coord(3)
844 r(1) = fixd_list(kk)%coord(1)
845 r(2) = fixd_list(kk)%coord(3)
848 r(1:3) = fixd_list(kk)%coord(1:3)
851 i_rep_val=nfixd_restart, r_vals_ptr=r)
859 WRITE (iw, *)
"MOLECULE KIND:", i,
" NR. FIXED ATOMS:",
SIZE(fixd_list(:)%fixd),
" LIST::", fixd_list(:)%fixd
861 CALL set_molecule_kind(molecule_kind, nfixd=nfixed_atoms, nfixd_restraint=nfixd_restraint, &
863 fixd_list_gci(nfixd_list_gci + 1:nfixd_list_gci + nfixed_atoms) = fixd_list
864 nfixd_list_gci = nfixd_list_gci + nfixed_atoms
867 WRITE (iw, *)
"TOTAL NUMBER OF FIXED ATOMS:", nfixd_list_gci
869 cpassert(count(missed_molname) == 0)
870 DEALLOCATE (missed_molname)
872 IF (gci%ntot /= 0)
THEN
873 ALLOCATE (fixd_list(nfixd_list_gci))
874 fixd_list(1:nfixd_list_gci) = fixd_list_gci(1:nfixd_list_gci)
875 gci%fixd_list => fixd_list
877 DEALLOCATE (fixd_list_gci)
880 gci%nrestraint = gci%ng3x3_restraint + &
881 gci%ng4x6_restraint + &
882 gci%nvsite_restraint + &
885 "PRINT%TOPOLOGY_INFO/UTIL_INFO")
886 CALL timestop(handle2)
887 CALL timestop(handle)