fsml_sample_n Interface

public interface fsml_sample_n

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.

Calls

interface~~fsml_sample_n~~CallsGraph interface~fsml_sample_n fsml_sample_n proc~s_dat_sample_n s_dat_sample_n interface~fsml_sample_n->proc~s_dat_sample_n proc~s_err_print s_err_print proc~s_dat_sample_n->proc~s_err_print

Module Procedures

public subroutine s_dat_sample_n(m, n, 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)

Arguments

Type IntentOptional 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