Skip to content

Commit

Permalink
ONIOM results (#917)
Browse files Browse the repository at this point in the history
Signed-off-by: albert <92109627+Albkat@users.noreply.github.com>
  • Loading branch information
Albkat committed Nov 28, 2023
1 parent 26a3403 commit ddc8329
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
23 changes: 23 additions & 0 deletions src/main/property.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
3 changes: 3 additions & 0 deletions src/prog/main.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 0 additions & 2 deletions src/xtb/calculator.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ddc8329

Please sign in to comment.