ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/notifyCutoffs.F90
(Generate patch)

Comparing trunk/OOPSE/libmdtools/notifyCutoffs.F90 (file contents):
Revision 1150 by gezelter, Fri May 7 21:35:05 2004 UTC vs.
Revision 1239 by gezelter, Fri Jun 4 14:59:27 2004 UTC

# Line 2 | Line 2 | module notifyCutoffs
2    
3    use definitions
4    use do_Forces, only:      setRlistDF
5  use charge_charge, only:  setCutoffsCharge
6  use dipole_dipole, only:  setCutoffsDipole
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 "fSwitchingFunction.h"
17  
18  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_rlist, this_ecr, this_est )
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 <      real(kind=dp), intent(in) :: this_rcut, this_rlist, this_ecr, this_est
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 <      real(kind=dp) :: rtaper, rcut, rlist, ecr
59 <      integer :: localError
60 <    
61 <      rcut   = this_rcut
30 <      rlist  = this_rlist
31 <      ecr    = this_ecr
32 <      rtaper = this_ecr - this_est
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 <      if ((rlist .lt. rcut) .or. (rlist .lt. ecr)) then
35 <         write(*,*) 'warning, rlist = ', rlist, ' but rcut, ecr = ', rcut, ecr
36 <      endif
63 >         call handleInfo("cutoffNotify", errMsg)
64  
65 <      call setRlistDF( rlist )
39 <      call setCutoffsCharge( ecr, rtaper )
40 <      call setCutoffsDipole( ecr, rtaper )
41 <      call setCutoffsRF( ecr, rtaper )
42 <      call setCutoffLJ( rcut, localError )
43 <      call setCutoffEAM(rcut, localError)
65 >         do_shift = .true.
66  
45      if (ecr.gt.rcut) then
46         call set_switch(GROUP_SWITCH, rtaper, ecr)
47      else
48         call set_switch(GROUP_SWITCH, rcut, rcut)
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  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines