-
Notifications
You must be signed in to change notification settings - Fork 8
/
trove.f90
243 lines (234 loc) · 5.92 KB
/
trove.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
!
! TROVE program: theoretical rovibrational energies
! version 08.10.2006
!
module tp_module
use accuracy
use fields
use perturbation
use symmetry
use timer
use moltype, only: intensity
use dipole, only: dm_tranint,dm_analysis_density
use refinement, only : refinement_by_fit,external_expectation_values
use tran, only : TRconvert_matel_j0_eigen,TRconvert_repres_J0_to_contr
use extfield
implicit none
!
! Defining the calculations
!
!
integer, parameter :: verbose = 2 ! Verbosity level
!
contains
!
! Here we do the TROVE calculations
!
subroutine ptmain
!
integer(ik) :: NPTorder,Natoms,Nmodes,Npolyads
integer(ik) :: j
!type(FLbasissetT),pointer :: basisset(:) ! Basis set specifications: range and type
!
!type(FLbasissetT) :: rotbasis ! Rotational basis set specifications
!
! Begin with constants intitialization
!
call TimerStart('TROVE')
!
call accuracyInitialize
!
if (job%verbose>=4) then
write(out,"('spacing around 1.0 is ',d18.8)") spacing(1.0d0)
endif
!
!
! Here we define the molecular structure and potential function
!
! make sure that size(poten)>= size(pseudo)
!
call FLReadInput(NPTorder,Npolyads,Natoms,Nmodes,j)
!
! Rotation will be treated only for a given J
!
!j = basisset(0)%range(1)
!
call FLsetMolecule
!
! Intensity calculations
!
if (intensity%do) then
!
!call FLbsetInit
!call FLinitilize_Kinetic
!call FLinitilize_Potential
!call FLinit_External_field
call PTinit(NPTorder,Nmodes,Npolyads)
!
if (job%rotsym_do) call PT_conctracted_rotational_bset(j)
!
if (trim(intensity%action)=='FIELD_ME') then
call emf2_matelem
else
call dm_tranint
endif
!
return
!
endif
!
if (action%fitting) then
!
call PTinit(NPTorder,Nmodes,Npolyads)
!
!call FLinitilize_Kinetic
!call FLinitilize_Potential
!call FLinit_External_field
!call FLbsetInit
!
call refinement_by_fit
!
if (job%verbose>=2) then
write(out,"(/'The End of TROVE-Fit')")
endif
!
return
!
endif
!
! Here we define the kinetic operator functions g_vib,g_rot,g_cor,pseudo and also potential function
!
call FLinitilize_Kinetic
!
! Here we initialize the potential energy field
!
if (job%Potential_Simple) then
call FLinitilize_Potential_II
else
call FLinitilize_Potential
end if
!
! Here we initialize the dipole moment field (if needed)
!
call FLinit_External_field
!
! Store the expansion coefficients of Hamiltonian
!
if (trim(trove%IO_hamiltonian)=='SAVE') call FLcheck_point_Hamiltonian('HAMILTONIAN_SAVE')
!
!
! Classical analysis of the Hamiltonian
!
if (analysis%classical) then
!
call FL_rotation_energy_surface
return
!
endif
!
! Initialization of the basis set
!
call FLbsetInit
!
! Here we initialize the PT elements, such as Nclasses, Nspecies, etc
!
call PTinit(NPTorder,Nmodes,Npolyads)
!
! Analysis of the density
!
if (analysis%extF) then
call external_expectation_values
return
endif
!
if (analysis%density) then
call dm_analysis_density
!call PTanalysis_density(j)
return
endif
!
! Copy matrix elements from the FIELD to PT modules
!
call PTget_primitive_matelements(j)
!
! Restoring the contracted basis set vectors from the check point:
!
if (trim(job%IOcontr_action)=='READ') then
!
call PTcheck_point_contracted_space('READ')
!
elseif (action%convert_vibme) then
!
call TRconvert_repres_J0_to_contr(j)
!
else
!
call PTcontracted_prediagonalization(j)
!
endif
!
! The rotational part of the contracted basis set to finish its constraction:
!
call PT_conctracted_rotational_bset(j)
!
call PTsymmetrization(j)
!
!if (trove%DVR) call PTDVR_contracted_bases(j)
!
! This type of diagonalization is obsolete: if (job%global_contract) call PTDiagonalize_hamiltonian_symm(j,nroots)
!
! Convert the J=0 basis set and mat.elements to the contracted represent.
!
if (action%convert_vibme) then
call TRconvert_matel_j0_eigen(j)
return
endif
!
if (job%contrci_me_fast) then
!
call PTstore_contr_matelem(j)
call PTcontracted_matelem_class_fast(j)
!
!call PTstore_contr_matelem_II(j)
!
!call PTcontracted_matelem_class_fast_II(j)
!
else
!
call PTcontracted_matelem_class(j)
!
endif
!
call PThamiltonian_contract(j)
!
! convert to j=0 representation as part of the first step j=0 calculation
!
if (job%convert_model_j0) then
!
call TRconvert_repres_J0_to_contr(j)
call TRconvert_matel_j0_eigen(j)
!
endif
!
call TimerStop('TROVE')
!
call MemoryReport
!
call TimerReport
!
if (job%verbose>=2) then
write(out,"(/'End of TROVE')")
endif
!
end subroutine ptmain
end module tp_module
!
program driver
!
use tp_module
!call ompaffinity()
call ptmain
end program driver
!
! S.N. Yurchenko, s.yurchenko@ucl.ac.uk
!