Subroutine for subsampling a rank 1 array. It shuffles indeces using the forward Fisher-Yates algorithm (as needed given n), then generates an index mask.
Subroutine for sampling a rank 1 array. It shuffles indeces using the forward Fisher-Yates algorithm (as needed given n), then generates an index mask from it. The mask can simply be applied using the pack intrinsic function: new_array = pack (old_array, mask)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=i4), | intent(in) | :: | m |
size of population (array) |
||
| integer(kind=i4), | intent(in) | :: | n |
size of sample |
||
| logical, | intent(out) | :: | mask(m) |
index mask for sampled data |