Message from discussion
Avoid the repeat factor in namelist with arrays
Received: by 10.224.105.205 with SMTP id u13mr5700913qao.6.1352420643673;
Thu, 08 Nov 2012 16:24:03 -0800 (PST)
Received: by 10.52.65.33 with SMTP id u1mr2198672vds.18.1352420643509; Thu, 08
Nov 2012 16:24:03 -0800 (PST)
Path: gf5ni18188417qab.0!nntp.google.com!c7no12872052qap.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Thu, 8 Nov 2012 16:24:03 -0800 (PST)
In-Reply-To: <1kt8wqr.18ygd511uzawhuN%nospam@see.signature>
Complaints-To: groups-abuse@google.com
Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=148.87.19.214;
posting-account=_tTe3QkAAACOHE4CJTyGnhTE9KtkCLO6
NNTP-Posting-Host: 148.87.19.214
References: <343d2ac8-c7a1-478e-a8a9-440645b09805@googlegroups.com>
<6a78868a-43eb-4ab7-9560-089d74a6be9b@googlegroups.com> <k77uiv$a5h$2@speranza.aioe.org>
<fkSls.19222$pn7.5518@newsfe18.iad> <4b396f15-794b-420b-bb65-54b21bab9c1d@googlegroups.com>
<k7h8om$ck6$1@speranza.aioe.org> <k7hb1m$hmj$1@speranza.aioe.org> <1kt8wqr.18ygd511uzawhuN%nospam@see.signature>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <62be685f-578e-4ad8-99fa-ba8670ee517e@googlegroups.com>
Subject: Re: Avoid the repeat factor in namelist with arrays
From: robert.corb...@oracle.com
Injection-Date: Fri, 09 Nov 2012 00:24:03 +0000
Content-Type: text/plain; charset=ISO-8859-1
On Thursday, November 8, 2012 2:45:59 PM UTC-8, Richard Maine wrote:
> glen herrmannsfeldt <g...@ugcs.caltech.edu> wrote:
>
> > But again, in the case of open source, you can add the switch, and
> > modify the compiler (and I presume library routine) to use that switch.
>
> Of course in this particular case, that's only multiple orders of
> magnitude more work than just fixing the code to depend only on what is
> specified by the standard.
In the specific case described by the OP, it is probably easier to
modify gfortran's run-time library than to modify the user's code.
The run-time library code almost certainly uses a test to check for
duplicate values. Replacing that test by a false value should
produce the desired result.
> Let's see. Start by learning another language (the compilers aren't
> written in Fortran). Then learn how the compiler innards work enough to
> figure out the modifications. Finally build and maintain your customized
> version of the compiler, distributing it along with your code to anyone
> who needs to use your code. Yup. That sounds like a good plan. :-(
The other language in question is C. I did assume that a Fortran
programmer is also likely to know C. The code that needs to be changed
should be in the run-time library, not the compiler. The run-time
library code should be much easier to understand than the compiler.
> Just because you *CAN* do things that way doesn't mean it is even
> remotely a good idea. Though I suppose maybe we are off in some abstract
> discussion of an imaginary world instead of giving practical advice.
Whether my advice is practical or not depends on the OP's circumstances.
If he wants the output in a given form for his own use, the approach I
suggested should be fine. If he intends to distribute his code for use
on a variety of platforms, he should probably do something else. Some
problems do not require general solutions.
Bob Corbett