ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-4/src/UseTheForce/DarkSide/simulation.F90
(Generate patch)

Comparing trunk/OOPSE-4/src/UseTheForce/DarkSide/simulation.F90 (file contents):
Revision 2262 by chuckv, Sun Jul 3 20:53:43 2005 UTC vs.
Revision 2402 by chrisfen, Tue Nov 1 19:09:30 2005 UTC

# Line 58 | Line 58 | module simulation
58   #define __FORTRAN90
59   #include "brains/fSimulation.h"
60   #include "UseTheForce/fSwitchingFunction.h"
61 + #include "UseTheForce/DarkSide/fElectrostaticSummationMethod.h"
62  
63    type (simtype), public, save :: thisSim
64  
# Line 83 | Line 84 | module simulation
84    real(kind=dp), allocatable, dimension(:), public :: mfactLocal
85  
86    logical, allocatable, dimension(:) :: simHasAtypeMap
87 + #ifdef IS_MPI
88 +  logical, allocatable, dimension(:) :: simHasAtypeMapTemp
89 + #endif
90 +
91    real(kind=dp), public, dimension(3,3), save :: Hmat, HmatInv
92    logical, public, save :: boxIsOrthorhombic
93  
# Line 104 | Line 109 | module simulation
109    public :: SimUsesShapes
110    public :: SimUsesFLARB
111    public :: SimUsesRF
112 +  public :: SimUsesDampedWolf
113    public :: SimRequiresPrepairCalc
114    public :: SimRequiresPostpairCalc
115    public :: SimHasAtype
# Line 554 | Line 560 | contains
560            logical :: doesit
561            doesit = thisSim%SIM_uses_RF
562          end function SimUsesRF
563 +
564 +        function SimUsesDampedWolf() result(doesit)
565 +          logical :: doesit
566 +          doesit = thisSim%SIM_uses_DampedWolf
567 +        end function SimUsesDampedWolf
568  
569          function SimRequiresPrepairCalc() result(doesit)
570            logical :: doesit
571            doesit = thisSim%SIM_uses_EAM
572          end function SimRequiresPrepairCalc
573 <
573 >        
574          function SimRequiresPostpairCalc() result(doesit)
575            logical :: doesit
576 <          doesit = thisSim%SIM_uses_RF
576 >          doesit = thisSim%SIM_uses_RF .or. thisSim%SIM_uses_DampedWolf
577          end function SimRequiresPostpairCalc
578  
579 < ! Function returns true if the simulation has this atype
579 >        ! Function returns true if the simulation has this atype
580          function SimHasAtype(thisAtype) result(doesit)
581            logical :: doesit
582            integer :: thisAtype
# Line 594 | Line 605 | contains
605               end if
606               SimHasAtypeMap = .false.
607            end if
608 < ! Loop through the local atoms and grab the atypes present        
608 >          
609 >          ! Loop through the local atoms and grab the atypes present        
610            do me_i = 1,nLocal
611               SimHasAtypeMap(atid(me_i)) = .true.
612            end do
613 < ! For MPI, we need to know all possible atypes present in simulation on all
614 < ! processors. Use LOR operation to set map.
613 >          ! For MPI, we need to know all possible atypes present in
614 >          ! simulation on all processors. Use LOR operation to set map.
615   #ifdef IS_MPI
616 <          call mpi_allreduce(SimHasAtypeMap, SimHasAtypeMap, nAtypes, mpi_logical, &
617 <               MPI_LOR, mpi_comm_world, mpiErrors)
618 < #endif
619 <
616 >          if (.not.allocated(SimHasAtypeMapTemp)) then
617 >             allocate(SimHasAtypeMapTemp(nAtypes),stat=alloc_stat)
618 >             if (alloc_stat /= 0 ) then
619 >                status = -1
620 >                return
621 >             end if
622 >          end if
623 >          call mpi_allreduce(SimHasAtypeMap, SimHasAtypeMaptemp, nAtypes, &
624 >               mpi_logical, MPI_LOR, mpi_comm_world, mpiErrors)
625 >          simHasAtypeMap = simHasAtypeMapTemp
626 >          deallocate(simHasAtypeMapTemp)
627 > #endif          
628          end subroutine createSimHasAtype
629 <
629 >        
630         subroutine InitializeSimGlobals(thisStat)
631            integer, intent(out) :: thisStat
632            integer :: alloc_stat

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines