- #1
Clint_Johnson
- 9
- 0
I have two files I need to read arrays out of using the "open" command and I keep getting a compiler error saying "(col. 1) remark: LOOP WAS VECTORIZED." I assume this is because I am reading the data out of the files incorrectly but I don't really understand what "loop was vectorized" means. The data in the files is formatted as
IxJ
number
number
number
...
where I and J are the dimensions the array and number represents numbers in the array
Here's what I have although I am pretty sure my error lies in my reading of the array
Thanks in advance for the help!
IxJ
number
number
number
...
where I and J are the dimensions the array and number represents numbers in the array
Here's what I have although I am pretty sure my error lies in my reading of the array
Code:
PROGRAM MAT_MUL_FORTRAN_INTRINSIC_FUNC
IMPLICIT NONE
CHARACTER(LEN=30) :: INPUT_FILE_1, INPUT_FILE_2
REAL, DIMENSION(10000,10000) :: DATA_ARRAY_1, DATA_ARRAY_2, DATA_ARRAY_3
PRINT *, "PLEASE ENTER THE COMPLETE NAME OF THE TWO FILES CONTAINING THE MATRICES YOU WISH TO MULTIPLY"
READ *, INPUT_FILE_1, INPUT_FILE_2
OPEN(1, FILE=INPUT_FILE_1, ACTION="READ", FORM='FORMATTED')
READ(1) DATA_ARRAY_1
CLOSE(1)
OPEN(2, FILE=INPUT_FILE_1, ACTION="READ", FORM='FORMATTED')
READ(2) DATA_ARRAY_2
CLOSE(2)
DATA_ARRAY_3 = DATA_ARRAY_1*DATA_ARRAY_2
OPEN(3, FILE="RESULTING_MATRIX.dat", ACTION="WRITE", FORM='FORMATTED')
WRITE(3) DATA_ARRAY_3
CLOSE(3)
END PROGRAM MAT_MUL_FORTRAN_INTRINSIC_FUNC
Thanks in advance for the help!