2
0
mirror of https://github.com/LCPQ/DEHam synced 2024-07-08 04:15:57 +02:00
DEHam/src/getdet.irp.f
vijay gopal chilkuri 3278aabfeb updating code to the current local version, it might not compile atm.
Many new features added:
1. getting S2 values
2. possibility of setting position of hole
3. possibility of setting Sbox
4. three Sbox definitions at once
5. Doing only FAM1 or the full set of states
6. efficiency improvements
2018-01-27 12:41:48 +01:00

75 lines
1.6 KiB
Fortran

subroutine getdet(add,ideter)
implicit none
BEGIN_DOC
! this routing gives the determinant in
! the traditional form given its address
END_DOC
integer,INTENT(INOUT)::ideter(natomax)
integer(kind=selected_int_kind(16)),INTENT(IN)::add
integer(kind=selected_int_kind(16))::deta,detb
integer::i,const,ia,ib, natom2
ib = MOD(add,nt2)
if(MOD(add,nt2).eq.0)then
ib=nt2
endif
ia = (add-ib)/nt2
ia = nt1 - ia
ideter=1
const=0
detb=0
deta=0
i=1
detb = det(ib,1)
deta = deth(ia,1)
if(FAM1) deta = ISHFT(deta,-(natom/2))
! do while (i.le.(ib))
! const=1
! do while(popcnt(detb).ne.nbeta .or. const==1)
! detb+=1
! const=0
! enddo
! i+=1
! write(6,14)detb,detb
! enddo
! i=1
! do while (i.le.(ia))
! const=1
! do while(popcnt(deta).ne.ntrou .or. const==1)
! deta+=1
! const=0
! enddo
! i+=1
! write(6,14)deta,deta
! enddo
const=0
if(FAM1) then
natom2 = natom/2
else
natom2 = natom
endif
do i=0,(natom2) - 1
if(BTEST(deta,i))then
ideter((natom2)-i)=3
endif
enddo
do i=0,natom-1
if(ideter(natom-i).eq.1)then
if(BTEST(detb,const))then
ideter(natom-i)=2
endif
const=const+1
endif
enddo
return
10 FORMAT(B64,I8,F8.2)
15 FORMAT(B64,I8,I8,I8)
11 FORMAT(B64,I3,B64)
12 FORMAT(I5,$)
13 FORMAT(B64,B64)
14 FORMAT(B64,I8)
16 FORMAT(B64,I8,I8)
end subroutine getdet