print_matrix_m_n Subroutine

private subroutine print_matrix_m_n(mat, n_cols, n_rows, format_type)

Print a matrix of n_cols by n_rows

Arguments

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

Calls

proc~~print_matrix_m_n~~CallsGraph proc~print_matrix_m_n print_matrix_m_n proc~print_matrix_in_format print_matrix_in_format proc~print_matrix_m_n->proc~print_matrix_in_format proc~print_plain_matrix print_plain_matrix proc~print_matrix_m_n->proc~print_plain_matrix

Called by

proc~~print_matrix_m_n~~CalledByGraph proc~print_matrix_m_n print_matrix_m_n interface~print_array_with_bounds print_array_with_bounds interface~print_array_with_bounds->proc~print_matrix_m_n

Variables

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

Source Code

   subroutine print_matrix_m_n(mat, n_cols, n_rows, format_type)
    !! Print a matrix of n_cols by n_rows
      real(kind=dp), intent(in) :: mat(:, :)  ! 2D array
      integer(kind=default_int), intent(in) :: n_cols, n_rows
      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_matrix(mat, n_cols, n_rows)
      else
         call print_matrix_in_format(mat, format_selected, n_cols, n_rows)
      end if
   end subroutine print_matrix_m_n