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

Comparing trunk/OOPSE/libmdtools/calc_LJ_FF.F90 (file contents):
Revision 625 by chuckv, Wed Jul 16 16:40:03 2003 UTC vs.
Revision 626 by mmeineke, Wed Jul 16 21:30:56 2003 UTC

# Line 2 | Line 2
2   !! Corresponds to the force field defined in lj_FF.cpp
3   !! @author Charles F. Vardeman II
4   !! @author Matthew Meineke
5 < !! @version $Id: calc_LJ_FF.F90,v 1.9 2003-07-16 16:40:03 chuckv Exp $, $Date: 2003-07-16 16:40:03 $, $Name: not supported by cvs2svn $, $Revision: 1.9 $
5 > !! @version $Id: calc_LJ_FF.F90,v 1.10 2003-07-16 21:30:54 mmeineke Exp $, $Date: 2003-07-16 21:30:54 $, $Name: not supported by cvs2svn $, $Revision: 1.10 $
6  
7   module lj
8    use definitions
# Line 22 | Line 22 | module lj
22  
23    integer, save :: LJ_Mixing_Policy
24    real(kind=DP), save :: LJ_rcut
25 +  logical, save :: havePolicy = .false., haveCut = .false.
26 +
27    
28    !! Logical has lj force field module been initialized?
29    
# Line 29 | Line 31 | module lj
31    
32    !! Public methods and data
33    public :: init_LJ_FF
34 <  public :: LJ_new_rcut
34 >  public :: setCutoffLJ
35    public :: do_lj_pair
36    
37    type :: lj_mixed_params
# Line 45 | Line 47 | module lj
47  
48       real ( kind = dp )  :: delta  = 0.0_dp
49  
50 +
51    end type lj_mixed_params
52    
53    type (lj_mixed_params), dimension(:,:), pointer :: ljMixed
54    
55   contains
56  
57 <  subroutine init_LJ_FF(mix_Policy, rcut, status)
57 >  subroutine init_LJ_FF(mix_Policy, status)
58      integer, intent(in) :: mix_Policy
59      integer, intent(out) :: status
60      integer :: myStatus
58    real(kind=dp) :: rcut
61      
62      if (mix_Policy == LB_MIXING_RULE) then
63         LJ_Mixing_Policy = LB_MIXING_RULE
# Line 68 | Line 70 | contains
70            return
71         endif
72      endif
71    
72    LJ_rcut = rcut
73  
74 <    status = 0
75 <    call createMixingList(myStatus)
76 <    if (myStatus /= 0) then
77 <       status = -1
78 <       return
74 >    havePolicy = .true.
75 >
76 >    if (haveCut) then
77 >       status = 0
78 >       call createMixingList(myStatus)
79 >       if (myStatus /= 0) then
80 >          status = -1
81 >          return
82 >       end if
83 >      
84 >       LJ_FF_initialized = .true.
85      end if
86 <    
81 <    LJ_FF_initialized = .true.
82 <    
86 >  
87    end subroutine init_LJ_FF
88    
89 <  subroutine LJ_new_rcut(rcut, status)
89 >  subroutine setCutoffLJ(rcut, status)
90      integer :: status, myStatus
91      real(kind=dp) :: rcut
92      
93      status = 0
94  
95 <    if ( rcut .ne. LJ_rcut ) then
96 <       LJ_rcut = rcut
95 >    LJ_rcut = rcut
96 >    haveCut = .true.
97 >
98 >    if (havePolicy) then
99 >       status = 0
100         call createMixingList(myStatus)
101         if (myStatus /= 0) then
102            status = -1
103            return
104         end if
105 <    endif
105 >      
106 >       LJ_FF_initialized = .true.
107 >    end if    
108      
100    
109      return
110 <  end subroutine LJ_new_rcut
110 >  end subroutine setCutoffLJ
111    
112    subroutine createMixingList(status)
113      integer :: nAtypes

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines