fill_vector_with_scalar Subroutine

private subroutine fill_vector_with_scalar(x, val, i)

Put the value in the vector and update the index

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(inout), dimension(:) :: x
real(kind=wp), intent(in) :: val
integer, intent(inout) :: i

should be initialized to 0 before the first call


Called by

proc~~fill_vector_with_scalar~~CalledByGraph proc~fill_vector_with_scalar vector_module::fill_vector_with_scalar interface~fill_vector vector_module::fill_vector interface~fill_vector->proc~fill_vector_with_scalar proc~fill_char_vector_with_vector vector_module::fill_char_vector_with_vector interface~fill_vector->proc~fill_char_vector_with_vector proc~fill_vector_with_vector vector_module::fill_vector_with_vector interface~fill_vector->proc~fill_vector_with_vector proc~fill_char_vector_with_vector->interface~fill_vector proc~fill_vector_with_vector->interface~fill_vector

Source Code

    subroutine fill_vector_with_scalar(x, val, i)

    implicit none

    real(wp),dimension(:),intent(inout) :: x
    real(wp),intent(in) :: val
    integer,intent(inout) :: i !! should be initialized to 0 before the first call

    i = i + 1
    if (i>size(x)) error stop 'error in fill_vector: x is not large enough.'
    x(i) = val

    end subroutine fill_vector_with_scalar