10
0
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-07-11 22:03:55 +02:00

Renamed lgamma into logabsgamma (lgamma is a Fortran intrinsic)

This commit is contained in:
Anthony Scemama 2021-06-01 10:35:33 +02:00
parent 0ad8058aea
commit e751901fa8
2 changed files with 18 additions and 18 deletions

View File

@ -1,8 +1,8 @@
real*8 function lgamma(x) real*8 function logabsgamma(x)
implicit none implicit none
real*8, intent(in) :: x real*8, intent(in) :: x
lgamma = log(abs(gamma(x))) logabsgamma = log(abs(gamma(x)))
end function lgamma end function logabsgamma
BEGIN_PROVIDER [ integer, NSOMOMax] BEGIN_PROVIDER [ integer, NSOMOMax]
&BEGIN_PROVIDER [ integer, NCSFMax] &BEGIN_PROVIDER [ integer, NCSFMax]
@ -31,7 +31,7 @@
real*8 :: coeff, binom1, binom2 real*8 :: coeff, binom1, binom2
integer MS integer MS
integer ncfgpersomo integer ncfgpersomo
real*8, external :: lgamma real*8, external :: logabsgamma
detDimperBF = 0 detDimperBF = 0
MS = elec_alpha_num-elec_beta_num MS = elec_alpha_num-elec_beta_num
! number of cfgs = number of dets for 0 somos ! number of cfgs = number of dets for 0 somos
@ -58,21 +58,21 @@
ncfg = ncfgpersomo - ncfgprev ncfg = ncfgpersomo - ncfgprev
if(iand(MS,1) .EQ. 0) then if(iand(MS,1) .EQ. 0) then
!dimcsfpercfg = max(1,nint((binom(i,i/2)-binom(i,i/2+1)))) !dimcsfpercfg = max(1,nint((binom(i,i/2)-binom(i,i/2+1))))
binom1 = dexp(lgamma(1.0d0*(i+1)) & binom1 = dexp(logabsgamma(1.0d0*(i+1)) &
- lgamma(1.0d0*((i/2)+1)) & - logabsgamma(1.0d0*((i/2)+1)) &
- lgamma(1.0d0*(i-((i/2))+1))); - logabsgamma(1.0d0*(i-((i/2))+1)));
binom2 = dexp(lgamma(1.0d0*(i+1)) & binom2 = dexp(logabsgamma(1.0d0*(i+1)) &
- lgamma(1.0d0*(((i/2)+1)+1)) & - logabsgamma(1.0d0*(((i/2)+1)+1)) &
- lgamma(1.0d0*(i-((i/2)+1)+1))); - logabsgamma(1.0d0*(i-((i/2)+1)+1)));
dimcsfpercfg = max(1,nint(binom1 - binom2)) dimcsfpercfg = max(1,nint(binom1 - binom2))
else else
!dimcsfpercfg = max(1,nint((binom(i,(i+1)/2)-binom(i,(i+3)/2)))) !dimcsfpercfg = max(1,nint((binom(i,(i+1)/2)-binom(i,(i+3)/2))))
binom1 = dexp(lgamma(1.0d0*(i+1)) & binom1 = dexp(logabsgamma(1.0d0*(i+1)) &
- lgamma(1.0d0*(((i+1)/2)+1)) & - logabsgamma(1.0d0*(((i+1)/2)+1)) &
- lgamma(1.0d0*(i-(((i+1)/2))+1))); - logabsgamma(1.0d0*(i-(((i+1)/2))+1)));
binom2 = dexp(lgamma(1.0d0*(i+1)) & binom2 = dexp(logabsgamma(1.0d0*(i+1)) &
- lgamma(1.0d0*((((i+3)/2)+1)+1)) & - logabsgamma(1.0d0*((((i+3)/2)+1)+1)) &
- lgamma(1.0d0*(i-(((i+3)/2)+1)+1))); - logabsgamma(1.0d0*(i-(((i+3)/2)+1)+1)));
dimcsfpercfg = max(1,nint(binom1 - binom2)) dimcsfpercfg = max(1,nint(binom1 - binom2))
endif endif
n_CSF += ncfg * dimcsfpercfg n_CSF += ncfg * dimcsfpercfg

View File

@ -57,8 +57,8 @@ END_PROVIDER
enddo enddo
! Deactivated temporarily: bug in N_csf ! Deactivated temporarily: bug in N_csf
! do_csf = s2_eig .and. only_expected_s2 .and. (expected_s2 == 0.d0) do_csf = s2_eig .and. only_expected_s2 .and. (expected_s2 == 0.d0)
do_csf = .False. ! do_csf = .False.
if (diag_algorithm == "Davidson") then if (diag_algorithm == "Davidson") then