Xref: utzoo comp.lang.c:32093 comp.lang.fortran:3840 Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uunet!wuarchive!uwm.edu!bionet!agate!violet.berkeley.edu!jerry From: jerry@violet.berkeley.edu (Jerry Berkman) Newsgroups: comp.lang.c,comp.lang.fortran Subject: Re: Fortran Main with C I/O Keywords: peace, calm, smart Message-ID: <1990Sep23.013115.8327@agate.berkeley.edu> Date: 23 Sep 90 01:31:15 GMT References: <1044@helens.Stanford.EDU> <1990Sep20.221007.8515@cs.dal.ca> <1990Sep21.132232.11305@DRD.Com> Sender: usenet@agate.berkeley.edu (USENET Administrator) Distribution: usa Organization: University of California, Berkeley Lines: 27 In article <1990Sep21.132232.11305@DRD.Com> mike@DRD.Com (Mike Rovak) writes: >bill%biomel@cs.dal.ca wrote: > In article <1044@helens.Stanford.EDU> joe@hanauma.Stanford.EDU (Joe Dellinger) writes: > > > >... Now we are told "if you want to be able to use C I/O > >you'll have to have your mains in C"! This means rewriting a LOT of software. > > >Not a problem, guys. Make a C main function whose sole purpose is to call >the Fortran routine. Change the word "PROGRAM" in each Fortran routine >to "SUBROUTINE" and your job is done. >-- Mike There's also the question of whether you want to run in the C environment or the Fortran environment. If you want to do I/O in Fortran, you may need to call the Fortran environment initialization routine; it's called "f_init()" in BSD VAX UNIX. It initializes units 0, 5, and 6 to standard error, standard input and standard output and line-buffers standard error. It also sets up to catch interrupts so that all your Fortran file buffers are flushed on error termination, and so that you get semi-inteligent messages. - Jerry Berkman, U.C.Berkeley, (415)642-4804 jerry@violet.berkeley.edu disclaimer: opinions are my own, not my employers, etc.