Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to output several arrays?

Status
Not open for further replies.

tocarnas

Programmer
Sep 12, 2016
1
0
0
PT
I am writing a program which computes the LU decomposition of a matrix, with partial pivoting, and I would like the function to output several (2 or 3) matrices without running the program several times, which is a waste of time since it gets me everything I want in one run. Is there a way of doing this?
 
Code:
program pm
    real :: matrix(2,4)
    character(len=20) :: fmt
    matrix(1,:) = [ 1, 2, 3, 4]
    matrix(2,:) = [ 5, 6, 7, 8]
    write(fmt,"('('i2,'(f8.2))')") size(matrix,2)
    write(*,fmt) transpose(matrix)
end program pm
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top