diff --git a/CMakeLists.txt b/CMakeLists.txt index da67f5bb2..f5aeea57e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) @@ -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 diff --git a/man/xcontrol.7.adoc b/man/xcontrol.7.adoc index 229840948..4bc12d183 100644 --- a/man/xcontrol.7.adoc +++ b/man/xcontrol.7.adoc @@ -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':: @@ -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 diff --git a/man/xtb.1.adoc b/man/xtb.1.adoc index 9b885e59a..df8e4e669 100644 --- a/man/xtb.1.adoc +++ b/man/xtb.1.adoc @@ -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 @@ -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 diff --git a/src/docking/search_nci.f90 b/src/docking/search_nci.f90 index 00e584dcd..d2ca33420 100644 --- a/src/docking/search_nci.f90 +++ b/src/docking/search_nci.f90 @@ -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 @@ -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 @@ -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 diff --git a/src/prog/main.F90 b/src/prog/main.F90 index 0b410c5b7..ef6984fb8 100644 --- a/src/prog/main.F90 +++ b/src/prog/main.F90 @@ -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) @@ -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) diff --git a/src/set_module.f90 b/src/set_module.f90 index 6aee4b227..c63d2d57a 100644 --- a/src/set_module.f90 +++ b/src/set_module.f90 @@ -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') @@ -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)