Fortran print called from C prog. goes to file fort.6 . Why?
Mike Hummell
mike at lll-lcc.aRpA
Thu Mar 10 07:20:33 AEST 1988
When we call a fortran subroutine from a C program, the fortran print
statement ends up in file "fort.6" instead of on the terminal, whereas
the same fortran print stmt. will go to the terminal when called from a
Fortran program and compiled/loaded with F77. How can we get the fortran
print to go to the terminal (called from the C program). The example is:
>type prog1.c
main() /* test calling fortran subroutine from C program */
{
printf("begin c program\n");
sub1_(); /* Need to add "_" after fortran subroutine name */
printf("end c program\n");
printf("end c program\n");
}
>type sub1.f
subroutine sub1
print 1000
1000 format(' fortran subroutine ')
return
end
>f77 -c sub1.f
>cc prog1.c sub1.o -lF77 -lI77 -lU77 -lc
>a.out
begin c program
end c program
>
REMARK: The output, " fortran subroutine ", is in file "fort.6" .
QUESTION: Why doesn't it come out to the standard output device (terminal?)
?
--------------------------------------------------------------------------
"Si Vis Pacem, Para Bellum" -- Vegetius
--------------------------------------------------------------------------
ARPA: mike at lll-lcc.llnl.gov (mike at lll-lcc.arpa)
UUCP: { ihnp4,sun,lll-crg,rutgers }!lll-lcc!mike
U.S. MAIL: LLNL ; P.O. Box 808 , L-363 ; Livermore, CA. 94550
--------------------------------------------------------------------------
More information about the Comp.sys.pyramid
mailing list