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)
Date: Thu, 8 Nov 2012 16:24:03 -0800 (PST)
Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=188.8.131.52;
<firstname.lastname@example.org> <email@example.com> <1kt8wqr.18ygd511uzawhuNfirstname.lastname@example.org>
Subject: Re: Avoid the repeat factor in namelist with arrays
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.