From ddc83293f11e6f6cd8bc9b4e1c62b180c098ca3f Mon Sep 17 00:00:00 2001 From: albert <92109627+Albkat@users.noreply.github.com> Date: Tue, 28 Nov 2023 10:13:33 +0100 Subject: [PATCH] ONIOM results (#917) Signed-off-by: albert <92109627+Albkat@users.noreply.github.com> --- src/main/property.F90 | 23 +++++++++++++++++++++++ src/prog/main.F90 | 3 +++ src/xtb/calculator.f90 | 2 -- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/src/main/property.F90 b/src/main/property.F90 index bbeaca3be..d7806d8fc 100644 --- a/src/main/property.F90 +++ b/src/main/property.F90 @@ -70,6 +70,29 @@ subroutine write_energy_gff(iunit,sccres,frqres,hess) write(iunit,'(11x,49("-"))') end subroutine write_energy_gff +subroutine write_energy_oniom(iunit,sccres,frqres,hess) + use xtb_type_data + implicit none + integer, intent(in) :: iunit ! file handle (usually output_unit=6) + logical, intent(in) :: hess + type(scc_results), intent(in) :: sccres + type(freq_results),intent(in) :: frqres + character(len=*),parameter :: outfmt = '(10x,"|",1x,a,f18.12,1x,a,1x,"|")' + + write(iunit,'(a)') + write(iunit,'(11x,49("-"))') + if (hess) then + write(iunit,outfmt) "ONIOM TOTAL ENERGY ", frqres%etot, "Eh " + write(iunit,outfmt) "ONIOM TOTAL ENTHALPY ", frqres%etot+frqres%htot,"Eh " + write(iunit,outfmt) "ONIOM TOTAL FREE ENERGY ", frqres%etot+frqres%gtot,"Eh " + write(iunit,outfmt) "ONIOM GRADIENT NORM ", frqres%gnorm, "Eh/α" + else + write(iunit,outfmt) "ONIOM TOTAL ENERGY ", sccres%e_total,"Eh " + write(iunit,outfmt) "ONIOM GRADIENT NORM ", sccres%gnorm, "Eh/α" + endif + write(iunit,'(11x,49("-"))') +end subroutine write_energy_oniom + subroutine main_property & (iunit,env,mol,wfx,basis,xtbData,res,solvModel,acc) diff --git a/src/prog/main.F90 b/src/prog/main.F90 index 18abfe80f..ef530ea72 100644 --- a/src/prog/main.F90 +++ b/src/prog/main.F90 @@ -958,6 +958,9 @@ subroutine xtbMain(env, argParser) type is(TxTBCalculator) call write_energy(env%unit,res,fres, & & (set%runtyp.eq.p_run_hess).or.(set%runtyp.eq.p_run_ohess).or.(set%runtyp.eq.p_run_bhess)) + type is(TOniomCalculator) + call write_energy_oniom(env%unit,res,fres, & + & (set%runtyp.eq.p_run_hess).or.(set%runtyp.eq.p_run_ohess.or.(set%runtyp.eq.p_run_bhess))) class default call write_energy_gff(env%unit,res,fres, & & (set%runtyp.eq.p_run_hess).or.(set%runtyp.eq.p_run_ohess).or.(set%runtyp.eq.p_run_bhess)) diff --git a/src/xtb/calculator.f90 b/src/xtb/calculator.f90 index 1d0fe8019..c4d0d2546 100644 --- a/src/xtb/calculator.f90 +++ b/src/xtb/calculator.f90 @@ -298,13 +298,11 @@ subroutine singlepoint(self, env, mol, chk, printlevel, restart, & ! ------------------------------------------------------------------------ ! fixing of certain atoms - ! print*,abs(efix/etot) energy = energy + efix results%e_total = energy results%gnorm = norm2(gradient) if (fixset%n.gt.0) then do i=1, fixset%n - !print*,i,fixset%atoms(i) gradient(1:3,fixset%atoms(i))=0 enddo endif