Skip to content

Commit

Permalink
add pointer for CLI charge initialization (#834)
Browse files Browse the repository at this point in the history
* add clichrg identifier

Signed-off-by: Albert Katbashev <[email protected]>

* refine condition

Co-authored-by: Marcel Stahn <[email protected]>

---------

Signed-off-by: Albert Katbashev <[email protected]>
Co-authored-by: Albert Katbashev <[email protected]>
Co-authored-by: Marcel Stahn <[email protected]>
  • Loading branch information
3 people authored Jul 13, 2023
1 parent a623800 commit 89dd3ed
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
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

0 comments on commit 89dd3ed

Please sign in to comment.