- #1
BC2210
- 17
- 0
Delete..
Delete..
Delete..
Last edited:
REAL,DIMENSION(2,3) :: array
DO,i=1,2
WRITE(6,*) array(i,:)
END DO
I don't think you want that first comma after the DO.minger said:They're not crazy, if I want to print all row entries in a column, then:
Code:REAL,DIMENSION(2,3) :: array DO,i=1,2 WRITE(6,*) array(i,:) END DO
This character - : - is a colon. This one - ; - is a semicolon.minger said:You can use the semi-colon as an implicit "all" when operating on arrays.
BC2210,BC2210 said:Delete..
To print a 1D array in Fortran as a 2D array, you can use a DO loop to iterate through the array and print each element in the desired format. You can also use the RESHAPE function to convert the 1D array into a 2D array before printing.
The purpose of printing a 1D array as a 2D array in Fortran is to visualize the data in a more organized and structured format. This can be helpful in understanding the data and identifying any patterns or trends.
Yes, you can specify the number of columns when printing a 1D array as a 2D array in Fortran using the RESHAPE function. This allows you to control the layout of the printed array and make it easier to read.
Yes, it is possible to print a 1D array as a 2D array in Fortran without using a DO loop by using the RESHAPE function. This function allows you to reshape the array without having to iterate through each element.
Yes, you can print a 1D array as a 2D array in Fortran with non-numeric data. However, the RESHAPE function may not work for non-numeric data. In this case, you can use a DO loop to iterate through the array and print each element in the desired format.