Initialize a boolean mask from a logical array
@param[in,out] this The boolean mask instance @param[in] logical_array The logical array to initialize from
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(boolean_mask), | intent(inout) | :: | this | |||
logical, | intent(in), | dimension(:) | :: | logical_array |
subroutine mask_constructor(this, logical_array) class(boolean_mask), intent(inout) :: this logical, dimension(:), intent(in) :: logical_array if (this % initialized) call this % destroy() this % size = size(logical_array) allocate (this % mask(this % size)) this % mask = logical_array this % initialized = .true. end subroutine mask_constructor