1 |
tim |
1498 |
module notifyCutoffs |
2 |
|
|
|
3 |
|
|
use definitions |
4 |
|
|
use do_Forces, only: setRlistDF |
5 |
|
|
use reaction_field, only: setCutoffsRF |
6 |
|
|
use lj, only: setCutoffLJ |
7 |
|
|
use eam, only: setCutoffEAM |
8 |
|
|
use switcheroo, only: set_switch |
9 |
|
|
use status |
10 |
|
|
implicit none |
11 |
|
|
|
12 |
|
|
PRIVATE |
13 |
|
|
|
14 |
|
|
character(len = statusMsgSize) :: errMsg |
15 |
|
|
|
16 |
|
|
#define __FORTRAN90 |
17 |
|
|
#include "UseTheForce/fSwitchingFunction.h" |
18 |
|
|
|
19 |
|
|
public::cutoffNotify |
20 |
|
|
|
21 |
|
|
contains |
22 |
|
|
|
23 |
|
|
subroutine cutoffNotify( this_rcut, this_rsw, this_rlist ) |
24 |
|
|
|
25 |
|
|
real(kind=dp), intent(in) :: this_rcut, this_rsw, this_rlist |
26 |
|
|
|
27 |
|
|
real(kind=dp) :: rsw, rcut, rlist |
28 |
|
|
integer :: localError |
29 |
|
|
logical :: do_shift |
30 |
|
|
|
31 |
|
|
rcut = this_rcut |
32 |
|
|
rsw = this_rsw |
33 |
|
|
rlist = this_rlist |
34 |
|
|
|
35 |
|
|
if (rcut .lt. rsw) then |
36 |
|
|
|
37 |
|
|
write(errMsg, *) 'cutoffRadius is ', rcut, newline // tab, & |
38 |
|
|
'but switchingRadius is set larger at ', rsw , newline // tab, & |
39 |
|
|
'That is probably not what you wanted to do!' |
40 |
|
|
|
41 |
|
|
call handleWarning("cutoffNotify", errMsg) |
42 |
|
|
|
43 |
|
|
endif |
44 |
|
|
|
45 |
|
|
if (rlist .lt. rcut) then |
46 |
|
|
|
47 |
|
|
write(errMsg, *) 'neighborListRadius is ', rlist, newline & |
48 |
|
|
// tab, 'but cutoffRadius is set larger at ', rcut , newline & |
49 |
|
|
// tab, 'That is probably a programming error!' |
50 |
|
|
|
51 |
|
|
call handleWarning("cutoffNotify", errMsg) |
52 |
|
|
|
53 |
|
|
endif |
54 |
|
|
|
55 |
|
|
do_shift = .false. |
56 |
|
|
if (abs(rcut-rsw) .lt. 0.0001) then |
57 |
|
|
|
58 |
|
|
write(errMsg, *) & |
59 |
|
|
'cutoffRadius and switchingRadius are set to the same', newline & |
60 |
|
|
// tab, 'value. OOPSE will use shifted Lennard-Jones', newline & |
61 |
|
|
// tab, 'potentials instead of switching functions.' |
62 |
|
|
|
63 |
|
|
call handleInfo("cutoffNotify", errMsg) |
64 |
|
|
|
65 |
|
|
do_shift = .true. |
66 |
|
|
|
67 |
|
|
endif |
68 |
|
|
|
69 |
|
|
call setRlistDF( rlist ) |
70 |
|
|
call setCutoffsRF( rcut, rsw ) |
71 |
|
|
call setCutoffLJ( rcut, do_shift, localError ) |
72 |
|
|
call setCutoffEAM( rcut, localError) |
73 |
|
|
call set_switch(GROUP_SWITCH, rsw, rcut) |
74 |
|
|
|
75 |
|
|
end subroutine cutoffNotify |
76 |
|
|
|
77 |
|
|
end module notifyCutoffs |