yambo-code / yambo

This is the official GPL repository of the yambo code
http://www.yambo-code.eu/
GNU General Public License v2.0
98 stars 38 forks source link

Bug in RIM-W implementation #45

Closed alberto-guandalini closed 2 years ago

alberto-guandalini commented 2 years ago

I realized that, I don't know why, there is a cleaning of the coefficient of the W interpolation before they are used. This is clear from the following lines of code in QP_interpolate_W.F:

 call rim('c')
 !
  YAMBO_FREE(f_coeff)

followed by the following lines:

   do ig2=1,RIM_W_ng
     do ig1=1,RIM_W_ng
       !
       if(ig1==1.and.ig2==1.and.(.not. RIM_W_for_graph)) then
         dummy(:) = f_coeff(1,1,1,1,:)

As f_coeff is used after cleaning, yambo gives an error.

alberto-guandalini commented 2 years ago

Moved the cleaning of f_coeff after it is used the last time.

Fixed by commit cb7ae81ec38ad0b5a6608471bcd11315fd5cb8df (in bug-fixes is 67ba18c0aeac9f170b82e13884569825278df3b5).

daniele-varsano commented 2 years ago

After validation it is needed to fix the GPL (crash reported by several users in the forum)

sangallidavide commented 2 years ago

Thanks. The source of the bug the fix was this commit: 822f289793f07806b602e659b5b927a643326f6e which was done to fix RIM_W with finite-q BSE. Previously f_coeff was not deallocated and the code was crashing in the BSE q-loop. New fix imported into branch 5.1 of GPL repo