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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reading rows and columns in a matrix

Status
Not open for further replies.

kbaum

Technical User
Mar 6, 2006
1
US
I'm new to fortran 90 and I need a code which will read the number of rows and columns of a matrix of dimensions n x m.
I understand how to get the number of rows, but can't figure out how to find the number of columns. This is part of the program which will find the number of rows, n:

DO
READ(13,*, iostat = error)
IF (error == -1) EXIT
n = n + 1
END DO

I'm thinking I need some form of nested do-loop, but I'm not sure how to set it up. Any help would be greatly appreciated. Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top