Commit b7ecde3b authored by Yingzhou Li's avatar Yingzhou Li

Reinitialized saved variables for multi-calling routines. This bug is...

Reinitialized saved variables for multi-calling routines. This bug is discovered by @Benjamin Hourahine
parent b051cbd8
Pipeline #1700 passed with stage
in 2 minutes and 4 seconds
......@@ -206,10 +206,13 @@ contains
c = (r_h%cheb_est_lb+r_h%cheb_est_ub)/2.0_r8
r = (r_h%cheb_est_ub-r_h%cheb_est_lb)/2.0_r8
if (allocated(Vec_conv)) deallocate(Vec_conv)
allocate (Vec_conv(n))
Vec_conv = 0.0_r8
if (allocated(Vec_ev)) deallocate(Vec_ev)
allocate (Vec_ev(n))
Vec_ev = 0.0_r8
if (allocated(Vec_evold)) deallocate(Vec_evold)
allocate (Vec_evold(n))
Vec_evold = 0.0_r8
......
......@@ -205,6 +205,7 @@ contains
m = r_h%n_basis
n = r_h%n_state
n_state = r_h%n_state
n_restart = 0
ovlp_is_unit = r_h%ovlp_is_unit
max_iter = r_h%max_iter
tol_iter = r_h%tol_iter
......@@ -212,12 +213,16 @@ contains
niter = 0
next = 0
if (allocated(Vec_conv)) deallocate(Vec_conv)
allocate (Vec_conv(max_n))
Vec_conv = 0.0_r8
if (allocated(Vec_ev)) deallocate(Vec_ev)
allocate (Vec_ev(max_n))
Vec_ev = 0.0_r8
if (allocated(Vec_evsub)) deallocate(Vec_evsub)
allocate (Vec_evsub(max_n))
Vec_evsub = 0.0_r8
if (allocated(Vec_evold)) deallocate(Vec_evold)
allocate (Vec_evold(max_n))
Vec_evold = 0.0_r8
......
......@@ -243,6 +243,13 @@ contains
est_ub = r_h%omm_est_ub
icg = 0
lambda = 0.0_r8
lambda_d = 0.0_r8
lambda_n = 0.0_r8
e_min = 0.0_r8
e_min_old = 0.0_r8
x_min = 0.0_r8
e_diff = 0.0_r8
conv = .false.
call rci_op_null(task)
return
end if
......
......@@ -209,7 +209,7 @@ contains
real(r8), save :: trdiff ! difference of the trace
logical, save :: ovlp_is_unit ! ovlp is unit flag
logical, save :: conv_flag = .false. ! indicator for convergence
logical, save :: conv_flag ! indicator for convergence
integer(i4), save, allocatable :: act_idx(:)
......@@ -225,9 +225,17 @@ contains
tol_iter = r_h%tol_iter
tol_lock = r_h%ppcg_tol_lock
sbsize = r_h%ppcg_sbsize
sbsize_last = 0
rrstep = r_h%ppcg_rrstep
iter = 0
iter_diag = 0
lsize = 0
lsize3 = 0
nsb = 0
nact = 0
conv_flag = .false.
if (allocated(act_idx)) deallocate(act_idx)
allocate (act_idx(n))
act_idx = 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment