96#include "./base/base_uses.f90"
100 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'topology'
130 molecule_set, colvar_p, gci, root_section, para_env, qmmm, qmmm_env, &
131 force_env_section, subsys_section, use_motion_section, &
132 exclusions, elkind, subsys)
142 LOGICAL,
INTENT(IN),
OPTIONAL :: qmmm
145 LOGICAL,
INTENT(IN) :: use_motion_section
147 POINTER :: exclusions
148 LOGICAL,
INTENT(IN),
OPTIONAL :: elkind
151 CHARACTER(LEN=*),
PARAMETER :: routinen =
'topology_control'
153 INTEGER :: handle, iw, iw2
154 LOGICAL :: binary_coord_read, el_as_kind, explicit, &
155 my_qmmm, use_ref_cell
156 TYPE(
cell_type),
POINTER :: my_cell, my_cell_ref
159 constraint_section, topology_section
164 CALL timeset(routinen, handle)
165 NULLIFY (cell_section, cell_ref_section, constraint_section, topology_section)
168 IF (use_motion_section)
THEN
175 IF (
PRESENT(qmmm) .AND.
PRESENT(qmmm_env)) my_qmmm = qmmm
177 IF (
PRESENT(elkind))
THEN
192 NULLIFY (my_cell, my_cell_ref)
193 CALL read_cell(my_cell, my_cell_ref, cell_section=cell_section, &
194 topology_section=topology_section, para_env=para_env)
195 use_ref_cell = .false.
203 IF (
PRESENT(subsys))
THEN
204 CALL cp_subsys_set(subsys, cell=my_cell, cell_ref=my_cell_ref, &
205 use_ref_cell=use_ref_cell)
207 CALL write_cell(my_cell, subsys_section, tag=
"CELL")
208 CALL write_cell(my_cell_ref, subsys_section, tag=
"CELL_REF")
221 IF (.NOT. binary_coord_read)
THEN
222 CALL coordinate_control(
topology, root_section, para_env, subsys_section)
248 molecule_kind_set, molecule_set, &
249 topology, my_qmmm, qmmm_env, subsys_section, &
250 force_env_section=force_env_section, exclusions=exclusions)
253 molecule_kind_set, molecule_set, &
254 topology, subsys_section=subsys_section, &
255 force_env_section=force_env_section, exclusions=exclusions)
259 CALL topology_post_proc_colvar(colvar_p, particle_set)
264 topology, qmmm_env, particle_set, root_section, subsys_section, &
268 topology, particle_set=particle_set, input_file=root_section, &
269 subsys_section=subsys_section, gci=gci)
274 file_status=
"REPLACE", extension=
".pdb")
281 file_status=
"REPLACE", extension=
".psf")
290 CALL timestop(handle)
292 "PRINT%TOPOLOGY_INFO")
313 LOGICAL,
INTENT(in),
OPTIONAL :: qmmm
317 CHARACTER(len=*),
PARAMETER :: routinen =
'connectivity_control'
318 INTEGER,
PARAMETER :: map0 = ichar(
"0"), map9 = ichar(
"9")
320 CHARACTER(len=default_string_length) :: element0, my_element
321 CHARACTER(len=default_string_length), &
322 ALLOCATABLE,
DIMENSION(:) :: elements
323 INTEGER :: handle, handle2, i, id, itmp, iw, j, k
324 LOGICAL :: check, my_qmmm, use_mm_map_first
331 CALL timeset(routinen, handle)
334 IF (
PRESENT(qmmm) .AND.
PRESENT(qmmm_env)) my_qmmm = qmmm
346 para_env, subsys_section)
358 check =
SIZE(
topology%atom_info%id_element) ==
SIZE(
topology%atom_info%id_atmname)
364 CALL timeset(routinen//
"_check_element_name", handle2)
370 use_mm_map_first = .true.
372 use_mm_map_first = .false.
378 ALLOCATE (elements(
SIZE(
topology%atom_info%id_element)))
379 DO i = 1,
SIZE(elements)
384 IF (elements(i) ==
"__DEF__") cycle
386 id = index(elements(i),
"_") - 1
387 IF (id == -1) id = len_trim(elements(i))
393 itmp = ichar(elements(i) (j:j))
394 IF ((itmp < map0) .OR. (itmp > map9))
EXIT
396 element0 = elements(i) (1:j)
399 subsys_section, use_mm_map_first)
401 element0 = elements(i)
405 elements(k) =
"__DEF__"
409 DEALLOCATE (elements)
413 CALL timestop(handle2)
457 CALL timestop(handle)
459 "PRINT%TOPOLOGY_INFO")
472 RECURSIVE SUBROUTINE read_topology_conn(topology, conn_type, conn_file_name, para_env, &
476 INTEGER,
INTENT(IN) :: conn_type
477 CHARACTER(LEN=default_path_length),
INTENT(IN) :: conn_file_name
481 CHARACTER(len=default_path_length) :: filename
482 INTEGER :: i_rep, imol, loc_conn_type, n_rep, nmol
487 SELECT CASE (conn_type)
495 CALL section_vals_val_get(section,
"CONN_FILE_FORMAT", i_val=loc_conn_type, i_rep_section=i_rep)
497 SELECT CASE (loc_conn_type)
500 CALL read_topology_conn(
topology, loc_conn_type, filename, para_env, subsys_section)
503 CALL cp_abort(__location__, &
504 "MOL_SET feature implemented only for PSF/UPSF, G87/G96 and AMBER "// &
505 "connectivity type.")
509 CALL cp_abort(__location__, &
510 "Number of atoms in connectivity control is larger than the "// &
511 "number of atoms in coordinate control. check coordinates and "// &
526 END SUBROUTINE read_topology_conn
540 SUBROUTINE coordinate_control(topology, root_section, para_env, subsys_section)
547 CHARACTER(len=*),
PARAMETER :: routinen =
'coordinate_control'
549 CHARACTER(LEN=default_string_length) :: message
550 INTEGER :: handle, handle2, istat, iw
551 LOGICAL :: found, save_mem
559 CALL timeset(routinen, handle)
561 NULLIFY (global_section)
568 INQUIRE (file=
topology%coord_file_name, exist=found, iostat=istat)
570 WRITE (unit=message, fmt=
"(A,I0,A)") &
571 "An error occurred inquiring the file <"// &
572 trim(
topology%coord_file_name)//
"> (IOSTAT = ", istat,
")"
573 cpabort(trim(message))
575 IF (.NOT. found)
THEN
576 CALL cp_abort(__location__, &
577 "Coordinate file <"//trim(
topology%coord_file_name)// &
584 CALL timeset(routinen//
"_READ_COORDINATE", handle2)
610 subsys_section=subsys_section, save_mem=save_mem)
614 CALL timestop(handle2)
617 cpabort(
"No atomic coordinates have been found! ")
618 CALL timestop(handle)
620 "PRINT%TOPOLOGY_INFO")
621 END SUBROUTINE coordinate_control
631 SUBROUTINE topology_post_proc_colvar(colvar_p, particle_set)
638 IF (
ASSOCIATED(colvar_p))
THEN
639 DO i = 1,
SIZE(colvar_p)
641 DO j = 1,
SIZE(colvar_p(i)%colvar%combine_cvs_param%colvar_p)
642 CALL post_process_colvar(colvar_p(i)%colvar%combine_cvs_param%colvar_p(j)%colvar, particle_set)
650 END SUBROUTINE topology_post_proc_colvar
659 SUBROUTINE setup_cell_muc(cell_muc, cell, subsys_section)
661 TYPE(
cell_type),
POINTER :: cell_muc, cell
664 INTEGER,
DIMENSION(:),
POINTER :: multiple_unit_cell
665 REAL(kind=
dp),
DIMENSION(3, 3) :: hmat_ref
667 cpassert(.NOT.
ASSOCIATED(cell_muc))
670 i_vals=multiple_unit_cell)
671 IF (any(multiple_unit_cell /= 1))
THEN
673 hmat_ref(:, 1) = cell%hmat(:, 1)/multiple_unit_cell(1)
674 hmat_ref(:, 2) = cell%hmat(:, 2)/multiple_unit_cell(2)
675 hmat_ref(:, 3) = cell%hmat(:, 3)/multiple_unit_cell(3)
677 CALL cell_create(cell_muc, hmat=hmat_ref, periodic=cell%perd, tag=
"CELL_UC")
685 END SUBROUTINE setup_cell_muc
Define the atomic kind types and their sub types.
Handles all functions related to the CELL.
subroutine, public write_cell(cell, subsys_section, tag)
Write the cell parameters to the output unit.
recursive subroutine, public read_cell(cell, cell_ref, use_ref_cell, cell_section, topology_section, check_for_ref, para_env)
...
subroutine, public cell_create(cell, hmat, periodic, tag)
allocates and initializes a cell
Handles all functions related to the CELL.
subroutine, public cell_release(cell)
releases the given cell (see doc/ReferenceCounting.html)
subroutine, public cell_clone(cell_in, cell_out, tag)
Clone cell variable.
subroutine, public cell_retain(cell)
retains the given cell (see doc/ReferenceCounting.html)
Initialize the collective variables types.
integer, parameter, public combine_colvar_id
subroutine, public colvar_setup(colvar)
Finalize the setup of the collective variable.
evaluations of colvar for internal coordinates schemes
subroutine, public post_process_colvar(colvar, particles)
Complete the description of the COORDINATION colvar when defined using KINDS.
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,...
types that represent a subsys, i.e. a part of the system
subroutine, public cp_subsys_set(subsys, atomic_kinds, particles, local_particles, molecules, molecule_kinds, local_molecules, para_env, colvar_p, shell_particles, core_particles, gci, multipoles, results, cell, cell_ref, use_ref_cell)
sets various propreties of the subsys
Defines the basic variable types.
integer, parameter, public dp
integer, parameter, public default_string_length
integer, parameter, public default_path_length
Interface to the message passing library MPI.
Contains the mapping ATOM_KIND -> ELEMENT for the most common cases in CHARMM and AMBER This should a...
subroutine, public create_ff_map(ff_type)
Initialize arrays for mapping KINDS <-> ELEMENTS for major elements in AMBER and CHARMM.
subroutine, public destroy_ff_map(ff_type)
Deallocates the arrays used for mapping.
Define the molecule kind structure types and the corresponding functionality.
Define the data structure for the molecule information.
Define the data structure for the particle information.
subroutine, public qmmm_coordinate_control(topology, qmmm_env, subsys_section)
Modifies the atom_infoid_atmname.
subroutine, public qmmm_connectivity_control(molecule_set, qmmm_env, subsys_section)
Set up the connectivity for QM/MM calculations.
generates a unique id number for a string (str2id) that can be used two compare two strings....
character(len=default_string_length) function, public s2s(str)
converts a string in a string of default_string_length
integer function, public str2id(str)
returns a unique id for a given string, and stores the string for later retrieval using the id.
character(len=default_string_length) function, public id2str(id)
returns the string associated with a given id
Handles all functions used to read and interpret AMBER coordinates and topology files.
subroutine, public read_coordinate_crd(topology, para_env, subsys_section)
Reads the ‘coord’ version generated by the PARM or LEaP programs, as well as the ‘restrt’ version,...
subroutine, public read_connectivity_amber(filename, topology, para_env, subsys_section)
Read AMBER topology file (.top) : At this level we parse only the connectivity info the ....
Handles CIF (Crystallographic Information File) files.
subroutine, public read_coordinate_cif(topology, para_env, subsys_section)
Performs the real task of reading the proper information from the CIF file.
Collection of subroutine needed for topology related things.
subroutine, public topology_conn_multiple(topology, subsys_section)
Handles the multiple unit cell option for the connectivity.
subroutine, public topology_connectivity_pack(molecule_kind_set, molecule_set, topology, subsys_section)
topology connectivity pack
Collection of subroutine needed for topology related things.
subroutine, public topology_constraint_pack(molecule_kind_set, molecule_set, topology, qmmm_env, particle_set, input_file, subsys_section, gci)
Pack in all the information needed for the constraints.
Collection of subroutine needed for topology related things.
subroutine, public topology_coordinate_pack(particle_set, atomic_kind_set, molecule_kind_set, molecule_set, topology, qmmm, qmmm_env, subsys_section, force_env_section, exclusions, ignore_outside_box)
Take info readin from different file format and stuff it into compatible data structure in cp2k.
subroutine, public read_coordinate_cp2k(topology, para_env, subsys_section)
Read the CP2K &COORD section from an external file, i.e. read atomic coordinates and molecule/residue...
Collection of subroutine needed for topology related things.
subroutine, public topology_generate_impr(topology, subsys_section)
Using a list of bends, generate a list of impr.
subroutine, public topology_generate_onfo(topology, subsys_section)
Using a list of torsion, generate a list of onfo.
subroutine, public topology_generate_bend(topology, subsys_section)
Using a list of bonds, generate a list of bends.
subroutine, public topology_generate_molecule(topology, qmmm, qmmm_env, subsys_section)
Use information from bond list to generate molecule. (ie clustering)
subroutine, public topology_generate_dihe(topology, subsys_section)
Generate a list of torsions from bonds.
subroutine, public topology_generate_ub(topology, subsys_section)
The list of Urey-Bradley is equal to the list of bends.
subroutine, public topology_generate_bond(topology, para_env, subsys_section)
Use info from periodic table and assumptions to generate bonds.
subroutine, public read_coordinate_g96(topology, para_env, subsys_section)
...
subroutine, public read_topology_gromos(file_name, topology, para_env, subsys_section)
Read GROMOS topology file.
Handles the multiple unit cell option regarding atomic coordinates.
subroutine, public topology_muc(topology, subsys_section)
Handles the multiple_unit_cell for the atomic coordinates.
subroutine, public write_coordinate_pdb(file_unit, topology, subsys_section)
...
subroutine, public read_coordinate_pdb(topology, para_env, subsys_section)
...
Functionality to read in PSF topologies and convert it into local data structures.
subroutine, public read_topology_psf(filename, topology, para_env, subsys_section, psf_type)
Read PSF topology file Teodoro Laino - Introduced CHARMM31 EXT PSF standard format.
subroutine, public idm_psf(topology, section, subsys_section)
Input driven modification (IDM) of PSF defined structures.
subroutine, public write_topology_psf(file_unit, topology, subsys_section, force_env_section)
Teodoro Laino - 01.2006 Write PSF topology file in the CHARMM31 EXT standard format.
subroutine, public psf_post_process(topology, subsys_section)
Post processing of PSF informations.
subroutine, public deallocate_topology(topology)
Just DEALLOCATE all the stuff
subroutine, public pre_read_topology(topology)
Deallocate possibly allocated arrays before reading topology.
subroutine, public init_topology(topology)
Just NULLIFY and zero all the stuff
Collection of subroutine needed for topology related things.
subroutine, public topology_molecules_check(topology, subsys_section)
Check and verify that all molecules of the same kind are bonded the same.
subroutine, public topology_reorder_atoms(topology, qmmm, qmmm_env_mm, subsys_section, force_env_section)
...
subroutine, public topology_set_atm_mass(topology, subsys_section)
Use info from periodic table and set atm_mass.
subroutine, public check_subsys_element(element_in, atom_name_in, element_out, subsys_section, use_mm_map_first)
Check and returns the ELEMENT label.
Handles XTL (Molecular Simulations, Inc (MSI)) files.
subroutine, public read_coordinate_xtl(topology, para_env, subsys_section)
Performs the real task of reading the proper information from the XTL file.
subroutine, public read_coordinate_xyz(topology, para_env, subsys_section)
...
Control for reading in different topologies and coordinates.
subroutine, public connectivity_control(topology, para_env, qmmm, qmmm_env, subsys_section, force_env_section)
If reading in from external file, make sure its there first
subroutine, public topology_control(atomic_kind_set, particle_set, molecule_kind_set, molecule_set, colvar_p, gci, root_section, para_env, qmmm, qmmm_env, force_env_section, subsys_section, use_motion_section, exclusions, elkind, subsys)
...
Provides all information about an atomic kind.
Type defining parameters related to the simulation cell.
type of a logger, at the moment it contains just a print level starting at which level it should be l...
represents a system: atoms, molecules, their pos,vel,...
A type used to store lists of exclusions and onfos.
stores all the informations relevant to an mpi environment