Skip to content

Commit

Permalink
accuracy->set%acc (#866)
Browse files Browse the repository at this point in the history
Signed-off-by: albert <92109627+Albkat@users.noreply.github.com>
  • Loading branch information
Albkat authored Sep 17, 2023
1 parent 000b4f9 commit a52f3d3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 16 deletions.
26 changes: 10 additions & 16 deletions src/prog/main.F90
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ subroutine xtbMain(env, argParser)
integer :: nFiles, iFile
integer :: rohf,err
real(wp) :: dum5,egap,etot,ipeashift
real(wp) :: zero,t0,t1,w0,w1,acc,etot2,g298
real(wp) :: zero,t0,t1,w0,w1,etot2,g298
real(wp) :: one,two
real(wp) :: ea,ip
real(wp) :: vomega
Expand Down Expand Up @@ -213,7 +213,7 @@ subroutine xtbMain(env, argParser)

! ------------------------------------------------------------------------
!> read the command line arguments
call parseArguments(env, argParser, xcontrol, fnv, acc, lgrad, &
call parseArguments(env, argParser, xcontrol, fnv, lgrad, &
& restart, gsolvstate, strict, copycontrol, coffee, printTopo, oniom, tblite)

!> Spin-polarization is only available in the tblite library
Expand Down Expand Up @@ -415,8 +415,6 @@ subroutine xtbMain(env, argParser)

call setup_summary(env%unit,mol%n,fname,xcontrol,chk%wfn,xrc)

if(set%fit) acc=0.2 ! higher SCF accuracy during fit

! ------------------------------------------------------------------------
!> 2D => 3D STRUCTURE CONVERTER
! ------------------------------------------------------------------------
Expand Down Expand Up @@ -540,7 +538,7 @@ subroutine xtbMain(env, argParser)

! ------------------------------------------------------------------------
!> Obtain the parameter data
call newCalculator(env, mol, calc, fnv, restart, acc, oniom, iff_data, tblite)
call newCalculator(env, mol, calc, fnv, restart, set%acc, oniom, iff_data, tblite)
call env%checkpoint("Could not setup single-point calculator")

call initDefaults(env, calc, mol, gsolvstate)
Expand Down Expand Up @@ -648,7 +646,7 @@ subroutine xtbMain(env, argParser)
if (set%runtyp.eq.p_run_bhess) then
call set_metadynamic(metaset,mol%n,mol%at,mol%xyz)
call get_kopt (metaset,env,restart,mol,chk,calc,egap,set%etemp,set%maxscciter, &
& set%optset%maxoptcycle,set%optset%optlev,etot,g,sigma,acc)
& set%optset%maxoptcycle,set%optset%optlev,etot,g,sigma,set%acc)
end if

! ------------------------------------------------------------------------
Expand Down Expand Up @@ -892,7 +890,7 @@ subroutine xtbMain(env, argParser)
select type(calc)
type is(TxTBCalculator)
call main_property(iprop,env,mol,chk%wfn,calc%basis,calc%xtbData,res, &
& calc%solvation,acc)
& calc%solvation,set%acc)
call main_cube(set%verbose,mol,chk%wfn,calc%basis,res)
end select
endif
Expand Down Expand Up @@ -1142,7 +1140,7 @@ end subroutine xtbMain


!> Parse command line arguments and forward them to settings
subroutine parseArguments(env, args, inputFile, paramFile, accuracy, lgrad, &
subroutine parseArguments(env, args, inputFile, paramFile, lgrad, &
& restart, gsolvstate, strict, copycontrol, coffee, printTopo, oniom, tblite)
use xtb_mctc_global, only : persistentEnv

Expand All @@ -1161,9 +1159,6 @@ subroutine parseArguments(env, args, inputFile, paramFile, accuracy, lgrad, &
!> Parameter file name
character(len=:),allocatable,intent(out) :: paramFile

!> Accuracy number for numerical thresholds
real(wp), intent(out) :: accuracy

!> Reference state for solvation free energies
integer, intent(out) :: gsolvstate

Expand Down Expand Up @@ -1211,7 +1206,6 @@ subroutine parseArguments(env, args, inputFile, paramFile, accuracy, lgrad, &
restart = .true.
copycontrol = .false.
lgrad = .false.
accuracy = 1.0_wp
gsolvstate = solutionState%gsolv
tblite%color = get_xtb_feature('color')

Expand Down Expand Up @@ -1313,16 +1307,16 @@ subroutine parseArguments(env, args, inputFile, paramFile, accuracy, lgrad, &
if (ddum.lt.1.e-4_wp) then
call env%warning("We cannot provide this level of accuracy, "//&
& "resetted accuracy to 0.0001", source)
accuracy = 1.e-4_wp
set%acc = 1.e-4_wp
else if (ddum.gt.1.e+3_wp) then
call env%warning("We cannot provide this level of accuracy, "//&
& "resetted accuracy to 1000", source)
accuracy = 1.e+3_wp
set%acc = 1.e+3_wp
else
accuracy = ddum
set%acc = ddum
endif
end if
tblite%accuracy = accuracy
tblite%accuracy = set%acc
else
call env%error("Accuracy is not provided", source)
end if
Expand Down
1 change: 1 addition & 0 deletions src/set_module.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1057,6 +1057,7 @@ end subroutine set_derived
subroutine set_fit
implicit none
set%fit = .true.
set%acc = 0.2_wp
end subroutine set_fit

subroutine set_cma
Expand Down
1 change: 1 addition & 0 deletions src/setparam.f90
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ module xtb_setparam
type :: TSet
integer :: gfn_method = -1
integer :: maxscciter = 250
real(wp) :: acc = 1.0_wp
logical :: newdisp = .true.
logical :: solve_scc = .true.
logical :: periodic = .false.
Expand Down

0 comments on commit a52f3d3

Please sign in to comment.