Hi, i'm very new at Fortran language and resently i've been having trouble with formats, specifically with complex formats while reading from an external file.
The file contains this matrix:
( 8.40, 0.62) (11.78, 1.14) (-2.17,-4.77) ( 4.84, 1.64) ( 3.26,-5.53)
( 0.44, 6.13) (-1.84,-5.56) ( 5.85, 3.40) (-3.61,-0.12) ( 9.05,-5.67)
( 5.80,-3.28) ( 6.46, 6.03) ( 1.49,-2.24) (-3.61, 5.05) ( 4.46, 4.09)
( 3.59,-4.65) (11.05, 0.12) ( 6.55,-5.00) ( 4.89, 0.39) ( 9.13, 5.14)
(10.51,-1.64) ( 5.71,-5.95) ( 5.58, 4.77) ( 9.43,-3.11) ( 3.92,-1.75)
In my code i've writen:
Open(10,file='P06-Matriz.dat')
Do i=1,5
Read(10,90)(Q(i,j),j=1,5) !line17
End Do
90 Format((f5.2,f5.2),2x)
But when executing de compiled program, this message results:
At line 17 of file Ejercicio12.f (unit = 10, file = 'P06-Matriz.dat')
Fortran runtime error: Bad value during floating point read
I've been trying changing the formats from the real and imaginary parts, but none resulted good.
Well, hope you guys can help me with this. Thanks in advance.
The file contains this matrix:
( 8.40, 0.62) (11.78, 1.14) (-2.17,-4.77) ( 4.84, 1.64) ( 3.26,-5.53)
( 0.44, 6.13) (-1.84,-5.56) ( 5.85, 3.40) (-3.61,-0.12) ( 9.05,-5.67)
( 5.80,-3.28) ( 6.46, 6.03) ( 1.49,-2.24) (-3.61, 5.05) ( 4.46, 4.09)
( 3.59,-4.65) (11.05, 0.12) ( 6.55,-5.00) ( 4.89, 0.39) ( 9.13, 5.14)
(10.51,-1.64) ( 5.71,-5.95) ( 5.58, 4.77) ( 9.43,-3.11) ( 3.92,-1.75)
In my code i've writen:
Open(10,file='P06-Matriz.dat')
Do i=1,5
Read(10,90)(Q(i,j),j=1,5) !line17
End Do
90 Format((f5.2,f5.2),2x)
But when executing de compiled program, this message results:
At line 17 of file Ejercicio12.f (unit = 10, file = 'P06-Matriz.dat')
Fortran runtime error: Bad value during floating point read
I've been trying changing the formats from the real and imaginary parts, but none resulted good.
Well, hope you guys can help me with this. Thanks in advance.