print_vector_n Subroutine

private subroutine print_vector_n(vec, n_elements, format_type)

print a vector from start up to n_elements

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: vec(:)
integer(kind=default_int), intent(in) :: n_elements
character(len=*), intent(in), optional :: format_type

Calls

proc~~print_vector_n~~CallsGraph proc~print_vector_n print_vector_n proc~print_plain_vector print_plain_vector proc~print_vector_n->proc~print_plain_vector proc~print_vector_in_format print_vector_in_format proc~print_vector_n->proc~print_vector_in_format

Called by

proc~~print_vector_n~~CalledByGraph proc~print_vector_n print_vector_n interface~print_array_with_bounds print_array_with_bounds interface~print_array_with_bounds->proc~print_vector_n

Variables

Type Visibility Attributes Name Initial
character(len=20), private :: format_selected

Source Code

   subroutine print_vector_n(vec, n_elements, format_type)
    !! print a vector from start up to n_elements
      real(dp), intent(in) :: vec(:)
      character(len=*), intent(in), optional :: format_type
      character(len=20) :: format_selected
      integer(kind=default_int), intent(in) :: n_elements
      ! Determine the format: default to "PLAIN" if not specified
      if (present(format_type)) then
         format_selected = trim(adjustl(format_type))
      else
         format_selected = "PLAIN"
      end if
      ! Handle plain format separately or delegate to print routine based on the format
      if (format_selected == "PLAIN") then
         call print_plain_vector(vec, n_elements)
      else
         call print_vector_in_format(vec, format_selected, n_elements)
      end if
   end subroutine print_vector_n