--- trunk/OOPSE/libmdtools/notifyCutoffs.F90 2004/05/12 19:44:54 1169 +++ trunk/OOPSE/libmdtools/notifyCutoffs.F90 2004/06/04 14:59:27 1239 @@ -6,48 +6,64 @@ module notifyCutoffs use lj, only: setCutoffLJ use eam, only: setCutoffEAM use switcheroo, only: set_switch + use status implicit none PRIVATE + character(len = statusMsgSize) :: errMsg + #define __FORTRAN90 #include "fSwitchingFunction.h" - - public::cutoffNotify - contains + public::cutoffNotify + +contains + + subroutine cutoffNotify( this_rcut, this_rsw, this_rlist ) - subroutine cutoffNotify( this_rcut, this_rsw, this_rlist ) - - real(kind=dp), intent(in) :: this_rcut, this_rsw, this_rlist + real(kind=dp), intent(in) :: this_rcut, this_rsw, this_rlist + + real(kind=dp) :: rsw, rcut, rlist + integer :: localError + logical :: do_shift + + rcut = this_rcut + rsw = this_rsw + rlist = this_rlist + + if (rcut .lt. rsw) then + + write(errMsg, *) 'cutoffRadius is ', rcut, newline // tab, & + 'but switchingRadius is set larger at ', rsw , newline // tab, & + 'That is probably not what you wanted to do!' + + call handleWarning("cutoffNotify", errMsg) - real(kind=dp) :: rsw, rcut, rlist - integer :: localError - logical :: do_shift - - rcut = this_rcut - rsw = this_rsw - rlist = this_rlist - - if (rcut .lt. rsw) then - write(*,*) 'cutoffNotify warning: cutoffRadius is ', rcut - write(*,*) ' but switchingRadius is set larger at ', rsw - write(*,*) ' That is probably not what you wanted to do!' endif - + if (rlist .lt. rcut) then - write(*,*) 'cutoffNotify warning: neighborListRadius is ', rlist - write(*,*) ' but cutoffRadius is set larger at ', rcut - write(*,*) ' That is probably a programming error!' + + write(errMsg, *) 'neighborListRadius is ', rlist, newline & + // tab, 'but cutoffRadius is set larger at ', rcut , newline & + // tab, 'That is probably a programming error!' + + call handleWarning("cutoffNotify", errMsg) + endif - + do_shift = .false. if (abs(rcut-rsw) .lt. 0.0001) then - write(*,*) 'cutoffNotify info: cutoffRadius and switchingRadius' - write(*,*) ' are set to the same value. OOPSE will use' - write(*,*) ' shifted Lennard-Jones potentials instead of' - write(*,*) ' switching functions.' + + write(errMsg, *) 'cutoffRadius and switchingRadius', newline & + // tab, 'are set to the same value. OOPSE will use', newline & + // tab, 'shifted Lennard-Jones potentials instead of', newline & + // tab, 'switching functions.' + + call handleInfo("cutoffNotify", errMsg) + do_shift = .true. + endif call setRlistDF( rlist )