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

update from master #1004

Merged
Merged
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
44 changes: 30 additions & 14 deletions src/solvation/hnd_coschg.F
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,7 @@ subroutine hnd_coschg(g_dens,ndens,rtdb,geom,basis,nat,nefc,
integer iter_cosmo_vem
integer l_efczfx, k_efczfx ! memory handles for fixed cosmo-vem charges
integer g_vem(3) ! ga handles for cosmo-vem GS potential, GS charges, and ES noneq charges
integer nefc_rtdb
double precision, external :: ddot
c
oprint_energies = util_print("cosmo_energies",print_never)
Expand Down Expand Up @@ -873,6 +874,28 @@ subroutine hnd_coschg(g_dens,ndens,rtdb,geom,basis,nat,nefc,
c
c ----- calculate qraw = q* = A^{-1}BQ -----
c
if (.not.rtdb_get(rtdb,'cosmo:n_raw',mt_int,1,nefc_rtdb))
c nefc_rtdb=0

iep=-99
ieq=-99
if (all) then
iep=i10
ieq=i20
else if (nucl) then
iep=i11
ieq=i21
else if (elec) then
iep=i12
ieq=i22
endif

if((nefc_rtdb.eq.0).or.(nefc_rtdb.ne.nefc)) then
call dfill(nefc,zero,dbl_mb(ieq),1)
status = rtdb_delete(rtdb,'cosmo:qraw')
status = rtdb_delete(rtdb,'cosmo:qrawn')
status = rtdb_delete(rtdb,'cosmo:qrawe')
else
if (all) then
if (.not.rtdb_get(rtdb,'cosmo:qraw',mt_dbl,nefc,
d dbl_mb(i20))) then
Expand All @@ -885,36 +908,29 @@ subroutine hnd_coschg(g_dens,ndens,rtdb,geom,basis,nat,nefc,
c If no raw nuclear COSMO charges were found initialize x=0
call dfill(nefc,zero,dbl_mb(i21),1)
endif
else if (elec) then
else if (elec) then
if (.not.rtdb_get(rtdb,'cosmo:qrawe',mt_dbl,nefc,
d dbl_mb(i22)))then
c If no raw electron COSMO charges were found initialize x=0
call dfill(nefc,zero,dbl_mb(i22),1)
endif
endif
endif
endif
c
direct=.true.
c
c ----- solve ... -----
c
iep=-99
ieq=-99
if (all) then
iep=i10
ieq=i20
else if (nucl) then
iep=i11
ieq=i21
else if (elec) then
iep=i12
ieq=i22
endif

call hnd_cg(nat,dbl_mb(iep),dbl_mb(ieq),nefc,
1 dbl_mb(i40),dbl_mb(i50),dbl_mb(i60),
d dbl_mb(i70),
2 efcc,efcs,efczz,efciat,ratm)
c
if (.not.rtdb_put(rtdb,'cosmo:n_raw',mt_int,1,nefc))
c call errquit('hnd_coschg: could not store n_raw COSMO ',
1 nefc,RTDB_ERR)

if (all) then
if (.not.rtdb_put(rtdb,'cosmo:qraw',mt_dbl,nefc,
d dbl_mb(i20))) then
Expand Down
Loading