Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes GFN-FF bug for specific pi systems #836

Merged
merged 4 commits into from
Aug 1, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions src/gfnff/gfnff_ini.f90
Original file line number Diff line number Diff line change
Expand Up @@ -918,16 +918,16 @@ integer function itabrow6(i)
if(pr)then
write(env%unit,'(''Hueckel system :'',i3,'' charge : '',i3,'' ndim/Nel :'',2i5, &
& 3x, ''eps(HOMO/LUMO)'',2f12.6)')pis,ipis(pis),npi,nelpi,pisip(pis),pisea(pis)
if(pisip(pis).gt.0.40) then
write(env%unit,*)'WARNING: probably wrong pi occupation. Second attempt with Nel=Nel-1!'
do i=1,mol%n
if(piadr4(i).ne.0) write(env%unit,*) 'at,nb,topo%hyb,Npiel:', i,mol%sym(i),topo%nb(20,i),topo%hyb(i),piel(i)
enddo
nelpi=nelpi-1
Api = Apisave
call gfnffqmsolve(.false.,Api,S,.false.,300.0d0,npi,0,nelpi,dum,occ,eps) !diagonalize
call PREIG(6,occ,1.0d0,eps,1,npi)
endif
end if
if(pisip(pis).gt.0.40) then
write(env%unit,*)'WARNING: probably wrong pi occupation. Second attempt with Nel=Nel-1!'
do i=1,mol%n
if(piadr4(i).ne.0) write(env%unit,*) 'at,nb,topo%hyb,Npiel:', i,mol%sym(i),topo%nb(20,i),topo%hyb(i),piel(i)
enddo
nelpi=nelpi-1
Api = Apisave
call gfnffqmsolve(.false.,Api,S,.false.,300.0d0,npi,0,nelpi,dum,occ,eps) !diagonalize
call PREIG(6,occ,1.0d0,eps,1,npi)
endif
! save BO
do i=1,topo%nbond
Expand Down
4 changes: 2 additions & 2 deletions test/unit/test_gfnff.f90
Original file line number Diff line number Diff line change
Expand Up @@ -487,10 +487,10 @@ subroutine test_gfnff_scaleup(error)
character(len=*), parameter :: solvents(5) = [character(len=20) ::&
& "h2o", "acetonitrile", "toluene", "ether", "dmso"]
real(wp), parameter :: ref_energies(5) = &
&[-4.6919926039901_wp, -8.8807760138817_wp, -13.311107073100_wp, &
&[-4.6919926039901_wp, -8.8807760138817_wp, -13.414631887285326_wp, &
& -13.822994859730_wp, -20.577952329212_wp]
real(wp), parameter :: ref_gnorms(5) = &
&[0.05947676640487_wp, 0.09522104624089_wp, 0.16195989065950_wp, &
&[0.05947676640487_wp, 0.09522104624089_wp, 0.1786821106451192_wp, &
& 0.12496592222660_wp, 0.19366599743810_wp]

call init(env)
Expand Down