9
1
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-07-26 04:17:29 +02:00

Merge pull request #172 from v1j4y/fixNcsfCalculation

Fix for `Floating-point exception` during the calculation of Ncsf
This commit is contained in:
Anthony Scemama 2021-07-28 14:13:40 +02:00 committed by GitHub
commit 820e58c6fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -56,6 +56,11 @@
endif endif
endif endif
ncfg = ncfgpersomo - ncfgprev ncfg = ncfgpersomo - ncfgprev
if(i .EQ. 0 .OR. i .EQ. 1) then
dimcsfpercfg = 1
elseif( i .EQ. 3) then
dimcsfpercfg = 2
else
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(logabsgamma(1.0d0*(i+1)) & binom1 = dexp(logabsgamma(1.0d0*(i+1)) &
@ -75,6 +80,7 @@
- logabsgamma(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
endif
n_CSF += ncfg * dimcsfpercfg n_CSF += ncfg * dimcsfpercfg
if(cfg_seniority_index(i+2) > ncfgprev) then if(cfg_seniority_index(i+2) > ncfgprev) then
ncfgprev = cfg_seniority_index(i+2) ncfgprev = cfg_seniority_index(i+2)