-
Notifications
You must be signed in to change notification settings - Fork 0
/
qmmm_qmtheorymodule.F90
261 lines (232 loc) · 8.58 KB
/
qmmm_qmtheorymodule.F90
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
module qmmm_qmtheorymodule
! ----------------------------------------------------------------------
! PURPOSE: Data type defining the theory we are running
!
! Author: Andreas W. Goetz
! <agoetz@sdsc.edu>
! Date : February 2010
! ----------------------------------------------------------------------
implicit none
private
public :: qmTheoryType
public :: Set, String
#ifdef MPI
public :: Broadcast
#endif
public :: CheckRetiredQmTheoryInputOption ! This is legacy
type qmTheoryType
logical PM3
logical AM1
logical AM1DHFR
logical AM1D ! This is AM1/d (with d orbitals), *NOT* AM1-D (with dispersion correction)
logical MNDO
logical MNDOD ! This is MNDO/d
logical PDDGPM3
logical PDDGMNDO
logical PM3CARB1
logical PM3ZNB
logical DFTB3
logical DFTB
logical RM1
logical PDDGPM3_08
logical PM6
logical DISPERSION ! This is the D correction (dispersion)
logical DISPERSION_HYDROGENPLUS ! This is the DH+ correction (dispersion and hydrogen bond)
logical PM3MAIS
logical EXTERN !External interface to ADF/GAMESS/Gaussian/TeraChem
logical QUICKHF !Interface to the Quick quantum chemistry package (HF only)
logical SEBOMD !External interface to SEBOMD: full QM calculation (no QM/MM)
end type qmTheoryType
interface Set
module procedure SetQmTheoryType
end interface
interface String
module procedure QmTheoryString
end interface
#ifdef MPI
interface Broadcast
module procedure BroadcastQmTheoryType
end interface
#endif
contains
! --------------------------
! Check retired input option
! --------------------------
subroutine CheckRetiredQmTheoryInputOption(qmtheory)
use constants, only : RETIRED_INPUT_OPTION
implicit none
integer, intent(in) :: qmtheory
if ( qmtheory /= RETIRED_INPUT_OPTION ) then
call sander_bomb('read_qmmm_nm_and_alloc','qmtheory is specified in the qmmm namelist.', &
'It is deprecated, please use qm_theory.')
end if
end subroutine CheckRetiredQmTheoryInputOption
! ---------------------------------------------------------
! Set the QM theory type
! NOTE: We default to PM3 if none is given in the input !!!
! ---------------------------------------------------------
subroutine SetQmTheoryType(self, qm_theory)
use UtilitiesModule, only : Upcase
implicit none
type (qmTheoryType), intent(out) :: self
character(len=12), intent(in) :: qm_theory
self%PM3 = .false.
self%AM1 = .false.
self%AM1DHFR = .false.
self%AM1D = .false.
self%MNDO = .false.
self%MNDOD = .false.
self%PDDGPM3 = .false.
self%PDDGMNDO = .false.
self%PM3CARB1 = .false.
self%PM3ZNB = .false.
self%DFTB3 = .false.
self%DFTB = .false.
self%RM1 = .false.
self%PDDGPM3_08 = .false.
self%PM6 = .false.
self%DISPERSION = .false.
self%DISPERSION_HYDROGENPLUS = .false.
self%PM3MAIS = .false.
self%EXTERN = .false.
self%QUICKHF = .false.
self%SEBOMD = .false.
select case (Upcase(qm_theory))
case ('', 'PM3')
self%PM3 = .true.
case ('AM1')
self%AM1 = .true.
case ('AM1DHFR', 'AM1-DHFR', 'AM1_DHFR', 'AM1/DHFR')
self%AM1DHFR = .true.
case ('AM1_D*', 'AM1-D*')
self%AM1 = .true.
self%dispersion = .true.
case ('AM1_DH+', 'AM1-DH+')
self%AM1 = .true.
self%DISPERSION_HYDROGENPLUS = .true.
case ('AM1D', 'AM1_D', 'AM1/D')
self%AM1D = .true.
case ('MNDO')
self%MNDO = .true.
case ('MNDOD', 'MNDO_D', 'MNDO/D')
self%MNDOD = .true.
case ('PM3-PDDG', 'PM3PDDG', 'PM3_PDDG', 'PDDG-PM3', 'PDDGPM3', 'PDDG_PM3')
self%PDDGPM3 = .true.
case ('MNDO-PDDG', 'MNDOPDDG', 'MNDO_PDDG', 'PDDG-MNDO', 'PDDGMNDO', 'PDDG_MNDO')
self%PDDGMNDO = .true.
case ('PM3-CARB1', 'PM3CARB1', 'PM3_CARB1')
self%PM3CARB1 = .true.
case ('PM3ZNB', 'PM3-ZNB', 'PM3_ZNB', 'PM3/ZNB', 'ZNB')
self%PM3ZNB = .true.
case ('DFTB', 'SCCDFTB', 'SCC-DFTB', 'SCC_DFTB', 'DFTB2')
self%DFTB = .true.
case ('DFTB3')
self%DFTB3 = .true.
self%DFTB = .true.
case ('RM1')
self%RM1 = .true.
case ('PM3-PDDG08', 'PM3PDDG08', 'PM3_PDDG08', 'PDDG-PM308', 'PDDGPM308', 'PDDG_PM308', &
'PM3-PDDG-08', 'PDDGPM3_08', 'PDDG_PM3_08', 'PM3-PDDG_08')
self%PDDGPM3_08 = .true.
case ('PM6')
self%PM6 = .true.
case ('PM6_D', 'PM6-D')
self%PM6 = .true.
self%DISPERSION = .true.
case ('PM6_DH+', 'PM6-DH+')
self%PM6 = .true.
self%DISPERSION_HYDROGENPLUS = .true.
case ('PM3-MAIS', 'PM3MAIS', 'PM3_MAIS', 'MAIS')
self%PM3MAIS = .true.
case ('EXTERN')
self%EXTERN = .true.
case ('HF')
self%QUICKHF = .true.
! CHECK
! write(6, '(a)') '| Selection of Quick HF active.'
! END CHECK
case ('SEBOMD')
self%SEBOMD = .true.
case default
call sander_bomb('qmtheorymodule:SetQmTheoryType','Unknown method specified for qm_theory', &
'Valid options are: PM3, AM1, RM1, MNDO, PM3-PDDG, PM3-PDDG_08, MNDO-PDDG, PM3-CARB1, '&
//'PM3-ZNB, PM3-MAIS, AM1-D*, AM1-DH+, MNDO/D, AM1/D, PM6, PM6-D, PM6-DH+, DFTB, DFTB2, DFTB3 '&
//'SEBOMD (full QM) and EXTERN (external)')
end select
end subroutine SetQmTheoryType
! ---------------------------------
! Return string with QM theory type
! ---------------------------------
function QmTheoryString(self)
implicit none
type(qmTheoryType), intent(in) :: self
character(len=12) :: qmTheoryString
if (self%PM3) then
qmTheoryString = 'PM3'
else if (self%AM1) then
qmTheoryString = 'AM1'
else if (self%AM1DHFR) then
qmTheoryString = 'AM1/DHFR'
else if (self%AM1D) then
qmTheoryString = 'AM1/D'
else if (self%MNDO) then
qmTheoryString = 'MNDO'
else if (self%MNDOD) then
qmTheoryString = 'MNDO/D'
else if (self%PDDGPM3) then
qmTheoryString = 'PDDG/PM3'
else if (self%PDDGMNDO) then
qmTheoryString = 'PDDG/MNDO'
else if (self%PM3CARB1) then
qmTheoryString = 'PM3/CARB1'
else if (self%PM3ZNB) then
qmTheoryString = 'PM3/ZNB'
else if (self%DFTB3) then ! needs to come first, for DFTB3 both %DFTB3 and %DFTB are true
qmTheoryString = 'DFTB3'
else if (self%DFTB) then
qmTheoryString = 'DFTB'
else if (self%RM1) then
qmTheoryString = 'RM1'
else if (self%PDDGPM3_08) then
qmTheoryString = 'PDDG/PM3(08)'
else if (self%PM6) then
qmTheoryString = 'PM6'
else if (self%PM3MAIS) then
qmTheoryString = 'PM3-MAIS'
else if (self%EXTERN) then
qmTheoryString = 'EXTERN'
else if (self%QUICKHF) then
qmTheoryString = 'HF'
else if (self%SEBOMD) then
qmTheoryString = 'SEBOMD'
end if
end function QmTheoryString
#ifdef MPI
subroutine BroadcastQmTheoryType(self)
implicit none
#include "parallel.h"
include 'mpif.h'
type(qmTheoryType) :: self
integer :: ier
call mpi_bcast(self%PM3 , 1, mpi_logical, 0, commsander, ier)
call mpi_bcast(self%AM1 , 1, mpi_logical, 0, commsander, ier)
call mpi_bcast(self%AM1DHFR , 1, mpi_logical, 0, commsander, ier)
call mpi_bcast(self%AM1D , 1, mpi_logical, 0, commsander, ier)
call mpi_bcast(self%MNDO , 1, mpi_logical, 0, commsander, ier)
call mpi_bcast(self%MNDOD , 1, mpi_logical, 0, commsander, ier)
call mpi_bcast(self%PDDGPM3 , 1, mpi_logical, 0, commsander, ier)
call mpi_bcast(self%PDDGMNDO , 1, mpi_logical, 0, commsander, ier)
call mpi_bcast(self%PM3CARB1 , 1, mpi_logical, 0, commsander, ier)
call mpi_bcast(self%PM3ZNB , 1, mpi_logical, 0, commsander, ier)
call mpi_bcast(self%DFTB , 1, mpi_logical, 0, commsander, ier)
call mpi_bcast(self%DFTB3 , 1, mpi_logical, 0, commsander, ier)
call mpi_bcast(self%RM1 , 1, mpi_logical, 0, commsander, ier)
call mpi_bcast(self%PDDGPM3_08, 1, mpi_logical, 0, commsander, ier)
call mpi_bcast(self%PM6 , 1, mpi_logical, 0, commsander, ier)
call mpi_bcast(self%PM3MAIS , 1, mpi_logical, 0, commsander, ier)
call mpi_bcast(self%EXTERN , 1, mpi_logical, 0, commsander, ier)
call mpi_bcast(self%QUICKHF , 1, mpi_logical, 0, commsander, ier)
call mpi_bcast(self%SEBOMD , 1, mpi_logical, 0, commsander, ier)
end subroutine BroadcastQmTheoryType
#endif
end module qmmm_qmtheorymodule