62 |
|
real( kind = dp ), allocatable, dimension(:,:), public :: eFrame_Col |
63 |
|
real( kind = dp ), allocatable, dimension(:,:), public :: A_Row |
64 |
|
real( kind = dp ), allocatable, dimension(:,:), public :: A_Col |
65 |
< |
|
65 |
> |
|
66 |
|
real( kind = dp ), allocatable, dimension(:), public :: pot_Row |
67 |
|
real( kind = dp ), allocatable, dimension(:), public :: pot_Col |
68 |
|
real( kind = dp ), allocatable, dimension(:), public :: pot_Temp |
85 |
|
real( kind = dp ), allocatable, dimension(:,:), public :: rf |
86 |
|
real(kind = dp), dimension(9), public :: tau_Temp = 0.0_dp |
87 |
|
real(kind = dp), public :: virial_Temp = 0.0_dp |
88 |
< |
|
88 |
> |
|
89 |
|
public :: InitializeForceGlobals |
90 |
< |
|
90 |
> |
|
91 |
|
contains |
92 |
< |
|
92 |
> |
|
93 |
|
subroutine InitializeForceGlobals(nlocal, thisStat) |
94 |
|
integer, intent(out) :: thisStat |
95 |
|
integer :: nAtomsInRow, nAtomsInCol |
97 |
|
integer :: nlocal |
98 |
|
integer :: ndim = 3 |
99 |
|
integer :: alloc_stat |
100 |
< |
|
100 |
> |
|
101 |
|
thisStat = 0 |
102 |
< |
|
102 |
> |
|
103 |
|
#ifdef IS_MPI |
104 |
|
nAtomsInRow = getNatomsInRow(plan_atom_row) |
105 |
|
nAtomsInCol = getNatomsInCol(plan_atom_col) |
106 |
|
nGroupsInRow = getNgroupsInRow(plan_group_row) |
107 |
|
nGroupsInCol = getNgroupsInCol(plan_group_col) |
108 |
< |
|
108 |
> |
|
109 |
|
#endif |
110 |
< |
|
110 |
> |
|
111 |
|
call FreeForceGlobals() |
112 |
< |
|
112 |
> |
|
113 |
|
#ifdef IS_MPI |
114 |
|
|
115 |
|
allocate(q_Row(ndim,nAtomsInRow),stat=alloc_stat) |
117 |
|
thisStat = -1 |
118 |
|
return |
119 |
|
endif |
120 |
< |
|
120 |
> |
|
121 |
|
allocate(q_Col(ndim,nAtomsInCol),stat=alloc_stat) |
122 |
|
if (alloc_stat /= 0 ) then |
123 |
|
thisStat = -1 |
129 |
|
thisStat = -1 |
130 |
|
return |
131 |
|
endif |
132 |
< |
|
132 |
> |
|
133 |
|
allocate(q_group_Col(ndim,nGroupsInCol),stat=alloc_stat) |
134 |
|
if (alloc_stat /= 0 ) then |
135 |
|
thisStat = -1 |
136 |
|
return |
137 |
|
endif |
138 |
< |
|
138 |
> |
|
139 |
|
allocate(eFrame_Row(9,nAtomsInRow),stat=alloc_stat) |
140 |
|
if (alloc_stat /= 0 ) then |
141 |
|
thisStat = -1 |
142 |
|
return |
143 |
|
endif |
144 |
< |
|
144 |
> |
|
145 |
|
allocate(eFrame_Col(9,nAtomsInCol),stat=alloc_stat) |
146 |
|
if (alloc_stat /= 0 ) then |
147 |
|
thisStat = -1 |
148 |
|
return |
149 |
|
endif |
150 |
< |
|
150 |
> |
|
151 |
|
allocate(A_row(9,nAtomsInRow),stat=alloc_stat) |
152 |
|
if (alloc_stat /= 0 ) then |
153 |
|
thisStat = -1 |
154 |
|
return |
155 |
|
endif |
156 |
< |
|
156 |
> |
|
157 |
|
allocate(A_Col(9,nAtomsInCol),stat=alloc_stat) |
158 |
|
if (alloc_stat /= 0 ) then |
159 |
|
thisStat = -1 |
160 |
|
return |
161 |
|
endif |
162 |
< |
|
162 |
> |
|
163 |
|
allocate(pot_row(nAtomsInRow),stat=alloc_stat) |
164 |
|
if (alloc_stat /= 0 ) then |
165 |
|
thisStat = -1 |
166 |
|
return |
167 |
|
endif |
168 |
< |
|
168 |
> |
|
169 |
|
allocate(pot_Col(nAtomsInCol),stat=alloc_stat) |
170 |
|
if (alloc_stat /= 0 ) then |
171 |
|
thisStat = -1 |
177 |
|
thisStat = -1 |
178 |
|
return |
179 |
|
endif |
180 |
< |
|
180 |
> |
|
181 |
|
allocate(f_Row(ndim,nAtomsInRow),stat=alloc_stat) |
182 |
|
if (alloc_stat /= 0 ) then |
183 |
|
thisStat = -1 |
184 |
|
return |
185 |
|
endif |
186 |
< |
|
186 |
> |
|
187 |
|
allocate(f_Col(ndim,nAtomsInCol),stat=alloc_stat) |
188 |
|
if (alloc_stat /= 0 ) then |
189 |
|
thisStat = -1 |
190 |
|
return |
191 |
|
endif |
192 |
< |
|
192 |
> |
|
193 |
|
allocate(f_Temp(ndim,nlocal),stat=alloc_stat) |
194 |
|
if (alloc_stat /= 0 ) then |
195 |
|
thisStat = -1 |
196 |
|
return |
197 |
|
endif |
198 |
< |
|
198 |
> |
|
199 |
|
allocate(t_Row(ndim,nAtomsInRow),stat=alloc_stat) |
200 |
|
if (alloc_stat /= 0 ) then |
201 |
|
thisStat = -1 |
202 |
|
return |
203 |
|
endif |
204 |
< |
|
204 |
> |
|
205 |
|
allocate(t_Col(ndim,nAtomsInCol),stat=alloc_stat) |
206 |
|
if (alloc_stat /= 0 ) then |
207 |
|
thisStat = -1 |
260 |
|
end if |
261 |
|
|
262 |
|
#endif |
263 |
< |
|
263 |
> |
|
264 |
|
allocate(rf(ndim,nlocal),stat=alloc_stat) |
265 |
|
if (alloc_stat /= 0 ) then |
266 |
|
thisStat = -1 |
270 |
|
force_globals_initialized = .true. |
271 |
|
|
272 |
|
end subroutine InitializeForceGlobals |
273 |
< |
|
273 |
> |
|
274 |
|
subroutine FreeForceGlobals() |
275 |
< |
|
275 |
> |
|
276 |
|
!We free in the opposite order in which we allocate in. |
277 |
< |
|
277 |
> |
|
278 |
|
if (allocated(rf)) deallocate(rf) |
279 |
|
#ifdef IS_MPI |
280 |
|
if (allocated(rf_Temp)) deallocate(rf_Temp) |
303 |
|
#else |
304 |
|
if (allocated(atid)) deallocate(atid) |
305 |
|
#endif |
306 |
< |
|
306 |
> |
|
307 |
|
end subroutine FreeForceGlobals |
308 |
< |
|
308 |
> |
|
309 |
|
end module force_globals |