! !--------------------------------------------------------------------- subroutine kpointdivision ( ik0 ) !--------------------------------------------------------------------- ! ! ! This is just to find the first kpoint block in the pool ! (I needed to cleanup elphel2_shuffle.f90) ! ! Feliciano Giustino, UCB ! !--------------------------------------------------------------------- ! #include "f_defs.h" ! USE para, ONLY : kunit #ifdef __PARA use para USE mp_global, ONLY : my_pool_id #endif use pwcom use phcom use el_phon ! implicit none integer :: nkl, nkr, ik0, iks ! #ifdef __PARA ! ! number of kpoint blocks, kpoints per pool and reminder ! nkbl = nkstot / kunit nkl = kunit * ( nkbl / npool ) nkr = ( nkstot - nkl * npool ) / kunit ! ! the reminder goes to the first nkr pools ! (0...nkr-1) ! if ( my_pool_id < nkr ) nkl = nkl + kunit ! ! the index of the first k point in this pool ! iks = nkl * my_pool_id + 1 if ( my_pool_id >= nkr ) iks = iks + nkr * kunit ! ! the index of the first k point block in this pool - 1 ! (I will need the index of ik, not ikk) ! ik0 = ( iks - 1 ) / kunit ! #else if (lgamma) then kunit = 1 else kunit = 2 endif nkbl = nkstot / kunit nksqp = nkbl #endif ! return end subroutine kpointdivision !-------------------------------------------------------------------- !