The following code reads the value of Discharge Q and Area A and writes the log of their values into the matrices log_Q and log_A respectively. I can not figure why it only writes the first digit of the log value. When i try to format like ‘(f8.2)’ it only gives 0s. I am writing the code in Fortran 77
dimension Q(15,1), A(15,1), log_A(15,2), log_Q(15,2),TR(15,15)
dimension PR(15,15), INV(15,15), H(15,15), SUB(15,15)
integer X
print *, "Enter Number of Q values"
read *, X
open(1,file="E:\Fortran\Class 5\WECS\Q.txt")
open(2,file="E:\Fortran\Class 5\WECS\A.txt")
open(3,file="E:\Fortran\Class 5\WECS\test.txt")
do 3 i = 1,X
read(1,*) Q(i,1)
3 continue
do 4 i = 1,X
read(2,*) A(i,1)
4 continue
do 5 i = 1,X
log_A(i,1) = 1
log_A(i,2) = log(A(i,1))
5 continue
do 6 i = 1,X
log_Q(i,1) = 1
log_Q(i,2) = log(Q(i,1))
6 continue
do 40 i = 1, X
write (3,*) (log_A(i,j), j = 1,2)
40 continue
end