subroutine check_arrayRoutines(res)
logical, intent(inout) :: res
real(kind=rk) :: logicalAsReals(5)
logicalAsReals = logicalToRealArray( &
& value = (/ .true., .true., .true., .true., .true. /), &
& n = 5 )
res = res .and. all( &
& pack( array = realToLogicalArray( value = logicalAsReals, n = 5), &
& mask = (/ .true., .true., .true., .true., .true. /) ) )
call checkResult( res, 'Test array with all true failed' )
logicalAsReals = logicalToRealArray( &
& value = (/ .false., .true., .false., .true., .false. /), &
& n = 5 )
res = res .and. all( &
& pack( array = realToLogicalArray( value = logicalAsReals, n = 5), &
& mask = (/ .false., .true., .false., .true., .false. /) ) )
call checkResult( res, 'Test mixed array for true failed' )
res = res .and. .not. any( &
& pack( array = realToLogicalArray( value = logicalAsReals, n = 5), &
& mask = (/ .true., .false., .true., .false., .true. /) ) )
call checkResult( res, 'Test mixed array for false failed' )
logicalAsReals = logicalToRealArray( &
& value = (/ .false., .false., .false., .false., .false. /), &
& n = 5 )
res = res .and. .not. any( &
& pack( array = realToLogicalArray( value = logicalAsReals, n = 5), &
& mask = (/ .true., .true., .true., .true., .true. /) ) )
call checkResult( res, 'Test array with all false failed' )
end subroutine check_arrayRoutines