program main
implicit none
include ‘omp_lib.h‘
integer :: threadCount
integer :: threadNum
!$OMP PARALLEL PRIVATE(threadCount, threadNum)
threadCount = OMP_GET_NUM_THREADS()
threadNum = OMP_GET_THREAD_NUM()
write(*, "(‘THREAD: ‘, I2, ‘/‘, I2)") threadNum, threadCount
!$OMP END PARALLEL
end program原文:http://blog.csdn.net/heyzol/article/details/18514883