1 |
< |
!! Fortran interface to C entry plug. |
1 |
> |
! Fortran interface to C entry plug. |
2 |
|
|
3 |
|
module force_globals |
4 |
|
use definitions |
14 |
|
#ifdef IS_MPI |
15 |
|
real( kind = dp ), allocatable, dimension(:,:), public :: q_Row |
16 |
|
real( kind = dp ), allocatable, dimension(:,:), public :: q_Col |
17 |
+ |
real( kind = dp ), allocatable, dimension(:,:), public :: q_group_Row |
18 |
+ |
real( kind = dp ), allocatable, dimension(:,:), public :: q_group_Col |
19 |
|
real( kind = dp ), allocatable, dimension(:,:), public :: u_l_Row |
20 |
|
real( kind = dp ), allocatable, dimension(:,:), public :: u_l_Col |
21 |
|
real( kind = dp ), allocatable, dimension(:,:), public :: A_Row |
36 |
|
|
37 |
|
integer, allocatable, dimension(:), public :: atid_Row |
38 |
|
integer, allocatable, dimension(:), public :: atid_Col |
37 |
– |
#else |
38 |
– |
integer, allocatable, dimension(:), public :: atid |
39 |
|
#endif |
40 |
+ |
|
41 |
+ |
integer, allocatable, dimension(:), public :: atid |
42 |
+ |
|
43 |
|
real( kind = dp ), allocatable, dimension(:,:), public :: rf |
44 |
|
real(kind = dp), dimension(9), public :: tau_Temp = 0.0_dp |
45 |
|
real(kind = dp), public :: virial_Temp = 0.0_dp |
50 |
|
|
51 |
|
subroutine InitializeForceGlobals(nlocal, thisStat) |
52 |
|
integer, intent(out) :: thisStat |
53 |
< |
integer :: nrow, ncol |
53 |
> |
integer :: nAtomsInRow, nAtomsInCol |
54 |
> |
integer :: nGroupsInRow, nGroupsInCol |
55 |
|
integer :: nlocal |
56 |
|
integer :: ndim = 3 |
57 |
|
integer :: alloc_stat |
59 |
|
thisStat = 0 |
60 |
|
|
61 |
|
#ifdef IS_MPI |
62 |
< |
nrow = getNrow(plan_row) |
63 |
< |
ncol = getNcol(plan_col) |
62 |
> |
nAtomsInRow = getNatomsInRow(plan_atom_row) |
63 |
> |
nAtomsInCol = getNatomsInCol(plan_atom_col) |
64 |
> |
nGroupsInRow = getNgroupsInRow(plan_group_row) |
65 |
> |
nGroupsInCol = getNgroupsInCol(plan_group_col) |
66 |
> |
|
67 |
|
#endif |
68 |
|
|
69 |
|
call FreeForceGlobals() |
70 |
|
|
71 |
|
#ifdef IS_MPI |
72 |
|
|
73 |
< |
allocate(q_Row(ndim,nrow),stat=alloc_stat) |
73 |
> |
allocate(q_Row(ndim,nAtomsInRow),stat=alloc_stat) |
74 |
|
if (alloc_stat /= 0 ) then |
75 |
|
thisStat = -1 |
76 |
|
return |
77 |
|
endif |
78 |
|
|
79 |
< |
allocate(q_Col(ndim,ncol),stat=alloc_stat) |
79 |
> |
allocate(q_Col(ndim,nAtomsInCol),stat=alloc_stat) |
80 |
|
if (alloc_stat /= 0 ) then |
81 |
|
thisStat = -1 |
82 |
|
return |
83 |
|
endif |
84 |
+ |
|
85 |
+ |
allocate(q_group_Row(ndim,nGroupsInRow),stat=alloc_stat) |
86 |
+ |
if (alloc_stat /= 0 ) then |
87 |
+ |
thisStat = -1 |
88 |
+ |
return |
89 |
+ |
endif |
90 |
+ |
|
91 |
+ |
allocate(q_group_Col(ndim,nGroupsInCol),stat=alloc_stat) |
92 |
+ |
if (alloc_stat /= 0 ) then |
93 |
+ |
thisStat = -1 |
94 |
+ |
return |
95 |
+ |
endif |
96 |
|
|
97 |
< |
allocate(u_l_Row(ndim,nrow),stat=alloc_stat) |
97 |
> |
allocate(u_l_Row(ndim,nAtomsInRow),stat=alloc_stat) |
98 |
|
if (alloc_stat /= 0 ) then |
99 |
|
thisStat = -1 |
100 |
|
return |
101 |
|
endif |
102 |
|
|
103 |
< |
allocate(u_l_Col(ndim,ncol),stat=alloc_stat) |
103 |
> |
allocate(u_l_Col(ndim,nAtomsInCol),stat=alloc_stat) |
104 |
|
if (alloc_stat /= 0 ) then |
105 |
|
thisStat = -1 |
106 |
|
return |
107 |
|
endif |
108 |
|
|
109 |
< |
allocate(A_row(9,nrow),stat=alloc_stat) |
109 |
> |
allocate(A_row(9,nAtomsInRow),stat=alloc_stat) |
110 |
|
if (alloc_stat /= 0 ) then |
111 |
|
thisStat = -1 |
112 |
|
return |
113 |
|
endif |
114 |
|
|
115 |
< |
allocate(A_Col(9,ncol),stat=alloc_stat) |
115 |
> |
allocate(A_Col(9,nAtomsInCol),stat=alloc_stat) |
116 |
|
if (alloc_stat /= 0 ) then |
117 |
|
thisStat = -1 |
118 |
|
return |
119 |
|
endif |
120 |
|
|
121 |
< |
allocate(pot_row(nrow),stat=alloc_stat) |
121 |
> |
allocate(pot_row(nAtomsInRow),stat=alloc_stat) |
122 |
|
if (alloc_stat /= 0 ) then |
123 |
|
thisStat = -1 |
124 |
|
return |
125 |
|
endif |
126 |
|
|
127 |
< |
allocate(pot_Col(ncol),stat=alloc_stat) |
127 |
> |
allocate(pot_Col(nAtomsInCol),stat=alloc_stat) |
128 |
|
if (alloc_stat /= 0 ) then |
129 |
|
thisStat = -1 |
130 |
|
return |
136 |
|
return |
137 |
|
endif |
138 |
|
|
139 |
< |
allocate(f_Row(ndim,nrow),stat=alloc_stat) |
139 |
> |
allocate(f_Row(ndim,nAtomsInRow),stat=alloc_stat) |
140 |
|
if (alloc_stat /= 0 ) then |
141 |
|
thisStat = -1 |
142 |
|
return |
143 |
|
endif |
144 |
|
|
145 |
< |
allocate(f_Col(ndim,ncol),stat=alloc_stat) |
145 |
> |
allocate(f_Col(ndim,nAtomsInCol),stat=alloc_stat) |
146 |
|
if (alloc_stat /= 0 ) then |
147 |
|
thisStat = -1 |
148 |
|
return |
154 |
|
return |
155 |
|
endif |
156 |
|
|
157 |
< |
allocate(t_Row(ndim,nrow),stat=alloc_stat) |
157 |
> |
allocate(t_Row(ndim,nAtomsInRow),stat=alloc_stat) |
158 |
|
if (alloc_stat /= 0 ) then |
159 |
|
thisStat = -1 |
160 |
|
return |
161 |
|
endif |
162 |
|
|
163 |
< |
allocate(t_Col(ndim,ncol),stat=alloc_stat) |
163 |
> |
allocate(t_Col(ndim,nAtomsInCol),stat=alloc_stat) |
164 |
|
if (alloc_stat /= 0 ) then |
165 |
|
thisStat = -1 |
166 |
|
return |
172 |
|
return |
173 |
|
endif |
174 |
|
|
175 |
< |
allocate(atid_Row(nrow),stat=alloc_stat) |
175 |
> |
allocate(atid(nlocal),stat=alloc_stat) |
176 |
|
if (alloc_stat /= 0 ) then |
177 |
|
thisStat = -1 |
178 |
|
return |
179 |
|
endif |
180 |
|
|
181 |
< |
allocate(atid_Col(ncol),stat=alloc_stat) |
181 |
> |
|
182 |
> |
allocate(atid_Row(nAtomsInRow),stat=alloc_stat) |
183 |
|
if (alloc_stat /= 0 ) then |
184 |
|
thisStat = -1 |
185 |
|
return |
186 |
|
endif |
187 |
|
|
188 |
< |
allocate(rf_Row(ndim,nrow),stat=alloc_stat) |
188 |
> |
allocate(atid_Col(nAtomsInCol),stat=alloc_stat) |
189 |
|
if (alloc_stat /= 0 ) then |
190 |
|
thisStat = -1 |
191 |
|
return |
192 |
|
endif |
193 |
|
|
194 |
< |
allocate(rf_Col(ndim,ncol),stat=alloc_stat) |
194 |
> |
allocate(rf_Row(ndim,nAtomsInRow),stat=alloc_stat) |
195 |
|
if (alloc_stat /= 0 ) then |
196 |
|
thisStat = -1 |
197 |
|
return |
198 |
|
endif |
199 |
|
|
200 |
+ |
allocate(rf_Col(ndim,nAtomsInCol),stat=alloc_stat) |
201 |
+ |
if (alloc_stat /= 0 ) then |
202 |
+ |
thisStat = -1 |
203 |
+ |
return |
204 |
+ |
endif |
205 |
+ |
|
206 |
|
allocate(rf_Temp(ndim,nlocal),stat=alloc_stat) |
207 |
|
if (alloc_stat /= 0 ) then |
208 |
|
thisStat = -1 |
240 |
|
if (allocated(rf_Row)) deallocate(rf_Row) |
241 |
|
if (allocated(atid_Col)) deallocate(atid_Col) |
242 |
|
if (allocated(atid_Row)) deallocate(atid_Row) |
243 |
+ |
if (allocated(atid)) deallocate(atid) |
244 |
|
if (allocated(t_Temp)) deallocate(t_Temp) |
245 |
|
if (allocated(t_Col)) deallocate(t_Col) |
246 |
|
if (allocated(t_Row)) deallocate(t_Row) |
254 |
|
if (allocated(A_Row)) deallocate(A_Row) |
255 |
|
if (allocated(u_l_Col)) deallocate(u_l_Col) |
256 |
|
if (allocated(u_l_Row)) deallocate(u_l_Row) |
257 |
+ |
if (allocated(q_group_Col)) deallocate(q_group_Col) |
258 |
+ |
if (allocated(q_group_Row)) deallocate(q_group_Row) |
259 |
|
if (allocated(q_Col)) deallocate(q_Col) |
260 |
|
if (allocated(q_Row)) deallocate(q_Row) |
261 |
|
#else |