mirror of
https://github.com/cp2k/cp2k.git
synced 2026-07-29 06:35:28 -04:00
Default for SE/TB is now use Element symbol as atom name (#340)
This commit is contained in:
parent
158053f68c
commit
dd18ba31a5
5 changed files with 47 additions and 10 deletions
|
|
@ -87,11 +87,12 @@ CONTAINS
|
|||
!> \param qmmm ...
|
||||
!> \param qmmm_env ...
|
||||
!> \param exclusions ...
|
||||
!> \param elkind ...
|
||||
!> \author Ole Schuett
|
||||
! **************************************************************************************************
|
||||
SUBROUTINE cp_subsys_create(subsys, para_env, &
|
||||
root_section, force_env_section, subsys_section, &
|
||||
use_motion_section, qmmm, qmmm_env, exclusions)
|
||||
use_motion_section, qmmm, qmmm_env, exclusions, elkind)
|
||||
TYPE(cp_subsys_type), POINTER :: subsys
|
||||
TYPE(cp_para_env_type), POINTER :: para_env
|
||||
TYPE(section_vals_type), POINTER :: root_section
|
||||
|
|
@ -101,6 +102,7 @@ CONTAINS
|
|||
TYPE(qmmm_env_mm_type), OPTIONAL, POINTER :: qmmm_env
|
||||
TYPE(exclusion_type), DIMENSION(:), OPTIONAL, &
|
||||
POINTER :: exclusions
|
||||
LOGICAL, INTENT(IN), OPTIONAL :: elkind
|
||||
|
||||
CHARACTER(len=*), PARAMETER :: routineN = 'cp_subsys_create', &
|
||||
routineP = moduleN//':'//routineN
|
||||
|
|
@ -159,7 +161,7 @@ CONTAINS
|
|||
subsys%colvar_p, subsys%gci, root_section, para_env, &
|
||||
force_env_section=my_force_env_section, &
|
||||
subsys_section=my_subsys_section, use_motion_section=my_use_motion_section, &
|
||||
qmmm=qmmm, qmmm_env=qmmm_env, exclusions=exclusions)
|
||||
qmmm=qmmm, qmmm_env=qmmm_env, exclusions=exclusions, elkind=elkind)
|
||||
|
||||
CALL particle_list_create(particles, els_ptr=particle_set)
|
||||
CALL atomic_kind_list_create(atomic_kinds, els_ptr=atomic_kind_set)
|
||||
|
|
|
|||
|
|
@ -1576,6 +1576,14 @@ CONTAINS
|
|||
|
||||
NULLIFY (keyword, print_key)
|
||||
! Logical
|
||||
CALL keyword_create(keyword, name="USE_ELEMENT_AS_KIND", &
|
||||
description="Kinds are generated according to the element name."// &
|
||||
" Default=True for SE and TB methods.", &
|
||||
usage="USE_ELEMENT_AS_KIND logical", &
|
||||
default_l_val=.FALSE., lone_keyword_l_val=.TRUE.)
|
||||
CALL section_add_keyword(section, keyword)
|
||||
CALL keyword_release(keyword)
|
||||
|
||||
CALL keyword_create(keyword, name="CHARGE_OCCUP", &
|
||||
variants=(/"CHARGE_O"/), &
|
||||
description="Read MM charges from the OCCUP field of PDB file.", &
|
||||
|
|
|
|||
|
|
@ -246,8 +246,9 @@ CONTAINS
|
|||
|
||||
INTEGER :: ikind, method_id, natom, nkind
|
||||
LOGICAL :: do_admm_rpa, do_et, do_exx, do_hfx, &
|
||||
do_kpoints, mp2_present, my_qmmm, &
|
||||
qmmm_decoupl, silent, use_ref_cell
|
||||
do_kpoints, is_semi, mp2_present, &
|
||||
my_qmmm, qmmm_decoupl, silent, &
|
||||
use_ref_cell
|
||||
REAL(KIND=dp), DIMENSION(:, :), POINTER :: rtmat
|
||||
TYPE(atomic_kind_type), DIMENSION(:), POINTER :: atomic_kind_set
|
||||
TYPE(cell_type), POINTER :: my_cell, my_cell_ref
|
||||
|
|
@ -294,8 +295,11 @@ CONTAINS
|
|||
CASE (do_method_rm1, do_method_am1, do_method_mndo, do_method_pdg, &
|
||||
do_method_pm3, do_method_pm6, do_method_pm6fm, do_method_mndod, do_method_pnnl)
|
||||
CALL init_se_intd_array()
|
||||
is_semi = .TRUE.
|
||||
CASE (do_method_xtb, do_method_dftb)
|
||||
is_semi = .TRUE.
|
||||
CASE DEFAULT
|
||||
! Do nothing
|
||||
is_semi = .FALSE.
|
||||
END SELECT
|
||||
|
||||
CALL qs_subsys_create(subsys, para_env, &
|
||||
|
|
@ -303,7 +307,8 @@ CONTAINS
|
|||
subsys_section=subsys_section, &
|
||||
use_motion_section=use_motion_section, &
|
||||
root_section=root_section, &
|
||||
cp_subsys=cp_subsys, cell=cell, cell_ref=cell_ref)
|
||||
cp_subsys=cp_subsys, cell=cell, cell_ref=cell_ref, &
|
||||
elkind=is_semi)
|
||||
|
||||
CALL qs_ks_env_create(ks_env)
|
||||
CALL set_ks_env(ks_env, subsys=subsys)
|
||||
|
|
|
|||
|
|
@ -63,9 +63,10 @@ CONTAINS
|
|||
!> \param cp_subsys ...
|
||||
!> \param cell ...
|
||||
!> \param cell_ref ...
|
||||
!> \param elkind ...
|
||||
! **************************************************************************************************
|
||||
SUBROUTINE qs_subsys_create(subsys, para_env, root_section, force_env_section, subsys_section, &
|
||||
use_motion_section, cp_subsys, cell, cell_ref)
|
||||
use_motion_section, cp_subsys, cell, cell_ref, elkind)
|
||||
TYPE(qs_subsys_type), POINTER :: subsys
|
||||
TYPE(cp_para_env_type), POINTER :: para_env
|
||||
TYPE(section_vals_type), OPTIONAL, POINTER :: root_section
|
||||
|
|
@ -73,6 +74,7 @@ CONTAINS
|
|||
LOGICAL, INTENT(IN) :: use_motion_section
|
||||
TYPE(cp_subsys_type), OPTIONAL, POINTER :: cp_subsys
|
||||
TYPE(cell_type), OPTIONAL, POINTER :: cell, cell_ref
|
||||
LOGICAL, INTENT(IN), OPTIONAL :: elkind
|
||||
|
||||
CHARACTER(len=*), PARAMETER :: routineN = 'qs_subsys_create', &
|
||||
routineP = moduleN//':'//routineN
|
||||
|
|
@ -95,7 +97,8 @@ CONTAINS
|
|||
CALL cp_subsys_create(my_cp_subsys, para_env, root_section=root_section, &
|
||||
force_env_section=force_env_section, &
|
||||
subsys_section=subsys_section, &
|
||||
use_motion_section=use_motion_section)
|
||||
use_motion_section=use_motion_section, &
|
||||
elkind=elkind)
|
||||
ELSE
|
||||
CPABORT("qs_subsys_create: cp_subsys or root_section needed")
|
||||
END IF
|
||||
|
|
|
|||
|
|
@ -115,10 +115,11 @@ CONTAINS
|
|||
!> \param subsys_section ...
|
||||
!> \param use_motion_section ...
|
||||
!> \param exclusions ...
|
||||
!> \param elkind ...
|
||||
! **************************************************************************************************
|
||||
SUBROUTINE 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)
|
||||
force_env_section, subsys_section, use_motion_section, exclusions, elkind)
|
||||
|
||||
TYPE(atomic_kind_type), DIMENSION(:), POINTER :: atomic_kind_set
|
||||
TYPE(particle_type), DIMENSION(:), POINTER :: particle_set
|
||||
|
|
@ -134,12 +135,14 @@ CONTAINS
|
|||
LOGICAL, INTENT(IN) :: use_motion_section
|
||||
TYPE(exclusion_type), DIMENSION(:), OPTIONAL, &
|
||||
POINTER :: exclusions
|
||||
LOGICAL, INTENT(IN), OPTIONAL :: elkind
|
||||
|
||||
CHARACTER(LEN=*), PARAMETER :: routineN = 'topology_control', &
|
||||
routineP = moduleN//':'//routineN
|
||||
|
||||
INTEGER :: handle, iw, iw2
|
||||
LOGICAL :: binary_coord_read, my_qmmm
|
||||
LOGICAL :: binary_coord_read, el_as_kind, explicit, &
|
||||
my_qmmm
|
||||
TYPE(cp_logger_type), POINTER :: logger
|
||||
TYPE(section_vals_type), POINTER :: cell_section, constraint_section, &
|
||||
topology_section
|
||||
|
|
@ -160,6 +163,17 @@ CONTAINS
|
|||
my_qmmm = .FALSE.
|
||||
IF (PRESENT(qmmm) .AND. PRESENT(qmmm_env)) my_qmmm = qmmm
|
||||
|
||||
IF (PRESENT(elkind)) THEN
|
||||
CALL section_vals_val_get(topology_section, "USE_ELEMENT_AS_KIND", explicit=explicit)
|
||||
IF (explicit) THEN
|
||||
CALL section_vals_val_get(topology_section, "USE_ELEMENT_AS_KIND", l_val=el_as_kind)
|
||||
ELSE
|
||||
el_as_kind = elkind
|
||||
END IF
|
||||
ELSE
|
||||
CALL section_vals_val_get(topology_section, "USE_ELEMENT_AS_KIND", l_val=el_as_kind)
|
||||
END IF
|
||||
|
||||
! 1. Initialize the topology structure type
|
||||
CALL init_topology(topology)
|
||||
|
||||
|
|
@ -186,6 +200,11 @@ CONTAINS
|
|||
CALL connectivity_control(topology, para_env, my_qmmm, qmmm_env, subsys_section, &
|
||||
force_env_section)
|
||||
|
||||
IF (el_as_kind) THEN
|
||||
! redefine atom names with the name of the element
|
||||
topology%atom_info%id_atmname(:) = topology%atom_info%id_element(:)
|
||||
END IF
|
||||
|
||||
! 7. Pack everything into the molecular types
|
||||
CALL topology_connectivity_pack(molecule_kind_set, molecule_set, &
|
||||
topology, subsys_section)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue