Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add pointer for CLI charge initialization #834

Merged
merged 2 commits into from
Jul 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/prog/main.F90
Original file line number Diff line number Diff line change
Expand Up @@ -346,10 +346,10 @@ subroutine xtbMain(env, argParser)

! Special CT input file case
if (mol%chrg /= 0.0_wp) then
if (set%ichrg == 0) then
set%ichrg = nint(mol%chrg)
else
if (set%clichrg) then
call env%warning("Charge in sdf/mol input was overwritten", source)
else
set%ichrg = nint(mol%chrg)
end if
end if

Expand Down
8 changes: 5 additions & 3 deletions src/set_module.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1109,9 +1109,11 @@ subroutine set_chrg(env,val)


if (set1) then

set%clichrg = .true.
ind = index(val,":")

! inner:outer !
! oniom inner:outer !
if (ind.ne.0) then
if (getValue(env,val(:ind-1),idum1) .and. &
& getValue(env,val(ind+1:),idum2)) then
Expand All @@ -1122,10 +1124,10 @@ subroutine set_chrg(env,val)
call env%error('Charge could not be read from your argument',source)
endif

! normal single chrg !
! conventional !
else

! transform character into int !
! char into int !
if (getValue(env,val,idum)) then
set%ichrg = idum
else
Expand Down
1 change: 1 addition & 0 deletions src/setparam.f90
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,7 @@ module xtb_setparam
! information about molecule
!! ------------------------------------------------------------------------
integer :: ichrg = 0
logical :: clichrg = .false.
integer :: nalphabeta = 0

! cannot be set by .xtbrc/setblock
Expand Down