Commit 8f23ac57 authored by Yingzhou Li's avatar Yingzhou Li

Updated rci reading matrix and OMM output eigenvalues

parent ccf43c07
......@@ -166,13 +166,11 @@ contains
implicit none
!**** INPUT ***********************************!
type(rci_handle), intent(in) :: r_h
!**** OUTPUT **********************************!
integer, intent(out) :: task
!**** INOUT ***********************************!
type(rci_handle), intent(inout) :: r_h
integer, intent(inout) :: ijob ! job id
type(rci_instr), intent(inout) :: iS
real(r8), intent(inout) :: resvec(:)
......@@ -580,11 +578,13 @@ contains
resvec(1) = e_min
if (e_diff <= tol_iter) then
conv = .true.
call rci_op_converge(task, conv)
ijob = SID_FINISH
call rci_op_null(task)
return
end if
if (icg > max_iter) then
call rci_op_converge(task, conv)
ijob = SID_FINISH
call rci_op_null(task)
return
end if
ijob = SID_UPDATE + 1
......@@ -801,6 +801,65 @@ contains
return
end if
! Determine whether to do RR
if (ijob == SID_FINISH) then
r_h%total_iter = icg
ijob = ijob + 1
call rci_op_null(task)
return
end if
! - HW = C'*HC
if (ijob == SID_FINISH + 1) then
call rci_op_gemm(iS, task, 'C', 'N', n, n, &
m, 1.0_r8, &
MID_C, m, MID_HC, m, 0.0_r8, &
MID_HW, max_n)
ijob = ijob + 1
return
end if
! - SW = C'*SC
if (ijob == SID_FINISH + 2) then
call rci_op_gemm(iS, task, 'C', 'N', n, n, &
m, 1.0_r8, &
MID_C, m, MID_SC, m, 0.0_r8, &
MID_SW, max_n)
ijob = ijob + 1
return
end if
! - solve a RR eigenvalue problem
! -- HW * X = SW * X * Diag(EW) eigenvector is in HW
if (ijob == SID_FINISH + 3) then
call rci_op_hegv(iS, task, 'V', 'L', n, &
MID_HW, max_n, MID_SW, max_n)
ijob = ijob + 1
return
end if
! - Psi = Psi*G
if (ijob == SID_FINISH + 4) then
r_h%total_energy = sum(resvec(1:n))
print *, resvec(1:n)
call rci_op_gemm(iS, task, 'N', 'N', m, n, &
n, 1.0_r8, &
MID_C, m, MID_HW, max_n, 0.0_r8, &
MID_WORK, m)
ijob = ijob + 1
return
end if
if (ijob == SID_FINISH + 5) then
call rci_op_copy(iS, task, 'N', MID_WORK, MID_C)
ijob = ijob + 1
return
end if
if (ijob == SID_FINISH + 6) then
call rci_op_converge(task, conv)
return
end if
end subroutine
end module ELSI_RCI_OMM
......@@ -1214,6 +1214,7 @@ contains
! - Psi = Psi*G
if (ijob == SID_RR + 10) then
r_h%total_energy = sum(resvec(1:n))
call rci_op_gemm(iS, task, 'N', 'N', m, n, &
n, 1.0_r8, &
MID_PWORK1, m, MID_G, max_n, 0.0_r8, &
......@@ -1343,6 +1344,8 @@ contains
end if
if (ijob == SID_FINISH + 2) then
r_h%total_iter = iter
print*, resvec(1:n)
call rci_op_converge(task, trdiff < tol_iter*sqrt(dble(nact)))
return
end if
......
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