Thank for your reply,

Actually cutool.f90 is a file with a module :

It is something like :

```
module cutools
! ...
contains
! ....
attributes(global) subroutine cuget_1bdensmat(dmat,CI,indexI,actdim)
implicit none
complex(8) :: dmat(:,:)
complex(8) :: CI(:)
integer :: indexI(:)
integer ,value :: actdim
complex(8) ,shared :: temp(blockDim%x*blockDim%y)
integer :: i,p,q,j, totslatt,slattoveralp,actP,actQ,inext
p = blockIdx%x
q = blockIdx%y
i = (threadIdx%y -1)*blockDim%x+threadIdx%x ! for the moment max nb of slater = 1024
temp(i) = cmplx(0.d0,0.d0)
temp(i) = cmplx(0.d0,0.d0)
if (i<= actdim) then
if (ABS(CI(i))>1.d-8) then
if (p==q) then
temp(i)=conjg(Ci(i))*CI(i)*btest(indexI(i),p-1)
else
j=1
do while (j <= actdim)
if (ABS(CI(j))>1.d-8) then
actP = ibclr(indexI(i), p-1)
actQ = ibclr(indexI(j), q-1)
if (actP==actQ .and. (actP/=indexI(i) .or. actQ/=indexI(j))) then
slattoveralp=(-2*POPPAR(ibits(indexI(i),0,p-1))+1)*(-2*POPPAR(ibits(indexI(j),0,q-1))+1)
temp(i)=slattoveralp*conjg(Ci(i))*CI(j)
end if
end if
j = j +1
end do
end if
end if
end if
!! reduction temp
!! dmat(p,q) = temp(1)
end subroutine cuget_1bdensmat
! ....
end module cutools
```

Thanks,

Jordan