Create a work partition
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(error_type), | intent(out), | allocatable | :: | error |
Error handling |
|
| type(work_partition), | intent(out) | :: | partition |
New work partition |
||
| integer, | intent(in) | :: | part |
Zero-based index of this part |
||
| integer, | intent(in) | :: | nparts |
Total number of parts |
subroutine new_work_partition(error, partition, part, nparts) !> Error handling type(error_type), allocatable, intent(out) :: error !> New work partition type(work_partition), intent(out) :: partition !> Zero-based index of this part integer, intent(in) :: part !> Total number of parts integer, intent(in) :: nparts if (nparts <= 0 .or. part < 0 .or. part >= nparts) then call fatal_error(error, "Invalid dispersion work partition") return end if partition%part = part partition%nparts = nparts end subroutine new_work_partition