! Collection of code snippets by Arne Vajhøj 
! (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
program sects
    use omp_lib
    !$omp parallel num_threads(2)
    !$omp sections
    !$omp section
    !$omp critical
    write(*,*) omp_get_thread_num(),' of ',omp_get_num_threads()
    !$omp end critical
    !$omp section
    !$omp critical
    write(*,*) omp_get_thread_num(),' of ',omp_get_num_threads()
    !$omp end critical
    !$omp section
    !$omp critical
    write(*,*) omp_get_thread_num(),' of ',omp_get_num_threads()
    !$omp end critical
    !$omp section
    !$omp critical
    write(*,*) omp_get_thread_num(),' of ',omp_get_num_threads()
    !$omp end critical
    !$omp end sections
    !$omp end parallel
end
