1program main
2  use omp_lib
3  implicit none (type, external)
4  integer :: i
5
6  !$omp teams num_teams (5)
7    if (omp_get_num_teams () /= 5) stop 1
8    !$omp distribute dist_schedule(static,1)
9    do i = 0, 4
10      if (omp_get_team_num () /= i) stop 2
11    end do
12  !$omp end teams
13
14  !$omp teams num_teams (7 : 9)
15    if (omp_get_num_teams () < 7 .or. omp_get_num_teams () > 9) &
16      stop 3
17    !$omp distribute dist_schedule(static,1)
18    do i = 0, omp_get_num_teams () - 1
19      if (omp_get_team_num () /= i) stop 4
20    end do
21  !$omp end teams
22end program main
23