[skip-CI] Better comments

This commit is contained in:
Paolo Giannozzi 2022-02-18 16:44:05 +01:00
parent f2dfc26039
commit b66fe03f02
2 changed files with 7 additions and 7 deletions

View File

@ -11,13 +11,13 @@ subroutine hpsort_eps (n, ra, ind, eps)
!! Sort an array ra(1:n) into ascending order using heapsort algorithm,
!! and considering two elements being equal if their values differ
!! for less than "eps". IMPORTANT NOTICE (PG February 2022):
!! Assume you have in input a,b,c, in this order, with |a-b| < eps,
!! |b-c| < eps, but |a-c| > eps. The resulting output order may be a,b,c,
!! not c,a,b as it should. I think this is a bug. I don't know how to fix
!! Assume you have in input a,b,c with c < b < a and a-b < eps, b-c < eps,
!! but a-c > eps. The resulting output order should be c,a,b, but may turn
!! out to be a,b,c instead. I think this is a bug. I don't know how to fix
!! it, I am not sure it does any harm, but re-ordering k+G with this same
!! routine may yield a different ordering for k+G and G vectors even if k=0.
!! This was definitely a bug that has been around for years and that was
!! worked around by avoiding to recompute the indices for k+G if k=0.
!! This is a bug that has been around for years. The current work-around
!! (in routine gk_sort) is to avoid recomputing indices for k+G if k=0.
!!
!! \(\text{n}\) is input, \(\text{ra}\) is replaced on output by its
!! sorted rearrangement.

View File

@ -19,8 +19,8 @@ SUBROUTINE gk_sort( k, ngm, g, ecut, ngk, igk, gk )
!! In practice, in some special cases (primitive lattice vectors that
!! are close to but not exactly equal to a symmetric Bravais lattice)
!! this does not hold, presumably due to a limitation of "hpsort_eps".
!! This is ia source of troouble for Gamma-only calculations, so one
!! explicitly sets igk(i)=i for k=0
!! This is a source of trouble for Gamma-only calculations, so here
!! we explicitly set igk(i)=i for k=0.
!
USE kinds, ONLY: DP
USE constants, ONLY: eps8