! @@name: cancellation.1f ! @@type: F-free ! @@compilable: yes ! @@linkable: no ! @@expect: success subroutine example(n, dim) integer, intent(in) :: n, dim(n) integer :: i, s, err real, allocatable :: B(:) err = 0 !$omp parallel shared(err) ! ... !$omp do private(s, B) do i=1, n !$omp cancellation point do allocate(B(dim(i)), stat=s) if (s .gt. 0) then !$omp atomic write err = s !$omp cancel do endif ! ... ! deallocate private array B if (allocated(B)) then deallocate(B) endif enddo !$omp end parallel end subroutine