| 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 "fSwitchingFunction.h" |
| 15 |
– |
#include "simError.h" |
| 16 |
– |
|
| 17 |
– |
public::cutoffNotify |
| 18 |
|
|
| 19 |
< |
contains |
| 19 |
> |
public::cutoffNotify |
| 20 |
> |
|
| 21 |
> |
contains |
| 22 |
> |
|
| 23 |
> |
subroutine cutoffNotify( this_rcut, this_rsw, this_rlist ) |
| 24 |
|
|
| 25 |
< |
subroutine cutoffNotify( this_rcut, this_rsw, this_rlist ) |
| 26 |
< |
|
| 27 |
< |
real(kind=dp), intent(in) :: this_rcut, this_rsw, this_rlist |
| 28 |
< |
|
| 29 |
< |
real(kind=dp) :: rsw, rcut, rlist |
| 30 |
< |
integer :: localError |
| 31 |
< |
logical :: do_shift |
| 32 |
< |
|
| 33 |
< |
rcut = this_rcut |
| 34 |
< |
rsw = this_rsw |
| 35 |
< |
rlist = this_rlist |
| 36 |
< |
|
| 37 |
< |
if (rcut .lt. rsw) then |
| 38 |
< |
|
| 39 |
< |
write(painCave%errMsg, *) 'cutoffRadius is ', rcut, & |
| 36 |
< |
achar(10) // achar(9), & |
| 37 |
< |
'but switchingRadius is set larger at ', rsw , & |
| 38 |
< |
achar(10) // achar(9) , & |
| 39 |
< |
'That is probably not what you wanted to do!', & |
| 40 |
< |
achar(10) // achar(0) |
| 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 |
< |
painCave%severity = OOPSE_WARNING |
| 43 |
< |
painCave%isFatal = .false. |
| 44 |
< |
call c_simError(painCave) |
| 41 |
> |
call handleWarning("cutoffNotify", errMsg) |
| 42 |
|
|
| 43 |
|
endif |
| 44 |
< |
|
| 44 |
> |
|
| 45 |
|
if (rlist .lt. rcut) then |
| 46 |
|
|
| 47 |
< |
write(painCave%errMsg, *) 'neighborListRadius is ', rlist, & |
| 48 |
< |
achar(10) // achar(9), & |
| 49 |
< |
'but cutoffRadius is set larger at ', rcut , & |
| 50 |
< |
achar(10) // achar(9) , & |
| 51 |
< |
'That is probably a programming error!', & |
| 52 |
< |
achar(10) // achar(0) |
| 56 |
< |
painCave%severity = OOPSE_WARNING |
| 57 |
< |
painCave%isFatal = .false. |
| 58 |
< |
call c_simError(painCave) |
| 59 |
< |
|
| 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 |
< |
|
| 54 |
> |
|
| 55 |
|
do_shift = .false. |
| 56 |
|
if (abs(rcut-rsw) .lt. 0.0001) then |
| 57 |
|
|
| 58 |
< |
write(painCave%errMsg,*) 'cutoffRadius and switchingRadius', & |
| 59 |
< |
achar(10) // achar(9), & |
| 60 |
< |
'are set to the same value. OOPSE will use', & |
| 61 |
< |
achar(10) // achar(9), & |
| 69 |
< |
'shifted Lennard-Jones potentials instead of', & |
| 70 |
< |
achar(10) // achar(9), & |
| 71 |
< |
'switching functions.', & |
| 72 |
< |
achar(10) // achar(0) |
| 73 |
< |
painCave%severity = OOPSE_INFO |
| 74 |
< |
painCave%isFatal = .false. |
| 75 |
< |
call c_simError(painCave) |
| 58 |
> |
write(errMsg, *) 'cutoffRadius and switchingRadius', newline & |
| 59 |
> |
// tab, 'are set to the same value. OOPSE will use', newline & |
| 60 |
> |
// tab, 'shifted Lennard-Jones potentials instead of', newline & |
| 61 |
> |
// tab, 'switching functions.' |
| 62 |
|
|
| 63 |
+ |
call handleInfo("cutoffNotify", errMsg) |
| 64 |
+ |
|
| 65 |
|
do_shift = .true. |
| 66 |
|
|
| 67 |
|
endif |