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 653 by chuckv, Fri Jul 25 20:00:17 2003 UTC vs.
Revision 1270 by gezelter, Fri Jun 11 19:46:26 2004 UTC

# Line 2 | Line 2 | module notifyCutoffs
2    
3    use definitions
4    use do_Forces, only:      setRlistDF
5  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
12  
13  public::cutoffNotify
13  
14 <  contains
14 >  character(len = statusMsgSize) :: errMsg
15 >
16 > #define __FORTRAN90
17 > #include "fSwitchingFunction.h"
18 >
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 )
26 <      
27 <      real(kind=dp), intent(in) :: 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 <      real(kind=dp) :: rtaper, rcut, rlist, ecr
22 <      integer :: localError
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 <      rcut   = this_rcut
59 <      rlist  = this_rlist
60 <      ecr    = this_ecr
61 <      rtaper = this_ecr - this_est
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 setCutoffsDipole( ecr, rtaper )
71 <      call setCutoffsRF( ecr, rtaper )
72 <      call setCutoffLJ( rcut, localError )
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