From owner-freebsd-questions Thu Dec 16 21:24:37 1999 Delivered-To: freebsd-questions@freebsd.org Received: from cc942873-a.ewndsr1.nj.home.com (cc942873-a.ewndsr1.nj.home.com [24.2.89.207]) by hub.freebsd.org (Postfix) with ESMTP id 1EA9E14E98 for ; Thu, 16 Dec 1999 21:24:35 -0800 (PST) (envelope-from cjc@cc942873-a.ewndsr1.nj.home.com) Received: (from cjc@localhost) by cc942873-a.ewndsr1.nj.home.com (8.9.3/8.9.3) id AAA85088 for freebsd-questions@FreeBSD.ORG; Fri, 17 Dec 1999 00:29:05 -0500 (EST) (envelope-from cjc) From: "Crist J. Clark" Message-Id: <199912170529.AAA85088@cc942873-a.ewndsr1.nj.home.com> Subject: Re: Back to the FORTRAN Question In-Reply-To: <199912132312.SAA74814@cc942873-a.ewndsr1.nj.home.com> To: freebsd-questions@FreeBSD.ORG (FreeBSD Questions) Date: Fri, 17 Dec 1999 00:29:04 -0500 (EST) Reply-To: cjclark@home.com X-Mailer: ELM [version 2.4ME+ PL54 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I wrote, > My f2c FORTRAN problems are still haunting me (see thread 'FORTRAN > Error Question' from November). This time, however, I think I have > more of an idea what is going on. [snip] For the sake of the mail archive, I thought I would post the solution to the problem I was having. The problem was that different .f-files had DATA statements for variables in a single COMMON block. In the simplest form, if I had a COMMON block, REAL A,B COMMON /STUFF/ A,B Like so, and then had two FORTRAN code files that referenced that COMMON block, but one file, say 'a.f,' had, DATA A /20.0/ And the other, 'b.f,' had DATA B /30.0/ I get the errors I saw. The reason for this is that in the f2c process, the _whole_ COMMON block will be initialized in each .c-file. This is not allowed. And it is good that it is not. If you somehow let it pass (our SGI FORTRAN compiler used the 'latest' definition, whatever that might mean), the COMMON block would have the value of one DATA statement and the other(s) would be clobbered. I'd like to thank everyone who tried to help on this thread, especially Kent Stewart. -- Crist J. Clark cjclark@home.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message