97#include "./base/base_uses.f90"
101 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'topology'
131 molecule_set, colvar_p, gci, root_section, para_env, qmmm, qmmm_env, &
132 force_env_section, subsys_section, use_motion_section, &
133 exclusions, elkind, subsys)
143 LOGICAL,
INTENT(IN),
OPTIONAL :: qmmm
146 LOGICAL,
INTENT(IN) :: use_motion_section
148 POINTER :: exclusions
149 LOGICAL,
INTENT(IN),
OPTIONAL :: elkind
152 CHARACTER(LEN=*),
PARAMETER :: routinen =
'topology_control'
154 INTEGER :: handle, iw, iw2
155 LOGICAL :: binary_coord_read, el_as_kind, explicit, &
156 my_qmmm, use_ref_cell
157 TYPE(
cell_type),
POINTER :: my_cell, my_cell_ref
160 constraint_section, fragment_section, &
166 CALL timeset(routinen, handle)
167 NULLIFY (cell_section, cell_ref_section, constraint_section, topology_section, fragment_section)
170 IF (use_motion_section)
THEN
177 IF (
PRESENT(qmmm) .AND.
PRESENT(qmmm_env)) my_qmmm = qmmm
179 IF (
PRESENT(elkind))
THEN
194 NULLIFY (my_cell, my_cell_ref)
195 CALL read_cell(my_cell, my_cell_ref, cell_section=cell_section, &
196 topology_section=topology_section, para_env=para_env)
197 use_ref_cell = .false.
205 IF (
PRESENT(subsys))
THEN
206 CALL cp_subsys_set(subsys, cell=my_cell, cell_ref=my_cell_ref, &
207 use_ref_cell=use_ref_cell)
209 CALL write_cell(my_cell, subsys_section, tag=
"CELL")
210 CALL write_cell(my_cell_ref, subsys_section, tag=
"CELL_REF")
223 IF (.NOT. binary_coord_read)
THEN
224 CALL coordinate_control(
topology, root_section, para_env, subsys_section)
250 molecule_kind_set, molecule_set, &
251 topology, my_qmmm, qmmm_env, subsys_section, &
252 force_env_section=force_env_section, exclusions=exclusions)
255 molecule_kind_set, molecule_set, &
256 topology, subsys_section=subsys_section, &
257 force_env_section=force_env_section, exclusions=exclusions)
261 CALL topology_post_proc_colvar(colvar_p, particle_set)
266 topology, qmmm_env, particle_set, root_section, subsys_section, &
270 topology, particle_set=particle_set, input_file=root_section, &
271 subsys_section=subsys_section, gci=gci)
276 file_status=
"REPLACE", extension=
".pdb")
283 file_status=
"REPLACE", extension=
".psf")
293 CALL read_fragments(
topology, subsys_section, particle_set=particle_set)
298 CALL timestop(handle)
300 "PRINT%TOPOLOGY_INFO")
322 LOGICAL,
INTENT(in),
OPTIONAL :: qmmm
326 CHARACTER(len=*),
PARAMETER :: routinen =
'connectivity_control'
327 INTEGER,
PARAMETER :: map0 = ichar(
"0"), map9 = ichar(
"9")
329 CHARACTER(len=default_string_length) :: element0, my_element
330 CHARACTER(len=default_string_length), &
331 ALLOCATABLE,
DIMENSION(:) :: elements
332 INTEGER :: handle, handle2, i, id, itmp, iw, j, k
333 LOGICAL :: check, my_qmmm, use_mm_map_first
340 CALL timeset(routinen, handle)
343 IF (
PRESENT(qmmm) .AND.
PRESENT(qmmm_env)) my_qmmm = qmmm
355 para_env, subsys_section)
367 check =
SIZE(
topology%atom_info%id_element) ==
SIZE(
topology%atom_info%id_atmname)
373 CALL timeset(routinen//
"_check_element_name", handle2)
379 use_mm_map_first = .true.
381 use_mm_map_first = .false.
387 ALLOCATE (elements(
SIZE(
topology%atom_info%id_element)))
388 DO i = 1,
SIZE(elements)
393 IF (elements(i) ==
"__DEF__") cycle
395 id = index(elements(i),
"_") - 1
396 IF (id == -1) id = len_trim(elements(i))
402 itmp = ichar(elements(i) (j:j))
403 IF ((itmp < map0) .OR. (itmp > map9))
EXIT
405 element0 = elements(i) (1:j)
408 subsys_section, use_mm_map_first)
410 element0 = elements(i)
414 elements(k) =
"__DEF__"
418 DEALLOCATE (elements)
422 CALL timestop(handle2)
466 CALL timestop(handle)
468 "PRINT%TOPOLOGY_INFO")
477 SUBROUTINE read_fragments(topology, subsys_section, particle_set)
483 INTEGER :: i_rep, ifrag, n_rep
484 INTEGER,
DIMENSION(:),
POINTER :: frag_range
493 ALLOCATE (
topology%fragments(n_rep))
497 topology%fragments(i_rep)%frag_start = frag_range(1)
498 topology%fragments(i_rep)%frag_end = frag_range(2)
499 DO ifrag =
topology%fragments(i_rep)%frag_start,
topology%fragments(i_rep)%frag_end
500 particle_set(ifrag)%fragment_index = i_rep
504 END SUBROUTINE read_fragments
515 RECURSIVE SUBROUTINE read_topology_conn(topology, conn_type, conn_file_name, para_env, &
519 INTEGER,
INTENT(IN) :: conn_type
520 CHARACTER(LEN=default_path_length),
INTENT(IN) :: conn_file_name
524 CHARACTER(len=default_path_length) :: filename
525 INTEGER :: i_rep, imol, loc_conn_type, n_rep, nmol
530 SELECT CASE (conn_type)
538 CALL section_vals_val_get(section,
"CONN_FILE_FORMAT", i_val=loc_conn_type, i_rep_section=i_rep)
540 SELECT CASE (loc_conn_type)
543 CALL read_topology_conn(
topology, loc_conn_type, filename, para_env, subsys_section)
546 CALL cp_abort(__location__, &
547 "MOL_SET feature implemented only for PSF/UPSF, G87/G96 and AMBER "// &
548 "connectivity type.")
552 CALL cp_abort(__location__, &
553 "Number of atoms in connectivity control is larger than the "// &
554 "number of atoms in coordinate control. check coordinates and "// &
569 END SUBROUTINE read_topology_conn
583 SUBROUTINE coordinate_control(topology, root_section, para_env, subsys_section)
590 CHARACTER(len=*),
PARAMETER :: routinen =
'coordinate_control'
592 CHARACTER(LEN=default_string_length) :: message
593 INTEGER :: handle, handle2, istat, iw
594 LOGICAL :: found, save_mem
602 CALL timeset(routinen, handle)
604 NULLIFY (global_section)
611 INQUIRE (file=
topology%coord_file_name, exist=found, iostat=istat)
613 WRITE (unit=message, fmt=
"(A,I0,A)") &
614 "An error occurred inquiring the file <"// &
615 trim(
topology%coord_file_name)//
"> (IOSTAT = ", istat,
")"
616 cpabort(trim(message))
618 IF (.NOT. found)
THEN
619 CALL cp_abort(__location__, &
620 "Coordinate file <"//trim(
topology%coord_file_name)// &
627 CALL timeset(routinen//
"_READ_COORDINATE", handle2)
633 CALL transform_external_cartesian_coordinates(
topology)
636 CALL transform_external_cartesian_coordinates(
topology)
639 CALL transform_external_cartesian_coordinates(
topology)
642 CALL transform_external_cartesian_coordinates(
topology)
657 subsys_section=subsys_section, save_mem=save_mem)
661 CALL timestop(handle2)
664 cpabort(
"No atomic coordinates have been found! ")
665 CALL timestop(handle)
667 "PRINT%TOPOLOGY_INFO")
668 END SUBROUTINE coordinate_control
674 SUBROUTINE transform_external_cartesian_coordinates(topology)
680 IF (.NOT.
ASSOCIATED(
topology%cell_muc))
RETURN
686 END SUBROUTINE transform_external_cartesian_coordinates
696 SUBROUTINE topology_post_proc_colvar(colvar_p, particle_set)
703 IF (
ASSOCIATED(colvar_p))
THEN
704 DO i = 1,
SIZE(colvar_p)
706 DO j = 1,
SIZE(colvar_p(i)%colvar%combine_cvs_param%colvar_p)
707 CALL post_process_colvar(colvar_p(i)%colvar%combine_cvs_param%colvar_p(j)%colvar, particle_set)
715 END SUBROUTINE topology_post_proc_colvar
724 SUBROUTINE setup_cell_muc(cell_muc, cell, subsys_section)
726 TYPE(
cell_type),
POINTER :: cell_muc, cell
729 INTEGER,
DIMENSION(:),
POINTER :: multiple_unit_cell
730 REAL(kind=
dp),
DIMENSION(3, 3) :: hmat_ref
732 cpassert(.NOT.
ASSOCIATED(cell_muc))
735 i_vals=multiple_unit_cell)
736 IF (any(multiple_unit_cell /= 1))
THEN
738 hmat_ref(:, 1) = cell%hmat(:, 1)/multiple_unit_cell(1)
739 hmat_ref(:, 2) = cell%hmat(:, 2)/multiple_unit_cell(2)
740 hmat_ref(:, 3) = cell%hmat(:, 3)/multiple_unit_cell(3)
742 CALL cell_create(cell_muc, hmat=hmat_ref, periodic=cell%perd, tag=
"CELL_UC")
750 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)
subroutine, public cell_transform_input_cartesian(cell, vector)
Transform a Cartesian real-space vector from the user input cell frame into CP2K's canonical internal...
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