subroutine read_ConvParam(Cps, flnm, unit, errst)
type(ConvParam), dimension(:), allocatable, intent(inout) :: Cps
character(len=*), intent(in) :: flnm
integer, intent(in) :: unit
integer, intent(out), optional :: errst
! Local variables
! ---------------
! for looping
integer :: ii
! read number of convergence parameters
integer :: nconv
!if(present(errst)) errst = 0
open(unit=unit, file=trim(adjustl(flnm)), action='read', status='old')
read(unit, '(1I16)') nconv
allocate(Cps(nconv))
do ii = 1, nconv
read(unit, '(1I16)') Cps(ii)%min_inner_sweeps
read(unit, '(1I16)') Cps(ii)%max_inner_sweeps
read(unit, '(1I16)') Cps(ii)%max_outer_sweeps
read(unit, '(1I16)') Cps(ii)%warmup_chi
read(unit, '(1I16)') Cps(ii)%max_bond_dimension
read(unit, '(1I16)') Cps(ii)%max_num_lanczos_iter
read(unit, '(1I16)') Cps(ii)%max_imps_iter
read(unit, '(1E30.15)') Cps(ii)%warmup_tol
read(unit, '(1E30.15)') Cps(ii)%lanczos_tol
read(unit, '(1E30.15)') Cps(ii)%local_tol
read(unit, '(1E30.15)') Cps(ii)%conv_tol
read(unit, '(1E30.15)') Cps(ii)%hpsi_tol
read(unit, '(1E30.15)') Cps(ii)%hlocal_tol
read(unit, '(1E30.15)') Cps(ii)%psi_tol
read(unit, '(1E30.15)') Cps(ii)%psi_local_tol
read(unit, '(1A1)') CPs(ii)%conv_method
read(unit, '(1A1)') CPs(ii)%tn_type
read(unit, '(1I16)') Cps(ii)%max_kappa
read(unit, '(1I16)') Cps(ii)%max_num_isteps
read(unit, '(1I16)') Cps(ii)%steps_for_ijudge
read(unit, '(1E30.15)') Cps(ii)%idt
read(unit, '(1I16)') Cps(ii)%ktebd
read(unit, '(1I16)') Cps(ii)%tmethod
end do
close(unit)
end subroutine read_ConvParam