ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/mdtools/md_code/lj_FF.F90
(Generate patch)

Comparing trunk/mdtools/md_code/lj_FF.F90 (file contents):
Revision 253 by chuckv, Thu Jan 30 15:20:21 2003 UTC vs.
Revision 258 by chuckv, Thu Jan 30 22:29:37 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: lj_FF.F90,v 1.13 2003-01-30 15:20:21 chuckv Exp $, $Date: 2003-01-30 15:20:21 $, $Name: not supported by cvs2svn $, $Revision: 1.13 $
5 > !! @version $Id: lj_FF.F90,v 1.15 2003-01-30 22:29:37 chuckv Exp $, $Date: 2003-01-30 22:29:37 $, $Name: not supported by cvs2svn $, $Revision: 1.15 $
6  
7  
8  
# Line 131 | Line 131 | contains
131      integer :: ncol
132   #endif
133      status = 0
134 +  
135 +
136 +    
137 +
138   !! if were're not in MPI, we just update ljatypePtrList
139   #ifndef IS_MPI
140      call create_IdentPtrlst(ident,ljListHead,identPtrList,thisStat)
# Line 154 | Line 158 | contains
158      
159   ! if were're in MPI, we also have to worry about row and col lists    
160   #else
161 +  
162   ! We can only set up forces if mpiSimulation has been setup.
163      if (.not. isMPISimSet()) then
164 +       write(default_error,*) "MPI is not set"
165         status = -1
166         return
167      endif
168 <    nrow = getNrow()
169 <    ncol = getNcol()
168 >    nrow = getNrow(plan_row)
169 >    ncol = getNcol(plan_col)
170 >
171   !! Allocate temperary arrays to hold gather information
172      allocate(identRow(nrow),stat=alloc_stat)
173      if (alloc_stat /= 0 ) then
# Line 173 | Line 180 | contains
180         status = -1
181         return
182      endif
183 +
184   !! Gather idents into row and column idents
185 +
186      call gather(ident,identRow,plan_row)
187      call gather(ident,identCol,plan_col)
188 <
188 >    
189 >
190   !! Create row and col pointer lists
191 <    call create_IdentPtrlst(identRow,ljListTail,identPtrListRow,thisStat)
191 >
192 >    call create_IdentPtrlst(identRow,ljListHead,identPtrListRow,thisStat)
193      if (thisStat /= 0 ) then
194         status = -1
195         return
196      endif
197  
198 <    call create_IdentPtrlst(identCol,ljListTail,identPtrListColumn,thisStat)
198 >    call create_IdentPtrlst(identCol,ljListHead,identPtrListColumn,thisStat)
199      if (thisStat /= 0 ) then
200         status = -1
201         return
202      endif
203 <
203 >    write(*,*) "After createIdent row-col lists"
204   !! free temporary ident arrays
205 <    deallocate(identCol)
206 <    deallocate(identRow)
207 <
205 >    if (allocated(identCol)) then
206 >       deallocate(identCol)
207 >    end if
208 >    if (allocated(identCol)) then
209 >       deallocate(identRow)
210 >    endif
211  
212   !! Allocate neighbor lists for mpi simulations.
213      if (.not. allocated(point)) then
# Line 343 | Line 357 | contains
357      type(lj_atype), pointer :: ljAtype_j
358  
359   #ifdef IS_MPI
360 <  real( kind = DP ), dimension(3,getNcol()) :: efr
360 >  real( kind = DP ), dimension(3,getNcol(plan_col)) :: efr
361    real( kind = DP ) :: pot_local
362   #else
363    real( kind = DP ), dimension(3,getNlocal()) :: efr
# Line 351 | Line 365 | contains
365    
366   !! Local arrays needed for MPI
367   #ifdef IS_MPI
368 <  real(kind = dp), dimension(3:getNrow()) :: qRow
369 <  real(kind = dp), dimension(3:getNcol()) :: qCol
368 >  real(kind = dp), dimension(3,getNrow(plan_row)) :: qRow
369 >  real(kind = dp), dimension(3,getNcol(plan_col)) :: qCol
370  
371 <  real(kind = dp), dimension(3:getNrow()) :: fRow
372 <  real(kind = dp), dimension(3:getNcol()) :: fCol
373 <  real(kind = dp), dimension(3:getNlocal()) :: fMPITemp
371 >  real(kind = dp), dimension(3,getNrow(plan_row)) :: fRow
372 >  real(kind = dp), dimension(3,getNcol(plan_col)) :: fCol
373 >  real(kind = dp), dimension(3,getNlocal()) :: fMPITemp
374  
375 <  real(kind = dp), dimension(getNrow()) :: eRow
376 <  real(kind = dp), dimension(getNcol()) :: eCol
375 >  real(kind = dp), dimension(getNrow(plan_row)) :: eRow
376 >  real(kind = dp), dimension(getNcol(plan_col)) :: eCol
377  
378    real(kind = dp), dimension(getNlocal()) :: eTemp
379   #endif
# Line 484 | Line 498 | contains
498   #ifdef IS_MPI
499   ! Assign identity pointers and tags
500             ljAtype_j => identPtrListColumn(j)%this
501 <           tag_j = tagCol(j)
501 >           tag_j = tagColumn(j)
502             if (newtons_thrd) then
503                if (tag_i <= tag_j) then
504                   if (mod(tag_i + tag_j,2) == 0) cycle inner
# Line 589 | Line 603 | contains
603                j = list(jnab)
604   #ifdef IS_MPI
605                ljAtype_j = identPtrListColumn(j)%this
606 <              rxij = wrap(rxi - q_col(1,j), 1)
607 <              ryij = wrap(ryi - q_col(2,j), 2)
608 <              rzij = wrap(rzi - q_col(3,j), 3)
606 >              rxij = wrap(rxi - qCol(1,j), 1)
607 >              ryij = wrap(ryi - qCol(2,j), 2)
608 >              rzij = wrap(rzi - qCol(3,j), 3)
609   #else
610                ljAtype_j = identPtrList(j)%this
611                rxij = wrap(rxi - q(1,j), 1)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines