Skip to content

Commit

Permalink
Fix incrementing counter
Browse files Browse the repository at this point in the history
  • Loading branch information
connoraird committed May 13, 2024
1 parent c0f57eb commit 902443b
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/exx_kernel_default.f90
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,7 @@ subroutine get_X_matrix( exxspin, scheme, backup_eris, niter, siter, level )
if(stat/=0) call cq_abort('Error allocating memory toeris/exx !',stat)
call reg_alloc_mem(area_exx, nb_eris, type_int,'eris',unit_memory_write)
eris(kpart)%filter_eris = .true.

!
! Second dummy call for poor-man filtering of ERIs
!
Expand Down Expand Up @@ -922,7 +923,6 @@ subroutine cri_eri_inner_calculation(nsf1_array, phi_i, Ome_kj, nsf1, nsf2, kpar
! Backup eris parameters. Optional as they are only needed by eri function
logical, intent(in) :: backup_eris
real(double), pointer, intent(inout), OPTIONAL :: store_eris_inner(:,:)

integer :: ncaddr, nsf3
real(double) :: exx_mat_elem

Expand Down Expand Up @@ -955,7 +955,7 @@ subroutine cri_eri_inner_calculation(nsf1_array, phi_i, Ome_kj, nsf1, nsf2, kpar
if ( backup_eris ) then
!
! eris(kpart)%store_eris( count ) = exx_mat_elem
store_eris_inner(nsf2, nsf3) = exx_mat_elem
store_eris_inner(nsf3, nsf2) = exx_mat_elem
!
else
!
Expand Down Expand Up @@ -1416,14 +1416,13 @@ subroutine m_kern_exx_eri(k_off, kpart, ib_nd_acc, ibaddr, nbnab, &
!
dr = grid_spacing
dv = dr**3
count = 1
count = 0
!
!!$
!!$ ****[ k loop ]****
!!$
k_loop: do k = 1, ahalo%nh_part(kpart)
!
write (*,*) kpart, ahalo%nh_part(kpart), k
k_in_halo = ahalo%j_beg(kpart) + k - 1
k_in_part = ahalo%j_seq(k_in_halo)
nbkbeg = ibaddr (k_in_part)
Expand Down Expand Up @@ -1600,8 +1599,8 @@ subroutine m_kern_exx_eri(k_off, kpart, ib_nd_acc, ibaddr, nbnab, &
Ome_kj(1:2*extent+1, 1:2*extent+1, 1:2*extent+1) => Ome_kj_1d_buffer
!
! Point at the next block of eris to store and update counter
store_eris_inner(1:ia%nsup, 1:jb%nsup) => eris(kpart)%store_eris(count:count + (jb%nsup * ia%nsup))
count = count + (jb%nsup * ia%nsup) + 1
store_eris_inner(1:ia%nsup, 1:jb%nsup) => eris(kpart)%store_eris(count+1:count + (jb%nsup * ia%nsup))
count = count + (jb%nsup * ia%nsup)
!
jb_loop: do nsf_jb = 1, jb%nsup
!
Expand Down

0 comments on commit 902443b

Please sign in to comment.