Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/Thomas3R/xtb into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas3R committed Dec 12, 2023
2 parents 9c97293 + be1102b commit 4152691
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 15 deletions.
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

cmake_minimum_required(VERSION 3.17)
option(WITH_OBJECT "To build using object library" TRUE)
option(INSTALL_MODULES "Install Fortran module files to include directory." FALSE)

# Buggy CMake versions
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.27.0)
Expand Down Expand Up @@ -249,6 +250,15 @@ install(
"${CMAKE_INSTALL_INCLUDEDIR}"
)

if (INSTALL_MODULES)
install(
DIRECTORY
"${PROJECT_BINARY_DIR}/include/"
DESTINATION
"${CMAKE_INSTALL_INCLUDEDIR}"
)
endif()

# xtb-parameters
install(
FILES
Expand Down
4 changes: 2 additions & 2 deletions man/xcontrol.7.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ NOTE: the scan parser will always terminate in error if the instruction could

$scc
~~~~
*temp*='real'::
*temp, etemp*='real'::
electronic temperature for the Fermi smearing

*broydamp*='real'::
Expand All @@ -448,7 +448,7 @@ $scc
*guess*=gasteiger|goedecker|sad::
different possible guess charges for GFN2-xTB SCC calculation

*maxiteration*='int'::
*iterations, maxiterations*='int'::
adjusts the number of SCC iterations in the first/last SCC calculation

$split
Expand Down
7 changes: 5 additions & 2 deletions man/xtb.1.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ OPTIONS
The inner region is given as comma-separated indices directly in the commandline
or in a file with each index on a separate line.

*--etemp* 'REAL'::
electronic temperature (default = 300K)
*--etemp, --temp* 'REAL'::
electronic temperature for SCC (default = 300K)

*--esp* ::
calculate electrostatic potential on VdW-grid
Expand All @@ -103,6 +103,9 @@ OPTIONS
*-a, --acc* 'REAL'::
accuracy for SCC calculation, lower is better (default = 1.0)

*--iterations, --maxiterations* 'INT'::
maximum number of SCC iterations per single point calculation (default = 250)

*--vparam* 'FILE'::
Parameter file for xTB calculation

Expand Down
33 changes: 26 additions & 7 deletions src/docking/search_nci.f90
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ module xtb_docking_search_nci
use xtb_eeq, only: goedecker_chrgeq
use xtb_basis, only: newBasisset
use xtb_gfnff_neighbor, only: TNeigh
use xtb_io_writer, only : writeMolecule
use xtb_mctc_filetypes, only : generateFileName
implicit none

private
Expand Down Expand Up @@ -174,6 +176,8 @@ END SUBROUTINE Quicksort
real(wp) :: tmp_e
!> Minimumposition
integer :: minpos
!> For outprint
character(len=:),allocatable :: extension, fin_name

!> Parameter
real(wp), parameter :: pi2 = 2*3.14159265358979_wp
Expand Down Expand Up @@ -949,14 +953,29 @@ END SUBROUTINE Quicksort

call remove_file(iopt)

call open_file(ifinal, 'best.xyz', 'w')
write (ifinal, '(i0)') comb%n
write (ifinal, '(f20.14)') final_e(1)
do j = 1, comb%n
write (ifinal, '(a4,2x,3f20.14)') comb%sym(j), xyz_opt(1, j, 1)*autoang, &
& xyz_opt(2, j, 1)*autoang, xyz_opt(3, j, 1)*autoang
end do
! Write best structure in format of the largest input molecule
comb%xyz(:,:) = xyz_opt(:,:,1)
if(molA%n >= molB%n) then
comb%ftype=molA%ftype
else
comb%ftype=molB%ftype
end if
call generateFileName(fin_name, 'best', '', comb%ftype)
call open_file(ifinal, fin_name, 'w')
call writeMolecule(comb, ifinal, energy=final_e(1))
!If not xyz then best.xyz is written to not have api break
if(comb%ftype /= 1)then
call open_file(ifinal, 'best.xyz', 'w')
write (ifinal, '(i0)') comb%n
write (ifinal, '(f20.14)') final_e(1)
do j = 1, comb%n
write (ifinal, '(a4,2x,3f20.14)') comb%sym(j), xyz_opt(1, j, 1)*autoang, &
& xyz_opt(2, j, 1)*autoang, xyz_opt(3, j, 1)*autoang
end do
end if
call close_file(ifinal)


call delete_file(set%opt_logfile)

!> Printout Interaction Energy
Expand Down
4 changes: 2 additions & 2 deletions src/prog/main.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1553,7 +1553,7 @@ subroutine parseArguments(env, args, inputFile, paramFile, lgrad, &
case('--cut')
call set_cut

case('--etemp')
case('--etemp', '--temp')
call args%nextArg(sec)
if (allocated(sec)) then
call set_scc(env,'temp',sec)
Expand Down Expand Up @@ -1635,7 +1635,7 @@ subroutine parseArguments(env, args, inputFile, paramFile, lgrad, &
call set_write(env,'fod','true')
call set_scc(env,'temp','5000.0')

case('--iterations')
case('--iterations', '--maxiterations')
call args%nextArg(sec)
if (allocated(sec)) then
call set_scc(env,'maxiterations',sec)
Expand Down
4 changes: 2 additions & 2 deletions src/set_module.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1520,7 +1520,7 @@ subroutine set_scc(env,key,val)
select case(key)
case default ! do nothing
call env%warning("the key '"//key//"' is not recognized by scc",source)
case('temp')
case('etemp','temp')
if (getValue(env,val,ddum).and.set1) set%eTemp = ddum
set1 = .false.
case('broydamp')
Expand All @@ -1538,7 +1538,7 @@ subroutine set_scc(env,key,val)
set%guess_charges = p_guess_multieq
endif
set3 = .false.
case('maxiterations')
case('iterations','maxiterations')
if (getValue(env,val,idum).and.set4) then
if (idum.le.0) then
call env%warning('negative SCC-Iterations make no sense',source)
Expand Down

0 comments on commit 4152691

Please sign in to comment.