Subroutine rand_vpe( npes, info, lst ) ! ---------------------------------------------------------------------- Use numerics Implicit None Integer, Intent(In) :: npes Integer, Intent(Out), Dimension(0:npes-1) :: lst Logical, Intent(Out), dimension(0:npes-1) :: info Integer, Dimension (0:(npes/2) - 1) :: pv Logical :: f Integer :: i, j, k, n, np Real(l_) :: r ! ---------------------------------------------------------------------- np = npes/2 Do i = 0, np-1 pv(i) = i + np End Do Do i = 0, np-1 j = pv(i) Call random_number( Harvest = r ) k = Int( r*(np-1) + 0.5_l_ ) pv (i) = pv(k) pv (k) = j End Do Do i = 0, np - 1 lst (i) = pv(i) lst (pv(i)) = i Call random_number( Harvest = r ) n = Int( r + 0.5_l_ ) f = .FALSE. if ( n == 0 ) f = .TRUE. info (i) = f info(pv(i)) = .NOT. f End Do ! ---------------------------------------------------------------------- End subroutine rand_vpe