3 |
|
module simulation |
4 |
|
use definitions |
5 |
|
use neighborLists |
6 |
< |
use atype_typedefs |
6 |
> |
use atype_module |
7 |
|
#ifdef IS_MPI |
8 |
|
use mpiSimulation |
9 |
|
#endif |
40 |
|
real( kind = dp ), allocatable, dimension(:,:), public :: t_Row |
41 |
|
real( kind = dp ), allocatable, dimension(:,:), public :: t_Col |
42 |
|
real( kind = dp ), allocatable, dimension(:,:), public :: t_Temp |
43 |
+ |
real( kind = dp ), allocatable, dimension(:,:), public :: rf_Row |
44 |
+ |
real( kind = dp ), allocatable, dimension(:,:), public :: rf_Col |
45 |
+ |
|
46 |
|
integer, allocatable, dimension(:), public :: atid_Row |
47 |
|
integer, allocatable, dimension(:), public :: atid_Col |
48 |
|
#else |
49 |
+ |
real( kind = dp ), allocatable, dimension(:,:), public :: rf |
50 |
|
integer, allocatable, dimension(:), public :: atid |
51 |
|
#endif |
52 |
+ |
|
53 |
+ |
real(kind = dp), dimension(9), public :: tau_Temp = 0.0_dp |
54 |
+ |
real(kind = dp), public :: virial_Temp = 0.0_dp |
55 |
|
|
56 |
|
public :: SimulationSetup |
57 |
|
public :: getBox |
59 |
|
public :: getRlist |
60 |
|
public :: getRrf |
61 |
|
public :: getRt |
62 |
+ |
public :: getDielect |
63 |
|
public :: getNlocal |
64 |
|
public :: SimUsesPBC |
65 |
|
public :: SimUsesLJ |
253 |
|
real( kind = dp ) :: rt |
254 |
|
rt = thisSim%rt |
255 |
|
end function getRt |
256 |
+ |
|
257 |
+ |
function getDielect() result(dielect) |
258 |
+ |
real( kind = dp ) :: dielect |
259 |
+ |
dielect = thisSim%dielect |
260 |
+ |
end function getDielect |
261 |
|
|
262 |
|
pure function getNlocal() result(nlocal) |
263 |
|
integer :: nlocal |
299 |
|
doesit = thisSim%SIM_uses_EAM |
300 |
|
end function SimUsesEAM |
301 |
|
|
302 |
+ |
function SimUsesDirectionalAtoms() result(doesit) |
303 |
+ |
logical :: doesit |
304 |
+ |
doesit = thisSim%SIM_uses_dipoles .or. thisSim%SIM_uses_sticky .or. & |
305 |
+ |
thisSim%SIM_uses_GB .or. thisSim%SIM_uses_RF |
306 |
+ |
end function SimRequiresPrepairCalc |
307 |
+ |
|
308 |
|
function SimRequiresPrepairCalc() result(doesit) |
309 |
|
logical :: doesit |
310 |
|
doesit = thisSim%SIM_uses_EAM |
437 |
|
return |
438 |
|
endif |
439 |
|
|
440 |
+ |
allocate(rf_Row(ndim,nrow),stat=alloc_stat) |
441 |
+ |
if (alloc_stat /= 0 ) then |
442 |
+ |
thisStat = 0 |
443 |
+ |
return |
444 |
+ |
endif |
445 |
+ |
|
446 |
+ |
allocate(rf_Col(ndim,ncol),stat=alloc_stat) |
447 |
+ |
if (alloc_stat /= 0 ) then |
448 |
+ |
thisStat = 0 |
449 |
+ |
return |
450 |
+ |
endif |
451 |
+ |
|
452 |
+ |
|
453 |
|
#else |
454 |
|
|
455 |
|
allocate(atid(nlocal),stat=alloc_stat) |
458 |
|
return |
459 |
|
end if |
460 |
|
|
461 |
+ |
allocate(rf(ndim,nlocal),stat=alloc_stat) |
462 |
+ |
if (alloc_stat /= 0 ) then |
463 |
+ |
thisStat = 0 |
464 |
+ |
return |
465 |
+ |
endif |
466 |
+ |
|
467 |
|
#endif |
468 |
|
|
469 |
|
end subroutine setupGlobals |
473 |
|
!We free in the opposite order in which we allocate in. |
474 |
|
#ifdef IS_MPI |
475 |
|
|
476 |
+ |
if (allocated(rf_Col)) deallocate(rf_Col) |
477 |
+ |
if (allocated(rf_Row)) deallocate(rf_Row) |
478 |
|
if (allocated(atid_Col)) deallocate(atid_Col) |
479 |
|
if (allocated(atid_Row)) deallocate(atid_Row) |
480 |
|
if (allocated(t_Temp)) deallocate(t_Temp) |
495 |
|
|
496 |
|
#else |
497 |
|
|
498 |
+ |
if (allocated(rf)) deallocate(rf) |
499 |
|
if (allocated(atid)) deallocate(atid) |
500 |
|
|
501 |
|
#endif |