--- trunk/OOPSE/libmdtools/mpiSimulation_module.F90 2003/11/07 21:46:56 858 +++ trunk/OOPSE/libmdtools/mpiSimulation_module.F90 2003/12/17 20:13:33 882 @@ -7,7 +7,7 @@ !! !! @author Charles F. Vardeman II !! @author Matthew Meineke -!! @version $Id: mpiSimulation_module.F90,v 1.9 2003-11-07 21:46:56 chuckv Exp $, $Date: 2003-11-07 21:46:56 $, $Name: not supported by cvs2svn $, $Revision: 1.9 $ +!! @version $Id: mpiSimulation_module.F90,v 1.10 2003-12-17 20:13:33 chuckv Exp $, $Date: 2003-12-17 20:13:33 $, $Name: not supported by cvs2svn $, $Revision: 1.10 $ module mpiSimulation use definitions @@ -73,7 +73,7 @@ module mpiSimulation !! Tags used during force loop for parallel simulation - integer, allocatable, dimension(:) :: tagLocal + integer, public, allocatable, dimension(:) :: tagLocal integer, public, allocatable, dimension(:) :: tagRow integer, public, allocatable, dimension(:) :: tagColumn @@ -626,7 +626,26 @@ contains ! allocate row arrays nrow = getNrow(plan_row) ncol = getNcol(plan_col) + + if(.not. allocated(tagLocal)) then + allocate(tagLocal(size(tags)),STAT=alloc_stat) + if (alloc_stat /= 0 ) then + status = -1 + return + endif + else + deallocate(tagLocal) + allocate(tagLocal(size(tags)),STAT=alloc_stat) + if (alloc_stat /= 0 ) then + status = -1 + return + endif + endif + + tagLocal = tags + + if (.not. allocated(tagRow)) then allocate(tagRow(nrow),STAT=alloc_stat) if (alloc_stat /= 0 ) then @@ -661,6 +680,7 @@ contains call gather(tags,tagRow,plan_row) call gather(tags,tagColumn,plan_col) + end subroutine setTags ! pure function getNcol(thisplan) result(ncol)