19 |
|
logical, save :: simulation_setup_complete = .false. |
20 |
|
|
21 |
|
integer :: natoms |
22 |
+ |
integer, public, save :: nExcludes_Global = 0 |
23 |
+ |
integer, public, save :: nExcludes_Local = 0 |
24 |
|
real(kind=dp), save :: rcut2 = 0.0_DP |
25 |
|
real(kind=dp), save :: rcut6 = 0.0_DP |
26 |
|
real(kind=dp), save :: rlist2 = 0.0_DP |
27 |
+ |
real(kind=dp), public, dimension(3), save :: box |
28 |
|
|
29 |
|
#ifdef IS_MPI |
30 |
|
real( kind = dp ), allocatable, dimension(:,:), public :: q_Row |
45 |
|
real( kind = dp ), allocatable, dimension(:,:), public :: t_Temp |
46 |
|
real( kind = dp ), allocatable, dimension(:,:), public :: rf_Row |
47 |
|
real( kind = dp ), allocatable, dimension(:,:), public :: rf_Col |
48 |
+ |
real( kind = dp ), allocatable, dimension(:,:), public :: rf_Temp |
49 |
|
|
50 |
|
integer, allocatable, dimension(:), public :: atid_Row |
51 |
|
integer, allocatable, dimension(:), public :: atid_Col |
52 |
|
#else |
49 |
– |
real( kind = dp ), allocatable, dimension(:,:), public :: rf |
53 |
|
integer, allocatable, dimension(:), public :: atid |
54 |
|
#endif |
55 |
< |
|
55 |
> |
real( kind = dp ), allocatable, dimension(:,:), public :: rf |
56 |
|
real(kind = dp), dimension(9), public :: tau_Temp = 0.0_dp |
57 |
|
real(kind = dp), public :: virial_Temp = 0.0_dp |
58 |
|
|
112 |
|
rcut2 = thisSim%rcut * thisSim%rcut |
113 |
|
rcut6 = rcut2 * rcut2 * rcut2 |
114 |
|
rlist2 = thisSim%rlist * thisSim%rlist |
115 |
+ |
box = thisSim%box |
116 |
|
|
117 |
|
#ifdef IS_MPI |
118 |
|
! We can only set up forces if mpiSimulation has been setup. |
199 |
|
subroutine change_box_size(new_box_size) |
200 |
|
real(kind=dp), dimension(3) :: new_box_size |
201 |
|
thisSim%box = new_box_size |
202 |
+ |
box = thisSim%box |
203 |
|
end subroutine change_box_size |
204 |
|
|
205 |
|
function getBox_3d() result(thisBox) |
308 |
|
logical :: doesit |
309 |
|
doesit = thisSim%SIM_uses_dipoles .or. thisSim%SIM_uses_sticky .or. & |
310 |
|
thisSim%SIM_uses_GB .or. thisSim%SIM_uses_RF |
311 |
< |
end function SimRequiresPrepairCalc |
311 |
> |
end function SimUsesDirectionalAtoms |
312 |
|
|
313 |
|
function SimRequiresPrepairCalc() result(doesit) |
314 |
|
logical :: doesit |
454 |
|
return |
455 |
|
endif |
456 |
|
|
457 |
+ |
allocate(rf_Temp(ndim,nlocal),stat=alloc_stat) |
458 |
+ |
if (alloc_stat /= 0 ) then |
459 |
+ |
thisStat = 0 |
460 |
+ |
return |
461 |
+ |
endif |
462 |
|
|
463 |
+ |
|
464 |
|
#else |
465 |
|
|
466 |
|
allocate(atid(nlocal),stat=alloc_stat) |
469 |
|
return |
470 |
|
end if |
471 |
|
|
472 |
+ |
#endif |
473 |
+ |
|
474 |
|
allocate(rf(ndim,nlocal),stat=alloc_stat) |
475 |
|
if (alloc_stat /= 0 ) then |
476 |
|
thisStat = 0 |
477 |
|
return |
478 |
|
endif |
479 |
|
|
467 |
– |
#endif |
468 |
– |
|
480 |
|
end subroutine setupGlobals |
481 |
|
|
482 |
|
subroutine freeGlobals() |
483 |
|
|
484 |
|
!We free in the opposite order in which we allocate in. |
474 |
– |
#ifdef IS_MPI |
485 |
|
|
486 |
+ |
if (allocated(rf)) deallocate(rf) |
487 |
+ |
#ifdef IS_MPI |
488 |
+ |
if (allocated(rf_Temp)) deallocate(rf_Temp) |
489 |
|
if (allocated(rf_Col)) deallocate(rf_Col) |
490 |
|
if (allocated(rf_Row)) deallocate(rf_Row) |
491 |
|
if (allocated(atid_Col)) deallocate(atid_Col) |
504 |
|
if (allocated(u_l_Col)) deallocate(u_l_Col) |
505 |
|
if (allocated(u_l_Row)) deallocate(u_l_Row) |
506 |
|
if (allocated(q_Col)) deallocate(q_Col) |
507 |
< |
if (allocated(q_Row)) deallocate(q_Row) |
508 |
< |
|
509 |
< |
#else |
497 |
< |
|
498 |
< |
if (allocated(rf)) deallocate(rf) |
499 |
< |
if (allocated(atid)) deallocate(atid) |
500 |
< |
|
507 |
> |
if (allocated(q_Row)) deallocate(q_Row) |
508 |
> |
#else |
509 |
> |
if (allocated(atid)) deallocate(atid) |
510 |
|
#endif |
511 |
|
|
512 |
|
end subroutine freeGlobals |