Build fragment payload arrays for a given fragment index. Caller owns the returned fragment_indices and must deallocate it.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int64), | intent(in) | :: | fragment_idx | |||
| integer, | intent(in) | :: | polymers(:,:) | |||
| integer(kind=int32), | intent(out) | :: | fragment_type | |||
| integer(kind=int32), | intent(out) | :: | fragment_size | |||
| integer, | intent(out), | allocatable | :: | fragment_indices(:) |
subroutine build_fragment_payload(fragment_idx, polymers, fragment_type, fragment_size, fragment_indices) !! Build fragment payload arrays for a given fragment index. !! Caller owns the returned fragment_indices and must deallocate it. integer(int64), intent(in) :: fragment_idx integer, intent(in) :: polymers(:, :) integer(int32), intent(out) :: fragment_type integer(int32), intent(out) :: fragment_size integer, allocatable, intent(out) :: fragment_indices(:) fragment_size = count(polymers(fragment_idx, :) > 0) allocate (fragment_indices(fragment_size)) fragment_indices = polymers(fragment_idx, 1:fragment_size) ! Standard MBE always uses monomer indices fragment_type = FRAGMENT_TYPE_MONOMERS end subroutine build_fragment_payload