-
Notifications
You must be signed in to change notification settings - Fork 1
/
qmmmx_create.F
97 lines (80 loc) · 4.79 KB
/
qmmmx_create.F
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
!--------------------------------------------------------------------------------------------------!
! CP2K: A general program to perform molecular dynamics simulations !
! Copyright 2000-2024 CP2K developers group <https://cp2k.org> !
! !
! SPDX-License-Identifier: GPL-2.0-or-later !
!--------------------------------------------------------------------------------------------------!
! **************************************************************************************************
!> \brief Initialize a QM/MM calculation with Force-Mixing
!> \author Ole Schuett
! **************************************************************************************************
MODULE qmmmx_create
USE cp_subsys_types, ONLY: cp_subsys_type
USE global_types, ONLY: global_environment_type
USE input_section_types, ONLY: section_vals_get_subs_vals,&
section_vals_release,&
section_vals_type
USE message_passing, ONLY: mp_para_env_type
USE qmmm_create, ONLY: qmmm_env_create
USE qmmm_types, ONLY: qmmm_env_get,&
qmmm_env_release,&
qmmm_env_type
USE qmmmx_types, ONLY: qmmmx_env_type
USE qmmmx_util, ONLY: setup_force_mixing_qmmm_sections,&
update_force_mixing_labels
#include "./base/base_uses.f90"
IMPLICIT NONE
PRIVATE
LOGICAL, PRIVATE, PARAMETER :: debug_this_module = .TRUE.
CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'qmmmx_create'
PUBLIC :: qmmmx_env_create
CONTAINS
! **************************************************************************************************
!> \brief ...
!> \param qmmmx_env ...
!> \param root_section ...
!> \param para_env ...
!> \param globenv ...
!> \param force_env_section ...
!> \param subsys_section ...
!> \param use_motion_section ...
!> \par History
!> 02.2012 created [noam]
!> \author Noam Bernstein
! **************************************************************************************************
SUBROUTINE qmmmx_env_create(qmmmx_env, root_section, para_env, globenv, &
force_env_section, subsys_section, use_motion_section)
TYPE(qmmmx_env_type), INTENT(OUT) :: qmmmx_env
TYPE(section_vals_type), POINTER :: root_section
TYPE(mp_para_env_type), POINTER :: para_env
TYPE(global_environment_type), POINTER :: globenv
TYPE(section_vals_type), POINTER :: force_env_section, subsys_section
LOGICAL, INTENT(IN) :: use_motion_section
TYPE(cp_subsys_type), POINTER :: subsys
TYPE(qmmm_env_type), POINTER :: dummy_qmmm_env
TYPE(section_vals_type), POINTER :: qmmm_core_section, &
qmmm_extended_section, qmmm_section
NULLIFY (dummy_qmmm_env)
qmmm_section => section_vals_get_subs_vals(force_env_section, "QMMM")
ALLOCATE (dummy_qmmm_env)
CALL qmmm_env_create(dummy_qmmm_env, root_section, para_env, globenv, &
force_env_section, qmmm_section, subsys_section, use_motion_section, &
ignore_outside_box=.TRUE.)
CALL qmmm_env_get(dummy_qmmm_env, subsys=subsys)
CALL update_force_mixing_labels(subsys, qmmm_section)
! using CUR_INDICES and CUR_LABELS, create appropriate QM_KIND sections for two QM/MM calculations
CALL setup_force_mixing_qmmm_sections(subsys, qmmm_section, qmmm_core_section, qmmm_extended_section)
ALLOCATE (qmmmx_env%core)
CALL qmmm_env_create(qmmmx_env%core, root_section, para_env, globenv, &
force_env_section, qmmm_core_section, subsys_section, use_motion_section, &
ignore_outside_box=.TRUE.)
ALLOCATE (qmmmx_env%ext)
CALL qmmm_env_create(qmmmx_env%ext, root_section, para_env, globenv, &
force_env_section, qmmm_extended_section, subsys_section, use_motion_section, &
ignore_outside_box=.TRUE.)
CALL section_vals_release(qmmm_core_section)
CALL section_vals_release(qmmm_extended_section)
CALL qmmm_env_release(dummy_qmmm_env)
DEALLOCATE (dummy_qmmm_env)
END SUBROUTINE qmmmx_env_create
END MODULE qmmmx_create