Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!mike From: mike@lll-lcc.aRpA (Mike Hummell) Newsgroups: comp.sys.pyramid Subject: Fortran print called from C prog. goes to file fort.6 . Why? Message-ID: <1540@lll-lcc.aRpA> Date: 9 Mar 88 21:20:33 GMT Distribution: na Organization: Lawrence Livermore Labs, Livermore Ca Lines: 46 Keywords: fortran subroutine in C program 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@lll-lcc.llnl.gov (mike@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 --------------------------------------------------------------------------