| 6 |
|
use force_globals |
| 7 |
|
use vector_class |
| 8 |
|
use atype_module |
| 9 |
– |
use lj |
| 9 |
|
#ifdef IS_MPI |
| 10 |
|
use mpiSimulation |
| 11 |
|
#endif |
| 104 |
|
|
| 105 |
|
call InitializeForceGlobals(natoms, thisStat) |
| 106 |
|
if (thisStat /= 0) then |
| 107 |
+ |
write(default_error,*) "SimSetup: InitializeForceGlobals error" |
| 108 |
|
status = -1 |
| 109 |
|
return |
| 110 |
|
endif |
| 111 |
|
|
| 112 |
|
call InitializeSimGlobals(thisStat) |
| 113 |
|
if (thisStat /= 0) then |
| 114 |
+ |
write(default_error,*) "SimSetup: InitializeSimGlobals error" |
| 115 |
|
status = -1 |
| 116 |
|
return |
| 117 |
|
endif |
| 169 |
|
enddo |
| 170 |
|
#endif |
| 171 |
|
|
| 171 |
– |
!! Create neighbor lists |
| 172 |
– |
call expandNeighborList(nComponents, thisStat) |
| 173 |
– |
if (thisStat /= 0) then |
| 174 |
– |
status = -1 |
| 175 |
– |
return |
| 176 |
– |
endif |
| 172 |
|
|
| 173 |
+ |
|
| 174 |
|
do i = 1, nExcludes_Local |
| 175 |
|
excludesLocal(1,i) = CexcludesLocal(1,i) |
| 176 |
|
excludesLocal(2,i) = CexcludesLocal(2,i) |
| 179 |
|
do i = 1, nExcludes_Global |
| 180 |
|
excludesGlobal(i) = CexcludesGlobal(i) |
| 181 |
|
enddo |
| 182 |
< |
|
| 182 |
> |
|
| 183 |
|
if (status == 0) simulation_setup_complete = .true. |
| 184 |
|
|
| 185 |
|
end subroutine SimulationSetup |
| 191 |
|
thisSim%box = new_box_size |
| 192 |
|
box = thisSim%box |
| 193 |
|
|
| 198 |
– |
smallest = 1 |
| 199 |
– |
do i = 2, 3 |
| 200 |
– |
if (new_box_size(i) .lt. new_box_size(smallest)) smallest = i |
| 201 |
– |
end do |
| 202 |
– |
if (thisSim%rcut .gt. 0.5_dp * new_box_size(smallest)) & |
| 203 |
– |
call setRcut(0.5_dp * new_box_size(smallest), status) |
| 194 |
|
return |
| 195 |
|
end subroutine setBox_3d |
| 196 |
|
|
| 199 |
|
real(kind=dp) :: new_box_size |
| 200 |
|
thisSim%box(dim) = new_box_size |
| 201 |
|
box(dim) = thisSim%box(dim) |
| 212 |
– |
if (thisSim%rcut .gt. 0.5_dp * new_box_size) & |
| 213 |
– |
call setRcut(0.5_dp * new_box_size, status) |
| 202 |
|
end subroutine setBox_1d |
| 203 |
|
|
| 204 |
|
subroutine setRcut(new_rcut, status) |
| 207 |
|
thisSim%rcut = new_rcut |
| 208 |
|
rcut2 = thisSim%rcut * thisSim%rcut |
| 209 |
|
rcut6 = rcut2 * rcut2 * rcut2 |
| 222 |
– |
myStatus = 0 |
| 223 |
– |
call LJ_new_rcut(new_rcut, myStatus) |
| 224 |
– |
if (myStatus .ne. 0) then |
| 225 |
– |
write(default_error, *) 'LJ module refused our rcut!' |
| 226 |
– |
status = -1 |
| 227 |
– |
return |
| 228 |
– |
endif |
| 210 |
|
status = 0 |
| 211 |
|
return |
| 212 |
|
end subroutine setRcut |
| 261 |
|
function getRrf() result(rrf) |
| 262 |
|
real( kind = dp ) :: rrf |
| 263 |
|
rrf = thisSim%rrf |
| 264 |
+ |
write(*,*) 'getRrf = ', rrf, thisSim%rrf |
| 265 |
|
end function getRrf |
| 266 |
|
|
| 267 |
|
function getRt() result(rt) |