Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site masscomp.UUCP Path: utzoo!watmath!clyde!bonnie!masscomp!leiby From: leiby@masscomp.UUCP Newsgroups: net.unix,net.lang.f77 Subject: Re: C calls FORTRAN subroutine Message-ID: <293@masscomp.UUCP> Date: Mon, 22-Oct-84 16:04:37 EDT Article-I.D.: masscomp.293 Posted: Mon Oct 22 16:04:37 1984 Date-Received: Tue, 23-Oct-84 02:18:01 EDT References: <249@imsvax.UUCP> <1206@hao.UUCP> Organization: MASSCOMP, Westford, MA Lines: 24 Regarding the fellow who calls a FORTRAN subroutine from his C program and is then unable to do I/O from within the FORTRAN subroutine: The problem here is that the FORTRAN start-up code maps logical unit numbers to Unix(tm) file descriptors in an implementation dependent way. Since the main program is in C, none of this setup gets done. Thus when the FORTRAN I/O library call is executed, it can't find a valid logical unit number table, and the output (if any) is trashed. I'd be amazed if the fellow gets any output at all. A solution? Unless you have the compiler code to look at, I'm afraid it's like the old joke: Patient: Dr., it hurts when I do this. Doctor: Well, don't do that!!! Mike Leibensperger {decvax,ihnp4,harpo,tektronix}!masscomp!leiby -- Mike Leibensperger {decvax,tektronix,harpo}!masscomp!leiby Masscomp; One Technology Park; Westford MA 01886