This subroutine inverts the 2-d or 3-d input mask array, which is either Logical, Logical(bool) or Integer(int8), where .true. and .false. are 1 and 0, respectively.
interface invertMask subroutine invertMask2dLogical(mask) logical, intent(inout) :: mask(:,:) end subroutine invertMask2dLogical subroutine invertMask2dBool(mask) logical(bool), intent(inout) :: mask(:,:) end subroutine invertMask2dBool subroutine invertMask2dInt8(mask) integer(int8), intent(inout) :: mask(:,:) end subroutine invertMask2dInt8 subroutine invertMask3dLogical(mask) logical, intent(inout) :: mask(:,:,:) end subroutine invertMask3dLogical subroutine invertMask3dBool(mask) logical(bool), intent(inout) :: mask(:,:,:) end subroutine invertMask3dBool subroutine invertMask3dInt8(mask) integer(int8), intent(inout) :: mask(:,:,:) end subroutine invertMask3dInt8 end interface