Commit e4868860 authored by Ben Hourahine's avatar Ben Hourahine Committed by Yingzhou Li

Updated all integer and real types to be consistent, i.e., integer(i4) and real(r8)

parent a6fd1e54
Pipeline #1695 passed with stage
in 4 minutes and 26 seconds
......@@ -60,15 +60,15 @@ contains
type(rci_handle), intent(in) :: r_h
!**** OUTPUT **********************************!
integer, intent(out) :: task
integer(i4), intent(out) :: task
!**** INOUT ***********************************!
integer, intent(inout) :: ijob ! job id
integer(i4), intent(inout) :: ijob ! job id
type(rci_instr), intent(inout) :: iS
!**** LOCAL ***********************************!
integer, save :: iter ! step num.
integer, save :: m, n ! size of the wave functions.
integer(i4), save :: iter ! step num.
integer(i4), save :: m, n ! size of the wave functions.
if (ijob <= SID_ALLOCATE) then
ijob = SID_ALLOCATE + 1
......@@ -111,14 +111,14 @@ contains
type(rci_handle), intent(in) :: r_h
!**** OUTPUT **********************************!
integer, intent(out) :: task
integer(i4), intent(out) :: task
!**** INOUT ***********************************!
integer, intent(inout) :: ijob ! job id
integer(i4), intent(inout) :: ijob ! job id
type(rci_instr), intent(inout) :: iS
!**** LOCAL ***********************************!
integer, save :: iter ! step num.
integer(i4), save :: iter ! step num.
if (ijob <= SID_DEALLOCATE) then
ijob = SID_DEALLOCATE + 1
......@@ -158,24 +158,24 @@ contains
!**** INPUT ***********************************!
!**** OUTPUT **********************************!
integer, intent(out) :: task
integer(i4), intent(out) :: task
!**** INOUT ***********************************!
type(rci_handle), intent(inout) :: r_h
integer, intent(inout) :: ijob ! job id
integer(i4), intent(inout) :: ijob ! job id
real(r8), intent(inout) :: resvec(:)
type(rci_instr), intent(inout) :: iS
!**** LOCAL ***********************************!
integer :: it, iti
integer, save :: m ! size of basis
integer, save :: n ! number of current states
integer, save :: nact ! number of active states
integer, save :: n_state ! number of wanted states
integer, save :: niter ! iteration num.
integer, save :: ninneriter ! inner iteration num.
integer, save :: max_iter ! max number of iterations
integer, save :: max_inneriter ! max number of inner iterations
integer(i4) :: it, iti
integer(i4), save :: m ! size of basis
integer(i4), save :: n ! number of current states
integer(i4), save :: nact ! number of active states
integer(i4), save :: n_state ! number of wanted states
integer(i4), save :: niter ! iteration num.
integer(i4), save :: ninneriter ! inner iteration num.
integer(i4), save :: max_iter ! max number of iterations
integer(i4), save :: max_inneriter ! max number of inner iterations
real(r8), save :: tol_iter ! convergence tolerance
real(r8), save :: c ! center of spectrum
......
......@@ -63,15 +63,15 @@ contains
type(rci_handle), intent(in) :: r_h
!**** OUTPUT **********************************!
integer, intent(out) :: task
integer(i4), intent(out) :: task
!**** INOUT ***********************************!
integer, intent(inout) :: ijob ! job id
integer(i4), intent(inout) :: ijob ! job id
type(rci_instr), intent(inout) :: iS
!**** LOCAL ***********************************!
integer, save :: iter ! step num.
integer, save :: m, n ! size of the wave functions.
integer(i4), save :: iter ! step num.
integer(i4), save :: m, n ! size of the wave functions.
if (ijob <= SID_ALLOCATE) then
ijob = SID_ALLOCATE + 1
......@@ -118,14 +118,14 @@ contains
type(rci_handle), intent(in) :: r_h
!**** OUTPUT **********************************!
integer, intent(out) :: task
integer(i4), intent(out) :: task
!**** INOUT ***********************************!
integer, intent(inout) :: ijob ! job id
integer(i4), intent(inout) :: ijob ! job id
type(rci_instr), intent(inout) :: iS
!**** LOCAL ***********************************!
integer, save :: iter ! step num.
integer(i4), save :: iter ! step num.
if (ijob <= SID_DEALLOCATE) then
ijob = SID_DEALLOCATE + 1
......@@ -169,24 +169,24 @@ contains
!**** INPUT ***********************************!
!**** OUTPUT **********************************!
integer, intent(out) :: task
integer(i4), intent(out) :: task
!**** INOUT ***********************************!
type(rci_handle), intent(inout) :: r_h
integer, intent(inout) :: ijob ! job id
integer(i4), intent(inout) :: ijob ! job id
real(r8), intent(inout) :: resvec(:)
type(rci_instr), intent(inout) :: iS
!**** LOCAL ***********************************!
integer :: it, iti
integer, save :: m ! size of basis
integer, save :: n ! number of current states
integer, save :: n_state ! number of wanted states
integer, save :: n_restart ! number of restarted states
integer, save :: next ! number of extended states
integer, save :: niter ! iteration num.
integer, save :: max_iter ! max number of iterations
integer, save :: max_n ! max number of basis in reduced space
integer(i4) :: it, iti
integer(i4), save :: m ! size of basis
integer(i4), save :: n ! number of current states
integer(i4), save :: n_state ! number of wanted states
integer(i4), save :: n_restart ! number of restarted states
integer(i4), save :: next ! number of extended states
integer(i4), save :: niter ! iteration num.
integer(i4), save :: max_iter ! max number of iterations
integer(i4), save :: max_n ! max number of basis in reduced space
real(r8), save :: tol_iter ! convergence tolerance
......
......@@ -71,15 +71,15 @@ contains
type(rci_handle), intent(in) :: r_h
!**** OUTPUT **********************************!
integer, intent(out) :: task
integer(i4), intent(out) :: task
!**** INOUT ***********************************!
integer, intent(inout) :: ijob ! job id
integer(i4), intent(inout) :: ijob ! job id
type(rci_instr), intent(inout) :: iS
!**** LOCAL ***********************************!
integer, save :: iter ! CG step num.
integer, save :: m, n ! size of the wave functions.
integer(i4), save :: iter ! CG step num.
integer(i4), save :: m, n ! size of the wave functions.
if (ijob <= SID_ALLOCATE) then
ijob = SID_ALLOCATE + 1
......@@ -126,14 +126,14 @@ contains
type(rci_handle), intent(in) :: r_h
!**** OUTPUT **********************************!
integer, intent(out) :: task
integer(i4), intent(out) :: task
!**** INOUT ***********************************!
integer, intent(inout) :: ijob ! job id
integer(i4), intent(inout) :: ijob ! job id
type(rci_instr), intent(inout) :: iS
!**** LOCAL ***********************************!
integer, save :: iter ! CG step num.
integer(i4), save :: iter ! CG step num.
if (ijob <= SID_DEALLOCATE) then
ijob = SID_DEALLOCATE + 1
......@@ -175,25 +175,25 @@ contains
implicit none
!**** OUTPUT **********************************!
integer, intent(out) :: task
integer(i4), intent(out) :: task
!**** INOUT ***********************************!
type(rci_handle), intent(inout) :: r_h
integer, intent(inout) :: ijob ! job id
integer(i4), intent(inout) :: ijob ! job id
type(rci_instr), intent(inout) :: iS
real(r8), intent(inout) :: resvec(:)
!**** LOCAL ***********************************!
integer, save :: m ! size of basis
integer, save :: n ! number of occupied states
integer, save :: max_iter
integer, save :: max_n ! max number of columns
integer(i4), save :: m ! size of basis
integer(i4), save :: n ! number of occupied states
integer(i4), save :: max_iter
integer(i4), save :: max_n ! max number of columns
real(r8), save :: tol_iter ! convergence tolerance of CG
logical, save :: ls_conv ! line search converged?
logical, save :: ls_fail ! line search failed?
integer, save :: icg ! CG step num.
integer(i4), save :: icg ! CG step num.
real(r8), save :: est_ub ! estimated upper bound of spectrum
real(r8), save :: lambda ! CG step size
......
......@@ -72,15 +72,15 @@ contains
type(rci_handle), intent(in) :: r_h
!**** OUTPUT **********************************!
integer, intent(out) :: task
integer(i4), intent(out) :: task
!**** INOUT ***********************************!
integer, intent(inout) :: ijob ! job id
integer(i4), intent(inout) :: ijob ! job id
type(rci_instr), intent(inout) :: iS
!**** LOCAL ***********************************!
integer, save :: iter ! step num.
integer, save :: m, n ! size of the wave functions.
integer(i4), save :: iter ! step num.
integer(i4), save :: m, n ! size of the wave functions.
if (ijob <= SID_ALLOCATE) then
ijob = SID_ALLOCATE + 1
......@@ -127,14 +127,14 @@ contains
type(rci_handle), intent(in) :: r_h
!**** OUTPUT **********************************!
integer, intent(out) :: task
integer(i4), intent(out) :: task
!**** INOUT ***********************************!
integer, intent(inout) :: ijob ! job id
integer(i4), intent(inout) :: ijob ! job id
type(rci_instr), intent(inout) :: iS
!**** LOCAL ***********************************!
integer, save :: iter ! step num.
integer(i4), save :: iter ! step num.
if (ijob <= SID_DEALLOCATE) then
ijob = SID_DEALLOCATE + 1
......@@ -178,29 +178,29 @@ contains
!**** INPUT ***********************************!
!**** OUTPUT **********************************!
integer, intent(out) :: task
integer(i4), intent(out) :: task
!**** INOUT ***********************************!
type(rci_handle), intent(inout) :: r_h
integer, intent(inout) :: ijob ! job id
integer(i4), intent(inout) :: ijob ! job id
real(r8), intent(inout) :: resvec(:)
type(rci_instr), intent(inout) :: iS
!**** LOCAL ***********************************!
integer :: it, iti
integer, save :: m ! size of basis
integer, save :: n ! number of current states
integer, save :: max_n ! max number of columns
integer, save :: iter ! iteration num.
integer, save :: iter_diag ! iteration num.
integer, save :: max_iter ! max number of iterations
integer, save :: rrstep ! iteration number gap between RR step
integer, save :: sbsize ! size of the sequential diag block
integer, save :: sbsize_last ! size of the last block
integer, save :: lsize ! local size of the block
integer, save :: lsize3 ! size of combined block
integer, save :: nsb ! number of the blocks
integer, save :: nact ! number of active columns
integer(i4) :: it, iti
integer(i4), save :: m ! size of basis
integer(i4), save :: n ! number of current states
integer(i4), save :: max_n ! max number of columns
integer(i4), save :: iter ! iteration num.
integer(i4), save :: iter_diag ! iteration num.
integer(i4), save :: max_iter ! max number of iterations
integer(i4), save :: rrstep ! iteration number gap between RR step
integer(i4), save :: sbsize ! size of the sequential diag block
integer(i4), save :: sbsize_last ! size of the last block
integer(i4), save :: lsize ! local size of the block
integer(i4), save :: lsize3 ! size of combined block
integer(i4), save :: nsb ! number of the blocks
integer(i4), save :: nact ! number of active columns
real(r8), save :: tol_iter ! convergence tolerance
real(r8), save :: tol_lock ! locking tolerance
......@@ -211,7 +211,7 @@ contains
logical, save :: ovlp_is_unit ! ovlp is unit flag
logical, save :: conv_flag = .false. ! indicator for convergence
integer, save, allocatable :: act_idx(:)
integer(i4), save, allocatable :: act_idx(:)
!**********************************************!
......
......@@ -53,18 +53,18 @@ module ELSI_RCI_DATATYPE
! 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
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(i4) :: m, n ! size of the output matrix
integer(i4) :: k ! size of the intermediate multiplication
integer(i4) :: 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(i4) :: rAoff,cAoff ! row and column offset of A
integer(i4) :: rBoff,cBoff ! row and column offset of B
integer :: Aidx, Bidx, Cidx ! indices for matrix A, B and C
integer(i4) :: Aidx, Bidx, Cidx ! indices for matrix A, B and C
real(r8) :: alpha, beta ! coefficients
......
......@@ -31,10 +31,10 @@ contains
type(rci_handle), intent(in) :: r_h
!**** OUTPUT **********************************!
integer, intent(out) :: task
integer(i4), intent(out) :: task
!**** INOUT ***********************************!
integer, intent(inout) :: ijob ! job id
integer(i4), intent(inout) :: ijob ! job id
type(rci_instr), intent(inout) :: iS
select case (r_h%solver)
......@@ -58,10 +58,10 @@ contains
type(rci_handle), intent(in) :: r_h
!**** OUTPUT **********************************!
integer, intent(out) :: task
integer(i4), intent(out) :: task
!**** INOUT ***********************************!
integer, intent(inout) :: ijob ! job id
integer(i4), intent(inout) :: ijob ! job id
type(rci_instr), intent(inout) :: iS
select case (r_h%solver)
......@@ -84,11 +84,11 @@ contains
!**** INPUT ***********************************!
!**** OUTPUT **********************************!
integer, intent(out) :: task
integer(i4), intent(out) :: task
!**** INOUT ***********************************!
type(rci_handle), intent(inout) :: r_h
integer, intent(inout) :: ijob ! job id
integer(i4), intent(inout) :: ijob ! job id
real(r8), intent(inout) :: resvec(:)
type(rci_instr), intent(inout) :: iS
......
This diff is collapsed.
......@@ -13,15 +13,15 @@ program elsi_rci_test
implicit none
character(len=128) :: arg1 ! ev or dm
character(len=128) :: arg2 ! dense or sparse
character(len=128) :: arg3 ! real or cmplx
character(len=128) :: arg4 ! solver
character(len=128) :: arg5 ! H file
character(len=128) :: arg6 ! S file
character(128) :: arg1 ! ev or dm
character(128) :: arg2 ! dense or sparse
character(128) :: arg3 ! real or cmplx
character(128) :: arg4 ! solver
character(128) :: arg5 ! H file
character(128) :: arg6 ! S file
integer(kind=i4) :: solver
integer(kind=i4) :: mat_type
integer(i4) :: solver
integer(i4) :: mat_type
! Read command line arguments
if(command_argument_count() >= 5) then
......
......@@ -19,22 +19,22 @@ module ELSI_RCI_READ_MAT
public :: rci_read_pw
public :: rci_read_clean
integer(kind=i4), public :: n_basis
integer(kind=i4), public :: n_basis_1D(3)
integer(kind=i4), public :: n_basis_pw
integer(kind=i4), public :: n_electron
integer(kind=i4), public :: n_h_vnl
real(kind=r8), allocatable, public :: h_real(:,:)
real(kind=r8), allocatable, public :: s_real(:,:)
complex(kind=r8), allocatable, public :: h_cmplx(:,:)
complex(kind=r8), allocatable, public :: s_cmplx(:,:)
integer(kind=i4), allocatable, public :: h_idx(:)
complex(kind=r8), allocatable, public :: h_gkin(:)
complex(kind=r8), allocatable, public :: h_vtot(:)
complex(kind=r8), allocatable, public :: h_vnlmat(:,:)
complex(kind=r8), allocatable, public :: h_vnlsign(:)
integer(i4), public :: n_basis
integer(i4), public :: n_basis_1D(3)
integer(i4), public :: n_basis_pw
integer(i4), public :: n_electron
integer(i4), public :: n_h_vnl
real(r8), allocatable, public :: h_real(:,:)
real(r8), allocatable, public :: s_real(:,:)
complex(r8), allocatable, public :: h_cmplx(:,:)
complex(r8), allocatable, public :: s_cmplx(:,:)
integer(i4), allocatable, public :: h_idx(:)
complex(r8), allocatable, public :: h_gkin(:)
complex(r8), allocatable, public :: h_vtot(:)
complex(r8), allocatable, public :: h_vnlmat(:,:)
complex(r8), allocatable, public :: h_vnlsign(:)
contains
......@@ -46,19 +46,19 @@ subroutine rci_read(h_file,s_file,is_real)
character(*), intent(in) :: s_file
logical, intent(in) :: is_real
integer(kind=i4) :: i_row
integer(kind=i4) :: i_col
integer(kind=i4) :: header(16)
integer(kind=i4) :: i_val
integer(kind=i4) :: nnz
integer(kind=i8) :: offset
integer(i4) :: i_row
integer(i4) :: i_col
integer(i4) :: header(16)
integer(i4) :: i_val
integer(i4) :: nnz
integer(i8) :: offset
real(kind=r8), allocatable :: h_val_real(:)
real(kind=r8), allocatable :: s_val_real(:)
complex(kind=r8), allocatable :: h_val_cmplx(:)
complex(kind=r8), allocatable :: s_val_cmplx(:)
integer(kind=i4), allocatable :: row_ind(:)
integer(kind=i4), allocatable :: col_ptr(:)
real(r8), allocatable :: h_val_real(:)
real(r8), allocatable :: s_val_real(:)
complex(r8), allocatable :: h_val_cmplx(:)
complex(r8), allocatable :: s_val_cmplx(:)
integer(i4), allocatable :: row_ind(:)
integer(i4), allocatable :: col_ptr(:)
! Open file
open(file=h_file,unit=30,access="stream",form="unformatted")
......@@ -241,10 +241,10 @@ subroutine rci_read_pw(h_file,is_real)
character(*), intent(in) :: h_file
logical, intent(in) :: is_real
integer(kind=i4) :: header(7)
integer(kind=i4) :: i_val
integer(kind=i4) :: nnz
integer(kind=i8) :: offset
integer(i4) :: header(7)
integer(i4) :: i_val
integer(i4) :: nnz
integer(i8) :: offset
! Open file
open(file=h_file,unit=30,access="sequential",form="formatted")
......
......@@ -23,9 +23,9 @@ subroutine rci_sort_bubble(ev,n,V,compar)
implicit none
real(kind=r8), intent(inout) :: ev(:)
integer(kind=i4), intent(in) :: n
real(kind=r8), intent(inout) :: V(:,:)
real(r8), intent(inout) :: ev(:)
integer(i4), intent(in) :: n
real(r8), intent(inout) :: V(:,:)
interface
integer(i4) function compar(a,b)
......@@ -34,10 +34,10 @@ subroutine rci_sort_bubble(ev,n,V,compar)
end function compar
end interface
real(kind=r8) :: tmpev
real(kind=r8), allocatable :: tmpV(:)
real(r8) :: tmpev
real(r8), allocatable :: tmpV(:)
integer(kind=i4) :: itsup, itbub
integer(i4) :: itsup, itbub
allocate(tmpV(size(V,1)))
......
......@@ -18,7 +18,7 @@ module ELSI_RCI_TIMER
public :: rci_init_timer
public :: rci_get_time
integer(kind=i4) :: clock_rate
integer(i4) :: clock_rate
contains
......@@ -26,8 +26,8 @@ subroutine rci_init_timer()
implicit none
integer(kind=i4) :: initial_time
integer(kind=i4) :: clock_max
integer(i4) :: initial_time
integer(i4) :: clock_max
call system_clock(initial_time,clock_rate,clock_max)
......@@ -37,9 +37,9 @@ subroutine rci_get_time(wtime)
implicit none
real(kind=r8), intent(out) :: wtime
real(r8), intent(out) :: wtime
integer(kind=i4) :: tics
integer(i4) :: tics
call system_clock(tics)
......
......@@ -27,11 +27,11 @@ subroutine rci_write_mat_real(matfile,mat)
implicit none
character(*), intent(in) :: matfile
real(kind=r8), intent(in):: mat(:,:)
real(r8), intent(in):: mat(:,:)
integer(kind=i4) :: m,n
integer(kind=i4) :: i_row
integer(kind=i4) :: i_col
integer(i4) :: m,n
integer(i4) :: i_row
integer(i4) :: i_col
! Open file
......@@ -57,10 +57,10 @@ subroutine rci_write_vec_real(vecfile,vec)
implicit none
character(*), intent(in) :: vecfile
real(kind=r8), intent(in):: vec(:)
real(r8), intent(in):: vec(:)
integer(kind=i4) :: m
integer(kind=i4) :: i_row
integer(i4) :: m
integer(i4) :: i_row
! Open file
......@@ -82,11 +82,11 @@ subroutine rci_write_mat_cmplx(matfile,mat)
implicit none
character(*), intent(in) :: matfile
complex(kind=r8), intent(in):: mat(:,:)
complex(r8), intent(in):: mat(:,:)
integer(kind=i4) :: m,n
integer(kind=i4) :: i_row
integer(kind=i4) :: i_col
integer(i4) :: m,n
integer(i4) :: i_row
integer(i4) :: i_col