! This file: http://ftp.aset.psu.edu/pub/ger/fortran/hdk/MxoutDemo.f90 ! program MxoutDemo implicit none real, dimension(10,10) :: A A=3.456789 call Mxout(6,A,10) contains subroutine Mxout(IOUT,C,M) ! Print square Real matrix C of order M to unit IOUT. ! hdk - 1979, 2004. real, dimension(:,:), intent(in) :: C integer, intent(in) :: M,IOUT integer :: IBEG,IEND,I,J IBEG=-1 do IBEG=1,M,4 IEND=min(M,IBEG+3) write (unit=IOUT,fmt="(/,A,4I23)") " ",(J,J=IBEG,IEND) do I=1,M write (unit=IOUT,fmt="(A,I3,A,4ES23.15)") " ", & I," ", (C(I,J),J=IBEG,IEND) end do end do end subroutine Mxout end program MxoutDemo