--- trunk/OOPSE/libmdtools/notifyCutoffs.F90 2004/06/04 02:38:23 1233 +++ trunk/OOPSE/libmdtools/notifyCutoffs.F90 2004/06/04 14:59:27 1239 @@ -6,74 +6,62 @@ 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" -#include "simError.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) :: rsw, rcut, rlist - integer :: localError - logical :: do_shift - - rcut = this_rcut - rsw = this_rsw - rlist = this_rlist - - if (rcut .lt. rsw) then - - write(painCave%errMsg, *) 'cutoffRadius is ', rcut, & - achar(10) // achar(9), & - 'but switchingRadius is set larger at ', rsw , & - achar(10) // achar(9) , & - 'That is probably not what you wanted to do!', & - achar(10) // achar(0) + 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!' - painCave%severity = OOPSE_WARNING - painCave%isFatal = .false. - call c_simError(painCave) + call handleWarning("cutoffNotify", errMsg) endif - + if (rlist .lt. rcut) then - write(painCave%errMsg, *) 'neighborListRadius is ', rlist, & - achar(10) // achar(9), & - 'but cutoffRadius is set larger at ', rcut , & - achar(10) // achar(9) , & - 'That is probably a programming error!', & - achar(10) // achar(0) - painCave%severity = OOPSE_WARNING - painCave%isFatal = .false. - call c_simError(painCave) - + 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(painCave%errMsg,*) 'cutoffRadius and switchingRadius', & - achar(10) // achar(9), & - 'are set to the same value. OOPSE will use', & - achar(10) // achar(9), & - 'shifted Lennard-Jones potentials instead of', & - achar(10) // achar(9), & - 'switching functions.', & - achar(10) // achar(0) - painCave%severity = OOPSE_INFO - painCave%isFatal = .false. - call c_simError(painCave) + 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