gather element number associated to MM atom types
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(mimic_communicator), | intent(inout) | :: | this | |||
integer, | intent(in), | dimension(:) | :: | elements_pcode | number of elements to expect per code |
|
integer, | intent(out), | dimension(:) | :: | elements | element numbers per code |
|
integer, | intent(in), | dimension(:,:) | :: | species_map |
subroutine gather_elements(this, elements_pcode, elements, species_map)
class(mimic_communicator), intent(inout) :: this
!> number of elements to expect per code
integer, dimension(:), intent(in) :: elements_pcode
!> element numbers per code
integer, dimension(:), intent(out) :: elements
integer, dimension(:,:), intent(in) :: species_map
integer :: n_client, n_species
integer, dimension(maxval(elements_pcode), this%num_clients), target :: temp_el
elements(:) = -1
temp_el(:, :) = -1
do n_client = 1, this%num_clients
call this%send_command(MCL_SEND_ATOM_ELEMENTS, n_client)
call mcl_receive(temp_el(:, n_client), elements_pcode(n_client), MCL_DATA, n_client)
do n_species = 1, elements_pcode(n_client)
if (species_map(n_species, n_client) /= - 1) then
elements(species_map(n_species, n_client)) = temp_el(n_species, n_client)
end if
end do ! n_species
end do ! n_client
end subroutine gather_elements