From 2c5cd11b814bf185655ca1d15315d1c65631ddab Mon Sep 17 00:00:00 2001 From: MtoLStoN <70513124+MtoLStoN@users.noreply.github.com> Date: Wed, 26 Jul 2023 17:43:27 +0200 Subject: [PATCH 1/4] Fixes GFN-FF bug for specific pi systems Signed-off-by: MtoLStoN <70513124+MtoLStoN@users.noreply.github.com> --- src/gfnff/gfnff_ini.f90 | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/gfnff/gfnff_ini.f90 b/src/gfnff/gfnff_ini.f90 index 41f605f67..00caa44b7 100644 --- a/src/gfnff/gfnff_ini.f90 +++ b/src/gfnff/gfnff_ini.f90 @@ -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 From 5d73f0dc4886e98f730810f9489b93a2b892c906 Mon Sep 17 00:00:00 2001 From: MtoLStoN <70513124+MtoLStoN@users.noreply.github.com> Date: Wed, 26 Jul 2023 17:59:06 +0200 Subject: [PATCH 2/4] Change Tests accordingly. Signed-off-by: MtoLStoN <70513124+MtoLStoN@users.noreply.github.com> --- test/unit/test_gfnff.f90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/unit/test_gfnff.f90 b/test/unit/test_gfnff.f90 index 524c12772..03f446c8c 100644 --- a/test/unit/test_gfnff.f90 +++ b/test/unit/test_gfnff.f90 @@ -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) From 163d6c4a3b8b0f1f71fbc3bb09c57dca1a4b6efc Mon Sep 17 00:00:00 2001 From: MtoLStoN <70513124+MtoLStoN@users.noreply.github.com> Date: Mon, 31 Jul 2023 11:40:53 +0200 Subject: [PATCH 3/4] Change Fermi Temp for special case to 4000. Change Test accordingly. Signed-off-by: MtoLStoN <70513124+MtoLStoN@users.noreply.github.com> --- src/gfnff/gfnff_ini.f90 | 2 +- test/unit/test_gfnff.f90 | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gfnff/gfnff_ini.f90 b/src/gfnff/gfnff_ini.f90 index 00caa44b7..e3b137d96 100644 --- a/src/gfnff/gfnff_ini.f90 +++ b/src/gfnff/gfnff_ini.f90 @@ -926,7 +926,7 @@ integer function itabrow6(i) enddo nelpi=nelpi-1 Api = Apisave - call gfnffqmsolve(.false.,Api,S,.false.,300.0d0,npi,0,nelpi,dum,occ,eps) !diagonalize + call gfnffqmsolve(.false.,Api,S,.false.,4000.0d0,npi,0,nelpi,dum,occ,eps) !diagonalize call PREIG(6,occ,1.0d0,eps,1,npi) endif ! save BO diff --git a/test/unit/test_gfnff.f90 b/test/unit/test_gfnff.f90 index 03f446c8c..bea7b1daf 100644 --- a/test/unit/test_gfnff.f90 +++ b/test/unit/test_gfnff.f90 @@ -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.414631887285326_wp, & + &[-4.6919926039901_wp, -8.8807760138817_wp, -13.40715596616603_wp, & & -13.822994859730_wp, -20.577952329212_wp] real(wp), parameter :: ref_gnorms(5) = & - &[0.05947676640487_wp, 0.09522104624089_wp, 0.1786821106451192_wp, & + &[0.05947676640487_wp, 0.09522104624089_wp, 0.1753769495334539_wp, & & 0.12496592222660_wp, 0.19366599743810_wp] call init(env) From 78b6202631aa6505a1d287b4dc5c04dce6c6f1d2 Mon Sep 17 00:00:00 2001 From: MtoLStoN <70513124+MtoLStoN@users.noreply.github.com> Date: Mon, 31 Jul 2023 16:29:43 +0200 Subject: [PATCH 4/4] More informative printout. Signed-off-by: MtoLStoN <70513124+MtoLStoN@users.noreply.github.com> --- src/gfnff/gfnff_ini.f90 | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/gfnff/gfnff_ini.f90 b/src/gfnff/gfnff_ini.f90 index e3b137d96..d88b3e6b0 100644 --- a/src/gfnff/gfnff_ini.f90 +++ b/src/gfnff/gfnff_ini.f90 @@ -920,7 +920,7 @@ integer function itabrow6(i) & 3x, ''eps(HOMO/LUMO)'',2f12.6)')pis,ipis(pis),npi,nelpi,pisip(pis),pisea(pis) end if if(pisip(pis).gt.0.40) then - write(env%unit,*)'WARNING: probably wrong pi occupation. Second attempt with Nel=Nel-1!' + write(env%unit,'(a,i0,a)')'WARNING: probably wrong pi occupation for system ',pis,'. 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 @@ -928,6 +928,16 @@ integer function itabrow6(i) Api = Apisave call gfnffqmsolve(.false.,Api,S,.false.,4000.0d0,npi,0,nelpi,dum,occ,eps) !diagonalize call PREIG(6,occ,1.0d0,eps,1,npi) + do i=1,npi ! save IP/EA + if(occ(i).gt.0.5) then + pisip(pis)=eps(i) ! IP + if(i+1.lt.npi)pisea(pis)=eps(i+1) ! EA + endif + enddo + 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) + end if endif ! save BO do i=1,topo%nbond