print_vector Subroutine

private subroutine print_vector(vec, format_type)

print a vector

Arguments

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

Calls

proc~~print_vector~~CallsGraph proc~print_vector print_vector proc~print_plain_vector print_plain_vector proc~print_vector->proc~print_plain_vector proc~print_vector_in_format print_vector_in_format proc~print_vector->proc~print_vector_in_format

Called by

proc~~print_vector~~CalledByGraph proc~print_vector print_vector interface~print_array print_array interface~print_array->proc~print_vector

Variables

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

Source Code

   subroutine print_vector(vec, format_type)
    !! print a vector
      real(kind=dp), intent(in) :: vec(:)  ! 1D array
      character(len=*), intent(in), optional :: format_type
      character(len=20) :: format_selected

      ! 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)
      else
         call print_vector_in_format(vec, format_selected)
      end if
   end subroutine print_vector