module wei_omp_mod
  use sep


  contains

  subroutine wei_ith(ith) 
    integer :: ith
#ifdef OMP
    integer, external :: omp_get_thread_num

    ith=omp_get_thread_num()+1
#else
    ith=1
#endif

  end subroutine

  subroutine wei_nth(nth)
    integer :: nth
    integer, external :: omp_get_num_threads
#ifdef OMP
!$OMP PARALLEL
  nth=omp_get_num_threads()
!$OMP END PARALLEL
#else
  nth=1
#endif
  end subroutine



  subroutine wei_barrier()
#ifdef OMP
!$OMP BARRIER
#endif
  end subroutine


end module

