Skip to content

Commit

Permalink
Add debug statements to fockdiag and r4dcasci
Browse files Browse the repository at this point in the history
  • Loading branch information
kohei-noda-qcrg committed Dec 27, 2023
1 parent 18a6dc9 commit 7e26723
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/fockdiag.f90
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,9 @@ SUBROUTINE fockdiag
fock_cmplx(1:nmo, 1:nmo) = fac(1:nmo, 1:nmo)
Call memminus(KIND(fac), SIZE(fac), 2); deallocate (fac)
end if
#ifdef DEBUG
Call e0aftertra

#endif
if (rank == 0) then ! Only master ranks are allowed to create files used by CASPT2 except for MDCINTNEW.
call open_unformatted_file(unit=unit_transfock, file='TRANSFOCK', status='replace', optional_action='write')
write (unit_transfock) nmo
Expand Down
15 changes: 12 additions & 3 deletions src/r4dcasci.f90
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ PROGRAM r4dcasci ! DO CASCI CALC IN THIS PROGRAM!
! kl !
!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!

#ifdef DEBUG
!! TEST TO CALCULATE FOCK MATRIX OF HF STATE fpq = hpq + SIGUMA_r[(pq|rr)-(pr|qr)]
!! THIS MUST BE DIAGONAL MATRIX AND DIAGONAL ELEMENTS CORESPONDS TO SPINOR ENERGIES.
if (realonly%is_realonly()) then
Expand All @@ -130,6 +131,7 @@ PROGRAM r4dcasci ! DO CASCI CALC IN THIS PROGRAM!
fock_cmplx(:, :) = 0.0d+00
call fock_matrix_of_hf_complex
End if
#endif

!! NOW MAKE FOCK MATRIX FOR CASCI STATE
!! fij = hij + SIGUMA_kl[<0|Ekl|0>{(ij|kl)-(il|kj)}
Expand All @@ -140,9 +142,15 @@ PROGRAM r4dcasci ! DO CASCI CALC IN THIS PROGRAM!
Call timing(date1, tsec1, date0, tsec0)
end if
if (realonly%is_realonly()) then
if (.not. allocated(fock_real)) then
allocate (fock_real(nmo, nmo)); call memplus(KIND(fock_real), SIZE(fock_real), 1)
end if
fock_real(:, :) = 0.0d+00
Call fockcasci_real
else
if (.not. allocated(fock_cmplx)) then
allocate (fock_cmplx(nmo, nmo)); call memplus(KIND(fock_cmplx), SIZE(fock_cmplx), 2)
end if
fock_cmplx(:, :) = 0.0d+00
Call fockcasci_complex
end if
Expand All @@ -153,9 +161,10 @@ PROGRAM r4dcasci ! DO CASCI CALC IN THIS PROGRAM!
tsec1 = tsec0
Call timing(date1, tsec1, date0, tsec0)
end if
debug = .FALSE.
if (rank == 0) print *, debug, 'debug'
if (debug) Call prtoutfock

#ifdef DEBUG
call prtoutfock
#endif

Allocate (eps(nmo)); Call memplus(KIND(eps), SIZE(eps), 1)
eps = 0.0d+00
Expand Down

0 comments on commit 7e26723

Please sign in to comment.