Unpredictable Ngm in phonons

Apparently in parallel phonon calculations the local value of 'ngm' may vary
between a q-vector and the following one. This may lead to OOB in the 2D case.
May be related to issue 488.
This commit is contained in:
Paolo Giannozzi 2022-05-10 17:52:39 +02:00
parent 1a5f6d9cb8
commit 11db1c1d13
3 changed files with 11 additions and 3 deletions

View File

@ -32,6 +32,7 @@ MODULE Coul_cut_2D_ph
!
!
PUBLIC :: cutoff_fact_qg, cutoff_lr_Vlocq, cutoff_localq
PUBLIC :: deallocate_2d_arrays
CONTAINS
!
@ -228,4 +229,10 @@ subroutine cutoff_dynmat0 (dynwrk, rhog)
ENDDO
return
end subroutine cutoff_dynmat0
subroutine deallocate_2d_arrays ()
IF ( allocated(cutoff_2D_qg) ) DEALLOCATE(cutoff_2D_qg)
IF ( allocated(lr_Vlocq) ) DEALLOCATE(lr_Vlocq)
end subroutine deallocate_2d_arrays
END MODULE Coul_cut_2D_ph

View File

@ -45,6 +45,7 @@ subroutine deallocate_phq
USE qpoint_aux, ONLY : ikmks, ikmkmqs, becpt, alphapt
USE becmod, ONLY : deallocate_bec_type
USE nc_mag_aux, ONLY : int1_nc_save, deeq_nc_save
USE Coul_cut_2D_ph, ONLY : deallocate_2d_arrays
IMPLICIT NONE
INTEGER :: ik, ipol
@ -194,6 +195,6 @@ subroutine deallocate_phq
!
ENDIF
RETURN
call deallocate_2d_arrays ()
end subroutine deallocate_phq

View File

@ -130,7 +130,7 @@ SUBROUTINE phq_init()
! component of the cutoff of the COulomb interaction
IF (do_cutoff_2D) call cutoff_fact_qg()
! in 2D calculations the long range part of vlocq(g) (erf/r part)
! was not re-added in g-space because everything is caclulated in
! was not re-added in g-space because everything is calculated in
! radial coordinates, which is not compatible with 2D cutoff.
! It will be re-added each time vlocq(g) is used in the code.
! Here, this cutoff long-range part of vlocq(g) is computed only once