Skip to content

Commit

Permalink
Charge and UHF input bug fixes for docking (#771)
Browse files Browse the repository at this point in the history
* Bug Fix for charges in aISS

Signed-off-by: cplett <82893466+cplett@users.noreply.github.com>

* Bug Fix for UHF in aISS

Signed-off-by: cplett <82893466+cplett@users.noreply.github.com>

* Add aISS citation

Signed-off-by: cplett <82893466+cplett@users.noreply.github.com>

---------

Signed-off-by: cplett <82893466+cplett@users.noreply.github.com>
  • Loading branch information
cplett authored Mar 20, 2023
1 parent 767c9c1 commit 037c151
Showing 1 changed file with 29 additions and 10 deletions.
39 changes: 29 additions & 10 deletions src/prog/dock.f90
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,17 @@ subroutine xtbDock(env, argParser)

!> Print an informative banner
call dockingHeader(env%unit)
!> make sure you cannot blame us for destroying your computer
call disclamer(env%unit)
!> Citations
write(env%unit,'(3x,a)') &
"Cite this work as:", &
"* C. Plett, S. Grimme, Angew. Chem. Int. Ed. 2023, 62, e202214477.",&
"DOI: 10.1002/anie.202214477",&
""

!> Check .CHRG, .UHF
call check_for_files(env)

!> Parse arguments
call parseArguments(env, argParser, fname)
Expand Down Expand Up @@ -156,6 +167,14 @@ subroutine xtbDock(env, argParser)
call reader%close
call env%checkpoint("Could not read geometry from '"//fnameB//"'")

!> Set molecular charges
molA%chrg = chrg(1)
molB%chrg = chrg(2)

!> Set molecular charges
molA%uhf = uhf(1)
molB%uhf = uhf(2)

!> Print current time
call prdate('S')

Expand All @@ -166,9 +185,6 @@ subroutine xtbDock(env, argParser)
call set_iff_param
fnam = 'xtblmoinfo'

!> Check .CHRG, .UHF and xcontrol
call check_for_files(env, molA, molB)

!> Printout Settings
call dockingPrintout(env%unit, fnameA, fnameB, molA, molB)

Expand Down Expand Up @@ -760,12 +776,10 @@ subroutine dockingHelp(iunit)

end subroutine dockingHelp

subroutine check_for_files(env, molA, molB)
subroutine check_for_files(env)

!> Calculation environment
type(TEnvironment), intent(inout) :: env
!> Molecular structure data
type(TMolecule), intent(inout) :: molA, molB

character(len=*), parameter :: source = "iff_file_read"

Expand All @@ -791,7 +805,7 @@ subroutine check_for_files(env, molA, molB)
call env%warning('.CHRG has only one line!')
else
if (getValue(env, cdum, charge)) then
molA%chrg = charge
chrg(1) = charge
end if
end if
!> Charge molB
Expand All @@ -800,7 +814,7 @@ subroutine check_for_files(env, molA, molB)
call env%warning('.CHRG has only two lines!')
else
if (getValue(env, cdum, charge)) then
molB%chrg = charge
chrg(2) = charge
end if
end if

Expand All @@ -812,20 +826,25 @@ subroutine check_for_files(env, molA, molB)
!> Number of unpaired electrons
call open_file(ich, '.UHF', 'r')
if (ich .ne. -1) then
!> Total number
call getline(ich, cdum, iostat=err)
if (err /= 0) then
call env%error('.UHF is empty!', source)
end if
call getline(ich, cdum, iostat=err)
if (err /= 0) then
call env%error('.UHF is empty!', source)
else
if (getValue(env, cdum, elect)) then
molA%uhf = elect
uhf(1) = elect
end if
end if
call getline(ich, cdum, iostat=err)
if (err /= 0) then
call env%warning('.UHF has only one line!')
else
if (getValue(env, cdum, elect)) then
molB%uhf = elect
uhf(2) = elect
end if
end if
call close_file(ich)
Expand Down

0 comments on commit 037c151

Please # to comment.