Skip to content

Commit

Permalink
Fix for making ALPB h2o compatible with tblite calculator (crest-lab#271
Browse files Browse the repository at this point in the history
)

* tblite apparently only knew "alpb water", but not "alpb h2o". fixed that

---------

Signed-off-by: Philipp Pracht <[email protected]>
  • Loading branch information
pprcht authored Feb 28, 2024
1 parent 9967345 commit 89d60ab
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/calculator/tblite_api.F90
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ subroutine tblite_add_solv(mol,chrg,uhf,ctx,wfn,tbcalc,smodel,solvent)
class(tblite_solvation_type),allocatable :: solv
type(solvation_input),allocatable :: solv_inp
type(solvent_data) :: solv_data
character(len=:),allocatable :: str
character(len=:),allocatable :: str,solvdum
logical :: pr

real(wp) :: etemp_au,energy
Expand All @@ -182,30 +182,37 @@ subroutine tblite_add_solv(mol,chrg,uhf,ctx,wfn,tbcalc,smodel,solvent)
return
end if

!> special case: tblite dosen't know 'h2o', only 'water'

pr = (ctx%verbosity > 0)

!>--- make an mctcmol object from mol
call tblite_mol2mol(mol,chrg,uhf,mctcmol)

if(pr) call ctx%message("tblite> setting up tblite implicit solvation")
!>--- generat solvation parametrization
solv_data = get_solvent_data(solvent)
if(solvent == 'h2o')then !> special case: tblite doesn't know 'h2o', only 'water' ...
solvdum = 'water'
else
solvdum = solvent
endif
solv_data = get_solvent_data(solvdum)
if (solv_data%eps <= 0.0_wp) then
if(pr) call ctx%message("tblite> Unknown solvent!")
return
end if
allocate (solv_inp)
select case (trim(smodel))
case ('gbsa')
if(pr) call ctx%message("tblite> using GBSA/"//solvent)
if(pr) call ctx%message("tblite> using GBSA/"//solvdum)
allocate (solv_inp%alpb)
solv_inp%alpb = alpb_input(solv_data%eps,alpb=.false.)
case ('cpcm')
if(pr) call ctx%message("tblite> using CPCM/"//solvent)
if(pr) call ctx%message("tblite> using CPCM/"//solvdum)
allocate (solv_inp%cpcm)
solv_inp%cpcm = cpcm_input(solv_data%eps)
case ('alpb')
if(pr) call ctx%message("tblite> using ALPB/"//solvent)
if(pr) call ctx%message("tblite> using ALPB/"//solvdum)
allocate (solv_inp%alpb)
solv_inp%alpb = alpb_input(solv_data%eps,alpb=.true.)
case default
Expand Down

0 comments on commit 89d60ab

Please sign in to comment.