- #1
jelanier
- 67
- 1
I have been re-writing several old FORTRAN programs to compile with G77 G95 and GFORTRAN.
G77 and G95 have been good to me. I can't say the same for GFORTRAN. The fact that it does not support CONOUT$ is the biggest issue. Some of these old programs liberally use unit 6 and unit 5. When CONOUT$ is available, you can simply open unit 6 with file=CONOUT$ to write to the con again.
While it is possible to write to the con by using write(6,xx) a,b , it does not work if unit 6 has already been used. Even if you close(6), you can not write to the con again. the print *,a,b will not work either.
Play with his test code by commenting out lines and you will see what I mean. Is there a solution?
Thanks,
Jim
program test_con
character(10) a,b,c
a="hello"
b="goodbye"
open (6,file="conout.txt")
write (6,10) a,b
C close(6)
C open (6,file="conout$")
print *,"hello"
write (*,10) a,b
10 format(a10,a10)
end program test_con
G77 and G95 have been good to me. I can't say the same for GFORTRAN. The fact that it does not support CONOUT$ is the biggest issue. Some of these old programs liberally use unit 6 and unit 5. When CONOUT$ is available, you can simply open unit 6 with file=CONOUT$ to write to the con again.
While it is possible to write to the con by using write(6,xx) a,b , it does not work if unit 6 has already been used. Even if you close(6), you can not write to the con again. the print *,a,b will not work either.
Play with his test code by commenting out lines and you will see what I mean. Is there a solution?
Thanks,
Jim
program test_con
character(10) a,b,c
a="hello"
b="goodbye"
open (6,file="conout.txt")
write (6,10) a,b
C close(6)
C open (6,file="conout$")
print *,"hello"
write (*,10) a,b
10 format(a10,a10)
end program test_con