Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Dec 1999 00:29:04 -0500 (EST)
From:      "Crist J. Clark" <cjc@cc942873-a.ewndsr1.nj.home.com>
To:        freebsd-questions@FreeBSD.ORG (FreeBSD Questions)
Subject:   Re: Back to the FORTRAN Question
Message-ID:  <199912170529.AAA85088@cc942873-a.ewndsr1.nj.home.com>
In-Reply-To: <199912132312.SAA74814@cc942873-a.ewndsr1.nj.home.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199912170529.AAA85088>