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 |
|
|
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 |
|
|
564 |
|
logical :: doesit |
565 |
|
doesit = thisSim%SIM_uses_EAM |
566 |
|
end function SimRequiresPrepairCalc |
567 |
< |
|
567 |
> |
|
568 |
|
function SimRequiresPostpairCalc() result(doesit) |
569 |
|
logical :: doesit |
570 |
|
doesit = thisSim%SIM_uses_RF |
571 |
|
end function SimRequiresPostpairCalc |
572 |
|
|
573 |
< |
! Function returns true if the simulation has this atype |
573 |
> |
! Function returns true if the simulation has this atype |
574 |
|
function SimHasAtype(thisAtype) result(doesit) |
575 |
|
logical :: doesit |
576 |
|
integer :: thisAtype |
599 |
|
end if |
600 |
|
SimHasAtypeMap = .false. |
601 |
|
end if |
602 |
< |
! Loop through the local atoms and grab the atypes present |
602 |
> |
|
603 |
> |
! Loop through the local atoms and grab the atypes present |
604 |
|
do me_i = 1,nLocal |
605 |
|
SimHasAtypeMap(atid(me_i)) = .true. |
606 |
|
end do |
607 |
< |
! For MPI, we need to know all possible atypes present in simulation on all |
608 |
< |
! processors. Use LOR operation to set map. |
607 |
> |
! For MPI, we need to know all possible atypes present in |
608 |
> |
! simulation on all processors. Use LOR operation to set map. |
609 |
|
#ifdef IS_MPI |
610 |
< |
call mpi_allreduce(SimHasAtypeMap, SimHasAtypeMap, nAtypes, mpi_logical, & |
611 |
< |
MPI_LOR, mpi_comm_world, mpiErrors) |
612 |
< |
#endif |
613 |
< |
|
610 |
> |
if (.not.allocated(SimHasAtypeMapTemp)) then |
611 |
> |
allocate(SimHasAtypeMapTemp(nAtypes),stat=alloc_stat) |
612 |
> |
if (alloc_stat /= 0 ) then |
613 |
> |
status = -1 |
614 |
> |
return |
615 |
> |
end if |
616 |
> |
end if |
617 |
> |
call mpi_allreduce(SimHasAtypeMap, SimHasAtypeMaptemp, nAtypes, & |
618 |
> |
mpi_logical, MPI_LOR, mpi_comm_world, mpiErrors) |
619 |
> |
simHasAtypeMap = simHasAtypeMapTemp |
620 |
> |
deallocate(simHasAtypeMapTemp) |
621 |
> |
#endif |
622 |
|
end subroutine createSimHasAtype |
623 |
< |
|
623 |
> |
|
624 |
|
subroutine InitializeSimGlobals(thisStat) |
625 |
|
integer, intent(out) :: thisStat |
626 |
|
integer :: alloc_stat |