Source code for Convergence_f90

"""
Fortran module Convergence:Containing the methods to read and store convergence parameters.

**Authors**

* D. Jaschke
* M. L. Wall

**Details**

The following subroutines / functions are defined for the
convergence parameters.

"""

[docs]def read_ConvParam(): """ fortran-subroutine - August 2017 (dj) Read the convergence parameters. This is a one for all subroutine always reading an array. **Arguments** Cps : TYPE(ConvParam)(\*), inout Array with convergence parameters. flnm : CHARACTER(\*), in This is the filename where the convergence parameters are stored. unit : INTEGER, in Open file on this unit. **Source Code** .. hidden-code-block:: fortran :label: show / hide f90 code 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 """ return