Skip to content

Commit

Permalink
make xtb compilable with latest tblite commit (6b7ee4e)
Browse files Browse the repository at this point in the history
Signed-off-by: Marcel Mueller <marcel.mueller@thch.uni-bonn.de>
  • Loading branch information
marcelmbn committed Jul 31, 2024
1 parent 26b2801 commit 6f68d1a
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 11 deletions.
8 changes: 8 additions & 0 deletions src/dipro.F90
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ subroutine get_jab(env, tblite, mol, fragment, dipro)
!=========================set up calculator===========================================

call get_calculator(xcalc, struc, tblite%method, error)
if (allocated(error)) then
call env%error(error%message, source)
return
end if
call new_wavefunction(wfn, struc%nat, xcalc%bas%nsh, xcalc%bas%nao, &
& 1, set%etemp * ktoau)
wfn%nspin=1
Expand Down Expand Up @@ -258,6 +262,10 @@ subroutine get_jab(env, tblite, mol, fragment, dipro)
write(*,'(A,I2)') "unpaired e- of fragment : ", mfrag(ifr)%uhf

call get_calculator(fcalc(ifr), mfrag(ifr), tblite%method, error)
if (allocated(error)) then
call env%error(error%message, source)
return
end if
!> mol%charge is updated automatically from wfn by tblite library
call new_wavefunction(wfx(ifr), mfrag(ifr)%nat, fcalc(ifr)%bas%nsh, fcalc(ifr)%bas%nao, &
& 1, set%etemp * ktoau)
Expand Down
6 changes: 3 additions & 3 deletions src/dipro/xtb.F90
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ subroutine get_calculator(xcalc, mol, method, error)
call fatal_error(error, "Unknown method '"//method//"' requested")
! error stop
case("gfn2")
call new_gfn2_calculator(xcalc, mol)
call new_gfn2_calculator(xcalc, mol, error)
case("gfn1")
call new_gfn1_calculator(xcalc, mol)
call new_gfn1_calculator(xcalc, mol, error)
case("ipea1")
call new_ipea1_calculator(xcalc, mol)
call new_ipea1_calculator(xcalc, mol, error)
end select
end subroutine get_calculator
#endif
Expand Down
14 changes: 7 additions & 7 deletions src/tblite/calculator.F90
Original file line number Diff line number Diff line change
Expand Up @@ -150,16 +150,16 @@ subroutine newTBLiteCalculator(env, mol, calc, input)
case default
call fatal_error(error, "Unknown method '"//method//"' requested")
case("gfn2")
call new_gfn2_calculator(calc%tblite, struc)
call new_gfn2_calculator(calc%tblite, struc, error)
case("gfn1")
call new_gfn1_calculator(calc%tblite, struc)
call new_gfn1_calculator(calc%tblite, struc, error)
case("ipea1")
call new_ipea1_calculator(calc%tblite, struc)
call new_ipea1_calculator(calc%tblite, struc, error)
case("ceh")
calc%guess = method
calc%nspin = 1
calc%etemp = 5000.0_wp * kt
call new_ceh_calculator(calc%tblite, struc)
calc%etemp = 5000.0_wp * kt ! MM (20240731): TODO: Update this value when CEH-2.0.0 is released
call new_ceh_calculator(calc%tblite, struc, error)
end select
end if
if (allocated(error)) then
Expand Down Expand Up @@ -244,7 +244,7 @@ subroutine newTBLiteWavefunction(env, mol, calc, chk)
block
use tblite_context, only : context_type, context_terminal
use tblite_context_terminal, only : escape
use tblite_ceh_singlepoint, only : ceh_guess
use tblite_ceh_singlepoint, only : ceh_singlepoint
use tblite_lapack_solver, only : lapack_solver
use tblite_lapack_solver, only : lapack_algorithm
type(context_type) :: ctx
Expand All @@ -255,7 +255,7 @@ subroutine newTBLiteWavefunction(env, mol, calc, chk)
write (env%unit, '(1x,a)') escape(ctx%terminal%cyan) // "Calculation of CEH charges" // &
& escape(ctx%terminal%reset)

call ceh_guess(ctx, calc%tblite, struc, error, wfn, calc%accuracy, 1)
call ceh_singlepoint(ctx, calc%tblite, struc, error, wfn, calc%accuracy, 1)
end block
end select
end associate
Expand Down
2 changes: 1 addition & 1 deletion subprojects/mstore.wrap
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[wrap-git]
directory = mstore
url = https://github.com/grimme-lab/mstore
revision = v0.2.0
revision = v0.3.0

0 comments on commit 6f68d1a

Please sign in to comment.