program variables
!$ use OMP_LIB
implicit none
integer :: a=22,b=67,c=53,d=12,rank,tnot
!$OMP PARALLEL SHARED(a) FIRSTPRIVATE(b) PRIVATE(d) DEFAULT(SHARED)
print *, " My values are ", a,b,c,d
rank = OMP_GET_THREAD_NUM () ! get the rank of current thread
tnot = OMP_GET_NUM_THREADS() ! get the total number of threads currently running this PR
b=tnot
d=rank
print *, " My values are now ", a,b,c,d
!$OMP END PARALLEL
print *, "After parallel region, my values are (look at difference with private and shared) :",a,b,c,d
end program variables