92#include "./base/base_uses.f90"
96 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'topology'
125 molecule_set, colvar_p, gci, root_section, para_env, qmmm, qmmm_env, &
126 force_env_section, subsys_section, use_motion_section, exclusions, elkind)
136 LOGICAL,
INTENT(IN),
OPTIONAL :: qmmm
139 LOGICAL,
INTENT(IN) :: use_motion_section
141 POINTER :: exclusions
142 LOGICAL,
INTENT(IN),
OPTIONAL :: elkind
144 CHARACTER(LEN=*),
PARAMETER :: routinen =
'topology_control'
146 INTEGER :: handle, iw, iw2
147 LOGICAL :: binary_coord_read, el_as_kind, explicit, &
156 CALL timeset(routinen, handle)
157 NULLIFY (cell_section, constraint_section, topology_section)
160 IF (use_motion_section)
THEN
167 IF (
PRESENT(qmmm) .AND.
PRESENT(qmmm_env)) my_qmmm = qmmm
169 IF (
PRESENT(elkind))
THEN
198 IF (.NOT. binary_coord_read)
THEN
199 CALL coordinate_control(
topology, root_section, para_env, subsys_section)
225 molecule_kind_set, molecule_set, &
226 topology, my_qmmm, qmmm_env, subsys_section, &
227 force_env_section=force_env_section, exclusions=exclusions)
230 molecule_kind_set, molecule_set, &
231 topology, subsys_section=subsys_section, &
232 force_env_section=force_env_section, exclusions=exclusions)
236 CALL topology_post_proc_colvar(colvar_p, particle_set)
241 topology, qmmm_env, particle_set, root_section, subsys_section, &
245 topology, particle_set=particle_set, input_file=root_section, &
246 subsys_section=subsys_section, gci=gci)
251 file_status=
"REPLACE", extension=
".pdb")
258 file_status=
"REPLACE", extension=
".psf")
267 CALL timestop(handle)
269 "PRINT%TOPOLOGY_INFO")
290 LOGICAL,
INTENT(in),
OPTIONAL :: qmmm
294 CHARACTER(len=*),
PARAMETER :: routinen =
'connectivity_control'
295 INTEGER,
PARAMETER :: map0 = ichar(
"0"), map9 = ichar(
"9")
297 CHARACTER(len=default_string_length) :: element0, my_element
298 CHARACTER(len=default_string_length), &
299 ALLOCATABLE,
DIMENSION(:) :: elements
300 INTEGER :: handle, handle2, i, id, itmp, iw, j, k
301 LOGICAL :: check, my_qmmm, use_mm_map_first
308 CALL timeset(routinen, handle)
311 IF (
PRESENT(qmmm) .AND.
PRESENT(qmmm_env)) my_qmmm = qmmm
323 para_env, subsys_section)
335 check =
SIZE(
topology%atom_info%id_element) ==
SIZE(
topology%atom_info%id_atmname)
341 CALL timeset(routinen//
"_check_element_name", handle2)
347 use_mm_map_first = .true.
349 use_mm_map_first = .false.
355 ALLOCATE (elements(
SIZE(
topology%atom_info%id_element)))
356 DO i = 1,
SIZE(elements)
361 IF (elements(i) ==
"__DEF__") cycle
363 id = index(elements(i),
"_") - 1
364 IF (id == -1) id = len_trim(elements(i))
370 itmp = ichar(elements(i) (j:j))
371 IF ((itmp < map0) .OR. (itmp > map9))
EXIT
373 element0 = elements(i) (1:j)
376 subsys_section, use_mm_map_first)
378 element0 = elements(i)
382 elements(k) =
"__DEF__"
386 DEALLOCATE (elements)
390 CALL timestop(handle2)
434 CALL timestop(handle)
436 "PRINT%TOPOLOGY_INFO")
449 RECURSIVE SUBROUTINE read_topology_conn(topology, conn_type, conn_file_name, para_env, &
453 INTEGER,
INTENT(IN) :: conn_type
454 CHARACTER(LEN=default_path_length),
INTENT(IN) :: conn_file_name
458 CHARACTER(len=default_path_length) :: filename
459 INTEGER :: i_rep, imol, loc_conn_type, n_rep, nmol
464 SELECT CASE (conn_type)
472 CALL section_vals_val_get(section,
"CONN_FILE_FORMAT", i_val=loc_conn_type, i_rep_section=i_rep)
474 SELECT CASE (loc_conn_type)
477 CALL read_topology_conn(
topology, loc_conn_type, filename, para_env, subsys_section)
480 CALL cp_abort(__location__, &
481 "MOL_SET feature implemented only for PSF/UPSF, G87/G96 and AMBER "// &
482 "connectivity type.")
486 CALL cp_abort(__location__, &
487 "Number of atoms in connectivity control is larger than the "// &
488 "number of atoms in coordinate control. check coordinates and "// &
503 END SUBROUTINE read_topology_conn
517 SUBROUTINE coordinate_control(topology, root_section, para_env, subsys_section)
524 CHARACTER(len=*),
PARAMETER :: routinen =
'coordinate_control'
526 CHARACTER(LEN=default_string_length) :: message
527 INTEGER :: handle, handle2, istat, iw
528 LOGICAL :: found, save_mem
536 CALL timeset(routinen, handle)
538 NULLIFY (global_section)
547 INQUIRE (file=
topology%coord_file_name, exist=found, iostat=istat)
549 WRITE (unit=message, fmt=
"(A,I0,A)") &
550 "An error occurred inquiring the file <"// &
551 trim(
topology%coord_file_name)//
"> (IOSTAT = ", istat,
")"
552 cpabort(trim(message))
554 IF (.NOT. found)
THEN
555 CALL cp_abort(__location__, &
556 "Coordinate file <"//trim(
topology%coord_file_name)// &
564 CALL timeset(routinen//
"_READ_COORDINATE", handle2)
590 subsys_section=subsys_section, save_mem=save_mem)
594 CALL timestop(handle2)
597 cpabort(
"No atomic coordinates have been found! ")
598 CALL timestop(handle)
600 "PRINT%TOPOLOGY_INFO")
601 END SUBROUTINE coordinate_control
611 SUBROUTINE topology_post_proc_colvar(colvar_p, particle_set)
618 IF (
ASSOCIATED(colvar_p))
THEN
619 DO i = 1,
SIZE(colvar_p)
621 DO j = 1,
SIZE(colvar_p(i)%colvar%combine_cvs_param%colvar_p)
622 CALL post_process_colvar(colvar_p(i)%colvar%combine_cvs_param%colvar_p(j)%colvar, particle_set)
630 END SUBROUTINE topology_post_proc_colvar
639 SUBROUTINE setup_cell_muc(cell_muc, cell, subsys_section)
641 TYPE(
cell_type),
POINTER :: cell_muc, cell
644 INTEGER,
DIMENSION(:),
POINTER :: multiple_unit_cell
645 REAL(kind=
dp),
DIMENSION(3, 3) :: hmat_ref
647 cpassert(.NOT.
ASSOCIATED(cell_muc))
650 i_vals=multiple_unit_cell)
651 IF (any(multiple_unit_cell /= 1))
THEN
653 hmat_ref(:, 1) = cell%hmat(:, 1)/multiple_unit_cell(1)
654 hmat_ref(:, 2) = cell%hmat(:, 2)/multiple_unit_cell(2)
655 hmat_ref(:, 3) = cell%hmat(:, 3)/multiple_unit_cell(3)
657 CALL cell_create(cell_muc, hmat=hmat_ref, periodic=cell%perd, tag=
"CELL_UC")
665 END SUBROUTINE setup_cell_muc
Define the atomic kind types and their sub types.
Handles all functions related to the CELL.
recursive subroutine, public read_cell(cell, cell_ref, use_ref_cell, cell_section, check_for_ref, para_env)
...
subroutine, public write_cell(cell, subsys_section, tag)
Write the cell parameters to the output unit.
subroutine, public cell_create(cell, hmat, periodic, tag)
allocates and initializes a cell
Handles all functions related to the CELL.
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,...
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 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)
...
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
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...
A type used to store lists of exclusions and onfos.
stores all the informations relevant to an mpi environment