check_laguerre_zeros Subroutine

public subroutine check_laguerre_zeros(zero)

Uses

FIXME : Add documentation

Arguments

Type IntentOptional Attributes Name
real, intent(in), dimension (:) :: zero

Contents

Source Code


Source Code

  subroutine check_laguerre_zeros (zero)
    use file_utils, only: error_unit
    use mp, only: mp_abort
    implicit none
    real, dimension (:), intent (in) :: zero
    logical :: error=.false.
    integer :: i, n

    n = size(zero)

    ! check positiveness
    if (any(zero <= 0.0)) then
       write (error_unit(),*) 'ERROR in laguerre: grid not positive'
       error = .true.
    end if

    ! check alignment
    if (any(zero(2:n)-zero(1:n-1) < 0.0)) then
       write (error_unit(),*) 'ERROR in laguerre: wrong alignment'
       error = .true.
    end if

    ! check distances are increasing
    do i=1, n-2
       if (zero(i+1)-zero(i) > zero(i+2)-zero(i+1)) then
          write (error_unit(),*) 'ERROR in laguerre: distances are decreasing at i= ', i
          error = .true.
       end if
    end do

    if (error) call mp_abort ('STOP in check_laguerre_zeros')

  end subroutine check_laguerre_zeros