Skip to content

Instantly share code, notes, and snippets.

@dryman
Created December 31, 2022 02:51
Show Gist options
  • Save dryman/bed2cb3513d16e8e7c9562163a12c91d to your computer and use it in GitHub Desktop.
Save dryman/bed2cb3513d16e8e7c9562163a12c91d to your computer and use it in GitHub Desktop.
subroutine print_matrix(A, var_name)
real, intent(in) :: A(:,:)
character(len = *), intent(in) :: var_name
integer :: i, M, N
M = size(A, 1)
N = size(A, 2)
print *, var_name, '='
do i = 1, M
print *, (A(i, j), j = 1,N)
end do
end subroutine print_matrix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment