Commit 0ed84948 authored by Victor Yu's avatar Victor Yu

Update source files

* Change 2018 to 2019 in header
* Convert a few dos files to unix
parent a37463ec
Pipeline #1436 passed with stage
in 12 seconds
Copyright (c) 2015-2018, the ELSI team. All rights reserved.
Copyright (c) 2015-2019, the ELSI team. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
......
! Copyright (c) 2015-2018, the ELSI team.
! Copyright (c) 2015-2019, the ELSI team.
! All rights reserved.
!
! This file is part of ELSI and is distributed under the BSD 3-clause license,
......@@ -411,7 +411,7 @@ contains
Vec_conv(it) = 0.0_r8
end if
end do
if (r_h%verbose > 0) write(*,'(a,i5,a,es15.7e3)') &
'Iter ', niter, ', Rel Err: ', &
sum(abs((Vec_ev(1:n_state) &
......@@ -430,7 +430,7 @@ contains
end if
end if
! -------------------------------------------------
! -------------------------------------------------
! - lock converged eigen pairs
! Psi_lock = Psi(:, conv)
if (ijob == SID_LOCK) then
......
! Copyright (c) 2015-2018, the ELSI team.
! Copyright (c) 2015-2019, the ELSI team.
! All rights reserved.
!
! This file is part of ELSI and is distributed under the BSD 3-clause license,
......
! Copyright (c) 2015-2018, the ELSI team.
! Copyright (c) 2015-2019, the ELSI team.
! All rights reserved.
!
! This file is part of ELSI and is distributed under the BSD 3-clause license,
......
......@@ -24,7 +24,7 @@ subroutine rci_omm_solve_cubic(coeff, x_min)
b = coeff(2)
c = coeff(1)
d = coeff(0)
p = (3.0_r8*c/a-(b/a)**2.0_r8)/3.0_r8;
q = (2.0_r8*(b/a)**3.0_r8-9.0_r8*b/a*c/a+27.0_r8*d/a)/27.0_r8
p3 = p/3.0_r8
......@@ -43,7 +43,7 @@ subroutine rci_omm_solve_cubic(coeff, x_min)
else
x_min = 2.0_r8*sqrt(-p3)*cos(atan2(qrtd,-q2)/3.0_r8)
end if
end if
x_min = x_min - b/a/3.0_r8
......
! Copyright (c) 2015-2018, the ELSI team.
! Copyright (c) 2015-2019, the ELSI team.
! All rights reserved.
!
! This file is part of ELSI and is distributed under the BSD 3-clause license,
......@@ -85,7 +85,7 @@ contains
if (ijob <= SID_ALLOCATE) then
ijob = SID_ALLOCATE + 1
m = r_h%n_basis
n = r_h%max_n
n = r_h%max_n
iter = 0
end if
......@@ -283,7 +283,7 @@ contains
return
end if
! -------------------------------------------------
! -------------------------------------------------
! - lock converged eigen pairs
if (ijob == SID_LOCK ) then
call rci_op_col_norm(iS, task, m, n, MID_W, m)
......@@ -372,7 +372,7 @@ contains
ijob = ijob + 1
return
end if
! Psi_lock = Psi(:, conv)
if (ijob == SID_LOCK + 7) then
resvec = 1.0_r8 - act_idx
......@@ -1511,7 +1511,7 @@ contains
return
end if
iter = iter + 1
call rci_op_null(task)
ijob = SID_ITER
return
......
! Copyright (c) 2015-2018, the ELSI team.
! All rights reserved.
!
! This file is part of ELSI and is distributed under the BSD 3-clause license,
! which may be found in the LICENSE file in the ELSI root directory.
!>
!! This module contains constants used in ELSI RCI.
!!
module ELSI_RCI_CONSTANTS
use ELSI_RCI_PRECISION, only:i4
implicit none
!&<
! Constant of solver
integer(i4), parameter :: RCI_SOLVER = -1
integer(i4), parameter :: RCI_SOLVER_DAVIDSON = 1
integer(i4), parameter :: RCI_SOLVER_OMM = 2
integer(i4), parameter :: RCI_SOLVER_PPCG = 3
integer(i4), parameter :: RCI_SOLVER_CHEBFILTER = 4
! Constant of ijob
integer(i4), parameter :: RCI_INIT_IJOB = -1
! Constant of task
integer(i4), parameter :: RCI_NULL = 0
integer(i4), parameter :: RCI_STOP = 1
integer(i4), parameter :: RCI_CONVERGE = 2
integer(i4), parameter :: RCI_ALLOCATE = 3
integer(i4), parameter :: RCI_DEALLOCATE = 4
integer(i4), parameter :: RCI_H_MULTI = 5
integer(i4), parameter :: RCI_S_MULTI = 6
integer(i4), parameter :: RCI_P_MULTI = 7
integer(i4), parameter :: RCI_COPY = 8
integer(i4), parameter :: RCI_SUBCOPY = 9
integer(i4), parameter :: RCI_SUBCOL = 10
integer(i4), parameter :: RCI_SUBROW = 11
integer(i4), parameter :: RCI_TRACE = 12
integer(i4), parameter :: RCI_DOT = 13
integer(i4), parameter :: RCI_SCALE = 14
integer(i4), parameter :: RCI_COLSCALE = 15
integer(i4), parameter :: RCI_ROWSCALE = 16
integer(i4), parameter :: RCI_AXPY = 17
integer(i4), parameter :: RCI_COL_NORM = 18
integer(i4), parameter :: RCI_GEMM = 19
integer(i4), parameter :: RCI_HEEV = 20
integer(i4), parameter :: RCI_HEGV = 21
integer(i4), parameter :: RCI_POTRF = 22
integer(i4), parameter :: RCI_TRSM = 23
!&>
end module ELSI_RCI_CONSTANTS
! Copyright (c) 2015-2019, the ELSI team.
! All rights reserved.
!
! This file is part of ELSI and is distributed under the BSD 3-clause license,
! which may be found in the LICENSE file in the ELSI root directory.
!>
!! This module contains constants used in ELSI RCI.
!!
module ELSI_RCI_CONSTANTS
use ELSI_RCI_PRECISION, only:i4
implicit none
!&<
! Constant of solver
integer(i4), parameter :: RCI_SOLVER = -1
integer(i4), parameter :: RCI_SOLVER_DAVIDSON = 1
integer(i4), parameter :: RCI_SOLVER_OMM = 2
integer(i4), parameter :: RCI_SOLVER_PPCG = 3
integer(i4), parameter :: RCI_SOLVER_CHEBFILTER = 4
! Constant of ijob
integer(i4), parameter :: RCI_INIT_IJOB = -1
! Constant of task
integer(i4), parameter :: RCI_NULL = 0
integer(i4), parameter :: RCI_STOP = 1
integer(i4), parameter :: RCI_CONVERGE = 2
integer(i4), parameter :: RCI_ALLOCATE = 3
integer(i4), parameter :: RCI_DEALLOCATE = 4
integer(i4), parameter :: RCI_H_MULTI = 5
integer(i4), parameter :: RCI_S_MULTI = 6
integer(i4), parameter :: RCI_P_MULTI = 7
integer(i4), parameter :: RCI_COPY = 8
integer(i4), parameter :: RCI_SUBCOPY = 9
integer(i4), parameter :: RCI_SUBCOL = 10
integer(i4), parameter :: RCI_SUBROW = 11
integer(i4), parameter :: RCI_TRACE = 12
integer(i4), parameter :: RCI_DOT = 13
integer(i4), parameter :: RCI_SCALE = 14
integer(i4), parameter :: RCI_COLSCALE = 15
integer(i4), parameter :: RCI_ROWSCALE = 16
integer(i4), parameter :: RCI_AXPY = 17
integer(i4), parameter :: RCI_COL_NORM = 18
integer(i4), parameter :: RCI_GEMM = 19
integer(i4), parameter :: RCI_HEEV = 20
integer(i4), parameter :: RCI_HEGV = 21
integer(i4), parameter :: RCI_POTRF = 22
integer(i4), parameter :: RCI_TRSM = 23
!&>
end module ELSI_RCI_CONSTANTS
! Copyright (c) 2015-2018, the ELSI team.
! All rights reserved.
!
! This file is part of ELSI and is distributed under the BSD 3-clause license,
! which may be found in the LICENSE file in the ELSI root directory.
!>
!! This module contains variables accessible in ELSI RCI and related modules.
module ELSI_RCI_DATATYPE
use, intrinsic :: ISO_C_BINDING
use ELSI_RCI_PRECISION
use ELSI_RCI_CONSTANTS
implicit none
type, public :: rci_handle
! Systems
integer(i4) :: n_basis
integer(i4) :: n_state
integer(i4) :: max_n
logical :: ovlp_is_unit = .false.
! Iteration
integer(i4) :: solver = RCI_SOLVER
integer(i4) :: max_iter = 1000
integer(i4) :: n_res ! size of resvec not specified by user
real(r8) :: tol_iter = 1E-6
integer(i4) :: verbose = 0 ! output verbose
! Output
integer(i4) :: total_iter
real(r8) :: total_energy
! OMM
real(r8) :: omm_est_ub
! PPCG
integer(i4) :: ppcg_sbsize
integer(i4) :: ppcg_rrstep
real(r8) :: ppcg_tol_lock
! ChebFilter
real(r8) :: cheb_est_lb
real(r8) :: cheb_est_ub
integer(i4) :: cheb_max_inneriter
end type
! RCI Instruction type
! H: Hamiltonian; S: Overlapping matrix; P: Preconditioner
! A, B, C: General matrices
type, public :: rci_instr
character :: jobz, uplo ! job char; and upper or lower
character :: side ! left or right side
character :: trH, trS, trP, trA, trB ! Operation for H, S, P, A, B
integer :: m, n ! size of the output matrix
integer :: k ! size of the intermediate multiplication
integer :: lda, ldb, ldc ! leading size for matrix A, B and C
integer :: rAoff,cAoff ! row and column offset of A
integer :: rBoff,cBoff ! row and column offset of B
integer :: Aidx, Bidx, Cidx ! indices for matrix A, B and C
real(r8) :: alpha, beta ! coefficients
end type
end module ELSI_RCI_DATATYPE
! Copyright (c) 2015-2019, the ELSI team.
! All rights reserved.
!
! This file is part of ELSI and is distributed under the BSD 3-clause license,
! which may be found in the LICENSE file in the ELSI root directory.
!>
!! This module contains variables accessible in ELSI RCI and related modules.
module ELSI_RCI_DATATYPE
use, intrinsic :: ISO_C_BINDING
use ELSI_RCI_PRECISION
use ELSI_RCI_CONSTANTS
implicit none
type, public :: rci_handle
! Systems
integer(i4) :: n_basis
integer(i4) :: n_state
integer(i4) :: max_n
logical :: ovlp_is_unit = .false.
! Iteration
integer(i4) :: solver = RCI_SOLVER
integer(i4) :: max_iter = 1000
integer(i4) :: n_res ! size of resvec not specified by user
real(r8) :: tol_iter = 1E-6
integer(i4) :: verbose = 0 ! output verbose
! Output
integer(i4) :: total_iter
real(r8) :: total_energy
! OMM
real(r8) :: omm_est_ub
! PPCG
integer(i4) :: ppcg_sbsize
integer(i4) :: ppcg_rrstep
real(r8) :: ppcg_tol_lock
! ChebFilter
real(r8) :: cheb_est_lb
real(r8) :: cheb_est_ub
integer(i4) :: cheb_max_inneriter
end type
! RCI Instruction type
! H: Hamiltonian; S: Overlapping matrix; P: Preconditioner
! A, B, C: General matrices
type, public :: rci_instr
character :: jobz, uplo ! job char; and upper or lower
character :: side ! left or right side
character :: trH, trS, trP, trA, trB ! Operation for H, S, P, A, B
integer :: m, n ! size of the output matrix
integer :: k ! size of the intermediate multiplication
integer :: lda, ldb, ldc ! leading size for matrix A, B and C
integer :: rAoff,cAoff ! row and column offset of A
integer :: rBoff,cBoff ! row and column offset of B
integer :: Aidx, Bidx, Cidx ! indices for matrix A, B and C
real(r8) :: alpha, beta ! coefficients
end type
end module ELSI_RCI_DATATYPE
! Copyright (c) 2015-2018, the ELSI team.
! All rights reserved.
!
! This file is part of ELSI and is distributed under the BSD 3-clause license,
! which may be found in the LICENSE file in the ELSI root directory.
!>
!! This module provides public-facting interface routines for using ELSI RCI.
!!
module ELSI_RCI
use ELSI_RCI_CONSTANTS
use ELSI_RCI_DATATYPE
use ELSI_RCI_SETUP
use ELSI_RCI_DAVIDSON
use ELSI_RCI_OMM
use ELSI_RCI_PPCG
use ELSI_RCI_CHEBFILTER
implicit none
contains
subroutine rci_solve_allocate(r_h, ijob, iS, task)
implicit none
!**** INPUT ***********************************!
type(rci_handle), intent(in) :: r_h
!**** OUTPUT **********************************!
integer, intent(out) :: task
!**** INOUT ***********************************!
integer, intent(inout) :: ijob ! job id
type(rci_instr), intent(inout) :: iS
select case (r_h%solver)
case (RCI_SOLVER_DAVIDSON)
call rci_davidson_allocate(r_h, ijob, iS, task)
case (RCI_SOLVER_OMM)
call rci_omm_allocate(r_h, ijob, iS, task)
case (RCI_SOLVER_PPCG)
call rci_ppcg_allocate(r_h, ijob, iS, task)
case (RCI_SOLVER_CHEBFILTER)
call rci_chebfilter_allocate(r_h, ijob, iS, task)
end select
end subroutine
subroutine rci_solve_deallocate(r_h, ijob, iS, task)
implicit none
!**** INPUT ***********************************!
type(rci_handle), intent(in) :: r_h
!**** OUTPUT **********************************!
integer, intent(out) :: task
!**** INOUT ***********************************!
integer, intent(inout) :: ijob ! job id
type(rci_instr), intent(inout) :: iS
select case (r_h%solver)
case (RCI_SOLVER_DAVIDSON)
call rci_davidson_deallocate(r_h, ijob, iS, task)
case (RCI_SOLVER_OMM)
call rci_omm_deallocate(r_h, ijob, iS, task)
case (RCI_SOLVER_PPCG)
call rci_ppcg_deallocate(r_h, ijob, iS, task)
case (RCI_SOLVER_CHEBFILTER)
call rci_chebfilter_deallocate(r_h, ijob, iS, task)
end select
end subroutine
subroutine rci_solve(r_h, ijob, iS, task, resvec)
implicit none
!**** INPUT ***********************************!
!**** OUTPUT **********************************!
integer, intent(out) :: task
!**** INOUT ***********************************!
type(rci_handle), intent(inout) :: r_h
integer, intent(inout) :: ijob ! job id
real(r8), intent(inout) :: resvec(:)
type(rci_instr), intent(inout) :: iS
select case (r_h%solver)
case (RCI_SOLVER_DAVIDSON)
call rci_davidson(r_h, ijob, iS, task, resvec)
case (RCI_SOLVER_OMM)
call rci_omm(r_h, ijob, iS, task, resvec)
case (RCI_SOLVER_PPCG)
call rci_ppcg(r_h, ijob, iS, task, resvec)
case (RCI_SOLVER_CHEBFILTER)
call rci_chebfilter(r_h, ijob, iS, task, resvec)
end select
end subroutine
end module ELSI_RCI
! Copyright (c) 2015-2019, the ELSI team.
! All rights reserved.
!
! This file is part of ELSI and is distributed under the BSD 3-clause license,
! which may be found in the LICENSE file in the ELSI root directory.
!>
!! This module provides public-facting interface routines for using ELSI RCI.
!!
module ELSI_RCI
use ELSI_RCI_CONSTANTS
use ELSI_RCI_DATATYPE
use ELSI_RCI_SETUP
use ELSI_RCI_DAVIDSON
use ELSI_RCI_OMM
use ELSI_RCI_PPCG
use ELSI_RCI_CHEBFILTER
implicit none
contains
subroutine rci_solve_allocate(r_h, ijob, iS, task)
implicit none
!**** INPUT ***********************************!
type(rci_handle), intent(in) :: r_h
!**** OUTPUT **********************************!
integer, intent(out) :: task
!**** INOUT ***********************************!
integer, intent(inout) :: ijob ! job id
type(rci_instr), intent(inout) :: iS
select case (r_h%solver)
case (RCI_SOLVER_DAVIDSON)
call rci_davidson_allocate(r_h, ijob, iS, task)
case (RCI_SOLVER_OMM)
call rci_omm_allocate(r_h, ijob, iS, task)
case (RCI_SOLVER_PPCG)
call rci_ppcg_allocate(r_h, ijob, iS, task)
case (RCI_SOLVER_CHEBFILTER)
call rci_chebfilter_allocate(r_h, ijob, iS, task)
end select
end subroutine
subroutine rci_solve_deallocate(r_h, ijob, iS, task)
implicit none
!**** INPUT ***********************************!
type(rci_handle), intent(in) :: r_h
!**** OUTPUT **********************************!
integer, intent(out) :: task
!**** INOUT ***********************************!
integer, intent(inout) :: ijob ! job id
type(rci_instr), intent(inout) :: iS
select case (r_h%solver)
case (RCI_SOLVER_DAVIDSON)
call rci_davidson_deallocate(r_h, ijob, iS, task)
case (RCI_SOLVER_OMM)
call rci_omm_deallocate(r_h, ijob, iS, task)
case (RCI_SOLVER_PPCG)
call rci_ppcg_deallocate(r_h, ijob, iS, task)
case (RCI_SOLVER_CHEBFILTER)
call rci_chebfilter_deallocate(r_h, ijob, iS, task)
end select
end subroutine
subroutine rci_solve(r_h, ijob, iS, task, resvec)
implicit none
!**** INPUT ***********************************!
!**** OUTPUT **********************************!
integer, intent(out) :: task
!**** INOUT ***********************************!
type(rci_handle), intent(inout) :: r_h
integer, intent(inout) :: ijob ! job id
real(r8), intent(inout) :: resvec(:)
type(rci_instr), intent(inout) :: iS
select case (r_h%solver)
case (RCI_SOLVER_DAVIDSON)
call rci_davidson(r_h, ijob, iS, task, resvec)
case (RCI_SOLVER_OMM)
call rci_omm(r_h, ijob, iS, task, resvec)
case (RCI_SOLVER_PPCG)
call rci_ppcg(r_h, ijob, iS, task, resvec)
case (RCI_SOLVER_CHEBFILTER)
call rci_chebfilter(r_h, ijob, iS, task, resvec)
end select
end subroutine
end module ELSI_RCI
! Copyright (c) 2015-2018, the ELSI team.
! Copyright (c) 2015-2019, the ELSI team.
! All rights reserved.
!
! This file is part of ELSI and is distributed under the BSD 3-clause license,
......
! Copyright (c) 2015-2018, the ELSI team.
! Copyright (c) 2015-2019, the ELSI team.
! All rights reserved.
!
! This file is part of ELSI and is distributed under the BSD 3-clause license,
......
! Copyright (c) 2015-2018, the ELSI team.
! Copyright (c) 2015-2019, the ELSI team.
! All rights reserved.
!
! This file is part of ELSI and is distributed under the BSD 3-clause license,
......
! Copyright (c) 2015-2018, the ELSI team.
! Copyright (c) 2015-2019, the ELSI team.
! All rights reserved.
!
! This file is part of ELSI and is distributed under the BSD 3-clause license,
......
! Copyright (c) 2015-2018, the ELSI team.
! Copyright (c) 2015-2019, the ELSI team.
! All rights reserved.
!
! This file is part of ELSI and is distributed under the BSD 3-clause license,
......
! Copyright (c) 2015-2018, the ELSI team.
! Copyright (c) 2015-2019, the ELSI team.
! All rights reserved.
!
! This file is part of ELSI and is distributed under the BSD 3-clause license,
......