Added comment explaining why the array is set to zero and what should be done

This commit is contained in:
Paolo Giannozzi 2020-09-01 13:59:09 +00:00
parent 28adcf3a00
commit 333bac9827
1 changed files with 4 additions and 0 deletions

View File

@ -416,6 +416,10 @@ CONTAINS
IF( upf%q_with_l ) THEN
ALLOCATE( upf%qfuncl(upf%mesh,upf%nbeta*(upf%nbeta+1)/2,0:2*upf%lmax) )
upf%qfuncl(:,:,:) = 0.0_dp
! NOTE: it would be wiser to dimension qfuncl as (:,:,0:upf%lmax)
! and store the q_l(r) with index l=L/2 (see loop_on_l below)
! This would save some storage and avoid "holes" in the array
! that may be a source of trouble if not initialized to zero
ELSE
ALLOCATE ( upf%qfunc(upf%mesh,upf%nbeta*(upf%nbeta+1)/2) )
upf%qfunc (:,:) = 0.0_dp