--- trunk/mdtools/md_code/lj_FF.F90 2003/01/30 15:20:21 253 +++ trunk/mdtools/md_code/lj_FF.F90 2003/01/30 20:03:37 254 @@ -2,7 +2,7 @@ !! Corresponds to the force field defined in lj_FF.cpp !! @author Charles F. Vardeman II !! @author Matthew Meineke -!! @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 $ +!! @version $Id: lj_FF.F90,v 1.14 2003-01-30 20:03:36 chuckv Exp $, $Date: 2003-01-30 20:03:36 $, $Name: not supported by cvs2svn $, $Revision: 1.14 $ @@ -131,6 +131,10 @@ contains integer :: ncol #endif status = 0 + + + + !! if were're not in MPI, we just update ljatypePtrList #ifndef IS_MPI call create_IdentPtrlst(ident,ljListHead,identPtrList,thisStat) @@ -154,13 +158,15 @@ contains ! if were're in MPI, we also have to worry about row and col lists #else + ! We can only set up forces if mpiSimulation has been setup. if (.not. isMPISimSet()) then + write(default_error,*) "MPI is not set" status = -1 return endif - nrow = getNrow() - ncol = getNcol() + nrow = getNrow(plan_row) + ncol = getNcol(plan_col) !! Allocate temperary arrays to hold gather information allocate(identRow(nrow),stat=alloc_stat) if (alloc_stat /= 0 ) then @@ -173,18 +179,22 @@ contains status = -1 return endif + !! Gather idents into row and column idents + call gather(ident,identRow,plan_row) call gather(ident,identCol,plan_col) + !! Create row and col pointer lists - call create_IdentPtrlst(identRow,ljListTail,identPtrListRow,thisStat) + + call create_IdentPtrlst(identRow,ljListHead,identPtrListRow,thisStat) if (thisStat /= 0 ) then status = -1 return endif - call create_IdentPtrlst(identCol,ljListTail,identPtrListColumn,thisStat) + call create_IdentPtrlst(identCol,ljListHead,identPtrListColumn,thisStat) if (thisStat /= 0 ) then status = -1 return @@ -343,7 +353,7 @@ contains type(lj_atype), pointer :: ljAtype_j #ifdef IS_MPI - real( kind = DP ), dimension(3,getNcol()) :: efr + real( kind = DP ), dimension(3,getNcol(plan_col)) :: efr real( kind = DP ) :: pot_local #else real( kind = DP ), dimension(3,getNlocal()) :: efr @@ -351,15 +361,15 @@ contains !! Local arrays needed for MPI #ifdef IS_MPI - real(kind = dp), dimension(3:getNrow()) :: qRow - real(kind = dp), dimension(3:getNcol()) :: qCol + real(kind = dp), dimension(3,getNrow(plan_row)) :: qRow + real(kind = dp), dimension(3,getNcol(plan_col)) :: qCol - real(kind = dp), dimension(3:getNrow()) :: fRow - real(kind = dp), dimension(3:getNcol()) :: fCol - real(kind = dp), dimension(3:getNlocal()) :: fMPITemp + real(kind = dp), dimension(3,getNrow(plan_row)) :: fRow + real(kind = dp), dimension(3,getNcol(plan_col)) :: fCol + real(kind = dp), dimension(3,getNlocal()) :: fMPITemp - real(kind = dp), dimension(getNrow()) :: eRow - real(kind = dp), dimension(getNcol()) :: eCol + real(kind = dp), dimension(getNrow(plan_row)) :: eRow + real(kind = dp), dimension(getNcol(plan_col)) :: eCol real(kind = dp), dimension(getNlocal()) :: eTemp #endif @@ -484,7 +494,7 @@ contains #ifdef IS_MPI ! Assign identity pointers and tags ljAtype_j => identPtrListColumn(j)%this - tag_j = tagCol(j) + tag_j = tagColumn(j) if (newtons_thrd) then if (tag_i <= tag_j) then if (mod(tag_i + tag_j,2) == 0) cycle inner @@ -589,9 +599,9 @@ contains j = list(jnab) #ifdef IS_MPI ljAtype_j = identPtrListColumn(j)%this - rxij = wrap(rxi - q_col(1,j), 1) - ryij = wrap(ryi - q_col(2,j), 2) - rzij = wrap(rzi - q_col(3,j), 3) + rxij = wrap(rxi - qCol(1,j), 1) + ryij = wrap(ryi - qCol(2,j), 2) + rzij = wrap(rzi - qCol(3,j), 3) #else ljAtype_j = identPtrList(j)%this rxij = wrap(rxi - q(1,j), 1)