franterminator

fortran read matrix

Apr 19th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. PROGRAM CROUT
  2.     implicit none
  3.     real(8),allocatable,dimension(:,:):: matriz
  4.     integer:: i,j,k,n,m
  5.     open(unit=24,file="matriz.txt")
  6.  
  7.     read(24,*) n, m
  8.  
  9.     allocate(matriz(n,m))
  10.  
  11.     matriz(:,:) = 0
  12.  
  13.     read(24,*) matriz
  14.     matriz = transpose(matriz)
  15.  
  16.     do i=1,n
  17.         write(6,*) (matriz(i,j),j=1,m)
  18.     enddo
  19.  
  20.     read(5,*)
  21. END PROGRAM
Advertisement
Add Comment
Please, Sign In to add comment